@tsrx/content-mapper 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapper-Gc2yuGNf.js","names":["resolveExports","bare_package_specifier_pattern","path","createRequire","logError","logWarning","exports","exports","require","createRequire","path","fileURLToPath","fs","identifier_pattern","require"],"sources":["../../typescript-plugin/src/config-host.js","../../../node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.mjs","../../typescript-plugin/src/package-resolution.js","../../typescript-plugin/src/jsonc.js","../../typescript-plugin/src/tsconfig-resolution.js","../../typescript-plugin/src/utils.js","../../typescript-plugin/src/consumer-compiler.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/binarySearch.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/translateOffset.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/sourceMap.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/index.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/editor.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/linkedCodeMap.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/types.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/utils.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/index.js","../../typescript-plugin/src/transform.js","../../typescript-plugin/src/language.js","../../tsrx/src/diagnostics.js","../src/diagnostic-directives.js","../src/export-stub.js","../src/platform-globals.js","../src/span-mappings.js","../src/mapper.js"],"sourcesContent":["/**\n * The file-system host the TSRX tooling reads `tsconfig.json` files and\n * package manifests through when no TypeScript `sys` is supplied. It covers\n * the subset of `ts.sys` that `tsconfig-resolution.js` and\n * `consumer-compiler.js` use, on `node:fs`, so the native TypeScript 7 path\n * (whose `typescript` package has no JavaScript API) needs no TypeScript at\n * all. `ts.sys` still satisfies the same interface for the classic path.\n */\n\nimport fs from 'node:fs';\nimport { fileURLToPath } from 'node:url';\n\n/**\n * @typedef {object} ConfigHost\n * @property {(file_name: string) => boolean} fileExists\n * @property {(file_name: string) => string | undefined} readFile\n * @property {(directory_name: string) => boolean} [directoryExists]\n * @property {boolean | (() => boolean)} useCaseSensitiveFileNames\n * @property {(file_name: string) => Date | undefined} [getModifiedTime]\n * @property {(path_name: string) => string} [realpath]\n */\n\n/**\n * Whether the file system distinguishes letter case, probed the way\n * TypeScript's `sys` does: this module's own path with its case swapped exists\n * only on a case-insensitive file system.\n * @returns {boolean}\n */\nfunction detect_case_sensitive_file_names() {\n\tconst own_path = fileURLToPath(import.meta.url);\n\tconst swapped = own_path.replace(/[a-zA-Z]/g, (letter) =>\n\t\tletter === letter.toLowerCase() ? letter.toUpperCase() : letter.toLowerCase(),\n\t);\n\tif (swapped === own_path) {\n\t\treturn true;\n\t}\n\treturn !fs.existsSync(swapped);\n}\n\n/** @type {boolean | undefined} */\nlet case_sensitive_file_names;\n\n/** @returns {boolean} */\nexport function use_case_sensitive_file_names() {\n\tcase_sensitive_file_names ??= detect_case_sensitive_file_names();\n\treturn case_sensitive_file_names;\n}\n\n/**\n * @param {string} file_name\n * @returns {fs.Stats | undefined}\n */\nfunction stat(file_name) {\n\ttry {\n\t\treturn fs.statSync(file_name, { throwIfNoEntry: false });\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/** @returns {ConfigHost} */\nexport function create_config_host() {\n\treturn {\n\t\tfileExists: (file_name) => stat(file_name)?.isFile() === true,\n\t\tdirectoryExists: (directory_name) => stat(directory_name)?.isDirectory() === true,\n\t\treadFile: (file_name) => {\n\t\t\ttry {\n\t\t\t\treturn fs.readFileSync(file_name, 'utf8');\n\t\t\t} catch {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t},\n\t\tuseCaseSensitiveFileNames: use_case_sensitive_file_names,\n\t\tgetModifiedTime: (file_name) => stat(file_name)?.mtime,\n\t\trealpath: (path_name) => {\n\t\t\ttry {\n\t\t\t\treturn fs.realpathSync(path_name);\n\t\t\t} catch {\n\t\t\t\treturn path_name;\n\t\t\t}\n\t\t},\n\t};\n}\n\n/** The shared default host; one instance so per-host caches are reused. */\nexport const NODE_CONFIG_HOST = create_config_host();\n","const A=r=>r!==null&&typeof r==\"object\",a=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),_=\"ERR_INVALID_PACKAGE_CONFIG\",E=\"ERR_INVALID_PACKAGE_TARGET\",I=\"ERR_PACKAGE_PATH_NOT_EXPORTED\",P=\"ERR_PACKAGE_IMPORT_NOT_DEFINED\",R=/^\\d+$/,O=/^(\\.{1,2}|node_modules)$/i,w=/\\/|\\\\/;var h=(r=>(r.Export=\"exports\",r.Import=\"imports\",r))(h||{});const f=(r,t,e,o,c)=>{if(t==null)return[];if(typeof t==\"string\"){const[n,...i]=t.split(w);if(n===\"..\"||i.some(l=>O.test(l)))throw a(E,`Invalid \"${r}\" target \"${t}\" defined in the package config`);return[c?t.replace(/\\*/g,c):t]}if(Array.isArray(t))return t.flatMap(n=>f(r,n,e,o,c));if(A(t)){for(const n of Object.keys(t)){if(R.test(n))throw a(_,\"Cannot contain numeric property keys\");if(n===\"default\"||o.includes(n))return f(r,t[n],e,o,c)}return[]}throw a(E,`Invalid \"${r}\" target \"${t}\"`)},s=\"*\",m=(r,t)=>{const e=r.indexOf(s),o=t.indexOf(s);return e===o?t.length>r.length:o>e};function d(r,t){if(!t.includes(s)&&r.hasOwnProperty(t))return[t];let e,o;for(const c of Object.keys(r))if(c.includes(s)){const[n,i,l]=c.split(s);if(l===void 0&&t.startsWith(n)&&t.endsWith(i)){const g=t.slice(n.length,-i.length||void 0);g&&(!e||m(e,c))&&(e=c,o=g)}}return[e,o]}const p=r=>Object.keys(r).reduce((t,e)=>{const o=e===\"\"||e[0]!==\".\";if(t===void 0||t===o)return o;throw a(_,'\"exports\" cannot contain some keys starting with \".\" and some not')},void 0),u=/^\\w+:/,v=(r,t,e)=>{if(!r)throw new Error('\"exports\" is required');t=t===\"\"?\".\":`./${t}`,(typeof r==\"string\"||Array.isArray(r)||A(r)&&p(r))&&(r={\".\":r});const[o,c]=d(r,t),n=f(h.Export,r[o],t,e,c);if(n.length===0)throw a(I,t===\".\"?'No \"exports\" main defined':`Package subpath '${t}' is not defined by \"exports\"`);for(const i of n)if(!i.startsWith(\"./\")&&!u.test(i))throw a(E,`Invalid \"exports\" target \"${i}\" defined in the package config`);return n},T=(r,t,e)=>{if(!r)throw new Error('\"imports\" is required');const[o,c]=d(r,t),n=f(h.Import,r[o],t,e,c);if(n.length===0)throw a(P,`Package import specifier \"${t}\" is not defined in package`);return n};export{v as resolveExports,T as resolveImports};\n","/**\n * Package lookups without TypeScript's module resolver: the runtime entry of a\n * TSRX compiler package, and the file a `tsconfig.json` `extends` entry names.\n * Both walk `node_modules` directories upwards from a starting directory and\n * read every `package.json` fresh, so they also serve as the retry path when\n * Node's own `require.resolve` keeps a negative lookup after a package is\n * installed.\n */\n\nimport path from 'node:path';\nimport { resolveExports } from 'resolve-pkg-maps';\nimport { NODE_CONFIG_HOST } from './config-host.js';\n\n/** @typedef {import('./config-host.js').ConfigHost} ConfigHost */\n\n/**\n * @typedef {object} ParsedSpecifier\n * @property {string} name `pkg` or `@scope/pkg`.\n * @property {string} subpath The part after the package name, without a leading slash; empty for the package root.\n */\n\n/**\n * @param {string} specifier\n * @returns {ParsedSpecifier | undefined} `undefined` for relative, absolute or empty specifiers.\n */\nexport function parse_bare_specifier(specifier) {\n\tif (specifier === '' || specifier.startsWith('.') || path.isAbsolute(specifier)) {\n\t\treturn undefined;\n\t}\n\tconst segments = specifier.split('/');\n\tconst name_segments = specifier.startsWith('@') ? 2 : 1;\n\tif (segments.length < name_segments || segments.slice(0, name_segments).some((s) => s === '')) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\tname: segments.slice(0, name_segments).join('/'),\n\t\tsubpath: segments.slice(name_segments).join('/'),\n\t};\n}\n\n/**\n * A directory exists when the host says so, or (for hosts without\n * `directoryExists`) when it holds a `package.json`.\n * @param {ConfigHost} host\n * @param {string} directory_name\n * @returns {boolean}\n */\nfunction is_directory(host, directory_name) {\n\treturn host.directoryExists\n\t\t? host.directoryExists(directory_name)\n\t\t: host.fileExists(path.join(directory_name, 'package.json'));\n}\n\n/**\n * Read a package manifest through the host, never through Node's cached reader.\n * @param {ConfigHost} host\n * @param {string} package_dir\n * @returns {Record<string, unknown> | undefined}\n */\nexport function read_package_manifest(host, package_dir) {\n\tconst text = host.readFile(path.join(package_dir, 'package.json'));\n\tif (text === undefined) {\n\t\treturn undefined;\n\t}\n\ttry {\n\t\tconst parsed = JSON.parse(text);\n\t\treturn parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed)\n\t\t\t? parsed\n\t\t\t: undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Every `node_modules/<name>` directory that exists on the way up from `from_dir`.\n * @param {ConfigHost} host\n * @param {string} from_dir\n * @param {string} name\n * @returns {string[]}\n */\nexport function package_directories(host, from_dir, name) {\n\t/** @type {string[]} */\n\tconst directories = [];\n\tlet current = path.resolve(from_dir);\n\twhile (true) {\n\t\tif (path.basename(current) !== 'node_modules') {\n\t\t\tconst candidate = path.join(current, 'node_modules', name);\n\t\t\tif (is_directory(host, candidate)) {\n\t\t\t\tdirectories.push(candidate);\n\t\t\t}\n\t\t}\n\t\tconst parent = path.dirname(current);\n\t\tif (parent === current) {\n\t\t\treturn directories;\n\t\t}\n\t\tcurrent = parent;\n\t}\n}\n\n/**\n * Targets of `exports` for a subpath under the given conditions, in order;\n * empty when the package has no `exports` or does not export the subpath.\n * @param {Record<string, unknown> | undefined} manifest\n * @param {string} subpath\n * @param {readonly string[]} conditions\n * @returns {string[]}\n */\nfunction exports_targets(manifest, subpath, conditions) {\n\tconst exports = manifest?.exports;\n\tif (exports === undefined || exports === null) {\n\t\treturn [];\n\t}\n\ttry {\n\t\treturn resolveExports(\n\t\t\t/** @type {import('resolve-pkg-maps').PathConditions} */ (exports),\n\t\t\tsubpath,\n\t\t\tconditions,\n\t\t);\n\t} catch {\n\t\treturn [];\n\t}\n}\n\n/**\n * The file a bare specifier loads at runtime: the package's `exports` (under\n * `conditions`), else its `main`, else `index.js`, with the extension probing\n * Node's CommonJS loader applies; a subpath is resolved the same way.\n * @param {string} specifier\n * @param {string} from_dir\n * @param {{ conditions?: readonly string[], host?: ConfigHost }} [options]\n * @returns {string | undefined}\n */\nexport function resolve_package_entry(specifier, from_dir, options = {}) {\n\tconst parsed = parse_bare_specifier(specifier);\n\tif (!parsed) {\n\t\treturn undefined;\n\t}\n\tconst host = options.host ?? NODE_CONFIG_HOST;\n\tconst conditions = options.conditions ?? ['node', 'require', 'default'];\n\tfor (const package_dir of package_directories(host, from_dir, parsed.name)) {\n\t\tconst manifest = read_package_manifest(host, package_dir);\n\t\tfor (const target of exports_targets(manifest, parsed.subpath, conditions)) {\n\t\t\tconst resolved = path.resolve(package_dir, target);\n\t\t\tif (host.fileExists(resolved)) {\n\t\t\t\treturn resolved;\n\t\t\t}\n\t\t}\n\t\tif (manifest?.exports !== undefined && manifest.exports !== null) {\n\t\t\t// `exports` is authoritative: nothing else in the package is reachable.\n\t\t\tcontinue;\n\t\t}\n\t\tconst main = typeof manifest?.main === 'string' ? manifest.main : undefined;\n\t\tconst targets =\n\t\t\tparsed.subpath !== '' ? [parsed.subpath] : main !== undefined ? [main, 'index'] : ['index'];\n\t\tfor (const target of targets) {\n\t\t\tconst base = path.resolve(package_dir, target);\n\t\t\tfor (const candidate of [\n\t\t\t\tbase,\n\t\t\t\t`${base}.js`,\n\t\t\t\t`${base}.cjs`,\n\t\t\t\t`${base}.mjs`,\n\t\t\t\t`${base}.json`,\n\t\t\t\tpath.join(base, 'index.js'),\n\t\t\t]) {\n\t\t\t\tif (host.fileExists(candidate)) {\n\t\t\t\t\treturn candidate;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * The config a package directory stands for: its `package.json` `tsconfig`\n * field (with `.json` appended when the file is missing without it, as\n * TypeScript's file loader does) or its `tsconfig.json`.\n * @param {ConfigHost} host\n * @param {string} directory\n * @param {Record<string, unknown> | undefined} manifest\n * @returns {string | undefined}\n */\nfunction tsconfig_field_target(host, directory, manifest) {\n\tconst field = typeof manifest?.tsconfig === 'string' ? manifest.tsconfig : 'tsconfig.json';\n\tlet resolved = path.resolve(directory, field);\n\tif (!host.fileExists(resolved) && !resolved.endsWith('.json')) {\n\t\tresolved = `${resolved}.json`;\n\t}\n\treturn host.fileExists(resolved) ? resolved : undefined;\n}\n\n/**\n * The JSON file a `tsconfig.json` `extends` entry names. The rules and their\n * order are those of get-tsconfig's `resolveExtendsPath` (MIT, privatenumber),\n * which are tested against `tsc`:\n *\n * 1. `..` means `../tsconfig.json`; an entry starting with `.` is relative to\n * the config's directory; an absolute path is used as is. A missing path\n * without a `.json` extension gets one appended.\n * 2. Otherwise the entry names a package (`name` or `@scope/name`, plus an\n * optional subpath) found by walking `node_modules` upwards. A package with\n * `exports` is resolved only through them (conditions `require`, `types`);\n * an unexported subpath is a hard stop. Without `exports`, the package\n * root's `tsconfig` field or its `tsconfig.json` is used; a subpath is tried\n * with `.json` appended, as a `.json` file, then as a directory whose\n * `package.json` `tsconfig` field or `tsconfig.json` is the target.\n *\n * @param {string} extends_value\n * @param {string} config_dir\n * @param {ConfigHost} [host]\n * @returns {{ path: string, candidate?: string } | { path?: undefined, candidate?: string }}\n * `path` when found; `candidate` is the location TypeScript would have read\n * for a path entry, whether or not it exists (so a watcher can wait for it).\n */\nexport function resolve_extends_target(extends_value, config_dir, host = NODE_CONFIG_HOST) {\n\tlet file_path = extends_value === '..' ? path.join('..', 'tsconfig.json') : extends_value;\n\tif (file_path.startsWith('.')) {\n\t\tfile_path = path.resolve(config_dir, file_path);\n\t}\n\tif (path.isAbsolute(file_path)) {\n\t\tif (host.fileExists(file_path)) {\n\t\t\treturn { path: file_path, candidate: file_path };\n\t\t}\n\t\t// Like TypeScript, append `.json` whenever the path is not a file, even\n\t\t// when a directory of that name exists next to the JSON file.\n\t\tconst candidate = file_path.endsWith('.json') ? file_path : `${file_path}.json`;\n\t\treturn host.fileExists(candidate) ? { path: candidate, candidate } : { candidate };\n\t}\n\tconst parsed = parse_bare_specifier(extends_value);\n\tif (!parsed) {\n\t\treturn {};\n\t}\n\tfor (const found_dir of package_directories(host, config_dir, parsed.name)) {\n\t\tconst package_dir = host.realpath ? host.realpath(found_dir) : found_dir;\n\t\tconst manifest = read_package_manifest(host, package_dir);\n\t\tif (manifest?.exports !== undefined && manifest.exports !== null) {\n\t\t\tconst [target] = exports_targets(manifest, parsed.subpath, ['require', 'types']);\n\t\t\tif (target === undefined) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst resolved = path.resolve(package_dir, target);\n\t\t\treturn host.fileExists(resolved) ? { path: resolved } : {};\n\t\t}\n\t\tif (parsed.subpath === '') {\n\t\t\tconst resolved = tsconfig_field_target(host, package_dir, manifest);\n\t\t\tif (resolved !== undefined) {\n\t\t\t\treturn { path: resolved };\n\t\t\t}\n\t\t}\n\t\tconst full_path = path.join(package_dir, parsed.subpath);\n\t\tif (!full_path.endsWith('.json') && host.fileExists(`${full_path}.json`)) {\n\t\t\treturn { path: `${full_path}.json` };\n\t\t}\n\t\tif (is_directory(host, full_path)) {\n\t\t\tconst resolved = tsconfig_field_target(\n\t\t\t\thost,\n\t\t\t\tfull_path,\n\t\t\t\tread_package_manifest(host, full_path),\n\t\t\t);\n\t\t\tif (resolved !== undefined) {\n\t\t\t\treturn { path: resolved };\n\t\t\t}\n\t\t} else if (full_path.endsWith('.json') && host.fileExists(full_path)) {\n\t\t\treturn { path: full_path };\n\t\t}\n\t}\n\treturn {};\n}\n","/**\n * A JSON-with-comments reader for `tsconfig.json` and package manifests:\n * comments and trailing commas are allowed, as TypeScript allows them. The\n * parsing is Microsoft's `jsonc-parser` (the same scanner VS Code and\n * get-tsconfig use), so what parses here parses there.\n */\n\n// The ESM build: the package's UMD `main` requires its `./impl/*` files at run\n// time, which the bundles of the mapper, the language server and the VS Code\n// extension cannot follow (the package has no `exports` map, so the path is\n// public).\n// A runtime dependency of every package that bundles this module (the mapper,\n// the language server, the VS Code extension): its UMD entry requires its\n// `./impl/*` files at run time, which a bundle cannot follow.\nimport { parse, printParseErrorCode } from 'jsonc-parser';\n\n/**\n * @typedef {object} JsoncParseResult\n * @property {unknown} value `undefined` when the text does not parse.\n * @property {{ message: string, offset: number }} [error] The first parse error.\n */\n\n/**\n * @param {string} text\n * @returns {JsoncParseResult}\n */\nexport function parse_jsonc(text) {\n\tconst source = text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;\n\tif (source.trim() === '') {\n\t\t// An empty config file is an empty object, as for TypeScript.\n\t\treturn { value: {} };\n\t}\n\t/** @type {import('jsonc-parser').ParseError[]} */\n\tconst errors = [];\n\tconst value = parse(source, errors, { allowTrailingComma: true, disallowComments: false });\n\tif (errors.length > 0) {\n\t\tconst [first] = errors;\n\t\treturn {\n\t\t\tvalue: undefined,\n\t\t\terror: {\n\t\t\t\tmessage: `${printParseErrorCode(first.error)} at offset ${first.offset}`,\n\t\t\t\toffset: first.offset,\n\t\t\t},\n\t\t};\n\t}\n\treturn { value };\n}\n","import path from 'node:path';\nimport { parse_jsonc } from './jsonc.js';\nimport { resolve_extends_target } from './package-resolution.js';\n\n/**\n * What the tooling needs from a file system to read tsconfig files: the\n * subset of TypeScript's `sys` that `config-host.js` also provides on\n * `node:fs`, so no TypeScript is needed to resolve a config chain.\n * @typedef {object} TsconfigHost\n * @property {(file_name: string) => boolean} fileExists\n * @property {(file_name: string) => string | undefined} readFile\n * @property {boolean | (() => boolean)} useCaseSensitiveFileNames\n * @property {(file_name: string) => Date | undefined} [getModifiedTime]\n */\n\n/**\n * A problem reading or resolving a config file. `code` follows TypeScript's\n * numbering for the cases it has one for (5024 invalid `extends` entry,\n * 6053 file not found, 18000 circular `extends`), so callers that filter on\n * codes keep working on both paths.\n * @typedef {object} TsconfigDiagnostic\n * @property {number} code\n * @property {string} message\n * @property {string} [file] The config file the problem is in.\n */\n\n/**\n * @typedef {object} TsconfigLayer\n * @property {string} path\n * @property {string} dir\n * @property {Record<string, unknown>} config\n * @property {string | undefined} raw_source\n * @property {TsconfigDiagnostic[]} parse_diagnostics\n */\n\n/** @typedef {TsconfigLayer & { extends_values: unknown[] }} ParsedTsconfigLayer */\n\n/**\n * @typedef {object} TsconfigExtendsFailure\n * @property {string} config_path\n * @property {unknown} extends_value\n * @property {string | undefined} resolved_path\n * @property {TsconfigDiagnostic[]} diagnostics\n */\n\n/**\n * @typedef {object} ResolvedTsconfigLayers\n * @property {TsconfigLayer[]} layers\n * @property {string[]} dependencies\n * @property {TsconfigDiagnostic[]} diagnostics\n * @property {TsconfigExtendsFailure[]} extends_failures\n */\n\n/**\n * @template TValue\n * @typedef {{state: 'absent'} | {state: 'found', value: TValue}} ConfigValueResult\n */\n\n/** @typedef {{config_path: string, config_dir: string}} TsconfigValueOrigin */\n\nexport const INVALID_EXTENDS_DIAGNOSTIC_CODE = 5024;\nexport const FILE_NOT_FOUND_DIAGNOSTIC_CODE = 6053;\nexport const CIRCULARITY_DIAGNOSTIC_CODE = 18000;\nconst PARSE_ERROR_DIAGNOSTIC_CODE = 1005;\n\n/**\n * Load a tsconfig and its explicit inheritance graph from lowest to highest\n * precedence. Parsed files are cached, but traversal intentionally does not\n * deduplicate layers because a shared base must be reapplied in every branch.\n * `extends` entries follow TypeScript's rules (see `resolve_extends_target`).\n *\n * @param {TsconfigHost} host\n * @param {string} config_file_name\n * @returns {ResolvedTsconfigLayers}\n */\nexport function load_tsconfig_layers(host, config_file_name) {\n\t/** @type {Map<string, ParsedTsconfigLayer>} */\n\tconst parsed_file_cache = new Map();\n\t/** @type {TsconfigLayer[]} */\n\tconst layers = [];\n\t/** @type {string[]} */\n\tconst dependencies = [];\n\tconst dependency_keys = new Set();\n\t/** @type {TsconfigDiagnostic[]} */\n\tconst diagnostics = [];\n\t/** @type {TsconfigExtendsFailure[]} */\n\tconst extends_failures = [];\n\tconst diagnostic_keys = new Set();\n\t/** The chain of configs being visited, root first, for cycle reporting. */\n\t/** @type {string[]} */\n\tconst active_stack = [];\n\tconst active_keys = new Set();\n\tconst use_case_sensitive_file_names =\n\t\ttypeof host.useCaseSensitiveFileNames === 'function'\n\t\t\t? host.useCaseSensitiveFileNames()\n\t\t\t: host.useCaseSensitiveFileNames;\n\n\t/** @param {string} file_name */\n\tfunction normalize_path(file_name) {\n\t\treturn path.normalize(path.resolve(file_name));\n\t}\n\n\t/** @param {string} file_name */\n\tfunction get_path_key(file_name) {\n\t\tconst normalized_path = normalize_path(file_name);\n\t\treturn use_case_sensitive_file_names ? normalized_path : normalized_path.toLowerCase();\n\t}\n\n\t/** @param {TsconfigDiagnostic[]} next_diagnostics */\n\tfunction add_diagnostics(next_diagnostics) {\n\t\tfor (const diagnostic of next_diagnostics) {\n\t\t\tconst key = `${diagnostic.code}\\0${diagnostic.file ?? ''}\\0${diagnostic.message}`;\n\t\t\tif (!diagnostic_keys.has(key)) {\n\t\t\t\tdiagnostic_keys.add(key);\n\t\t\t\tdiagnostics.push(diagnostic);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @param {string} file_name */\n\tfunction add_dependency(file_name) {\n\t\tconst normalized_path = normalize_path(file_name);\n\t\tconst key = get_path_key(normalized_path);\n\t\tif (!dependency_keys.has(key)) {\n\t\t\tdependency_keys.add(key);\n\t\t\tdependencies.push(normalized_path);\n\t\t}\n\t}\n\n\t/** @param {string} file_name */\n\tfunction parse_file(file_name) {\n\t\tconst normalized_path = normalize_path(file_name);\n\t\tconst key = get_path_key(normalized_path);\n\t\tconst cached = parsed_file_cache.get(key);\n\t\tif (cached) {\n\t\t\treturn cached;\n\t\t}\n\n\t\tconst raw_source = host.readFile(normalized_path);\n\t\t/** @type {TsconfigDiagnostic[]} */\n\t\tconst parse_diagnostics = [];\n\t\t/** @type {Record<string, unknown>} */\n\t\tlet config = {};\n\t\tif (raw_source !== undefined) {\n\t\t\tconst parsed = parse_jsonc(raw_source);\n\t\t\tif (parsed.error) {\n\t\t\t\tparse_diagnostics.push({\n\t\t\t\t\tcode: PARSE_ERROR_DIAGNOSTIC_CODE,\n\t\t\t\t\tmessage: `Failed to parse ${normalized_path}: ${parsed.error.message}`,\n\t\t\t\t\tfile: normalized_path,\n\t\t\t\t});\n\t\t\t} else if (\n\t\t\t\tparsed.value !== null &&\n\t\t\t\ttypeof parsed.value === 'object' &&\n\t\t\t\t!Array.isArray(parsed.value)\n\t\t\t) {\n\t\t\t\tconfig = /** @type {Record<string, unknown>} */ (parsed.value);\n\t\t\t} else {\n\t\t\t\tparse_diagnostics.push({\n\t\t\t\t\tcode: PARSE_ERROR_DIAGNOSTIC_CODE,\n\t\t\t\t\tmessage: `The root value of ${normalized_path} must be an object.`,\n\t\t\t\t\tfile: normalized_path,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst extends_value = config.extends;\n\t\tconst extends_values = Array.isArray(extends_value)\n\t\t\t? extends_value\n\t\t\t: extends_value !== undefined\n\t\t\t\t? [extends_value]\n\t\t\t\t: [];\n\t\tconst parsed = {\n\t\t\tpath: normalized_path,\n\t\t\tdir: path.dirname(normalized_path),\n\t\t\tconfig,\n\t\t\traw_source,\n\t\t\tparse_diagnostics,\n\t\t\textends_values,\n\t\t};\n\t\tparsed_file_cache.set(key, parsed);\n\t\tadd_diagnostics(parse_diagnostics);\n\t\treturn parsed;\n\t}\n\n\t/**\n\t * Resolve one immediate extends entry. The conventional JSON candidate of an\n\t * unresolved relative entry is still recorded as a dependency so creating it\n\t * later invalidates caches and language-server projects.\n\t * @param {ParsedTsconfigLayer} parsed\n\t * @param {unknown} extends_value\n\t */\n\tfunction resolve_extends_path(parsed, extends_value) {\n\t\tif (typeof extends_value !== 'string') {\n\t\t\tconst diagnostic = {\n\t\t\t\tcode: INVALID_EXTENDS_DIAGNOSTIC_CODE,\n\t\t\t\tmessage: `Compiler option 'extends' requires a value of type string.`,\n\t\t\t\tfile: parsed.path,\n\t\t\t};\n\t\t\tadd_diagnostics([diagnostic]);\n\t\t\textends_failures.push({\n\t\t\t\tconfig_path: parsed.path,\n\t\t\t\textends_value,\n\t\t\t\tresolved_path: undefined,\n\t\t\t\tdiagnostics: [diagnostic],\n\t\t\t});\n\t\t\treturn undefined;\n\t\t}\n\t\tconst target = resolve_extends_target(extends_value, parsed.dir, host);\n\t\tconst dependency_path = target.path ?? target.candidate;\n\t\tif (dependency_path !== undefined) {\n\t\t\tadd_dependency(dependency_path);\n\t\t}\n\t\tif (target.path === undefined) {\n\t\t\tconst diagnostic = {\n\t\t\t\tcode: FILE_NOT_FOUND_DIAGNOSTIC_CODE,\n\t\t\t\tmessage: `File '${target.candidate ?? extends_value}' not found.`,\n\t\t\t\tfile: parsed.path,\n\t\t\t};\n\t\t\tadd_diagnostics([diagnostic]);\n\t\t\textends_failures.push({\n\t\t\t\tconfig_path: parsed.path,\n\t\t\t\textends_value,\n\t\t\t\tresolved_path: dependency_path,\n\t\t\t\tdiagnostics: [diagnostic],\n\t\t\t});\n\t\t\treturn undefined;\n\t\t}\n\t\tif (active_keys.has(get_path_key(target.path))) {\n\t\t\tconst chain = [...active_stack, normalize_path(target.path)];\n\t\t\tconst diagnostic = {\n\t\t\t\tcode: CIRCULARITY_DIAGNOSTIC_CODE,\n\t\t\t\tmessage: `Circularity detected while resolving configuration: ${chain.join(' -> ')}`,\n\t\t\t\tfile: parsed.path,\n\t\t\t};\n\t\t\tadd_diagnostics([diagnostic]);\n\t\t\textends_failures.push({\n\t\t\t\tconfig_path: parsed.path,\n\t\t\t\textends_value,\n\t\t\t\tresolved_path: dependency_path,\n\t\t\t\tdiagnostics: [diagnostic],\n\t\t\t});\n\t\t\treturn undefined;\n\t\t}\n\t\treturn target.path;\n\t}\n\n\t/** @param {string} file_name */\n\tfunction visit(file_name) {\n\t\tconst normalized_path = normalize_path(file_name);\n\t\tconst key = get_path_key(normalized_path);\n\t\tactive_keys.add(key);\n\t\tactive_stack.push(normalized_path);\n\t\tadd_dependency(normalized_path);\n\t\tconst parsed = parse_file(normalized_path);\n\t\tfor (const extends_value of parsed.extends_values) {\n\t\t\tconst extended_path = resolve_extends_path(parsed, extends_value);\n\t\t\tif (extended_path !== undefined) {\n\t\t\t\tvisit(extended_path);\n\t\t\t}\n\t\t}\n\t\tlayers.push({\n\t\t\tpath: parsed.path,\n\t\t\tdir: parsed.dir,\n\t\t\tconfig: parsed.config,\n\t\t\traw_source: parsed.raw_source,\n\t\t\tparse_diagnostics: parsed.parse_diagnostics,\n\t\t});\n\t\tactive_stack.pop();\n\t\tactive_keys.delete(key);\n\t}\n\n\tvisit(config_file_name);\n\treturn { layers, dependencies, diagnostics, extends_failures };\n}\n\n/**\n * Read a nested config value only when every segment is an own property.\n *\n * @param {unknown} config\n * @param {readonly PropertyKey[]} path_parts\n * @returns {ConfigValueResult<unknown>}\n */\nexport function get_own_config_value(config, path_parts) {\n\tlet current = config;\n\tfor (const path_part of path_parts) {\n\t\tif (\n\t\t\tcurrent === null ||\n\t\t\t(typeof current !== 'object' && typeof current !== 'function') ||\n\t\t\t!Object.prototype.hasOwnProperty.call(current, path_part)\n\t\t) {\n\t\t\treturn { state: 'absent' };\n\t\t}\n\t\tcurrent = /** @type {Record<PropertyKey, unknown>} */ (current)[path_part];\n\t}\n\treturn { state: 'found', value: current };\n}\n\n/**\n * Resolve a caller-defined value across layers. The last result whose state is\n * not absent wins and is annotated with the config that declared it.\n *\n * @template {{state: string}} TResult\n * @param {readonly TsconfigLayer[]} layers\n * @param {(layer: TsconfigLayer) => TResult} read_layer\n * @returns {{state: 'absent'} | (TResult & TsconfigValueOrigin)}\n */\nexport function resolve_inherited_config_value(layers, read_layer) {\n\t/** @type {{state: 'absent'} | (TResult & TsconfigValueOrigin)} */\n\tlet resolved = { state: 'absent' };\n\tfor (const layer of layers) {\n\t\tconst value = read_layer(layer);\n\t\tif (value.state !== 'absent') {\n\t\t\tresolved = {\n\t\t\t\t...value,\n\t\t\t\tconfig_path: layer.path,\n\t\t\t\tconfig_dir: layer.dir,\n\t\t\t};\n\t\t}\n\t}\n\treturn resolved;\n}\n","export const DEBUG = process.env.TSRX_DEBUG === 'true';\n// Matches valid JS/CSS identifier characters: word chars, dashes (CSS), $, and # (TSRX shorthands)\nexport const charAllowedWordRegex = /[\\w\\-$#]/;\n\n/**\n * Create a logging utility with a specific label\n * @param {string} label\n * @returns {{\n * \tlog: (...args: unknown[]) => void,\n * \tlogError: (...args: unknown[]) => void,\n * \tlogWarning: (...args: unknown[]) => void,\n * }}\n */\nexport function createLogging(label) {\n\treturn {\n\t\tlog(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.log(label, ...args);\n\t\t\t}\n\t\t},\n\t\tlogError(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.error(label, ...args);\n\t\t\t}\n\t\t},\n\t\tlogWarning(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.warn(label, ...args);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Get the word at a specific position in the text\n * @param {string} text\n * @param {number} start\n * @returns {{word: string, start: number, end: number}}\n */\nexport function getWordFromPosition(text, start) {\n\tlet wordStart = start;\n\tlet wordEnd = start;\n\twhile (wordStart > 0 && charAllowedWordRegex.test(text[wordStart - 1])) {\n\t\twordStart--;\n\t}\n\twhile (wordEnd < text.length && charAllowedWordRegex.test(text[wordEnd])) {\n\t\twordEnd++;\n\t}\n\n\tconst word = text.substring(wordStart, wordEnd);\n\n\treturn {\n\t\tword,\n\t\tstart: wordStart,\n\t\tend: wordEnd,\n\t};\n}\n","/** @typedef {{actual_type: string, actual_value: string}} InvalidConfigValueDetails */\n/** @typedef {'web' | 'ios' | 'android'} Platform */\n/**\n * @typedef {\n * \t| {state: 'absent'}\n * \t| {state: 'declared', value: string}\n * \t| ({state: 'invalid', target: 'tsrx' | 'compiler'} & InvalidConfigValueDetails)\n * } CompilerDeclaration\n */\n\n/**\n * @typedef {\n * \t| {state: 'absent'}\n * \t| {state: 'declared', value: Platform}\n * \t| ({state: 'invalid', target: 'tsrx' | 'platform'} & InvalidConfigValueDetails)\n * } PlatformDeclaration\n */\n\n/**\n * @typedef {object} CompilerResolutionOptions\n * @property {typeof import('typescript')} [ts] Accepted for the classic callers; config resolution no longer uses it.\n * @property {string} [configFileName]\n * @property {import('./tsconfig-resolution.js').TsconfigHost} [configHost]\n * @property {Set<string>} [dependencies]\n * @property {boolean} [requirePlatformResolution]\n */\n\n/**\n * @typedef {object} ConfigHostResolutionCache\n * @property {Map<string, string | null>} nearest_config_paths\n * @property {Map<string, CachedTsconfigLayers>} resolved_config_layers\n */\n\n/**\n * @typedef {object} CachedTsconfigLayers\n * @property {import('./tsconfig-resolution.js').ResolvedTsconfigLayers} value\n * @property {Map<string, number | undefined> | undefined} dependency_modified_times\n */\n\nimport { createRequire } from 'module';\nimport path from 'path';\nimport { NODE_CONFIG_HOST } from './config-host.js';\nimport { resolve_package_entry } from './package-resolution.js';\nimport {\n\tget_own_config_value,\n\tload_tsconfig_layers,\n\tresolve_inherited_config_value,\n} from './tsconfig-resolution.js';\nimport { createLogging } from './utils.js';\n\nconst { log, logError, logWarning } = createLogging('[TSRX Language]');\n// npm scope/package names stay lowercase-strict; case-sensitive export subpaths may use capitals.\nconst bare_package_specifier_pattern =\n\t/^(?:@[a-z0-9][a-z0-9._~-]*\\/)?[a-z0-9][a-z0-9._~-]*(?:\\/[A-Za-z0-9][A-Za-z0-9._~-]*)*$/;\nconst tsrx_key_pattern = /[\"']tsrx[\"']\\s*:/;\n/** @type {WeakMap<object, ConfigHostResolutionCache>} */\nlet config_host_to_resolution_cache = new WeakMap();\n/** @type {Map<string, string | null>} */\nconst declared_compiler_path_map = new Map();\n\n/**\n * @param {unknown} value\n * @returns {{ actual_type: string, actual_value: string }}\n */\nfunction describe_config_value(value) {\n\tconst actual_type = value === null ? 'null' : Array.isArray(value) ? 'array' : typeof value;\n\treturn {\n\t\tactual_type,\n\t\tactual_value: JSON.stringify(value) ?? String(value),\n\t};\n}\n\n/**\n * Keep filesystem-derived config caches isolated per TypeScript/Volar host.\n * Different hosts can expose different snapshots for the same absolute path.\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n */\nfunction get_config_host_cache(host) {\n\tlet cache = config_host_to_resolution_cache.get(host);\n\tif (!cache) {\n\t\tcache = {\n\t\t\tnearest_config_paths: new Map(),\n\t\t\tresolved_config_layers: new Map(),\n\t\t};\n\t\tconfig_host_to_resolution_cache.set(host, cache);\n\t}\n\treturn cache;\n}\n\n/**\n * @param {string} file_name\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n */\nfunction get_config_cache_key(file_name, host) {\n\tconst normalized_path = path.normalize(path.resolve(file_name));\n\tconst use_case_sensitive_file_names =\n\t\ttypeof host.useCaseSensitiveFileNames === 'function'\n\t\t\t? host.useCaseSensitiveFileNames()\n\t\t\t: host.useCaseSensitiveFileNames;\n\treturn use_case_sensitive_file_names ? normalized_path : normalized_path.toLowerCase();\n}\n\n/**\n * @param {unknown} config\n * @returns {CompilerDeclaration}\n */\nfunction get_compiler_declaration(config) {\n\tconst tsrx_result = get_own_config_value(config, ['tsrx']);\n\tif (tsrx_result.state === 'absent') {\n\t\treturn { state: 'absent' };\n\t}\n\n\tconst tsrx_value = tsrx_result.value;\n\tif (tsrx_value === null || typeof tsrx_value !== 'object' || Array.isArray(tsrx_value)) {\n\t\treturn { state: 'invalid', target: 'tsrx', ...describe_config_value(tsrx_value) };\n\t}\n\tconst compiler_result = get_own_config_value(tsrx_value, ['compiler']);\n\tif (compiler_result.state === 'absent') {\n\t\treturn { state: 'absent' };\n\t}\n\n\tconst compiler = compiler_result.value;\n\tif (typeof compiler === 'string' && compiler.trim() !== '') {\n\t\treturn { state: 'declared', value: compiler.trim() };\n\t}\n\treturn { state: 'invalid', target: 'compiler', ...describe_config_value(compiler) };\n}\n\n/**\n * @param {unknown} config\n * @returns {PlatformDeclaration}\n */\nfunction get_platform_declaration(config) {\n\tconst tsrx_result = get_own_config_value(config, ['tsrx']);\n\tif (tsrx_result.state === 'absent') {\n\t\treturn { state: 'absent' };\n\t}\n\n\tconst tsrx_value = tsrx_result.value;\n\tif (tsrx_value === null || typeof tsrx_value !== 'object' || Array.isArray(tsrx_value)) {\n\t\treturn { state: 'invalid', target: 'tsrx', ...describe_config_value(tsrx_value) };\n\t}\n\tconst platform_result = get_own_config_value(tsrx_value, ['platform']);\n\tif (platform_result.state === 'absent') {\n\t\treturn { state: 'absent' };\n\t}\n\n\tconst platform = platform_result.value;\n\tif (platform === 'web' || platform === 'ios' || platform === 'android') {\n\t\treturn { state: 'declared', value: platform };\n\t}\n\treturn { state: 'invalid', target: 'platform', ...describe_config_value(platform) };\n}\n\n/**\n * Find the nearest tsconfig.json to use as the root of inheritance resolution.\n * @param {string} start_dir\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n * @param {ConfigHostResolutionCache} cache\n * @returns {string | null}\n */\nfunction get_nearest_root_tsconfig(start_dir, host, cache) {\n\tlet current_dir = start_dir;\n\t/** @type {string[]} */\n\tconst visited_dir_keys = [];\n\n\twhile (current_dir) {\n\t\tconst current_dir_key = get_config_cache_key(current_dir, host);\n\t\tif (cache.nearest_config_paths.has(current_dir_key)) {\n\t\t\tconst cached_tsconfig = cache.nearest_config_paths.get(current_dir_key) ?? null;\n\t\t\tfor (const visited_dir_key of visited_dir_keys) {\n\t\t\t\tcache.nearest_config_paths.set(visited_dir_key, cached_tsconfig);\n\t\t\t}\n\t\t\treturn cached_tsconfig;\n\t\t}\n\n\t\tvisited_dir_keys.push(current_dir_key);\n\t\tconst tsconfig_path = path.join(current_dir, 'tsconfig.json');\n\t\tif (host.fileExists(tsconfig_path)) {\n\t\t\tfor (const visited_dir_key of visited_dir_keys) {\n\t\t\t\tcache.nearest_config_paths.set(visited_dir_key, tsconfig_path);\n\t\t\t}\n\t\t\treturn tsconfig_path;\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n\n\tfor (const visited_dir_key of visited_dir_keys) {\n\t\tcache.nearest_config_paths.set(visited_dir_key, null);\n\t}\n\treturn null;\n}\n\n/**\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n * @param {string} root_config_path\n * @param {ConfigHostResolutionCache} cache\n */\nfunction get_tsconfig_layers(host, root_config_path, cache) {\n\tconst cache_key = get_config_cache_key(root_config_path, host);\n\tconst cached = cache.resolved_config_layers.get(cache_key);\n\tif (\n\t\tcached &&\n\t\t(cached.dependency_modified_times === undefined ||\n\t\t\t[...cached.dependency_modified_times].every(\n\t\t\t\t([dependency, modified_time]) =>\n\t\t\t\t\thost.getModifiedTime?.(dependency)?.valueOf() === modified_time,\n\t\t\t))\n\t) {\n\t\treturn cached.value;\n\t}\n\tconst value = load_tsconfig_layers(host, root_config_path);\n\tconst dependency_modified_times = host.getModifiedTime\n\t\t? new Map(\n\t\t\t\tvalue.dependencies.map((dependency) => [\n\t\t\t\t\tdependency,\n\t\t\t\t\thost.getModifiedTime?.(dependency)?.valueOf(),\n\t\t\t\t]),\n\t\t\t)\n\t\t: undefined;\n\tcache.resolved_config_layers.set(cache_key, { value, dependency_modified_times });\n\treturn value;\n}\n\n/**\n * A declaration in the config that owns a failed extends entry, or in a child\n * config above it, has higher precedence than anything the missing base could\n * have declared and therefore makes that failure irrelevant to this value.\n * @param {readonly import('./tsconfig-resolution.js').TsconfigLayer[]} layers\n * @param {import('./tsconfig-resolution.js').TsconfigExtendsFailure} failure\n * @param {string} declaration_config_path\n */\nfunction is_extends_failure_overridden(layers, failure, declaration_config_path) {\n\tconst failure_owner_index = layers.findLastIndex((layer) => layer.path === failure.config_path);\n\tconst declaration_index = layers.findLastIndex((layer) => layer.path === declaration_config_path);\n\treturn failure_owner_index >= 0 && declaration_index >= failure_owner_index;\n}\n\n/**\n * Resolve without a module-resolution cache. This is the recovery path when\n * Node retains a negative package lookup after a dependency is installed: the\n * package walk reads every manifest fresh and resolves the runtime entry.\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n * @param {string} config_path\n * @param {string} specifier\n */\nfunction resolve_uncached_declared_compiler(host, config_path, specifier) {\n\treturn resolve_package_entry(specifier, path.dirname(config_path), { host });\n}\n\n/**\n * Resolve the compiler explicitly selected by a consumer tsconfig. Invalid\n * specifiers are stable and cached, while missing packages are retried so\n * tsserver can recover after the dependency is installed.\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n * @param {string} config_path\n * @param {string} specifier\n * @returns {string | null}\n */\nfunction resolve_declared_compiler(host, config_path, specifier) {\n\tconst cache_key = `${config_path}\\0${specifier}`;\n\tif (declared_compiler_path_map.has(cache_key)) {\n\t\treturn declared_compiler_path_map.get(cache_key) ?? null;\n\t}\n\n\tif (!bare_package_specifier_pattern.test(specifier)) {\n\t\tdeclared_compiler_path_map.set(cache_key, null);\n\t\tlogError(\n\t\t\t'Declared TSRX compiler must be a bare package specifier:',\n\t\t\tspecifier,\n\t\t\t`in ${config_path}`,\n\t\t);\n\t\treturn null;\n\t}\n\n\ttry {\n\t\tconst tsconfig_require = createRequire(config_path);\n\t\tconst compiler_path = tsconfig_require.resolve(specifier);\n\t\tdeclared_compiler_path_map.set(cache_key, compiler_path);\n\t\tlog('Found declared tsrx compiler at:', compiler_path, 'from tsconfig:', config_path);\n\t\treturn compiler_path;\n\t} catch {\n\t\tconst compiler_path = resolve_uncached_declared_compiler(host, config_path, specifier);\n\t\tif (compiler_path !== undefined) {\n\t\t\tdeclared_compiler_path_map.set(cache_key, compiler_path);\n\t\t\tlog(\n\t\t\t\t'Found declared tsrx compiler after uncached retry at:',\n\t\t\t\tcompiler_path,\n\t\t\t\t'from tsconfig:',\n\t\t\t\tconfig_path,\n\t\t\t);\n\t\t\treturn compiler_path;\n\t\t}\n\t\tlogError(`Unable to resolve declared TSRX compiler \"${specifier}\" from tsconfig`, config_path);\n\t\treturn null;\n\t}\n}\n\n/**\n * Return undefined when there is no consumer declaration, null for a declared\n * hard stop, or the resolved compiler path for a valid declaration.\n * @param {string} normalized_file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {string | null | undefined}\n */\nexport function resolve_consumer_compiler_for_file(normalized_file_name, options = {}) {\n\tconst config_host = options.configHost ?? NODE_CONFIG_HOST;\n\tconst host_cache = get_config_host_cache(config_host);\n\tconst root_config_path =\n\t\toptions.configFileName ??\n\t\tget_nearest_root_tsconfig(path.dirname(normalized_file_name), config_host, host_cache);\n\tif (root_config_path === null) {\n\t\treturn undefined;\n\t}\n\tconst resolved_layers = get_tsconfig_layers(config_host, root_config_path, host_cache);\n\tfor (const dependency of resolved_layers.dependencies) {\n\t\toptions.dependencies?.add(dependency);\n\t}\n\tconst unreadable_layers = resolved_layers.layers.filter(\n\t\t(layer) => layer.raw_source === undefined,\n\t);\n\tif (unreadable_layers.length > 0) {\n\t\tfor (const layer of unreadable_layers) {\n\t\t\tlogError('Unable to read tsconfig layer:', layer.path);\n\t\t}\n\t\treturn null;\n\t}\n\tconst malformed_layers = resolved_layers.layers.filter(\n\t\t(layer) => layer.parse_diagnostics.length > 0,\n\t);\n\tif (malformed_layers.length > 0) {\n\t\tconst has_tsrx_intent = resolved_layers.layers.some((layer) => {\n\t\t\tif (get_own_config_value(layer.config, ['tsrx']).state === 'found') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (layer.parse_diagnostics.length === 0 || layer.raw_source === undefined) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// A comment can cause a false positive and hard stop; that fails safe when\n\t\t\t// an unparseable layer may have declared a compiler.\n\t\t\treturn tsrx_key_pattern.test(layer.raw_source);\n\t\t});\n\t\tconst log_parse_error = has_tsrx_intent ? logError : logWarning;\n\t\tfor (const layer of malformed_layers) {\n\t\t\tfor (const diagnostic of layer.parse_diagnostics) {\n\t\t\t\tlog_parse_error('Unable to parse tsconfig layer:', layer.path, diagnostic.message);\n\t\t\t}\n\t\t}\n\t\treturn has_tsrx_intent ? null : undefined;\n\t}\n\tconst declaration = resolve_inherited_config_value(resolved_layers.layers, (layer) =>\n\t\tget_compiler_declaration(layer.config),\n\t);\n\tif (declaration.state === 'invalid') {\n\t\tlogError(\n\t\t\t`Invalid TSRX ${declaration.target} declaration:`,\n\t\t\tdeclaration.actual_type,\n\t\t\tdeclaration.actual_value,\n\t\t\t`in ${declaration.config_path}`,\n\t\t);\n\t\treturn null;\n\t}\n\tconst effective_extends_failures = resolved_layers.extends_failures.filter(\n\t\t(failure) =>\n\t\t\tdeclaration.state !== 'declared' ||\n\t\t\t!is_extends_failure_overridden(resolved_layers.layers, failure, declaration.config_path),\n\t);\n\tif (effective_extends_failures.length > 0) {\n\t\tfor (const failure of effective_extends_failures) {\n\t\t\tif (failure.diagnostics.length === 0) {\n\t\t\t\tlogError(\n\t\t\t\t\t'Unable to resolve tsconfig extends entry:',\n\t\t\t\t\tJSON.stringify(failure.extends_value),\n\t\t\t\t\t`in ${failure.config_path}`,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (const diagnostic of failure.diagnostics) {\n\t\t\t\tlogError(\n\t\t\t\t\t'Unable to resolve tsconfig extends entry:',\n\t\t\t\t\tJSON.stringify(failure.extends_value),\n\t\t\t\t\t`in ${failure.config_path}`,\n\t\t\t\t\tdiagnostic.message,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\tif (declaration.state === 'declared') {\n\t\treturn resolve_declared_compiler(config_host, declaration.config_path, declaration.value);\n\t}\n\treturn undefined;\n}\n\n/**\n * Resolve the compile-time platform selected by the active TypeScript project.\n * The same inheritance graph and dependency tracking as compiler selection are\n * used so nested projects and config edits cannot silently drift.\n *\n * @param {string} normalized_file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {Platform | undefined}\n */\nexport function resolve_consumer_platform_for_file(normalized_file_name, options = {}) {\n\tconst config_host = options.configHost ?? NODE_CONFIG_HOST;\n\tconst host_cache = get_config_host_cache(config_host);\n\tconst root_config_path =\n\t\toptions.configFileName ??\n\t\tget_nearest_root_tsconfig(path.dirname(normalized_file_name), config_host, host_cache);\n\tif (root_config_path === null) {\n\t\treturn undefined;\n\t}\n\n\tconst resolved_layers = get_tsconfig_layers(config_host, root_config_path, host_cache);\n\tfor (const dependency of resolved_layers.dependencies) {\n\t\toptions.dependencies?.add(dependency);\n\t}\n\n\tconst unreadable_layer = resolved_layers.layers.find((layer) => layer.raw_source === undefined);\n\tif (unreadable_layer) {\n\t\tconst message = `Unable to read tsconfig layer while resolving TSRX platform: ${unreadable_layer.path}`;\n\t\tlogError(message);\n\t\tthrow new Error(message);\n\t}\n\n\tconst malformed_layers = resolved_layers.layers.filter(\n\t\t(layer) => layer.parse_diagnostics.length > 0,\n\t);\n\tif (malformed_layers.length > 0) {\n\t\tconst has_tsrx_intent = resolved_layers.layers.some((layer) => {\n\t\t\tif (get_own_config_value(layer.config, ['tsrx']).state === 'found') return true;\n\t\t\treturn (\n\t\t\t\tlayer.parse_diagnostics.length > 0 &&\n\t\t\t\tlayer.raw_source !== undefined &&\n\t\t\t\ttsrx_key_pattern.test(layer.raw_source)\n\t\t\t);\n\t\t});\n\t\tif (!has_tsrx_intent) return undefined;\n\n\t\tconst layer = malformed_layers[0];\n\t\tconst detail = layer.parse_diagnostics[0].message;\n\t\tconst message = `Unable to parse tsconfig layer while resolving TSRX platform: ${layer.path}: ${detail}`;\n\t\tlogError(message);\n\t\tthrow new Error(message);\n\t}\n\n\tconst declaration = resolve_inherited_config_value(resolved_layers.layers, (layer) =>\n\t\tget_platform_declaration(layer.config),\n\t);\n\tif (declaration.state === 'invalid') {\n\t\tconst expected =\n\t\t\tdeclaration.target === 'platform' ? ' Expected \"web\", \"ios\", or \"android\".' : '';\n\t\tconst message = `Invalid TSRX ${declaration.target} declaration: ${declaration.actual_type} ${declaration.actual_value} in ${declaration.config_path}.${expected}`;\n\t\tlogError(message);\n\t\tthrow new TypeError(message);\n\t}\n\n\tconst effective_extends_failures = resolved_layers.extends_failures.filter(\n\t\t(failure) =>\n\t\t\tdeclaration.state !== 'declared' ||\n\t\t\t!is_extends_failure_overridden(resolved_layers.layers, failure, declaration.config_path),\n\t);\n\tif (effective_extends_failures.length > 0) {\n\t\t// An unresolved lower-precedence config must not break a file that does not\n\t\t// use platform flags. Known declarations are still validated above. When a\n\t\t// flag is present, the caller requests a complete graph so an unknown base\n\t\t// cannot silently choose the wrong branch.\n\t\tif (!options.requirePlatformResolution) {\n\t\t\treturn declaration.state === 'declared' ? declaration.value : undefined;\n\t\t}\n\t\tconst failure = effective_extends_failures[0];\n\t\tconst detail = failure.diagnostics.length > 0 ? `: ${failure.diagnostics[0].message}` : '';\n\t\tconst message = `Unable to resolve tsconfig extends entry ${JSON.stringify(failure.extends_value)} in ${failure.config_path} while resolving TSRX platform${detail}`;\n\t\tlogError(message);\n\t\tthrow new Error(message);\n\t}\n\n\treturn declaration.state === 'declared' ? declaration.value : undefined;\n}\n\n/** Drop all filesystem-derived consumer compiler resolution state. */\nexport function reset_consumer_compiler_resolution_caches() {\n\tconfig_host_to_resolution_cache = new WeakMap();\n\tdeclared_compiler_path_map.clear();\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.binarySearch = binarySearch;\nfunction binarySearch(values, searchValue) {\n let low = 0;\n let high = values.length - 1;\n let match;\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const midValue = values[mid];\n if (midValue < searchValue) {\n low = mid + 1;\n }\n else if (midValue > searchValue) {\n high = mid - 1;\n }\n else {\n low = mid;\n high = mid;\n match = mid;\n break;\n }\n }\n const finalLow = Math.max(Math.min(low, high, values.length - 1), 0);\n const finalHigh = Math.min(Math.max(low, high, 0), values.length - 1);\n return { low: finalLow, high: finalHigh, match };\n}\n//# sourceMappingURL=binarySearch.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.translateOffset = translateOffset;\nlet warned = false;\nfunction translateOffset(start, fromOffsets, toOffsets, fromLengths, toLengths = fromLengths, preferEnd = false) {\n const isSorted = fromOffsets.every((value, index) => index === 0 || fromOffsets[index - 1] <= value);\n if (!isSorted) {\n for (let i = 0; i < fromOffsets.length; i++) {\n const fromOffset = fromOffsets[i];\n const fromLength = fromLengths[i];\n if (start >= fromOffset && start <= fromOffset + fromLength) {\n const toLength = toLengths[i];\n const toOffset = toOffsets[i];\n let rangeOffset;\n const relativePos = start - fromOffset;\n if (preferEnd && toLength > fromLength && relativePos === fromLength) {\n rangeOffset = toLength;\n }\n else {\n rangeOffset = Math.min(relativePos, toLength);\n }\n return toOffset + rangeOffset;\n }\n }\n if (!warned) {\n warned = true;\n console.warn('fromOffsets should be sorted in ascending order');\n }\n }\n let low = 0;\n let high = fromOffsets.length - 1;\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const fromOffset = fromOffsets[mid];\n const fromLength = fromLengths[mid];\n if (start >= fromOffset && start <= fromOffset + fromLength) {\n const toLength = toLengths[mid];\n const toOffset = toOffsets[mid];\n let rangeOffset;\n const relativePos = start - fromOffset;\n if (preferEnd && toLength > fromLength && relativePos === fromLength) {\n rangeOffset = toLength;\n }\n else {\n rangeOffset = Math.min(relativePos, toLength);\n }\n return toOffset + rangeOffset;\n }\n else if (start < fromOffset) {\n high = mid - 1;\n }\n else {\n low = mid + 1;\n }\n }\n}\n//# sourceMappingURL=translateOffset.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SourceMap = void 0;\nconst binarySearch_1 = require(\"./binarySearch\");\nconst translateOffset_1 = require(\"./translateOffset\");\nclass SourceMap {\n constructor(mappings) {\n this.mappings = mappings;\n }\n toSourceRange(generatedStart, generatedEnd, fallbackToAnyMatch, filter) {\n return this.findMatchingStartEnd(generatedStart, generatedEnd, fallbackToAnyMatch, 'generatedOffsets', filter);\n }\n toGeneratedRange(sourceStart, sourceEnd, fallbackToAnyMatch, filter) {\n return this.findMatchingStartEnd(sourceStart, sourceEnd, fallbackToAnyMatch, 'sourceOffsets', filter);\n }\n toSourceLocation(generatedOffset, filter) {\n return this.findMatchingOffsets(generatedOffset, 'generatedOffsets', filter);\n }\n toGeneratedLocation(sourceOffset, filter) {\n return this.findMatchingOffsets(sourceOffset, 'sourceOffsets', filter);\n }\n *findMatchingOffsets(offset, fromRange, filter, preferEnd = false) {\n const memo = this.getMemoBasedOnRange(fromRange);\n if (memo.offsets.length === 0) {\n return;\n }\n const { low: start, high: end } = (0, binarySearch_1.binarySearch)(memo.offsets, offset);\n const skip = new Set();\n const toRange = fromRange === 'sourceOffsets' ? 'generatedOffsets' : 'sourceOffsets';\n for (let i = start; i <= end; i++) {\n for (const mapping of memo.mappings[i]) {\n if (skip.has(mapping)) {\n continue;\n }\n skip.add(mapping);\n if (filter && !filter(mapping.data)) {\n continue;\n }\n const mapped = (0, translateOffset_1.translateOffset)(offset, mapping[fromRange], mapping[toRange], getLengths(mapping, fromRange), getLengths(mapping, toRange), preferEnd);\n if (mapped !== undefined) {\n yield [mapped, mapping];\n }\n }\n }\n }\n *findMatchingStartEnd(start, end, fallbackToAnyMatch, fromRange, filter) {\n const toRange = fromRange === 'sourceOffsets' ? 'generatedOffsets' : 'sourceOffsets';\n const preferEnd = toRange === 'sourceOffsets';\n const mappedStarts = [];\n let hadMatch = false;\n for (const [mappedStart, mapping] of this.findMatchingOffsets(start, fromRange)) {\n if (filter && !filter(mapping.data)) {\n continue;\n }\n mappedStarts.push([mappedStart, mapping]);\n const mappedEnd = (0, translateOffset_1.translateOffset)(end, mapping[fromRange], mapping[toRange], getLengths(mapping, fromRange), getLengths(mapping, toRange), preferEnd);\n if (mappedEnd !== undefined) {\n hadMatch = true;\n yield [mappedStart, mappedEnd, mapping, mapping];\n }\n }\n if (!hadMatch && fallbackToAnyMatch) {\n for (const [mappedStart, mappingStart] of mappedStarts) {\n for (const [mappedEnd, mappingEnd] of this.findMatchingOffsets(end, fromRange, undefined, preferEnd)) {\n if (filter && !filter(mappingEnd.data) || mappedEnd < mappedStart) {\n continue;\n }\n yield [mappedStart, mappedEnd, mappingStart, mappingEnd];\n break;\n }\n }\n }\n }\n getMemoBasedOnRange(fromRange) {\n return fromRange === 'sourceOffsets'\n ? this.sourceCodeOffsetsMemo ??= this.createMemo('sourceOffsets')\n : this.generatedCodeOffsetsMemo ??= this.createMemo('generatedOffsets');\n }\n createMemo(key) {\n const offsetsSet = new Set();\n for (const mapping of this.mappings) {\n for (let i = 0; i < mapping[key].length; i++) {\n offsetsSet.add(mapping[key][i]);\n offsetsSet.add(mapping[key][i] + getLengths(mapping, key)[i]);\n }\n }\n const offsets = [...offsetsSet].sort((a, b) => a - b);\n const mappings = offsets.map(() => new Set());\n for (const mapping of this.mappings) {\n for (let i = 0; i < mapping[key].length; i++) {\n const startIndex = (0, binarySearch_1.binarySearch)(offsets, mapping[key][i]).match;\n const endIndex = (0, binarySearch_1.binarySearch)(offsets, mapping[key][i] + getLengths(mapping, key)[i]).match;\n for (let i = startIndex; i <= endIndex; i++) {\n mappings[i].add(mapping);\n }\n }\n }\n return { offsets, mappings };\n }\n}\nexports.SourceMap = SourceMap;\nfunction getLengths(mapping, key) {\n return key === 'sourceOffsets' ? mapping.lengths : mapping.generatedLengths ?? mapping.lengths;\n}\n//# sourceMappingURL=sourceMap.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/sourceMap\"), exports);\n__exportStar(require(\"./lib/translateOffset\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isHoverEnabled = isHoverEnabled;\nexports.isInlayHintsEnabled = isInlayHintsEnabled;\nexports.isCodeLensEnabled = isCodeLensEnabled;\nexports.isMonikerEnabled = isMonikerEnabled;\nexports.isInlineValueEnabled = isInlineValueEnabled;\nexports.isSemanticTokensEnabled = isSemanticTokensEnabled;\nexports.isCallHierarchyEnabled = isCallHierarchyEnabled;\nexports.isTypeHierarchyEnabled = isTypeHierarchyEnabled;\nexports.isRenameEnabled = isRenameEnabled;\nexports.isDefinitionEnabled = isDefinitionEnabled;\nexports.isTypeDefinitionEnabled = isTypeDefinitionEnabled;\nexports.isReferencesEnabled = isReferencesEnabled;\nexports.isImplementationEnabled = isImplementationEnabled;\nexports.isHighlightEnabled = isHighlightEnabled;\nexports.isSymbolsEnabled = isSymbolsEnabled;\nexports.isFoldingRangesEnabled = isFoldingRangesEnabled;\nexports.isSelectionRangesEnabled = isSelectionRangesEnabled;\nexports.isLinkedEditingEnabled = isLinkedEditingEnabled;\nexports.isColorEnabled = isColorEnabled;\nexports.isDocumentLinkEnabled = isDocumentLinkEnabled;\nexports.isDiagnosticsEnabled = isDiagnosticsEnabled;\nexports.isCodeActionsEnabled = isCodeActionsEnabled;\nexports.isFormattingEnabled = isFormattingEnabled;\nexports.isCompletionEnabled = isCompletionEnabled;\nexports.isAutoInsertEnabled = isAutoInsertEnabled;\nexports.isSignatureHelpEnabled = isSignatureHelpEnabled;\nexports.shouldReportDiagnostics = shouldReportDiagnostics;\nexports.resolveRenameNewName = resolveRenameNewName;\nexports.resolveRenameEditText = resolveRenameEditText;\nexports.findOverlapCodeRange = findOverlapCodeRange;\nfunction isHoverEnabled(info) {\n return !!info.semantic;\n}\nfunction isInlayHintsEnabled(info) {\n return !!info.semantic;\n}\nfunction isCodeLensEnabled(info) {\n return !!info.semantic;\n}\nfunction isMonikerEnabled(info) {\n return !!info.semantic;\n}\nfunction isInlineValueEnabled(info) {\n return !!info.semantic;\n}\nfunction isSemanticTokensEnabled(info) {\n return typeof info.semantic === 'object'\n ? info.semantic.shouldHighlight?.() ?? true\n : !!info.semantic;\n}\nfunction isCallHierarchyEnabled(info) {\n return !!info.navigation;\n}\nfunction isTypeHierarchyEnabled(info) {\n return !!info.navigation;\n}\nfunction isRenameEnabled(info) {\n return typeof info.navigation === 'object'\n ? info.navigation.shouldRename?.() ?? true\n : !!info.navigation;\n}\nfunction isDefinitionEnabled(info) {\n return !!info.navigation;\n}\nfunction isTypeDefinitionEnabled(info) {\n return !!info.navigation;\n}\nfunction isReferencesEnabled(info) {\n return !!info.navigation;\n}\nfunction isImplementationEnabled(info) {\n return !!info.navigation;\n}\nfunction isHighlightEnabled(info) {\n return typeof info.navigation === 'object'\n ? info.navigation.shouldHighlight?.() ?? true\n : !!info.navigation;\n}\nfunction isSymbolsEnabled(info) {\n return !!info.structure;\n}\nfunction isFoldingRangesEnabled(info) {\n return !!info.structure;\n}\nfunction isSelectionRangesEnabled(info) {\n return !!info.structure;\n}\nfunction isLinkedEditingEnabled(info) {\n return !!info.structure;\n}\nfunction isColorEnabled(info) {\n return !!info.structure;\n}\nfunction isDocumentLinkEnabled(info) {\n return !!info.structure;\n}\nfunction isDiagnosticsEnabled(info) {\n return !!info.verification;\n}\nfunction isCodeActionsEnabled(info) {\n return !!info.verification;\n}\nfunction isFormattingEnabled(info) {\n return !!info.format;\n}\nfunction isCompletionEnabled(info) {\n return !!info.completion;\n}\nfunction isAutoInsertEnabled(info) {\n return !!info.completion;\n}\nfunction isSignatureHelpEnabled(info) {\n return !!info.completion;\n}\n// should...\nfunction shouldReportDiagnostics(info, source, code) {\n return typeof info.verification === 'object'\n ? info.verification.shouldReport?.(source, code) ?? true\n : !!info.verification;\n}\n// resolve...\nfunction resolveRenameNewName(newName, info) {\n return typeof info.navigation === 'object'\n ? info.navigation.resolveRenameNewName?.(newName) ?? newName\n : newName;\n}\nfunction resolveRenameEditText(text, info) {\n return typeof info.navigation === 'object'\n ? info.navigation.resolveRenameEditText?.(text) ?? text\n : text;\n}\nfunction findOverlapCodeRange(start, end, map, filter) {\n let mappedStart;\n let mappedEnd;\n for (const [mapped, mapping] of map.toGeneratedLocation(start)) {\n if (filter(mapping.data)) {\n mappedStart = mapped;\n break;\n }\n }\n for (const [mapped, mapping] of map.toGeneratedLocation(end)) {\n if (filter(mapping.data)) {\n mappedEnd = mapped;\n break;\n }\n }\n if (mappedStart === undefined || mappedEnd === undefined) {\n for (const mapping of map.mappings) {\n if (filter(mapping.data)) {\n const mappingStart = mapping.sourceOffsets[0];\n const mappingEnd = mapping.sourceOffsets[mapping.sourceOffsets.length - 1]\n + mapping.lengths[mapping.lengths.length - 1];\n const overlap = getOverlapRange(start, end, mappingStart, mappingEnd);\n if (overlap) {\n const curMappedStart = (overlap.start - mappingStart) + mapping.generatedOffsets[0];\n const lastGeneratedLength = (mapping.generatedLengths ?? mapping.lengths)[mapping.generatedOffsets.length - 1];\n const curMappedEndOffset = Math.min(overlap.end - mapping.sourceOffsets[mapping.sourceOffsets.length - 1], lastGeneratedLength);\n const curMappedEnd = mapping.generatedOffsets[mapping.generatedOffsets.length - 1] + curMappedEndOffset;\n mappedStart = mappedStart === undefined ? curMappedStart : Math.min(mappedStart, curMappedStart);\n mappedEnd = mappedEnd === undefined ? curMappedEnd : Math.max(mappedEnd, curMappedEnd);\n }\n }\n }\n }\n if (mappedStart !== undefined && mappedEnd !== undefined) {\n return {\n start: mappedStart,\n end: mappedEnd,\n };\n }\n}\nfunction getOverlapRange(range1Start, range1End, range2Start, range2End) {\n const start = Math.max(range1Start, range2Start);\n const end = Math.min(range1End, range2End);\n if (start > end) {\n return undefined;\n }\n return {\n start,\n end,\n };\n}\n//# sourceMappingURL=editor.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LinkedCodeMap = void 0;\nconst source_map_1 = require(\"@volar/source-map\");\nclass LinkedCodeMap extends source_map_1.SourceMap {\n *getLinkedOffsets(start) {\n for (const mapped of this.toGeneratedLocation(start)) {\n yield mapped[0];\n }\n for (const mapped of this.toSourceLocation(start)) {\n yield mapped[0];\n }\n }\n}\nexports.LinkedCodeMap = LinkedCodeMap;\n//# sourceMappingURL=linkedCodeMap.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileMap = void 0;\nclass FileMap extends Map {\n constructor(caseSensitive) {\n super();\n this.caseSensitive = caseSensitive;\n this.originalFileNames = new Map();\n }\n keys() {\n return this.originalFileNames.values();\n }\n get(key) {\n return super.get(this.normalizeId(key));\n }\n has(key) {\n return super.has(this.normalizeId(key));\n }\n set(key, value) {\n this.originalFileNames.set(this.normalizeId(key), key);\n return super.set(this.normalizeId(key), value);\n }\n delete(key) {\n this.originalFileNames.delete(this.normalizeId(key));\n return super.delete(this.normalizeId(key));\n }\n clear() {\n this.originalFileNames.clear();\n return super.clear();\n }\n normalizeId(id) {\n return this.caseSensitive ? id : id.toLowerCase();\n }\n}\nexports.FileMap = FileMap;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultMapperFactory = exports.SourceMap = void 0;\nexports.createLanguage = createLanguage;\nexports.forEachEmbeddedCode = forEachEmbeddedCode;\nvar source_map_1 = require(\"@volar/source-map\");\nObject.defineProperty(exports, \"SourceMap\", { enumerable: true, get: function () { return source_map_1.SourceMap; } });\n__exportStar(require(\"./lib/editor\"), exports);\n__exportStar(require(\"./lib/linkedCodeMap\"), exports);\n__exportStar(require(\"./lib/types\"), exports);\n__exportStar(require(\"./lib/utils\"), exports);\nconst source_map_2 = require(\"@volar/source-map\");\nconst linkedCodeMap_1 = require(\"./lib/linkedCodeMap\");\nconst defaultMapperFactory = mappings => new source_map_2.SourceMap(mappings);\nexports.defaultMapperFactory = defaultMapperFactory;\nfunction createLanguage(plugins, scriptRegistry, sync, onAssociationDirty) {\n const virtualCodeToSourceScriptMap = new WeakMap();\n const virtualCodeToSourceMap = new WeakMap();\n const virtualCodeToLinkedCodeMap = new WeakMap();\n const language = {\n mapperFactory: exports.defaultMapperFactory,\n plugins,\n scripts: {\n fromVirtualCode(virtualCode) {\n return virtualCodeToSourceScriptMap.get(virtualCode);\n },\n get(id, includeFsFiles = true, shouldRegister = false) {\n sync(id, includeFsFiles, shouldRegister);\n const result = scriptRegistry.get(id);\n // The sync function provider may not always call the set function due to caching, so it is necessary to explicitly check isAssociationDirty.\n if (result?.isAssociationDirty) {\n this.set(id, result.snapshot, result.languageId);\n }\n return scriptRegistry.get(id);\n },\n set(id, snapshot, languageId, _plugins = plugins) {\n if (!languageId) {\n for (const plugin of plugins) {\n languageId = plugin.getLanguageId?.(id);\n if (languageId) {\n break;\n }\n }\n }\n if (!languageId) {\n console.warn(`languageId not found for ${String(id)}`);\n return;\n }\n let associatedOnly = false;\n for (const plugin of plugins) {\n if (plugin.isAssociatedFileOnly?.(id, languageId)) {\n associatedOnly = true;\n break;\n }\n }\n if (scriptRegistry.has(id)) {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript.languageId !== languageId || sourceScript.associatedOnly !== associatedOnly) {\n this.delete(id);\n triggerTargetsDirty(sourceScript);\n return this.set(id, snapshot, languageId);\n }\n else if (associatedOnly) {\n if (sourceScript.snapshot !== snapshot) {\n sourceScript.snapshot = snapshot;\n triggerTargetsDirty(sourceScript);\n }\n }\n else if (sourceScript.isAssociationDirty || sourceScript.snapshot !== snapshot) {\n if (sourceScript.snapshot !== snapshot) {\n sourceScript.snapshot = snapshot;\n triggerTargetsDirty(sourceScript);\n }\n const codegenCtx = prepareCreateVirtualCode(sourceScript);\n if (sourceScript.generated) {\n const { updateVirtualCode, createVirtualCode } = sourceScript.generated.languagePlugin;\n const newVirtualCode = updateVirtualCode\n ? updateVirtualCode(id, sourceScript.generated.root, snapshot, codegenCtx)\n : createVirtualCode?.(id, languageId, snapshot, codegenCtx);\n if (newVirtualCode) {\n sourceScript.generated.root = newVirtualCode;\n sourceScript.generated.embeddedCodes.clear();\n for (const code of forEachEmbeddedCode(sourceScript.generated.root)) {\n virtualCodeToSourceScriptMap.set(code, sourceScript);\n sourceScript.generated.embeddedCodes.set(code.id, code);\n }\n return sourceScript;\n }\n else {\n this.delete(id);\n return;\n }\n }\n }\n else {\n // not changed\n return sourceScript;\n }\n }\n else {\n // created\n const sourceScript = {\n id: id,\n languageId,\n snapshot,\n associatedIds: new Set(),\n targetIds: new Set(),\n associatedOnly,\n };\n scriptRegistry.set(id, sourceScript);\n if (associatedOnly) {\n return sourceScript;\n }\n for (const languagePlugin of _plugins) {\n const virtualCode = languagePlugin.createVirtualCode?.(id, languageId, snapshot, prepareCreateVirtualCode(sourceScript));\n if (virtualCode) {\n sourceScript.generated = {\n root: virtualCode,\n languagePlugin,\n embeddedCodes: new Map(),\n };\n for (const code of forEachEmbeddedCode(virtualCode)) {\n virtualCodeToSourceScriptMap.set(code, sourceScript);\n sourceScript.generated.embeddedCodes.set(code.id, code);\n }\n break;\n }\n }\n return sourceScript;\n }\n },\n delete(id) {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript) {\n sourceScript.generated?.languagePlugin.disposeVirtualCode?.(id, sourceScript.generated.root);\n scriptRegistry.delete(id);\n triggerTargetsDirty(sourceScript);\n }\n },\n },\n maps: {\n get(virtualCode, sourceScript) {\n let mapCache = virtualCodeToSourceMap.get(virtualCode.snapshot);\n if (!mapCache) {\n virtualCodeToSourceMap.set(virtualCode.snapshot, mapCache = new WeakMap());\n }\n if (!mapCache.has(sourceScript.snapshot)) {\n const mappings = virtualCode.associatedScriptMappings?.get(sourceScript.id) ?? virtualCode.mappings;\n mapCache.set(sourceScript.snapshot, language.mapperFactory(mappings));\n }\n return mapCache.get(sourceScript.snapshot);\n },\n *forEach(virtualCode) {\n const sourceScript = virtualCodeToSourceScriptMap.get(virtualCode);\n yield [\n sourceScript,\n this.get(virtualCode, sourceScript),\n ];\n if (virtualCode.associatedScriptMappings) {\n for (const [relatedScriptId] of virtualCode.associatedScriptMappings) {\n const relatedSourceScript = scriptRegistry.get(relatedScriptId);\n if (relatedSourceScript) {\n yield [\n relatedSourceScript,\n this.get(virtualCode, relatedSourceScript),\n ];\n }\n }\n }\n },\n },\n linkedCodeMaps: {\n get(virtualCode) {\n const sourceScript = virtualCodeToSourceScriptMap.get(virtualCode);\n let mapCache = virtualCodeToLinkedCodeMap.get(virtualCode.snapshot);\n if (mapCache?.[0] !== sourceScript.snapshot) {\n virtualCodeToLinkedCodeMap.set(virtualCode.snapshot, mapCache = [\n sourceScript.snapshot,\n virtualCode.linkedCodeMappings\n ? new linkedCodeMap_1.LinkedCodeMap(virtualCode.linkedCodeMappings)\n : undefined,\n ]);\n }\n return mapCache[1];\n },\n },\n };\n return language;\n function triggerTargetsDirty(sourceScript) {\n sourceScript.targetIds.forEach(id => {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript) {\n sourceScript.isAssociationDirty = true;\n onAssociationDirty?.(sourceScript.id);\n }\n });\n }\n function prepareCreateVirtualCode(sourceScript) {\n for (const id of sourceScript.associatedIds) {\n scriptRegistry.get(id)?.targetIds.delete(sourceScript.id);\n }\n sourceScript.associatedIds.clear();\n sourceScript.isAssociationDirty = false;\n return {\n getAssociatedScript(id) {\n sync(id, true, true);\n const relatedSourceScript = scriptRegistry.get(id);\n if (relatedSourceScript) {\n relatedSourceScript.targetIds.add(sourceScript.id);\n sourceScript.associatedIds.add(relatedSourceScript.id);\n }\n return relatedSourceScript;\n },\n };\n }\n}\nfunction* forEachEmbeddedCode(virtualCode) {\n yield virtualCode;\n if (virtualCode.embeddedCodes) {\n for (const embeddedCode of virtualCode.embeddedCodes) {\n yield* forEachEmbeddedCode(embeddedCode);\n }\n }\n}\n//# sourceMappingURL=index.js.map","/** @import * as AST from 'estree'; */\n/** @import {CompileError, VolarMappingsResult, CodeMapping} from '@tsrx/core/types' */\n\n/**\n * The compiler contract every TSRX target exposes for editor tooling. Octane\n * and consumer-declared modules may spell the entry `compileToVolarMappings`;\n * see `normalize_tsrx_compiler_module` in `language.js`.\n * @typedef {{\n * \tcompile?: (source: string, filename: string, options?: TsrxTransformOptions) => { code?: string, errors?: CompileError[] },\n * \tcompile_to_volar_mappings(source: string, filename: string, options?: { loose?: boolean } & TsrxTransformOptions): VolarMappingsResult,\n * }} TSRXCompilerModule\n */\n\n/**\n * @typedef {object} TsrxTransformOptions\n * @property {'web' | 'ios' | 'android'} [platform] Platform selected for `import.meta.env.platform` flags.\n */\n\n/**\n * A `<style>` or `<script>` body inside a `.tsrx` file, located by source\n * offset. Both region kinds map 1:1 onto their source text.\n * @typedef {object} EmbeddedRegion\n * @property {string} id Stable id, e.g. `style_0` / `script_0`.\n * @property {number} start Source offset of the first character of the body.\n * @property {number} length Body length in UTF-16 code units.\n * @property {string} content The body text.\n */\n\n/**\n * The type-only transform of one `.tsrx` file, free of any Volar or\n * TypeScript-host types so that both the classic Volar language plugin and the\n * TypeScript 7 content mapper can consume it.\n *\n * `fatalError` is set when the compiler threw: `text` is then `''`,\n * `mappings` is empty and `sourceAst` is `null`. Otherwise `text` is the\n * generated TSX, `mappings` maps it back to the source, `errors` holds the\n * non-fatal (usage) diagnostics and the regions describe the embedded\n * `<style>` / `<script>` bodies.\n * @typedef {object} TsrxTransformResult\n * @property {string} text\n * @property {CodeMapping[]} mappings\n * @property {EmbeddedRegion[]} cssRegions\n * @property {EmbeddedRegion[]} scriptRegions\n * @property {CompileError[]} errors\n * @property {CompileError | null} fatalError\n * @property {AST.Program | null} sourceAst\n */\n\n/**\n * Run a TSRX compiler's type-only transform in loose mode.\n *\n * Pure with respect to its inputs: the compiler module is the only\n * collaborator, no caches are consulted and nothing is logged.\n * @param {TSRXCompilerModule} compiler\n * @param {string} file_name\n * @param {string} content\n * @param {TsrxTransformOptions} [options]\n * @returns {TsrxTransformResult}\n */\nexport function transform_tsrx(compiler, file_name, content, options = {}) {\n\t/** @type {VolarMappingsResult} */\n\tlet transpiled;\n\ttry {\n\t\ttranspiled = compiler.compile_to_volar_mappings(content, file_name, {\n\t\t\tloose: true,\n\t\t\tplatform: options.platform,\n\t\t});\n\t} catch (e) {\n\t\tconst error = /** @type {CompileError} */ (e);\n\t\terror.type = 'fatal';\n\t\treturn {\n\t\t\ttext: '',\n\t\t\tmappings: [],\n\t\t\tcssRegions: [],\n\t\t\tscriptRegions: [],\n\t\t\terrors: [],\n\t\t\tfatalError: error,\n\t\t\tsourceAst: null,\n\t\t};\n\t}\n\n\tconst scriptRegions = regions_from_mappings(transpiled.scriptMappings ?? []);\n\tconst embedded = embed_script_bodies(\n\t\tblank_script_bodies(transpiled.code ?? '', scriptRegions),\n\t\ttranspiled.mappings ?? [],\n\t\tscriptRegions,\n\t);\n\treturn {\n\t\ttext: embedded.text,\n\t\tmappings: embedded.mappings,\n\t\tcssRegions: regions_from_mappings(transpiled.cssMappings ?? []),\n\t\tscriptRegions,\n\t\terrors: transpiled.errors ?? [],\n\t\tfatalError: null,\n\t\tsourceAst: transpiled.sourceAst ?? null,\n\t};\n}\n\n/**\n * The mapping data of a `<script>` body embedded in the generated TSX: every\n * language feature except formatting, exactly like the compiler's own spans.\n */\nconst SCRIPT_BODY_MAPPING_DATA = {\n\tverification: true,\n\tcompletion: true,\n\tsemantic: true,\n\tnavigation: true,\n\tstructure: true,\n\tformat: false,\n\tcustomData: {},\n};\n\n/**\n * `import` declarations at the top level of a `<script>` body, by offset. A\n * conservative statement scanner (a line starting with `import`, up to the\n * module specifier and optional attributes) rather than a parser: the body is\n * plain TypeScript and the transform has no TypeScript parser of its own.\n */\nconst IMPORT_DECLARATION =\n\t/^[ \\t]*import\\s+(?:type\\s+)?(?:(?:[\\w$]+\\s*,\\s*)?(?:\\{[^}]*\\}|\\*\\s+as\\s+[\\w$]+|[\\w$]+)\\s+from\\s+)?(['\"])[^'\"\\n]*\\1(?:\\s+with\\s*\\{[^}]*\\})?[ \\t]*;?/gm;\n\n/**\n * Whole export statements that carry no declaration: re-exports\n * (`export ... from '...'`), local export lists (`export { a as b };`),\n * `export type { T };` and `export = x;`. Module-level syntax with nothing to\n * export from an inline script, blanked entirely.\n */\nconst EXPORT_STATEMENT =\n\t/^[ \\t]*export\\s+(?:type\\s+)?(?:(?:\\{[^}]*\\}|\\*(?:\\s+as\\s+[\\w$]+)?)(?:\\s+from\\s+(['\"])[^'\"\\n]*\\1(?:\\s+with\\s*\\{[^}]*\\})?)?|=\\s*[^;\\n]*)[ \\t]*;?/gm;\n\n/**\n * `export default` in front of a named function or class declaration: only the\n * keywords are blanked, so the declaration keeps its name in the block's scope.\n */\nconst EXPORT_DEFAULT_NAMED =\n\t/^([ \\t]*)(export[ \\t]+default[ \\t]+)(?=(?:async[ \\t]+)?function[ \\t]*\\*?[ \\t]*[A-Za-z_$]|(?:abstract[ \\t]+)?class[ \\t]+(?!(?:extends|implements)\\b)[A-Za-z_$])/gm;\n\n/**\n * `export default` in front of an expression, an anonymous function or an\n * anonymous class: replaced by a same-length `const <name>=` so the rest stays\n * a valid, checked initializer (an anonymous `function () {}` or `class {}` is\n * only valid as an expression).\n */\nconst EXPORT_DEFAULT = /^([ \\t]*)(export[ \\t]+default[ \\t]+)(?=\\S)/gm;\n\n/** The `export` keyword in front of a declaration. */\nconst EXPORT_KEYWORD =\n\t/^([ \\t]*)(export[ \\t]+)(?=(?:async[ \\t]+)?(?:const|let|var|function|class|type|interface|enum|abstract|declare|namespace|module)\\b)/gm;\n\n/**\n * A `<script type=\"module\">` body may `export`, but nothing can import an inline\n * script, so its exports are dead and a block cannot hold them: statements that\n * only export are blanked, `export default` becomes a same-length `const`\n * binding, and the keyword in front of a declaration is blanked, keeping every\n * length so the body's mapping stays one to one.\n * @param {string} body\n * @returns {string}\n */\nexport function blank_export_syntax(body) {\n\treturn body\n\t\t.replace(EXPORT_STATEMENT, (statement) => statement.replace(/[^\\r\\n]/g, ' '))\n\t\t.replace(\n\t\t\tEXPORT_DEFAULT_NAMED,\n\t\t\t(_match, indent, keywords) => indent + ' '.repeat(keywords.length),\n\t\t)\n\t\t.replace(EXPORT_DEFAULT, (_match, indent, keywords) => {\n\t\t\t// `const ` + name + `=` must be exactly as long as the keywords (15+ chars).\n\t\t\tconst name = '_default'.padEnd(keywords.length - 'const '.length - '='.length, '_');\n\t\t\treturn `${indent}const ${name}=`;\n\t\t})\n\t\t.replace(EXPORT_KEYWORD, (_match, indent, keyword) => indent + ' '.repeat(keyword.length));\n}\n\n/**\n * @param {string} body\n * @returns {Array<{ start: number, end: number }>}\n */\nexport function find_import_declarations(body) {\n\t/** @type {Array<{ start: number, end: number }>} */\n\tconst imports = [];\n\tfor (const match of body.matchAll(IMPORT_DECLARATION)) {\n\t\tconst start = match.index + match[0].length - match[0].trimStart().length;\n\t\timports.push({ start, end: match.index + match[0].length });\n\t}\n\treturn imports;\n}\n\n/**\n * Append every `<script>` body to the generated TSX as a block statement, so\n * TypeScript checks it in the same file as the component, on every path that\n * consumes the transform (the language server, tsserver through the plugin, and\n * the content mapper), with ordinary mappings back to the source. A block keeps\n * one body's declarations from colliding with another's or with the\n * component's, and contributes nothing to declaration output.\n *\n * `import` declarations cannot live in a block, so each body's imports are\n * hoisted verbatim in front of its block, at module level, where TypeScript\n * resolves them like any other import (a browser-only URL in a\n * `<script type=\"module\">` yields a mapped \"cannot find module\"); their place\n * in the block is blanked. `export` syntax is blanked in place\n * ({@link blank_export_syntax}). Top-level `await` is legal inside a block of a\n * module and stays as written. Each body maps in one multi-segment mapping.\n * @param {string} text\n * @param {CodeMapping[]} mappings\n * @param {EmbeddedRegion[]} script_regions\n * @returns {{ text: string, mappings: CodeMapping[] }}\n */\nexport function embed_script_bodies(text, mappings, script_regions) {\n\tconst result_mappings = [...mappings];\n\tfor (const region of script_regions) {\n\t\tif (region.length === 0 || region.content.length !== region.length) continue;\n\t\tconst imports = find_import_declarations(region.content);\n\t\t/** @type {number[]} */\n\t\tconst sourceOffsets = [];\n\t\t/** @type {number[]} */\n\t\tconst generatedOffsets = [];\n\t\t/** @type {number[]} */\n\t\tconst lengths = [];\n\n\t\tlet hoisted = '';\n\t\tlet body = blank_export_syntax(region.content);\n\t\tfor (const { start, end } of imports) {\n\t\t\tsourceOffsets.push(region.start + start);\n\t\t\tgeneratedOffsets.push(text.length + 1 + hoisted.length);\n\t\t\tlengths.push(end - start);\n\t\t\thoisted += region.content.slice(start, end) + '\\n';\n\t\t\tbody = body.slice(0, start) + ' '.repeat(end - start) + body.slice(end);\n\t\t}\n\t\tconst block_prefix = `\\n${hoisted};{\\n`;\n\t\tconst body_offset = text.length + block_prefix.length;\n\t\tlet cursor = 0;\n\t\tfor (const { start, end } of [...imports, { start: region.length, end: region.length }]) {\n\t\t\tif (start > cursor) {\n\t\t\t\tsourceOffsets.push(region.start + cursor);\n\t\t\t\tgeneratedOffsets.push(body_offset + cursor);\n\t\t\t\tlengths.push(start - cursor);\n\t\t\t}\n\t\t\tcursor = end;\n\t\t}\n\t\ttext += `${block_prefix}${body}\\n}\\n`;\n\t\tif (sourceOffsets.length > 0) {\n\t\t\tresult_mappings.push({\n\t\t\t\tsourceOffsets,\n\t\t\t\tgeneratedOffsets,\n\t\t\t\tlengths,\n\t\t\t\tgeneratedLengths: [...lengths],\n\t\t\t\tdata: { ...SCRIPT_BODY_MAPPING_DATA, customData: { embeddedId: region.id } },\n\t\t\t});\n\t\t}\n\t}\n\treturn { text, mappings: result_mappings };\n}\n\n/**\n * Blank every `<script>` body in the generated TSX, keeping its length and\n * line breaks. The compilers copy the body verbatim into the JSX text of the\n * `<script>` element, where a `<` (as in `1 < 2`) parses as a tag and yields a\n * syntax error that only the Volar path used to hide (it drops diagnostics\n * with no source mapping; the content-mapper protocol reports them). The body\n * is type-checked as a block appended by {@link embed_script_bodies}, and no\n * mapping of the generated TSX points into the copy in the JSX text\n * (`regions_from_mappings`), so blanking it loses nothing. A body is located by its text followed by the closing tag; a body\n * that is not found unchanged in the output is left alone.\n * @param {string} text\n * @param {EmbeddedRegion[]} script_regions\n * @returns {string}\n */\nexport function blank_script_bodies(text, script_regions) {\n\tlet cursor = 0;\n\tfor (const region of script_regions) {\n\t\tif (region.length === 0) continue;\n\t\tconst needle = `${region.content}</script>`;\n\t\tconst index = text.indexOf(needle, cursor);\n\t\tif (index < 0) continue;\n\t\tconst blank = region.content.replace(/[^\\r\\n]/g, ' ');\n\t\ttext = text.slice(0, index) + blank + text.slice(index + region.content.length);\n\t\tcursor = index + needle.length;\n\t}\n\treturn text;\n}\n\n/**\n * @param {CodeMapping[]} mappings\n * @returns {EmbeddedRegion[]}\n */\nfunction regions_from_mappings(mappings) {\n\treturn mappings.map((mapping) => ({\n\t\tid: String(mapping.data?.customData?.embeddedId ?? ''),\n\t\tstart: mapping.sourceOffsets[0],\n\t\tlength: mapping.lengths[0],\n\t\tcontent: String(mapping.data?.customData?.content ?? ''),\n\t}));\n}\n\n/**\n * Extract raw `<style>...</style>` bodies from source text, used as a fallback\n * for CSS intellisense while the file has a fatal compile error (no AST\n * available; the normal path derives regions from the compiler's\n * `cssMappings` instead).\n *\n * The opening-tag pattern is attribute-aware: a `>` inside a quoted value or an\n * `{...}` expression container (one level of nesting) does not end the tag, so\n * `apply={cond ? a : b}` and `apply={(x) => y}` are handled. It refuses to\n * match self-closing `<style apply={theme} />` blocks (the `/` before `>` must\n * not close the tag): they carry no CSS body, so, like the compiler's\n * `cssMappings`, they yield no region and cannot swallow a later bodied block.\n * One region is produced per bodied block, in source order, whether the blocks\n * share a scope or sit in nested `@{ ... }` / control-flow bodies.\n * @param {string} code\n * @returns {EmbeddedRegion[]}\n */\nexport function extract_css_regions(code) {\n\tconst style_regex =\n\t\t/<style\\b((?:[^>\"'{}/]|\"[^\"]*\"|'[^']*'|\\{(?:[^{}]|\\{[^{}]*\\})*\\}|\\/(?!>))*)>([\\s\\S]*?)<\\/style>/gi;\n\treturn extract_regions(code, style_regex, '<style'.length, 'style');\n}\n\n/**\n * @param {string} code\n * @param {RegExp} regex Global regex whose group 1 is the attribute text and group 2 the body.\n * @param {number} tag_name_length Length of `<tag`.\n * @param {string} id_prefix\n * @returns {EmbeddedRegion[]}\n */\nfunction extract_regions(code, regex, tag_name_length, id_prefix) {\n\t/** @type {EmbeddedRegion[]} */\n\tconst regions = [];\n\tlet match;\n\twhile ((match = regex.exec(code)) !== null) {\n\t\tconst attrs = match[1];\n\t\tconst content = match[2];\n\t\t// `<tag` + attrs + `>`; attrs may contain a quoted or braced `>`, so derive\n\t\t// the opening tag's end from the match structure rather than searching for `>`.\n\t\tconst start = match.index + tag_name_length + attrs.length + 1;\n\t\tregions.push({\n\t\t\tid: `${id_prefix}_${regions.length}`,\n\t\t\tstart,\n\t\t\tlength: content.length,\n\t\t\tcontent,\n\t\t});\n\t}\n\treturn regions;\n}\n","/** @import * as AST from 'estree'; */\n/** @import {CompileError, CodeMapping} from '@tsrx/core/types' */\n\n/** @typedef {import('./transform.js').TSRXCompilerModule} TSRXCompilerModule */\n/** @typedef {import('./transform.js').TsrxTransformResult} TsrxTransformResult */\n/** @typedef {import('./transform.js').EmbeddedRegion} EmbeddedRegion */\n\n/** @typedef {Map<string, CodeMapping>} CachedMappings */\n/** @typedef {import('typescript').CompilerOptions} CompilerOptions */\n/** @typedef {import('@volar/language-core').IScriptSnapshot} IScriptSnapshot */\n/** @typedef {import('@volar/language-core').VirtualCode} VirtualCode */\n/** @typedef {string | { fsPath: string }} ScriptId */\n// Side-effect import: augments @volar/language-core's LanguagePlugin with the `typescript` field.\n/** @typedef {typeof import('@volar/typescript')} _VolarTypeScriptAugmentation */\n/** @typedef {import('./consumer-compiler.js').CompilerResolutionOptions} CompilerResolutionOptions */\n/** @typedef {import('@volar/language-core').LanguagePlugin<ScriptId, VirtualCode>} TsrxLanguagePlugin */\n\n/** @typedef {InstanceType<typeof import('./language.js')[\"TSRXVirtualCode\"]>} TSRXVirtualCodeInstance */\n\nimport { forEachEmbeddedCode } from '@volar/language-core';\nimport fs from 'fs';\nimport path from 'path';\nimport { createRequire } from 'module';\nimport { fileURLToPath } from 'url';\nimport {\n\treset_consumer_compiler_resolution_caches,\n\tresolve_consumer_compiler_for_file,\n\tresolve_consumer_platform_for_file,\n} from './consumer-compiler.js';\nimport { NODE_CONFIG_HOST } from './config-host.js';\nimport { extract_css_regions, transform_tsrx } from './transform.js';\nimport { createLogging, DEBUG } from './utils.js';\n\nconst require = createRequire(import.meta.url);\nconst root_dirname = path.dirname(fileURLToPath(import.meta.url));\n\nconst { log, logWarning, logError } = createLogging('[TSRX Language]');\n/** @type {Set<string>} */\nconst loggedCompilationFailures = new Set();\nexport const TSRX_EXTENSIONS = ['.tsrx'];\n/**\n * `[package name, package directory parts, supported extensions, package hints, entry candidates?]`.\n * Entry candidates are relative to the package directory and are probed in order,\n * so a package that ships both a build output and its sources lists the published\n * layout first.\n * @typedef {[string, string[], string[], string[], string[][]?]} CompilerCandidate\n */\n/** @type {CompilerCandidate[]} */\nexport const COMPILER_CANDIDATES = [\n\t[\n\t\t'@tsrx/ripple',\n\t\t['node_modules', '@tsrx', 'ripple'],\n\t\t['.tsrx'],\n\t\t['@tsrx/ripple', 'ripple', '@ripple-ts/vite-plugin'],\n\t],\n\t[\n\t\t'@tsrx/react',\n\t\t['node_modules', '@tsrx', 'react'],\n\t\t['.tsrx'],\n\t\t['@tsrx/react', '@tsrx/vite-plugin-react'],\n\t],\n\t[\n\t\t'@tsrx/solid',\n\t\t['node_modules', '@tsrx', 'solid'],\n\t\t['.tsrx'],\n\t\t['@tsrx/solid', '@tsrx/vite-plugin-solid'],\n\t],\n\t[\n\t\t'@tsrx/preact',\n\t\t['node_modules', '@tsrx', 'preact'],\n\t\t['.tsrx'],\n\t\t['@tsrx/preact', '@tsrx/vite-plugin-preact'],\n\t],\n\t[\n\t\t'@tsrx/vue',\n\t\t['node_modules', '@tsrx', 'vue'],\n\t\t['.tsrx'],\n\t\t['@tsrx/vue', '@tsrx/vite-plugin-vue'],\n\t],\n\t[\n\t\t'@tsrx/hono',\n\t\t['node_modules', '@tsrx', 'hono'],\n\t\t['.tsrx'],\n\t\t['@tsrx/hono', '@tsrx/vite-plugin-hono'],\n\t],\n\t[\n\t\t'octane',\n\t\t['node_modules', 'octane'],\n\t\t['.tsrx'],\n\t\t['octane', '@octanejs/vite-plugin'],\n\t\t// Published `octane` releases only ship `dist/` and expose the compiler as\n\t\t// `octane/compiler/volar`; the `src/` layout is kept for source checkouts.\n\t\t[\n\t\t\t['dist', 'compiler', 'volar.js'],\n\t\t\t['src', 'compiler', 'volar.js'],\n\t\t],\n\t],\n];\n\n/** @type {string[][]} */\nconst DEFAULT_COMPILER_ENTRY_CANDIDATES = [['src', 'index.js']];\n\n/**\n * @param {string} file_name\n * @returns {boolean}\n */\nexport function is_tsrx_file(file_name) {\n\treturn TSRX_EXTENSIONS.some((extension) => file_name.endsWith(extension));\n}\n\n/**\n * Tokenize enough of a source text to find member chains: comments and\n * string literals are skipped, template literals contribute only their\n * `${...}` expressions, and every identifier, `.` and `?.` is a token.\n * It tokenizes independently of any grammar, so partially authored TSRX and\n * template syntax (`@{`, `@if`) are fine.\n * @param {string} source\n * @returns {Array<{ kind: 'word' | 'dot' | 'question-dot' | 'other', text: string }>}\n */\nfunction tokenize_member_chains(source) {\n\t/** @type {Array<{ kind: 'word' | 'dot' | 'question-dot' | 'other', text: string }>} */\n\tconst tokens = [];\n\tconst length = source.length;\n\tlet index = 0;\n\t/** Brace depth at which each open template substitution started, innermost last. */\n\t/** @type {number[]} */\n\tconst template_braces = [];\n\tlet brace_depth = 0;\n\n\t/** Skip template text from `index` to the closing backtick or the next substitution. */\n\tfunction skip_template_text() {\n\t\twhile (index < length && source[index] !== '`') {\n\t\t\tif (source[index] === '\\\\') {\n\t\t\t\tindex += 2;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (source[index] === '$' && source[index + 1] === '{') {\n\t\t\t\ttemplate_braces.push(brace_depth);\n\t\t\t\tindex += 2;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tindex += 1;\n\t\t}\n\t\tif (index < length) index += 1;\n\t}\n\n\twhile (index < length) {\n\t\tconst char = source[index];\n\t\tconst next = source[index + 1];\n\t\tif (/\\s/.test(char)) {\n\t\t\tindex += 1;\n\t\t} else if (char === '/' && next === '/') {\n\t\t\twhile (index < length && source[index] !== '\\n') index += 1;\n\t\t} else if (char === '/' && next === '*') {\n\t\t\tconst end = source.indexOf('*/', index + 2);\n\t\t\tindex = end < 0 ? length : end + 2;\n\t\t} else if (char === '\"' || char === \"'\") {\n\t\t\tindex += 1;\n\t\t\twhile (index < length && source[index] !== char && source[index] !== '\\n') {\n\t\t\t\tif (source[index] === '\\\\') index += 1;\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t\tindex += 1;\n\t\t} else if (char === '`') {\n\t\t\tindex += 1;\n\t\t\tskip_template_text();\n\t\t} else if (\n\t\t\tchar === '}' &&\n\t\t\ttemplate_braces.length > 0 &&\n\t\t\ttemplate_braces[template_braces.length - 1] === brace_depth\n\t\t) {\n\t\t\t// The substitution closed: back into the template literal's text.\n\t\t\ttemplate_braces.pop();\n\t\t\tindex += 1;\n\t\t\tskip_template_text();\n\t\t} else if (/[A-Za-z_$]/.test(char)) {\n\t\t\tlet end = index + 1;\n\t\t\twhile (end < length && /[\\w$]/.test(source[end])) end += 1;\n\t\t\ttokens.push({ kind: 'word', text: source.slice(index, end) });\n\t\t\tindex = end;\n\t\t} else if (char === '?' && next === '.') {\n\t\t\ttokens.push({ kind: 'question-dot', text: '?.' });\n\t\t\tindex += 2;\n\t\t} else if (char === '.') {\n\t\t\ttokens.push({ kind: 'dot', text: '.' });\n\t\t\tindex += 1;\n\t\t} else {\n\t\t\tif (char === '{') brace_depth += 1;\n\t\t\telse if (char === '}') brace_depth -= 1;\n\t\t\ttokens.push({ kind: 'other', text: char });\n\t\t\tindex += 1;\n\t\t}\n\t}\n\treturn tokens;\n}\n\n/**\n * Detect exact platform property paths (`import.meta.env.platform.web` and\n * the `ios` and `android` twins) without matching comments or string\n * literals, and without TypeScript's scanner so the native path needs no\n * TypeScript.\n *\n * @param {string} source\n * @param {unknown} [_typescript] Accepted for older callers; unused.\n * @returns {boolean}\n */\nexport function source_uses_platform_flag(source, _typescript) {\n\tconst tokens = tokenize_member_chains(source);\n\tconst prefix = ['import', '.', 'meta', '.', 'env', '.', 'platform', '.'];\n\tfor (let index = 0; index + prefix.length < tokens.length; index += 1) {\n\t\tif (\n\t\t\tindex > 0 &&\n\t\t\t(tokens[index - 1].kind === 'dot' || tokens[index - 1].kind === 'question-dot')\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (!prefix.every((text, offset) => tokens[index + offset].text === text)) continue;\n\t\tconst name = tokens[index + prefix.length].text;\n\t\tif (name === 'web' || name === 'ios' || name === 'android') return true;\n\t}\n\treturn false;\n}\n\n/**\n * @param {CompilerResolutionOptions} [options]\n * @returns {TsrxLanguagePlugin}\n */\nexport function getTsrxLanguagePlugin(options = {}) {\n\tlog('Creating TSRX language plugin...');\n\t// `ts` is only needed by the TypeScript-facing parts of the plugin (the\n\t// classic path); the native backend creates the plugin without one.\n\tconst typescript = options.ts;\n\t/** @type {CompilerResolutionOptions} */\n\tconst compiler_resolution_options = {\n\t\t...options,\n\t\tconfigHost: options.configHost ?? NODE_CONFIG_HOST,\n\t};\n\n\treturn {\n\t\tgetLanguageId(fileNameOrUri) {\n\t\t\tconst file_name =\n\t\t\t\ttypeof fileNameOrUri === 'string'\n\t\t\t\t\t? fileNameOrUri\n\t\t\t\t\t: fileNameOrUri.fsPath.replace(/\\\\/g, '/');\n\t\t\tif (is_tsrx_file(file_name)) {\n\t\t\t\tlog('Identified TSRX file:', file_name);\n\t\t\t\treturn 'tsrx';\n\t\t\t}\n\t\t},\n\t\tcreateVirtualCode(fileNameOrUri, languageId, snapshot) {\n\t\t\tif (languageId === 'tsrx') {\n\t\t\t\tconst file_name = normalizeFileNameOrUri(fileNameOrUri);\n\t\t\t\tconst compiler = get_tsrx_compiler(file_name, compiler_resolution_options);\n\t\t\t\tif (!compiler) {\n\t\t\t\t\tlogError(`TSRX compiler not found for file: ${file_name}`);\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tlog('Creating virtual code for:', file_name);\n\t\t\t\ttry {\n\t\t\t\t\treturn new TSRXVirtualCode(file_name, snapshot, compiler, (required) =>\n\t\t\t\t\t\tresolve_consumer_platform_for_file(file_name, {\n\t\t\t\t\t\t\t...compiler_resolution_options,\n\t\t\t\t\t\t\trequirePlatformResolution: required,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tlogError('Failed to create virtual code for:', file_name, ':', err);\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t\tupdateVirtualCode(fileNameOrUri, virtualCode, snapshot) {\n\t\t\tif (virtualCode instanceof TSRXVirtualCode) {\n\t\t\t\tlog('Updating existing virtual code for:', virtualCode.fileName);\n\t\t\t\tvirtualCode.update(snapshot);\n\t\t\t\treturn virtualCode;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\n\t\ttypescript: {\n\t\t\textraFileExtensions: TSRX_EXTENSIONS.map((extension) => ({\n\t\t\t\textension: extension.slice(1),\n\t\t\t\tisMixedContent: false,\n\t\t\t\tscriptKind: 7,\n\t\t\t})),\n\t\t\t/**\n\t\t\t * @param {VirtualCode} tsrx_code\n\t\t\t */\n\t\t\tgetServiceScript(tsrx_code) {\n\t\t\t\tfor (const code of forEachEmbeddedCode(tsrx_code)) {\n\t\t\t\t\tif (code.languageId === 'tsrx') {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcode,\n\t\t\t\t\t\t\textension: '.tsx',\n\t\t\t\t\t\t\tscriptKind: 4,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * @implements {VirtualCode}\n */\n/**\n * File names (as TypeScript spells them) whose last TSRX compilation failed.\n * While a file is in this state its generated code is the raw source, so every\n * TypeScript diagnostic on it would be noise; the tsserver plugin (`index.js`)\n * drops them, as the classic language server's diagnostic filter does, and the\n * TSRX compile error is reported by the language server instead.\n * @type {Set<string>}\n */\nexport const files_with_fatal_compile_error = new Set();\n\n/**\n * @param {string} file_name\n * @returns {boolean}\n */\nexport function has_fatal_compile_error(file_name) {\n\treturn files_with_fatal_compile_error.has(normalize_file_name_key(file_name));\n}\n\n/**\n * @param {string} file_name\n * @returns {string}\n */\nfunction normalize_file_name_key(file_name) {\n\treturn file_name.replace(/\\\\/g, '/').toLowerCase();\n}\n\nexport class TSRXVirtualCode {\n\t/** @type {string} */\n\tid = 'root';\n\t/** @type {string} */\n\tlanguageId = 'tsrx';\n\t/** @type {unknown[]} */\n\tcodegenStacks = [];\n\t/** @type {TSRXCompilerModule} */\n\ttsrx;\n\t/** @type {((required: boolean) => 'web' | 'ios' | 'android' | undefined) | undefined} */\n\tplatformProvider;\n\t/** @type {string} */\n\tgeneratedCode = '';\n\t/** @type {VirtualCode['embeddedCodes']} */\n\tembeddedCodes = [];\n\t/** @type {CodeMapping[]} */\n\tmappings = [];\n\t/** @type {CompileError[]} */\n\tfatalErrors = [];\n\t/** @type {CompileError[]} */\n\tusageErrors = [];\n\t/** @type {IScriptSnapshot} */\n\tsnapshot;\n\t/** @type {IScriptSnapshot} */\n\tsourceSnapshot;\n\t/** @type {string} */\n\toriginalCode = '';\n\t/** @type {AST.Program | null} */\n\tsourceAst = null;\n\t/**\n\t * The `<script>` bodies of code (not data blocks) the transform appends to the\n\t * generated TSX as blocks; empty while the file has a fatal compile error.\n\t * @type {EmbeddedRegion[]}\n\t */\n\tscriptRegions = [];\n\t/** @type {boolean} */\n\tisDotCompletionMode = false;\n\t/** @type {unknown[]} */\n\tdiagnostics = [];\n\t/** @type {CachedMappings | null} */\n\t#mappingGenToSource = null;\n\t/** @type {CachedMappings | null} */\n\t#mappingSourceToGen = null;\n\n\t/**\n\t * @param {string} file_name\n\t * @param {IScriptSnapshot} snapshot\n\t * @param {TSRXCompilerModule} tsrx\n\t * @param {(required: boolean) => 'web' | 'ios' | 'android' | undefined} [platform_provider]\n\t */\n\tconstructor(file_name, snapshot, tsrx, platform_provider) {\n\t\tlog('Initializing TSRXVirtualCode for:', file_name);\n\n\t\tthis.fileName = file_name;\n\t\tthis.tsrx = tsrx;\n\t\tthis.platformProvider = platform_provider;\n\t\tthis.snapshot = snapshot;\n\t\tthis.sourceSnapshot = snapshot;\n\t\tthis.originalCode = snapshot.getText(0, snapshot.getLength());\n\n\t\t// Validate the selected TSRX compiler.\n\t\tif (!tsrx || typeof tsrx.compile_to_volar_mappings !== 'function') {\n\t\t\tlogError('Invalid TSRX compiler - missing compile_to_volar_mappings method');\n\t\t\tthrow new Error('Invalid TSRX compiler');\n\t\t}\n\n\t\tthis.update(snapshot);\n\t}\n\n\t/**\n\t * @param {IScriptSnapshot} snapshot\n\t * @returns {void}\n\t */\n\tupdate(snapshot) {\n\t\tlog('Updating virtual code for:', this.fileName);\n\n\t\tconst newCode = snapshot.getText(0, snapshot.getLength());\n\t\tconst changeRange = snapshot.getChangeRange(this.sourceSnapshot);\n\t\tthis.sourceSnapshot = snapshot;\n\n\t\t// Only clear mapping index - don't update snapshot/originalCode yet\n\t\tthis.#mappingGenToSource = null;\n\t\tthis.#mappingSourceToGen = null;\n\n\t\tthis.fatalErrors = [];\n\t\tthis.usageErrors = [];\n\t\tthis.sourceAst = null;\n\t\tthis.scriptRegions = [];\n\t\tthis.isDotCompletionMode = false;\n\n\t\t// Check if a single \".\" was typed using changeRange\n\t\tlet isDotTyped = false;\n\t\tlet dotPosition = -1;\n\n\t\tlog('changeRange:', JSON.stringify(changeRange));\n\n\t\tif (changeRange) {\n\t\t\tconst changeStart = changeRange.span.start;\n\t\t\tconst changeEnd = changeStart + changeRange.span.length;\n\t\t\tconst newEnd = changeStart + changeRange.newLength;\n\n\t\t\t// Get the old text (what was replaced) from originalCode\n\t\t\tconst oldText = this.originalCode.substring(changeStart, changeEnd);\n\t\t\t// Get the new text (what replaced it) from newCode\n\t\t\tconst newText = newCode.substring(changeStart, newEnd);\n\n\t\t\tlog('Change details:');\n\t\t\tlog(' Position:', changeStart, '-', changeEnd, '(length:', changeRange.span.length, ')');\n\t\t\tlog(' Old text:', JSON.stringify(oldText));\n\t\t\tlog(' New text:', JSON.stringify(newText), '(length:', changeRange.newLength, ')');\n\n\t\t\t// Check if a dot was added at the end of the new text\n\t\t\tif (newText.endsWith('.')) {\n\t\t\t\t// The dot is at position newEnd - 1\n\t\t\t\t// We need to check the character BEFORE the dot (inside the new text)\n\t\t\t\tconst charBeforeDot = newEnd > 1 ? newCode[newEnd - 2] : '';\n\t\t\t\tlog(' Char before dot:', JSON.stringify(charBeforeDot));\n\n\t\t\t\tif (/[$#_\\u200C\\u200D\\p{ID_Continue}\\)\\]\\}]/u.test(charBeforeDot)) {\n\t\t\t\t\tisDotTyped = true;\n\t\t\t\t\tdotPosition = newEnd - 1; // Position of the dot\n\t\t\t\t\tlog('ChangeRange detected dot typed at position', dotPosition);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/** @type {TsrxTransformResult} */\n\t\tlet result;\n\t\ttry {\n\t\t\tconst platform = this.platformProvider?.(source_uses_platform_flag(newCode));\n\t\t\t// If user typed a \".\", compile without it and then stitch it back into\n\t\t\t// the generated output so completions can still resolve.\n\t\t\tif (isDotTyped && dotPosition >= 0) {\n\t\t\t\tthis.isDotCompletionMode = true;\n\t\t\t\tconst codeWithoutDot =\n\t\t\t\t\tnewCode.substring(0, dotPosition) + newCode.substring(dotPosition + 1);\n\n\t\t\t\tlog('Compiling without typed dot at position', dotPosition);\n\t\t\t\tresult = transform_tsrx(this.tsrx, this.fileName, codeWithoutDot, { platform });\n\n\t\t\t\tif (!result.fatalError && result.text && result.mappings.length > 0) {\n\t\t\t\t\tlog('Compilation without dot successful');\n\t\t\t\t\tconst insertedDotPosition = restore_typed_dot_in_transpiled_code(result, dotPosition);\n\n\t\t\t\t\tif (insertedDotPosition === null) {\n\t\t\t\t\t\tlogWarning('Failed to restore typed dot into transpiled output');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog('Inserted typed dot at generated position', insertedDotPosition);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlog('Compiling TSRX code...');\n\t\t\t\tresult = transform_tsrx(this.tsrx, this.fileName, newCode, { platform });\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// Platform resolution failed (invalid tsconfig): treat it like a compile failure.\n\t\t\tconst error = /** @type {CompileError} */ (e);\n\t\t\terror.type = 'fatal';\n\t\t\tresult = {\n\t\t\t\ttext: '',\n\t\t\t\tmappings: [],\n\t\t\t\tcssRegions: [],\n\t\t\t\tscriptRegions: [],\n\t\t\t\terrors: [],\n\t\t\t\tfatalError: error,\n\t\t\t\tsourceAst: null,\n\t\t\t};\n\t\t}\n\n\t\tif (result.fatalError) {\n\t\t\tlogError('TSRX compilation failed for', this.fileName, ':', result.fatalError);\n\t\t\tif (process.env.TSRX_TSC === 'true') {\n\t\t\t\tlogTSRXErrors(this.fileName, [result.fatalError], newCode);\n\t\t\t}\n\t\t\tthis.fatalErrors.push(result.fatalError);\n\t\t\tfiles_with_fatal_compile_error.add(normalize_file_name_key(this.fileName));\n\t\t} else {\n\t\t\tlog('Compilation successful, generated code length:', result.text.length);\n\t\t\tfiles_with_fatal_compile_error.delete(normalize_file_name_key(this.fileName));\n\t\t}\n\n\t\tthis.originalCode = newCode;\n\n\t\tif (!result.fatalError && result.text) {\n\t\t\t// Successful compilation - update everything\n\t\t\tthis.generatedCode = hashbang_as_comment(result.text);\n\t\t\tthis.mappings = result.mappings;\n\t\t\tthis.usageErrors = result.errors;\n\t\t\tthis.sourceAst = result.sourceAst;\n\t\t\tthis.scriptRegions = result.scriptRegions;\n\n\t\t\tif (process.env.TSRX_TSC === 'true' && result.errors.length > 0) {\n\t\t\t\tlogTSRXErrors(this.fileName, result.errors, newCode);\n\t\t\t}\n\n\t\t\tif (result.cssRegions.length > 0) {\n\t\t\t\tlog('Creating', result.cssRegions.length, 'CSS embedded codes');\n\t\t\t}\n\t\t\t// `<script>` bodies are not embedded codes: the transform appends each one\n\t\t\t// to the generated TSX as a block (`embed_script_bodies`), so TypeScript\n\t\t\t// checks them in the same file on every path. Only CSS is embedded.\n\t\t\tthis.embeddedCodes = result.cssRegions.map((region) =>\n\t\t\t\tcreate_embedded_code_from_region(region, 'css'),\n\t\t\t);\n\n\t\t\tif (DEBUG) {\n\t\t\t\tlog('CSS embedded codes:', (this.embeddedCodes || []).length);\n\t\t\t\tlog('Using transpiled code, mapping count:', this.mappings.length);\n\t\t\t\tlog('Original code length:', newCode.length);\n\t\t\t\tlog('Generated code length:', this.generatedCode.length);\n\t\t\t\tlog('Last 100 chars of original:', JSON.stringify(newCode.slice(-100)));\n\t\t\t\tlog('Last 200 chars of generated:', JSON.stringify(this.generatedCode.slice(-200)));\n\t\t\t\tlog('Last few mappings:');\n\t\t\t\tconst startIdx = Math.max(0, this.mappings.length - 5);\n\t\t\t\tfor (let i = startIdx; i < this.mappings.length; i++) {\n\t\t\t\t\tconst m = this.mappings[i];\n\t\t\t\t\tlog(\n\t\t\t\t\t\t` Mapping ${i}: source[${m.sourceOffsets[0]}:${m.sourceOffsets[0] + m.lengths[0]}] -> gen[${m.generatedOffsets[0]}:${m.generatedOffsets[0] + m.lengths[0]}], len=${m.lengths[0]}, completion=${m.data?.completion}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// When compilation fails, show where it failed and disable all\n\t\t\t// TypeScript diagnostics until the compilation error is fixed\n\t\t\tlog('Compilation failed, only display where the compilation error occurred.');\n\n\t\t\t// Feed the raw source back as the generated code, with verification\n\t\t\t// enabled. This lets TS parse it and surface errors at the broken\n\t\t\t// construct itself — important when a TSRX compile error has no `pos`\n\t\t\t// (or an unreliable one), since the dedicated diagnostic plugin would\n\t\t\t// otherwise pin the error to offset 0 (top of file, off-screen) and the\n\t\t\t// user would have no signal pointing at the actual problem.\n\t\t\tthis.generatedCode = hashbang_as_comment(newCode);\n\n\t\t\t// Create 1:1 mappings for the entire content.\n\t\t\t//\n\t\t\t// Enable `completion` on this fallback mapping. Volar only invokes\n\t\t\t// completion providers at a cursor position when some mapping covering\n\t\t\t// it has the completion capability (isCompletionEnabled === !!data.completion).\n\t\t\t// Without it, a transient compile error (e.g. a half-typed `@if`) would\n\t\t\t// disable ALL completions in the file, so the user gets no suggestions to\n\t\t\t// help them finish the very construct that is broken. Keeping completion on\n\t\t\t// lets template-directive and TypeScript completions surface while editing.\n\t\t\tthis.mappings = [\n\t\t\t\t{\n\t\t\t\t\tsourceOffsets: [0],\n\t\t\t\t\tgeneratedOffsets: [0],\n\t\t\t\t\tlengths: [newCode.length],\n\t\t\t\t\tgeneratedLengths: [newCode.length],\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tcompletion: true,\n\t\t\t\t\t\tverification: true,\n\t\t\t\t\t\tcustomData: {},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\n\t\t\t// Extract CSS from <style> tags for embedded codes, so CSS intellisense\n\t\t\t// keeps working while the file has a transient compile error elsewhere.\n\t\t\tthis.embeddedCodes = extract_css_regions(newCode).map((region) =>\n\t\t\t\tcreate_embedded_code_from_region(region, 'css'),\n\t\t\t);\n\t\t}\n\n\t\tthis.snapshot = /** @type {IScriptSnapshot} */ ({\n\t\t\tgetText: (start, end) => this.generatedCode.substring(start, end),\n\t\t\tgetLength: () => this.generatedCode.length,\n\t\t\tgetChangeRange: () => undefined,\n\t\t});\n\t}\n\n\t#buildMappingCache() {\n\t\tif (this.#mappingGenToSource || this.#mappingSourceToGen) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#mappingGenToSource = new Map();\n\t\tthis.#mappingSourceToGen = new Map();\n\n\t\tvar mapping, genStart, genLength, genEnd, genKey;\n\t\tvar sourceStart, sourceLength, sourceEnd, sourceKey;\n\t\tfor (var i = 0; i < this.mappings.length; i++) {\n\t\t\tmapping = this.mappings[i];\n\n\t\t\tgenStart = mapping.generatedOffsets[0];\n\t\t\tgenLength = mapping.generatedLengths[0];\n\t\t\tgenEnd = genStart + genLength;\n\t\t\tgenKey = `${genStart}-${genEnd}`;\n\t\t\tthis.#mappingGenToSource.set(genKey, mapping);\n\n\t\t\tsourceStart = mapping.sourceOffsets[0];\n\t\t\tsourceLength = mapping.lengths[0];\n\t\t\tsourceEnd = sourceStart + sourceLength;\n\t\t\tsourceKey = `${sourceStart}-${sourceEnd}`;\n\t\t\tthis.#mappingSourceToGen.set(sourceKey, mapping);\n\t\t}\n\t}\n\n\t/**\n\t * Find mapping by generated range\n\t * @param {number} start - The start offset of the range\n\t * @param {number} end - The end offset of the range\n\t * @returns {CodeMapping | null} The mapping for this range, or null if not found\n\t */\n\tfindMappingByGeneratedRange(start, end) {\n\t\tthis.#buildMappingCache();\n\t\treturn /** @type {CachedMappings} */ (this.#mappingGenToSource).get(`${start}-${end}`) ?? null;\n\t}\n\n\t/**\n\t * Find mapping by source range\n\t * @param {number} start - The start offset of the range\n\t * @param {number} end - The end offset of the range\n\t * @returns {CodeMapping | null} The mapping for this range, or null if not found\n\t */\n\tfindMappingBySourceRange(start, end) {\n\t\tthis.#buildMappingCache();\n\t\treturn /** @type {CachedMappings} */ (this.#mappingSourceToGen).get(`${start}-${end}`) ?? null;\n\t}\n\n\t/**\n\t * Resolve a source range to a generated `[start, end]` offset pair by spanning\n\t * the token mappings that overlap it.\n\t *\n\t * Statement and element source ranges are only ever covered by several\n\t * granular token mappings (e.g. `const test = 5;` maps as `const `, `test`,\n\t * ` = `, `5`, `;`), and keywords/punctuation are frequently dropped entirely,\n\t * so an exact `findMappingBySourceRange` lookup never matches a multi-token\n\t * range and the endpoints often fall on unmapped tokens. Callers that have a\n\t * range with no exact mapping (such as compile-error diagnostics) use this to\n\t * land on the range: the generated start comes from the first overlapping\n\t * token and the generated end from the last, so an error pointing at a `const`\n\t * keyword still resolves via the `test`/`5` tokens that follow it.\n\t *\n\t * @param {number} start - Start of the source range\n\t * @param {number} end - Exclusive end of the source range\n\t * @returns {[number, number] | null} Generated `[start, end]`, or null if no\n\t * token overlaps the range\n\t */\n\tfindGeneratedRangeBySourceRange(start, end) {\n\t\t/** @type {CodeMapping | null} */\n\t\tlet first = null;\n\t\t/** @type {CodeMapping | null} */\n\t\tlet last = null;\n\t\tfor (let i = 0; i < this.mappings.length; i++) {\n\t\t\tconst mapping = this.mappings[i];\n\t\t\tconst sourceStart = mapping.sourceOffsets[0];\n\t\t\tconst sourceEnd = sourceStart + mapping.lengths[0];\n\t\t\t// Skip tokens that do not overlap the half-open range [start, end).\n\t\t\tif (sourceEnd <= start || sourceStart >= end) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!first || sourceStart < first.sourceOffsets[0]) {\n\t\t\t\tfirst = mapping;\n\t\t\t}\n\t\t\tif (!last || sourceEnd > last.sourceOffsets[0] + last.lengths[0]) {\n\t\t\t\tlast = mapping;\n\t\t\t}\n\t\t}\n\t\tif (!first || !last) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Offset into the first/last token, clamped so an endpoint that lands\n\t\t// before/after the token (an unmapped keyword or punctuation) snaps to the\n\t\t// token edge rather than escaping its generated span.\n\t\tconst generated_start =\n\t\t\tfirst.generatedOffsets[0] +\n\t\t\tclamp_offset(start - first.sourceOffsets[0], first.generatedLengths[0]);\n\t\tconst generated_end =\n\t\t\tlast.generatedOffsets[0] +\n\t\t\tclamp_offset(end - last.sourceOffsets[0], last.generatedLengths[0]);\n\t\treturn [generated_start, Math.max(generated_end, generated_start + 1)];\n\t}\n}\n\n/**\n * Volar puts the generated code after blank lines as long as the source in the\n * file TypeScript reads (in tsserver and `tsrx-tsc`), so a `#!` line there is no\n * longer at the start of the file and TypeScript reads it as code: two\n * expression statements without `;`. They count when TypeScript infers the\n * semicolon style of an edit, so an import added to a file whose own statements\n * have no `;` lost its `;`. A line comment of the same length keeps every offset.\n * @param {string} code\n * @returns {string}\n */\nfunction hashbang_as_comment(code) {\n\treturn code.startsWith('#!') ? `//${code.slice(2)}` : code;\n}\n\n/**\n * Clamp an intra-token offset into `[0, length]`.\n * @param {number} offset\n * @param {number} length\n * @returns {number}\n */\nfunction clamp_offset(offset, length) {\n\treturn Math.min(Math.max(offset, 0), length);\n}\n\n/**\n * @typedef {{\n * \tmessage?: unknown,\n * \tcode?: unknown,\n * \tseverity?: unknown,\n * \ttype?: unknown,\n * \tpos?: unknown,\n * \tloc?: { line?: unknown, column?: unknown, start?: { line?: unknown, column?: unknown } },\n * }} LoggedDiagnostic\n */\n\n/**\n * Mirrors compiler diagnostics to stderr under `tsrx-tsc`. The line follows\n * tsc's `file(line,col): error TS2339: message` convention — position when the\n * diagnostic has one, then severity and the diagnostic `code` — so output is\n * greppable by code and actionable by position. A thrown (fatal) error stops\n * the compile, so it prints as an error whatever its `severity`, as the\n * language server shows it.\n * @param {string} file_name\n * @param {ReadonlyArray<unknown>} errors\n * @param {string} source the compiled text, which a diagnostic's `pos` indexes\n */\nfunction logTSRXErrors(file_name, errors, source) {\n\tfor (const error of errors) {\n\t\tconst details =\n\t\t\terror && typeof error === 'object' ? /** @type {LoggedDiagnostic} */ (error) : undefined;\n\t\tconst message = details && 'message' in details ? String(details.message) : String(error);\n\t\tconst severity =\n\t\t\tdetails?.severity === 'warning' && details.type !== 'fatal' ? 'warning' : 'error';\n\t\tconst code =\n\t\t\ttypeof details?.code === 'string' && details.code.length > 0 ? details.code : undefined;\n\t\tconst label = code === undefined ? severity : `${severity} ${code}`;\n\t\tconst start = diagnostic_start(details, source);\n\t\tconst position = start ? `(${start.line},${start.column + 1})` : '';\n\t\tconst key = `${file_name}\\0${position}\\0${label}\\0${message}`;\n\t\tif (loggedCompilationFailures.has(key)) {\n\t\t\tcontinue;\n\t\t}\n\t\tloggedCompilationFailures.add(key);\n\t\tconsole.error(`[tsrx-tsc] ${file_name}${position}: ${label}: ${message}`);\n\t}\n}\n\nconst LINE_BREAK = /\\r\\n?|[\\n\\u2028\\u2029]/g;\n\n/**\n * Where a diagnostic starts, as a 1-based line and a 0-based column. A\n * collected error's `loc` is a range, and a parse error acorn throws gives its\n * position as `loc` itself (`{ line, column }`). A diagnostic without `loc`,\n * such as one a consumer compiler builds with only `pos` and `end`, is placed\n * by `pos` in `source`, breaking lines where tsc does.\n * @param {LoggedDiagnostic | undefined} details\n * @param {string} source\n * @returns {{ line: number, column: number } | undefined}\n */\nfunction diagnostic_start(details, source) {\n\tconst start = details?.loc?.start ?? details?.loc;\n\tif (typeof start?.line === 'number' && typeof start?.column === 'number') {\n\t\treturn { line: start.line, column: start.column };\n\t}\n\tconst pos = details?.pos;\n\tif (typeof pos !== 'number' || pos < 0 || pos > source.length) return undefined;\n\tlet line = 1;\n\tlet line_start = 0;\n\tfor (const match of source.slice(0, pos).matchAll(LINE_BREAK)) {\n\t\tline++;\n\t\tline_start = match.index + match[0].length;\n\t}\n\treturn { line, column: pos - line_start };\n}\n\n/**\n * Build an embedded virtual code from a `<style>` / `<script>` region produced\n * by the transform. The embedded document text is the region's content;\n * `languageId` selects which Volar service handles it (`css` or `typescript`).\n * @param {EmbeddedRegion} region\n * @param {string} languageId\n * @returns {VirtualCode}\n */\nfunction create_embedded_code_from_region(region, languageId) {\n\tconst content = region.content;\n\t/** @type {CodeMapping} */\n\tconst mapping = {\n\t\tsourceOffsets: [region.start],\n\t\tgeneratedOffsets: [0],\n\t\tlengths: [region.length],\n\t\tgeneratedLengths: [region.length],\n\t\tdata: {\n\t\t\tverification: true,\n\t\t\tcompletion: true,\n\t\t\tsemantic: true,\n\t\t\tnavigation: true,\n\t\t\tstructure: true,\n\t\t\tformat: false,\n\t\t\tcustomData: {\n\t\t\t\tcontent,\n\t\t\t\tembeddedId: region.id,\n\t\t\t},\n\t\t},\n\t};\n\treturn {\n\t\tid: region.id,\n\t\tlanguageId,\n\t\tsnapshot: {\n\t\t\tgetText: (/** @type {number} */ start, /** @type {number} */ end) =>\n\t\t\t\tcontent.substring(start, end),\n\t\t\tgetLength: () => region.length,\n\t\t\tgetChangeRange: () => undefined,\n\t\t},\n\t\tmappings: [mapping],\n\t\tembeddedCodes: [],\n\t};\n}\n\n/**\n * Insert a typed dot back into the transpiled code and update mappings so the\n * source and generated offsets stay aligned for completion requests.\n * @param {TsrxTransformResult} transpiled\n * @param {number} dotPosition\n * @returns {number | null}\n */\nfunction restore_typed_dot_in_transpiled_code(transpiled, dotPosition) {\n\tlet dot_mapping = null;\n\n\tfor (const mapping of transpiled.mappings) {\n\t\tconst source_end = mapping.sourceOffsets[0] + mapping.lengths[0];\n\t\tif (source_end === dotPosition) {\n\t\t\tdot_mapping = mapping;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!dot_mapping) {\n\t\treturn null;\n\t}\n\n\tconst generated_length = dot_mapping.generatedLengths[0];\n\tconst insertedDotPosition = dot_mapping.generatedOffsets[0] + generated_length;\n\n\ttranspiled.text =\n\t\ttranspiled.text.substring(0, insertedDotPosition) +\n\t\t'.' +\n\t\ttranspiled.text.substring(insertedDotPosition);\n\n\t// Create a separate 1:1 mapping for the dot character instead of extending\n\t// the existing mapping. When source and generated lengths differ (e.g.\n\t// #state → _$__u0023_state), Volar's translateOffset uses\n\t// Math.min(relativePos, toLength) which would map the cursor after the dot\n\t// to the middle of the generated identifier instead of after it.\n\n\t/** @type {CodeMapping} */\n\tconst new_dot_mapping = {\n\t\tsourceOffsets: [dotPosition],\n\t\tgeneratedOffsets: [insertedDotPosition],\n\t\tlengths: [1],\n\t\tgeneratedLengths: [1],\n\t\tdata: { ...dot_mapping.data },\n\t};\n\n\t// Find the index to insert after dot_mapping\n\tconst dot_mapping_index = transpiled.mappings.indexOf(dot_mapping);\n\ttranspiled.mappings.splice(dot_mapping_index + 1, 0, new_dot_mapping);\n\n\tfor (const mapping of transpiled.mappings) {\n\t\tif (\n\t\t\tmapping !== dot_mapping &&\n\t\t\tmapping !== new_dot_mapping &&\n\t\t\tmapping.generatedOffsets[0] >= insertedDotPosition\n\t\t) {\n\t\t\tmapping.generatedOffsets[0] += 1;\n\t\t}\n\t\tif (\n\t\t\tmapping !== dot_mapping &&\n\t\t\tmapping !== new_dot_mapping &&\n\t\t\tmapping.sourceOffsets[0] >= dotPosition\n\t\t) {\n\t\t\tmapping.sourceOffsets[0] += 1;\n\t\t}\n\t}\n\n\treturn insertedDotPosition;\n}\n\n/**\n * @template T\n * @param {{ options?: CompilerOptions } & T} config\n * @returns {{ options: CompilerOptions } & T}\n */\nexport const resolveConfig = (config) => {\n\tconst baseOptions = config.options ?? /** @type {CompilerOptions} */ ({});\n\t/** @type {CompilerOptions} */\n\tconst options = { ...baseOptions };\n\n\t// Only the classic path (a TypeScript language service host) asks for\n\t// resolved compiler options, so TypeScript is loaded here and not at import.\n\tconst ts = /** @type {typeof import('typescript')} */ (require('typescript'));\n\n\t// Default target: align with modern bundlers while staying configurable.\n\tif (options.target === undefined) {\n\t\toptions.target = ts.ScriptTarget.ESNext;\n\t}\n\n\t// Leave `lib` unchanged. When omitted, TypeScript selects the target's\n\t// default library through the active language-service host. `lib: []`\n\t// and `noLib` must retain their distinct TypeScript semantics.\n\n\t// Default typeRoots: automatically discover @types like tsserver.\n\tif (!options.types) {\n\t\tconst host = ts.createCompilerHost(options);\n\t\tconst typeRoots = ts.getEffectiveTypeRoots(options, host);\n\t\tif (typeRoots && typeRoots.length > 0) {\n\t\t\toptions.typeRoots = typeRoots;\n\t\t}\n\t}\n\n\treturn {\n\t\t...config,\n\t\toptions,\n\t};\n};\n\n/** @type {Map<string, string | null>} */\nexport const path2TsrxCompilerPathMap = new Map();\n/** @type {Map<string, { mtimeMs: number, size: number, content: string }>} */\nconst pathToTypesCache = new Map();\n/** @type {Map<string, { text: string, matches: Map<string, RegExpMatchArray> }>} */\nconst typeNameMatchCache = new Map();\n/** @type {Map<string, { name: string | null, dependencies: Set<string> } | null>} */\nconst pathToPackageManifestCache = new Map();\n\n/**\n * @param {ScriptId} fileNameOrUri\n * @returns {string}\n */\nexport function normalizeFileNameOrUri(fileNameOrUri) {\n\treturn typeof fileNameOrUri === 'string'\n\t\t? fileNameOrUri\n\t\t: fileNameOrUri.fsPath.replace(/\\\\/g, '/');\n}\n\n/**\n * @param {string} start_dir\n * @param {(file_path: import('fs').PathLike) => boolean} [exists_sync]\n * @returns {{ name: string | null, dependencies: Set<string> } | null}\n */\nfunction get_nearest_package_manifest(start_dir, exists_sync = fs.existsSync) {\n\tlet current_dir = start_dir;\n\t/** @type {string[]} */\n\tconst visited_dirs = [];\n\n\twhile (current_dir) {\n\t\tif (pathToPackageManifestCache.has(current_dir)) {\n\t\t\tconst cached_manifest = pathToPackageManifestCache.get(current_dir) ?? null;\n\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\tpathToPackageManifestCache.set(visited_dir, cached_manifest);\n\t\t\t}\n\t\t\treturn cached_manifest;\n\t\t}\n\n\t\tvisited_dirs.push(current_dir);\n\n\t\tconst package_json_path = path.join(current_dir, 'package.json');\n\t\tif (exists_sync(package_json_path)) {\n\t\t\ttry {\n\t\t\t\tconst package_json = JSON.parse(fs.readFileSync(package_json_path, 'utf8'));\n\t\t\t\tconst dependencies = new Set([\n\t\t\t\t\t...Object.keys(package_json.dependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.devDependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.peerDependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.optionalDependencies ?? {}),\n\t\t\t\t]);\n\t\t\t\tconst package_manifest = {\n\t\t\t\t\tname: typeof package_json.name === 'string' ? package_json.name : null,\n\t\t\t\t\tdependencies,\n\t\t\t\t};\n\n\t\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\t\tpathToPackageManifestCache.set(visited_dir, package_manifest);\n\t\t\t\t}\n\n\t\t\t\treturn package_manifest;\n\t\t\t} catch {\n\t\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\t\tpathToPackageManifestCache.set(visited_dir, null);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n\n\tfor (const visited_dir of visited_dirs) {\n\t\tpathToPackageManifestCache.set(visited_dir, null);\n\t}\n\n\treturn null;\n}\n\n/**\n * @param {{ name: string | null, dependencies: Set<string> } | null} package_manifest\n * @param {string} compiler_name\n * @param {string[]} package_hints\n * @returns {boolean}\n */\nfunction package_manifest_matches_compiler(package_manifest, compiler_name, package_hints) {\n\tif (!package_manifest) {\n\t\treturn false;\n\t}\n\n\tif (\n\t\tpackage_manifest.name === compiler_name ||\n\t\tpackage_hints.includes(package_manifest.name ?? '')\n\t) {\n\t\treturn true;\n\t}\n\n\tif (package_manifest.dependencies.has(compiler_name)) {\n\t\treturn true;\n\t}\n\n\tfor (const package_hint of package_hints) {\n\t\tif (package_manifest.dependencies.has(package_hint)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Resolve and load the TSRX compiler that owns a `.tsrx` file.\n * @param {string} normalized_file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {TSRXCompilerModule | undefined}\n */\nexport function get_tsrx_compiler(normalized_file_name, options) {\n\tconst compiler_path = get_compiler_entry_for_file(normalized_file_name, options);\n\tif (compiler_path) {\n\t\treturn require_tsrx_compiler(compiler_path);\n\t}\n}\n\n/**\n * Load a resolved compiler entry and normalize its contract.\n * @param {string} compiler_path\n * @returns {TSRXCompilerModule}\n */\nexport function require_tsrx_compiler(compiler_path) {\n\treturn normalize_tsrx_compiler_module(require(compiler_path));\n}\n\n/**\n * Normalize the compiler contract used by Octane and consumer-declared modules.\n * @param {TSRXCompilerModule & { compileToVolarMappings?: TSRXCompilerModule['compile_to_volar_mappings'] }} compiler_module\n * @returns {TSRXCompilerModule}\n */\nfunction normalize_tsrx_compiler_module(compiler_module) {\n\tif (\n\t\ttypeof compiler_module?.compile_to_volar_mappings !== 'function' &&\n\t\ttypeof compiler_module?.compileToVolarMappings === 'function'\n\t) {\n\t\treturn {\n\t\t\t...compiler_module,\n\t\t\tcompile_to_volar_mappings: compiler_module.compileToVolarMappings,\n\t\t};\n\t}\n\treturn compiler_module;\n}\n\n/**\n * @param {string} normalized_file_name\n * @param {(file_path: import('fs').PathLike) => boolean} [exists_sync]\n * @param {Map<string, string | null>} [compiler_path_map]\n * @returns {string | undefined}\n */\nexport function find_workspace_compiler_entry_for_file(\n\tnormalized_file_name,\n\texists_sync = fs.existsSync,\n\tcompiler_path_map = path2TsrxCompilerPathMap,\n) {\n\tconst parts = normalized_file_name.split('/');\n\tconst ext = path.extname(normalized_file_name);\n\n\tfor (let i = parts.length - 2; i >= 0; i--) {\n\t\tconst dir = parts.slice(0, i + 1).join('/');\n\t\tconst cache_key = dir + '\\0' + ext;\n\n\t\tif (!compiler_path_map.has(cache_key)) {\n\t\t\t/** @type {Array<[string, string, string[]]>} */\n\t\t\tconst available_candidates = [];\n\t\t\tfor (const [\n\t\t\t\tcompiler_name,\n\t\t\t\tcompiler_dir_parts,\n\t\t\t\tsupported_extensions,\n\t\t\t\tpackage_hints,\n\t\t\t\tentry_candidates = DEFAULT_COMPILER_ENTRY_CANDIDATES,\n\t\t\t] of COMPILER_CANDIDATES) {\n\t\t\t\tif (!supported_extensions.includes(ext)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tfor (const entry_parts of entry_candidates) {\n\t\t\t\t\tconst full_path = [dir, ...compiler_dir_parts, ...entry_parts].join('/');\n\t\t\t\t\tif (exists_sync(full_path)) {\n\t\t\t\t\t\tavailable_candidates.push([compiler_name, full_path, package_hints]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet found_path = null;\n\t\t\tif (available_candidates.length > 0) {\n\t\t\t\tconst package_manifest = get_nearest_package_manifest(dir, exists_sync);\n\t\t\t\tconst preferred_candidate = available_candidates.find(([compiler_name, , package_hints]) =>\n\t\t\t\t\tpackage_manifest_matches_compiler(package_manifest, compiler_name, package_hints),\n\t\t\t\t);\n\t\t\t\tfound_path = preferred_candidate?.[1] ?? available_candidates[0][1];\n\t\t\t\tlog('Found tsrx compiler at:', found_path, 'for extension:', ext);\n\t\t\t}\n\n\t\t\tcompiler_path_map.set(cache_key, found_path);\n\t\t}\n\n\t\tconst compiler_path = compiler_path_map.get(cache_key);\n\t\tif (compiler_path) {\n\t\t\treturn compiler_path;\n\t\t}\n\t}\n}\n\n/**\n * @param {string} normalized_file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {string | undefined}\n */\nexport function get_compiler_entry_for_file(normalized_file_name, options) {\n\tconst ext = path.extname(normalized_file_name);\n\tconst consumer_compiler_path = resolve_consumer_compiler_for_file(normalized_file_name, options);\n\tif (consumer_compiler_path !== undefined) {\n\t\treturn consumer_compiler_path ?? undefined;\n\t}\n\tconst package_manifest = get_nearest_package_manifest(path.dirname(normalized_file_name));\n\n\tconst workspace_compiler_path = find_workspace_compiler_entry_for_file(normalized_file_name);\n\tif (workspace_compiler_path) {\n\t\treturn workspace_compiler_path;\n\t}\n\n\tconst warn_message = `No supported tsrx compiler found in workspace for ${normalized_file_name}.`;\n\n\t// Fallback: look for a packaged compiler.\n\tlet current_dir = root_dirname;\n\n\twhile (current_dir) {\n\t\t/** @type {Array<[string, string, string[]]>} */\n\t\tconst available_candidates = [];\n\t\tfor (const [\n\t\t\tcompiler_name,\n\t\t\tcompiler_dir_parts,\n\t\t\tsupported_extensions,\n\t\t\tpackage_hints,\n\t\t\tentry_candidates = DEFAULT_COMPILER_ENTRY_CANDIDATES,\n\t\t] of COMPILER_CANDIDATES) {\n\t\t\tif (!supported_extensions.includes(ext)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst full_path = path.join(current_dir, ...compiler_dir_parts);\n\t\t\tfor (const entry_parts of entry_candidates) {\n\t\t\t\tconst entry_path = path.join(full_path, ...entry_parts);\n\t\t\t\tif (fs.existsSync(entry_path)) {\n\t\t\t\t\tavailable_candidates.push([compiler_name, entry_path, package_hints]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (available_candidates.length > 0) {\n\t\t\tconst preferred_candidate = available_candidates.find(([compiler_name, , package_hints]) =>\n\t\t\t\tpackage_manifest_matches_compiler(package_manifest, compiler_name, package_hints),\n\t\t\t);\n\t\t\tconst entry_path = preferred_candidate?.[1] ?? available_candidates[0][1];\n\t\t\tlogWarning(`${warn_message} Using packaged version at ${entry_path}`);\n\t\t\treturn entry_path;\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Resolve the tsrx compiler package that owns a `.tsrx` file (e.g. `'@tsrx/ripple'`,\n * `'@tsrx/react'`) from the exact compiler entry selected for compilation. All\n * targets share the `.tsrx` extension, so this is how the editor layer tells them\n * apart. Returns `undefined` for an unresolved or unknown third-party compiler.\n * @param {string} file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {string | undefined}\n */\nexport function get_tsrx_compiler_name_for_file(file_name, options) {\n\tconst entry = get_compiler_entry_for_file(file_name.replace(/\\\\/g, '/'), options);\n\tif (!entry) {\n\t\treturn undefined;\n\t}\n\n\tconst package_name = get_nearest_package_manifest(path.dirname(entry))?.name;\n\tif (COMPILER_CANDIDATES.some(([compiler_name]) => compiler_name === package_name)) {\n\t\treturn package_name ?? undefined;\n\t}\n\n\t// Compatibility fallback for unpackaged compiler fixtures and historical\n\t// source layouts that do not include a readable package manifest.\n\tconst normalized_entry = entry.replace(/\\\\/g, '/');\n\tfor (const [\n\t\tcompiler_name,\n\t\tcompiler_dir_parts,\n\t\t,\n\t\t,\n\t\tentry_candidates = DEFAULT_COMPILER_ENTRY_CANDIDATES,\n\t] of COMPILER_CANDIDATES) {\n\t\tfor (const entry_parts of entry_candidates) {\n\t\t\tconst suffix = '/' + [...compiler_dir_parts, ...entry_parts].join('/');\n\t\t\tif (normalized_entry.endsWith(suffix)) {\n\t\t\t\treturn compiler_name;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Whether a `.tsrx` file is compiled by the Ripple target (as opposed to\n * React/Solid/Preact/Vue). Used to gate Ripple-runtime-only editor suggestions.\n * @param {string} file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {boolean}\n */\nexport function is_ripple_target_file(file_name, options) {\n\treturn get_tsrx_compiler_name_for_file(file_name, options) === '@tsrx/ripple';\n}\n\n/**\n * Create a stable key for filesystem caches. Windows paths are case-insensitive\n * to TypeScript, while file URIs conventionally lowercase their drive letter.\n * @param {string} file_name\n */\nfunction getPathCacheKey(file_name) {\n\tconst is_windows_path =\n\t\tprocess.platform === 'win32' || /^[a-z]:[\\\\/]/i.test(file_name) || file_name.startsWith('\\\\\\\\');\n\tconst path_api = is_windows_path ? path.win32 : path;\n\tconst normalized = path_api.normalize(file_name);\n\treturn is_windows_path ? normalized.toLowerCase() : normalized;\n}\n\n/**\n * @param {string} typesFilePath\n * @returns {string | undefined}\n */\nexport function getCachedTypeDefinitionFile(typesFilePath) {\n\tconst cache_key = getPathCacheKey(typesFilePath);\n\n\tlet stat;\n\ttry {\n\t\tstat = fs.statSync(typesFilePath);\n\t} catch {\n\t\tlogWarning(`Types file does not exist at path: ${typesFilePath}`);\n\t\treturn;\n\t}\n\n\tconst cached = pathToTypesCache.get(cache_key);\n\tif (cached && cached.mtimeMs === stat.mtimeMs && cached.size === stat.size) {\n\t\treturn cached.content;\n\t}\n\n\tlog(`Found TSRX types at: ${typesFilePath}`);\n\n\t// Read the file to find the class definition offset\n\tconst fileContent = fs.readFileSync(typesFilePath, 'utf8');\n\n\tif (!fileContent) {\n\t\tlogWarning(`Failed to read content of types file at: ${typesFilePath}`);\n\t\treturn;\n\t}\n\n\tpathToTypesCache.set(cache_key, {\n\t\tmtimeMs: stat.mtimeMs,\n\t\tsize: stat.size,\n\t\tcontent: fileContent,\n\t});\n\treturn fileContent;\n}\n\n/**\n * @param {string} typeName\n * @param {string} text\n * @param {string} [sourceKey]\n * @returns {RegExpMatchArray | undefined}\n */\nexport function getCachedTypeMatches(typeName, text, sourceKey = text) {\n\tconst cache_key = sourceKey === text ? text : getPathCacheKey(sourceKey);\n\tlet source_cache = typeNameMatchCache.get(cache_key);\n\tif (!source_cache || source_cache.text !== text) {\n\t\tsource_cache = {\n\t\t\ttext,\n\t\t\tmatches: new Map(),\n\t\t};\n\t\ttypeNameMatchCache.set(cache_key, source_cache);\n\t}\n\n\tconst cached = source_cache.matches.get(typeName);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst searchPattern = new RegExp(\n\t\t`(?:export\\\\s+(?:declare\\\\s+)?|declare\\\\s+)(class|function)\\\\s+${typeName}`,\n\t);\n\n\tconst match = text.match(searchPattern);\n\n\tif (match && match.index !== undefined) {\n\t\tsource_cache.matches.set(typeName, match);\n\t\treturn match;\n\t}\n\n\treturn;\n}\n\n/**\n * @param {string} normalized_file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {string | undefined}\n */\nexport function get_compiler_dir_for_file(normalized_file_name, options) {\n\tconst entry = get_compiler_entry_for_file(normalized_file_name, options);\n\tif (!entry) {\n\t\treturn undefined;\n\t}\n\n\tlet current_dir = path.dirname(entry);\n\twhile (current_dir) {\n\t\tif (fs.existsSync(path.join(current_dir, 'package.json'))) {\n\t\t\treturn current_dir;\n\t\t}\n\t\tif (path.basename(current_dir) === 'node_modules') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\treturn undefined;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n}\n\nexport { get_compiler_dir_for_file as getTsrxCompilerDirForFile };\n\n/**\n * Drop compiler-selection state. Loaded ESM compiler graphs cannot be evicted\n * safely in-process; language-server package watchers restart the process.\n */\nexport function invalidateCompilerResolutionCaches() {\n\tpath2TsrxCompilerPathMap.clear();\n\tpathToPackageManifestCache.clear();\n\treset_consumer_compiler_resolution_caches();\n\tloggedCompilationFailures.clear();\n}\n\n/**\n * Drop cached definition-file content and matches. A path invalidates only one\n * file; omitting it clears all definition state.\n * @param {string} [typesFilePath]\n */\nexport function invalidateTypeDefinitionCaches(typesFilePath) {\n\tif (typesFilePath) {\n\t\tconst cache_key = getPathCacheKey(typesFilePath);\n\t\tpathToTypesCache.delete(cache_key);\n\t\ttypeNameMatchCache.delete(cache_key);\n\t\treturn;\n\t}\n\n\tpathToTypesCache.clear();\n\ttypeNameMatchCache.clear();\n}\n\n/** Reset all module-level state used in tests. */\nexport function _reset_for_test() {\n\tinvalidateCompilerResolutionCaches();\n\tinvalidateTypeDefinitionCaches();\n}\n","// This file must not import anything, and nothing in it may run when it loads.\n// `@tsrx/core/diagnostics` exports it on its own so that tools can bundle or\n// load the error tables without the rest of the compiler. An import here would\n// pull that module, and everything it imports, into each of them, and code that\n// runs on load would keep every table in a bundle that reads one. So the tables\n// are literals and calls to functions marked `/* @__NO_SIDE_EFFECTS__ */`, with\n// no property reads, and the lookup of upstream messages is built on first use.\n// `tests/utils/error-codes.test.js` checks both.\n\n/**\n * TSRX's own error codes, one per mistake only TSRX reports. The TSRX\n * specification lists each with its message and an example (its appendix,\n * \"Error codes\"). A mistake TypeScript also reports has TypeScript's code\n * instead (`TS1005`), from {@link TS_ERRORS}.\n *\n * - `TSRX1xxx`: markup syntax only TSRX has\n * - `TSRX2xxx`: template rules\n * - `TSRX3xxx`: `<style>` and CSS\n * - `TSRX4xxx`: everything else\n */\nexport const DIAGNOSTIC_CODES = {\n\t/** An element has no closing tag before the end of its template. */\n\tUNCLOSED_TAG: 'TSRX1001',\n\t/** A closing tag doesn't match the element it closes. */\n\tMISMATCHED_CLOSING_TAG: 'TSRX1002',\n\t/** A closing tag with no element open. */\n\tUNEXPECTED_CLOSING_TAG: 'TSRX1003',\n\t/** A `</script` in a `<script>` body that isn't its closing tag, where HTML would end the script. */\n\tSCRIPT_END_TAG_IN_BODY: 'TSRX1004',\n\t/** A namespaced element name (`<foo:bar>`). */\n\tNAMESPACED_ELEMENT: 'TSRX1005',\n\t/** A spread as an attribute's value (`a={...b}`). */\n\tATTRIBUTE_VALUE_SPREAD: 'TSRX1006',\n\t/** A `;` at the end of an expression container (`{a;}`). */\n\tTEMPLATE_EXPRESSION_TRAILING_SEMICOLON: 'TSRX1007',\n\t/** A directive without its `{ … }` body. */\n\tDIRECTIVE_BODY_EXPECTED: 'TSRX1008',\n\t/** A directive's next branch written without its `@` (`else`, `empty`, `pending`, `catch`). */\n\tDIRECTIVE_BRANCH_EXPECTED: 'TSRX1009',\n\t/** An `@try` with neither `@catch` nor `@pending`. */\n\tTRY_HANDLER_MISSING: 'TSRX1010',\n\t/** An `@for`'s `index` or `key` clause is incomplete or out of order. */\n\tFOR_CLAUSE: 'TSRX1011',\n\n\t/** A `return` in a template. */\n\tTEMPLATE_RETURN_STATEMENT: 'TSRX2001',\n\t/** A `return` in an `@if` body. */\n\tIF_RETURN_STATEMENT: 'TSRX2002',\n\t/** A `break` in an `@if` body. */\n\tIF_BREAK_STATEMENT: 'TSRX2003',\n\t/** A `continue` in an `@if` body. */\n\tIF_CONTINUE_STATEMENT: 'TSRX2004',\n\t/** A `return` in an `@for` body. */\n\tFOR_RETURN_STATEMENT: 'TSRX2005',\n\t/** A `break` in an `@for` body. */\n\tFOR_BREAK_STATEMENT: 'TSRX2006',\n\t/** A `continue` in an `@for` body. */\n\tFOR_CONTINUE_STATEMENT: 'TSRX2007',\n\t/** A `break` in an `@case` body. */\n\tSWITCH_CASE_BREAK_STATEMENT: 'TSRX2008',\n\t/** A `return` in an `@case` body. */\n\tSWITCH_CASE_RETURN_STATEMENT: 'TSRX2009',\n\t/** Template output nothing renders: not returned, assigned, or part of the output. */\n\tFORGOTTEN_STATEMENT_CONTAINER: 'TSRX2010',\n\t/** A `@{ … }` body with more than one output node. */\n\tCODE_BLOCK_SINGLE_OUTPUT: 'TSRX2011',\n\t/** A statement after a `@{ … }` body's output. */\n\tCODE_BLOCK_STATEMENT_AFTER_OUTPUT: 'TSRX2012',\n\t/** A JSX spread child (`{...items}`), which parses but no target supports. */\n\tJSX_SPREAD_CHILD: 'TSRX2013',\n\t/** A dynamic tag expression (`<{expr}>`) other than an identifier, a member access, or a string literal. */\n\tDYNAMIC_TAG_EXPRESSION: 'TSRX2014',\n\t/** An `@for` over something other than `for…of`. */\n\tFOR_OF_ONLY: 'TSRX2015',\n\t/** An element with more than one `ref` attribute. */\n\tMULTIPLE_REFS: 'TSRX2016',\n\t/** An element nested where HTML doesn't allow it (`<p>` in `<p>`). */\n\tINVALID_HTML_NESTING: 'TSRX2017',\n\t/** A JavaScript `try…finally` in a template. */\n\tTEMPLATE_TRY_FINALLY: 'TSRX2018',\n\t/** A `try` in a template with neither a `pending` nor a `catch` block. */\n\tTEMPLATE_TRY_HANDLER: 'TSRX2019',\n\t/** An `@pending` block on a target without it. */\n\tTARGET_PENDING_UNSUPPORTED: 'TSRX2020',\n\t/** An `await` where the target can't await (in a callback, or in its components). */\n\tTARGET_AWAIT_UNSUPPORTED: 'TSRX2021',\n\t/** A `yield` in a part of the template that runs in a callback. */\n\tTARGET_YIELD_UNSUPPORTED: 'TSRX2022',\n\t/** A `super` in a part of the template that's lowered into a generator function. */\n\tTARGET_SUPER_UNSUPPORTED: 'TSRX2023',\n\t/** A `for await…of` in a template on a target without it. */\n\tTARGET_FOR_AWAIT_UNSUPPORTED: 'TSRX2024',\n\t/** A top-level `await` in a TSRX function without a module-level `\"use server\"`. */\n\tTOP_LEVEL_AWAIT_USE_SERVER: 'TSRX2025',\n\t/** An `@catch` reset parameter on a target whose error boundary has none. */\n\tTARGET_CATCH_RESET_UNSUPPORTED: 'TSRX2026',\n\t/** An `@for` head that assigns to existing variables, or declares its loop variable with `var` or `using`. */\n\tFOR_HEAD: 'TSRX2027',\n\t/** A component read above its declaration on a target that compiles it to a constant, where moving the declaration up would change what it reads. */\n\tTARGET_COMPONENT_READ_BEFORE_DECLARATION: 'TSRX2028',\n\t/** A destructured prop default the target's component compiler drops. */\n\tTARGET_PROP_DEFAULT_UNSUPPORTED: 'TSRX2029',\n\t/** A `var` declared in a nested `@{ … }` block or an `@if`, `@for`, `@switch` or `@try` body, outside any function or class in it. */\n\tDIRECTIVE_BODY_VAR: 'TSRX2030',\n\t/** A destructured prop key the target's component compiler reads as another prop, or leaves out. */\n\tTARGET_PROP_KEY_UNSUPPORTED: 'TSRX2031',\n\t/** A binding of a name the target's toolchain finds by name: Vue's `defineVaporComponent`. */\n\tTARGET_RESERVED_NAME: 'TSRX2032',\n\t/** Type arguments after a dynamic tag (`<{Tag}<T> />`). */\n\tDYNAMIC_TAG_TYPE_ARGUMENTS: 'TSRX2033',\n\t/** A `yield` in a template value the target's JSX compiler moves into an effect, getter or callback. */\n\tTARGET_TEMPLATE_YIELD_UNSUPPORTED: 'TSRX2034',\n\t/**\n\t * A warning: a `@{ … }` with no output whose only statement is an\n\t * expression there only for its value, such as `<p>@{user.name}</p>`, so\n\t * it renders nothing.\n\t */\n\tCODE_BLOCK_EXPRESSION_ONLY: 'TSRX2035',\n\n\t/** `<style apply>` carries no expression value. */\n\tSTYLE_APPLY_VALUE: 'TSRX3001',\n\t/** An `apply` entry is not an identifier, member, or array of those, or does not resolve to a style block. */\n\tSTYLE_APPLY_TARGET: 'TSRX3002',\n\t/** An `apply` target is declared after the applying block in source order. */\n\tSTYLE_APPLY_BEFORE_DECLARATION: 'TSRX3003',\n\t/** Two `apply` attributes on one `<style>` block. */\n\tSTYLE_APPLY_DUPLICATE: 'TSRX3004',\n\t/** `apply` on a `<head>` style or a resource (`href`) style. */\n\tSTYLE_APPLY_UNSUPPORTED_HOST: 'TSRX3005',\n\t/** An assigned style block authors a `.$class` class selector. */\n\tSTYLE_RESERVED_CLASS_KEY: 'TSRX3006',\n\t/** A standalone `<style>` block at module scope. */\n\tSTYLE_STANDALONE_AT_MODULE_SCOPE: 'TSRX3007',\n\t/** A standalone `<style>` block with CSS text outside any `@{ … }` or control-flow body. */\n\tSTYLE_STANDALONE_OUTSIDE_TEMPLATE: 'TSRX3008',\n\t/** A standalone `<style>` block in a statement slot: the lone output of a `@{ … }` or control-flow body, or a statement. */\n\tSTYLE_STANDALONE_NEEDS_FRAGMENT: 'TSRX3009',\n\t/** A `<style>` attribute other than `ref` and `apply`. */\n\tSTYLE_UNKNOWN_ATTRIBUTE: 'TSRX3010',\n\t/** `:global` used where the scoping rules do not allow it. */\n\tCSS_GLOBAL_PLACEMENT: 'TSRX3011',\n\t/** An `@import` rule in a `<style>` block, whose rules would not be scoped. */\n\tCSS_IMPORT: 'TSRX3012',\n\t/** CSS in a `<style>` block that doesn't parse. */\n\tCSS_SYNTAX: 'TSRX3013',\n\t/** A `<style>` block in a child expression container (`{<style>…</style>}`), which renders its class map. */\n\tSTYLE_IN_EXPRESSION_CONTAINER: 'TSRX3014',\n\n\t/** A recognized `import.meta.env.platform.*` flag is used without a selected platform. */\n\tPLATFORM_REQUIRED: 'TSRX4001',\n\t/** A name that starts with the prefix the compiler reserves for its own identifiers. */\n\tRESERVED_IDENTIFIER_PREFIX: 'TSRX4002',\n\t/** JavaScript syntax the parser rejects that TypeScript accepts (an escaped `import.meta`). */\n\tJAVASCRIPT_SYNTAX: 'TSRX4003',\n};\n\n/**\n * The source TSRX's errors are reported under, in capitals like TypeScript's\n * own `TS2322`: `@tsrx/content-mapper` declares it to TypeScript 7, which shows\n * its errors as `TSRX2002`, and the TSRX language server reports its compile\n * errors with it.\n */\nexport const DIAGNOSTIC_SOURCE = 'TSRX';\n\n/**\n * The TypeScript codes in this module that TypeScript reports as syntax errors,\n * from its scanner or parser (`getSyntacticDiagnostics`). It reports every\n * other TypeScript code here from its binder or checker, as a grammar or\n * semantic error, with its other checker errors, and none of them for a file\n * with a syntax error (see `#isSyntaxError` in `plugin.js`). A test derives\n * this from where TypeScript raises each code.\n * @type {string[]}\n */\nexport const TS_SYNTAX_ERROR_CODES = [\n\t'TS1002',\n\t'TS1003',\n\t'TS1005',\n\t'TS1010',\n\t'TS1012',\n\t'TS1109',\n\t'TS1124',\n\t'TS1125',\n\t'TS1127',\n\t'TS1128',\n\t'TS1134',\n\t'TS1136',\n\t'TS1145',\n\t'TS1146',\n\t'TS1160',\n\t'TS1161',\n\t'TS1177',\n\t'TS1178',\n\t'TS1198',\n\t'TS1209',\n\t'TS1260',\n\t'TS1351',\n\t'TS1359',\n\t'TS1381',\n\t'TS1434',\n\t'TS1435',\n\t'TS1438',\n\t'TS1440',\n\t'TS1472',\n\t'TS1477',\n\t'TS1478',\n\t'TS1487',\n\t'TS1488',\n\t'TS17002',\n\t'TS2657',\n\t'TS6188',\n\t'TS6189',\n];\n\n/**\n * TypeScript 7's content-mapper protocol takes a number as an error's code, and\n * shows every error `@tsrx/content-mapper` reports as {@link DIAGNOSTIC_SOURCE}\n * then that number. Each kind of code gets its own numbers:\n *\n * - a TSRX code, its number: `TSRX2002` → `2002`\n * - a TypeScript code, `TYPESCRIPT_CODE_PREFIX` then its number: `TS1005` → `111005`\n * - the mapper's own errors, `MAPPER_CODE_PREFIX` then theirs ({@link MAPPER_CODES})\n */\nexport const TYPESCRIPT_CODE_PREFIX = '11';\n/** See {@link TYPESCRIPT_CODE_PREFIX}. */\nexport const MAPPER_CODE_PREFIX = '77';\n\n/** @param {number} number */\n/* @__NO_SIDE_EFFECTS__ */\nfunction mapper_code(number) {\n\treturn Number(`${MAPPER_CODE_PREFIX}${number}`);\n}\n\n/** The errors `@tsrx/content-mapper` reports itself. */\nexport const MAPPER_CODES = {\n\t/** A file that doesn't compile, with an error that has no code. */\n\tCOMPILE_ERROR: mapper_code(1000),\n\t/** An error without a TSRX or TypeScript code. */\n\tUSAGE_ERROR: mapper_code(1001),\n\t/** No TSRX compiler found for a file. */\n\tNO_COMPILER: mapper_code(1002),\n\t/** The project's TSRX configuration is invalid. */\n\tINVALID_CONFIG: mapper_code(1003),\n};\n\n/**\n * An error TSRX reports: its code, TSRX's own or TypeScript's for a mistake\n * TypeScript also reports, and its message.\n * @typedef {{ code: string, message: string }} Diagnostic\n */\n\n/**\n * An error whose message takes values, such as a name from the source. Called\n * with them, it gives the {@link Diagnostic}; its `code` is the code of every\n * message it gives.\n * @typedef {((...values: string[]) => Diagnostic) & { code: string }} DiagnosticWithValues\n */\n\n/**\n * @param {string} code\n * @param {(...values: string[]) => string} message\n * @returns {DiagnosticWithValues}\n */\n/* @__NO_SIDE_EFFECTS__ */\nfunction with_values(code, message) {\n\treturn Object.assign(\n\t\t(/** @type {string[]} */ ...values) => ({ code, message: message(...values) }),\n\t\t{\n\t\t\tcode,\n\t\t},\n\t);\n}\n\n/**\n * The code of `key` in {@link DIAGNOSTIC_CODES}. It is read here, not where an\n * entry is written: a property read when the module loads would keep every\n * table in a bundle. The typecheck rejects a key that isn't there; so does\n * this, when the module loads.\n * @param {keyof typeof DIAGNOSTIC_CODES} key\n * @returns {string}\n */\nfunction tsrx_code(key) {\n\tif (!(key in DIAGNOSTIC_CODES)) {\n\t\tthrow new Error(`DIAGNOSTIC_CODES has no ${key}`);\n\t}\n\treturn DIAGNOSTIC_CODES[key];\n}\n\n/**\n * A TSRX error with the code of `key` in {@link DIAGNOSTIC_CODES}.\n * @param {keyof typeof DIAGNOSTIC_CODES} key\n * @param {string} message\n * @returns {Diagnostic}\n */\n/* @__NO_SIDE_EFFECTS__ */\nfunction tsrx(key, message) {\n\treturn { code: tsrx_code(key), message };\n}\n\n/**\n * {@link with_values} for a TSRX error, with the code of `key` in\n * {@link DIAGNOSTIC_CODES}.\n * @param {keyof typeof DIAGNOSTIC_CODES} key\n * @param {(...values: string[]) => string} message\n * @returns {DiagnosticWithValues}\n */\n/* @__NO_SIDE_EFFECTS__ */\nfunction tsrx_with_values(key, message) {\n\treturn with_values(tsrx_code(key), message);\n}\n\n/**\n * The advice that ends Vue's destructured-props errors: read the prop where it\n * is used, so it stays reactive, as `example` does when there is one.\n * @param {string} example\n * @returns {string}\n */\nfunction read_prop_where_used(example) {\n\treturn `Take the props as a \\`props\\` parameter and read the prop where you use it instead${example ? `, for example \\`${example}\\`` : ''}, or derive it in a \\`computed\\`.`;\n}\n\n/**\n * The errors only TSRX reports, each with its code from\n * {@link DIAGNOSTIC_CODES}, named by its key.\n * A code can have several messages, one for each form of the mistake.\n */\nexport const TSRX_ERRORS = {\n\t// TSRX1xxx\n\tUNCLOSED_TAG: tsrx_with_values(\n\t\t'UNCLOSED_TAG',\n\t\t(tag) => `Unclosed tag '<${tag}>'. Expected '</${tag}>' before end of template.`,\n\t),\n\t/**\n\t * An unclosed tag that is a lone type parameter before a `(`, as in\n\t * `<T>(x) => x`. `parameter` is the type parameter, with its `const`.\n\t */\n\tUNCLOSED_TAG_GENERIC_ARROW: tsrx_with_values(\n\t\t'UNCLOSED_TAG',\n\t\t(tag, parameter) =>\n\t\t\t`Unclosed tag '<${tag}>'. Expected '</${tag}>' before end of template. To write a generic arrow function, add a trailing comma, as in \\`<${parameter},>() => ...\\`.`,\n\t),\n\tMISMATCHED_CLOSING_TAG: tsrx_with_values(\n\t\t'MISMATCHED_CLOSING_TAG',\n\t\t(opening, closing) =>\n\t\t\t`Expected closing tag to match opening tag. Expected '</${opening}>' but found '</${closing}>'`,\n\t),\n\tUNEXPECTED_CLOSING_TAG: tsrx('UNEXPECTED_CLOSING_TAG', 'Unexpected closing tag'),\n\t/** `written` is the `</script` as written, in any case. */\n\tSCRIPT_END_TAG_IN_BODY: tsrx_with_values(\n\t\t'SCRIPT_END_TAG_IN_BODY',\n\t\t(written) =>\n\t\t\t`'${written}' can end a script in HTML, so a '<script>' body can't contain it. Write '<\\\\/${written.slice(2)}' instead.`,\n\t),\n\tNAMESPACED_ELEMENT: tsrx_with_values(\n\t\t'NAMESPACED_ELEMENT',\n\t\t(tag) => `Namespaced elements are not supported in TSRX templates: <${tag}>.`,\n\t),\n\tATTRIBUTE_VALUE_SPREAD: tsrx(\n\t\t'ATTRIBUTE_VALUE_SPREAD',\n\t\t'Attribute values cannot be spread. Use a spread attribute (`{...props}`) instead.',\n\t),\n\tTEMPLATE_EXPRESSION_TRAILING_SEMICOLON: tsrx(\n\t\t'TEMPLATE_EXPRESSION_TRAILING_SEMICOLON',\n\t\t'TSRX expression containers do not use semicolons. Remove this semicolon.',\n\t),\n\tDIRECTIVE_BODY_EXPECTED: tsrx(\n\t\t'DIRECTIVE_BODY_EXPECTED',\n\t\t'Expected `{` after JSX control-flow directive.',\n\t),\n\t/** `branch` is the branch written without its `@`, and `directive` the directive it belongs to. */\n\tDIRECTIVE_BRANCH_EXPECTED: tsrx_with_values(\n\t\t'DIRECTIVE_BRANCH_EXPECTED',\n\t\t(branch, directive) => `Expected \\`@${branch}\\` after \\`@${directive}\\` block.`,\n\t),\n\tTRY_HANDLER_MISSING: tsrx(\n\t\t'TRY_HANDLER_MISSING',\n\t\t'Missing `@catch` or `@pending` after `@try` block.',\n\t),\n\tFOR_INDEX_NAME_EXPECTED: tsrx('FOR_CLAUSE', 'Expected identifier after \"index\" keyword'),\n\tFOR_INDEX_AFTER_KEY: tsrx('FOR_CLAUSE', '\"index\" must come before \"key\" in for-of loop'),\n\n\t// TSRX2xxx\n\tTEMPLATE_RETURN_STATEMENT: tsrx(\n\t\t'TEMPLATE_RETURN_STATEMENT',\n\t\t'Return statements are not allowed inside TSRX templates. Move the return before the TSRX return value, or use conditional rendering instead.',\n\t),\n\tIF_RETURN_STATEMENT: tsrx(\n\t\t'IF_RETURN_STATEMENT',\n\t\t'Return statements are not allowed inside TSRX template @if blocks. Move the return before the template output or render conditionally instead.',\n\t),\n\tIF_BREAK_STATEMENT: tsrx(\n\t\t'IF_BREAK_STATEMENT',\n\t\t'Break statements are not allowed inside TSRX template @if blocks.',\n\t),\n\tIF_CONTINUE_STATEMENT: tsrx(\n\t\t'IF_CONTINUE_STATEMENT',\n\t\t'Continue statements are not allowed inside TSRX template @if blocks. Filter before rendering or use conditional output instead.',\n\t),\n\tFOR_RETURN_STATEMENT: tsrx(\n\t\t'FOR_RETURN_STATEMENT',\n\t\t'Return statements are not allowed inside TSRX template for...of loops. Filter the iterable before rendering or use an @empty fallback for empty lists.',\n\t),\n\tFOR_BREAK_STATEMENT: tsrx(\n\t\t'FOR_BREAK_STATEMENT',\n\t\t'Break statements are not allowed inside TSRX template for...of loops.',\n\t),\n\tFOR_CONTINUE_STATEMENT: tsrx(\n\t\t'FOR_CONTINUE_STATEMENT',\n\t\t'Continue statements are not allowed inside TSRX template for...of loops. Filter the iterable before rendering.',\n\t),\n\tSWITCH_CASE_BREAK_STATEMENT: tsrx(\n\t\t'SWITCH_CASE_BREAK_STATEMENT',\n\t\t'`break` is invalid inside `@switch` cases.',\n\t),\n\tSWITCH_CASE_RETURN_STATEMENT: tsrx(\n\t\t'SWITCH_CASE_RETURN_STATEMENT',\n\t\t'`return` is invalid inside `@switch` cases.',\n\t),\n\tFORGOTTEN_STATEMENT_CONTAINER: tsrx(\n\t\t'FORGOTTEN_STATEMENT_CONTAINER',\n\t\t\"This TSRX template output is unused. Return it, assign it to a value that is rendered, or make it part of the rendered output of a function '@{...}' body.\",\n\t),\n\tCODE_BLOCK_SINGLE_OUTPUT: tsrx(\n\t\t'CODE_BLOCK_SINGLE_OUTPUT',\n\t\t\"A code block renders a single node; wrap multiple nodes or text in a fragment '<>…</>'.\",\n\t),\n\tCODE_BLOCK_STATEMENT_AFTER_OUTPUT: tsrx(\n\t\t'CODE_BLOCK_STATEMENT_AFTER_OUTPUT',\n\t\t\"Code must be at the top of '@{ }'; statements cannot follow the rendered output.\",\n\t),\n\tJSX_SPREAD_CHILD: tsrx(\n\t\t'JSX_SPREAD_CHILD',\n\t\t'JSX spread children (`{...items}`) are not supported. Render the array as an expression child instead: `{items}`.',\n\t),\n\tDYNAMIC_TAG_EXPRESSION: tsrx(\n\t\t'DYNAMIC_TAG_EXPRESSION',\n\t\t'A dynamic tag expression must be an identifier, a member access such as `props.as` or `registry[name]`, or a string literal. Compute anything else before the element: `const Tag = c ? Child : Fallback;`, then `<{Tag} />`.',\n\t),\n\tDYNAMIC_TAG_TYPE_ARGUMENTS: tsrx(\n\t\t'DYNAMIC_TAG_TYPE_ARGUMENTS',\n\t\t'A dynamic tag takes no type arguments. Declare a typed alias before the element: `const Typed = Tag<T>;`, then `<{Typed} />`.',\n\t),\n\tFOR_OF_ONLY: tsrx(\n\t\t'FOR_OF_ONLY',\n\t\t'TSRX `@for` currently supports `for...of` loops in template output.',\n\t),\n\tFOR_STATEMENT: tsrx(\n\t\t'FOR_OF_ONLY',\n\t\t'For loops are not supported in TSRX templates. Use for...of instead.',\n\t),\n\tFOR_IN_STATEMENT: tsrx(\n\t\t'FOR_OF_ONLY',\n\t\t'For...in loops are not supported in TSRX templates. Use for...of instead.',\n\t),\n\tWHILE_STATEMENT: tsrx(\n\t\t'FOR_OF_ONLY',\n\t\t'While loops are not supported in TSRX templates. Move the while loop into a function.',\n\t),\n\tDO_WHILE_STATEMENT: tsrx(\n\t\t'FOR_OF_ONLY',\n\t\t'Do...while loops are not supported in TSRX templates. Move the do...while loop into a function.',\n\t),\n\tFOR_HEAD_ASSIGNMENT: tsrx(\n\t\t'FOR_HEAD',\n\t\t'TSRX `@for` must declare its loop variable, as in `@for (const item of items)`, not assign to an existing variable or property.',\n\t),\n\tFOR_HEAD_VAR: tsrx(\n\t\t'FOR_HEAD',\n\t\t\"TSRX `@for` does not support `var` loop variables, since its loop variable can't be read after the loop. Declare it with `const` or `let`, as in `@for (const item of items)`.\",\n\t),\n\t/** `kind` is `using` or `await using`. */\n\tFOR_HEAD_USING: tsrx_with_values(\n\t\t'FOR_HEAD',\n\t\t(kind) =>\n\t\t\t`TSRX \\`@for\\` does not support \\`${kind}\\` loop variables. Declare the resource in the loop body instead: \\`@for (const item of items) { ${kind} resource = item; ... }\\`.`,\n\t),\n\tDIRECTIVE_BODY_VAR: tsrx(\n\t\t'DIRECTIVE_BODY_VAR',\n\t\t\"TSRX does not support `var` declarations in a nested `@{ … }` block or an `@if`, `@for`, `@switch` or `@try` body, since the variable can't be read outside it. Declare it with `const` or `let`.\",\n\t),\n\tMULTIPLE_REFS: tsrx(\n\t\t'MULTIPLE_REFS',\n\t\t'Element has multiple `ref={...}` attributes; an element may have at most one. Use a single ref list such as `ref={[a, b]}`, which applies every ref in it.',\n\t),\n\tINVALID_HTML_NESTING: tsrx_with_values(\n\t\t'INVALID_HTML_NESTING',\n\t\t(tag, parent) => `Invalid HTML nesting: <${tag}> cannot be a descendant of <${parent}>.`,\n\t),\n\t/** `target` is the target's name. */\n\tTEMPLATE_TRY_FINALLY: tsrx_with_values(\n\t\t'TEMPLATE_TRY_FINALLY',\n\t\t(target) =>\n\t\t\t`${target} TSRX does not support JavaScript \\`try/finally\\` in TSRX templates. \\`finally\\` is not part of TSRX control flow; move the try/finally into a function if you need cleanup logic.`,\n\t),\n\tTEMPLATE_TRY_HANDLER: tsrx(\n\t\t'TEMPLATE_TRY_HANDLER',\n\t\t'TSRX try statements must have a `pending` or `catch` block.',\n\t),\n\t/** `target` is the target's name. */\n\tTARGET_AWAIT_UNSUPPORTED: tsrx_with_values(\n\t\t'TARGET_AWAIT_UNSUPPORTED',\n\t\t(target) =>\n\t\t\t`${target} TSRX does not support \\`await\\` here: this part of the template renders through a callback the target calls, so its result cannot be awaited. Await the value in the component body, or move it into an async child component.`,\n\t),\n\t/** `target` is the target's name. For a target whose components can't be async. */\n\tTARGET_COMPONENT_AWAIT_UNSUPPORTED: tsrx_with_values(\n\t\t'TARGET_AWAIT_UNSUPPORTED',\n\t\t(target) => `${target} TSRX components do not support \\`await\\`.`,\n\t),\n\tHONO_DOM_COMPONENT_AWAIT_UNSUPPORTED: tsrx(\n\t\t'TARGET_AWAIT_UNSUPPORTED',\n\t\t'Hono JSX DOM does not support top-level `await` in components. Use `use(promise)` with `<Suspense>` instead.',\n\t),\n\t/** For an `async` component that a Hono DOM module renders. */\n\tHONO_DOM_ASYNC_COMPONENT_UNSUPPORTED: tsrx(\n\t\t'TARGET_AWAIT_UNSUPPORTED',\n\t\t'Hono JSX DOM does not support async components. Use `use(promise)` with `<Suspense>` instead.',\n\t),\n\t/** `target` is the target's name. */\n\tTARGET_YIELD_UNSUPPORTED: tsrx_with_values(\n\t\t'TARGET_YIELD_UNSUPPORTED',\n\t\t(target) =>\n\t\t\t`${target} TSRX does not support \\`yield\\` here: this part of the template runs in a callback, which cannot yield from the enclosing generator. Yield the value in the function body first.`,\n\t),\n\t/** `target` is the target's name. For Solid and Vue, whose JSX compilers move some template values into effects. */\n\tTARGET_TEMPLATE_YIELD_UNSUPPORTED: tsrx_with_values(\n\t\t'TARGET_TEMPLATE_YIELD_UNSUPPORTED',\n\t\t(target) =>\n\t\t\t`${target} TSRX does not support \\`yield\\` in this part of the template: ${target}'s JSX compiler evaluates it in an effect, a getter or a callback, which cannot yield from the enclosing generator. Yield the value before the template, as in \\`const value = yield …;\\`, and use \\`value\\` in it.`,\n\t),\n\t/** `target` is the target's name. */\n\tTARGET_SUPER_UNSUPPORTED: tsrx_with_values(\n\t\t'TARGET_SUPER_UNSUPPORTED',\n\t\t(target) =>\n\t\t\t`${target} TSRX does not support \\`super\\` here: this part of the template also yields, so it is lowered into a generator function, where \\`super\\` is unavailable. Read the value into a variable in the method body first.`,\n\t),\n\t/** `target` is the target's name. */\n\tTARGET_FOR_AWAIT_UNSUPPORTED: tsrx_with_values(\n\t\t'TARGET_FOR_AWAIT_UNSUPPORTED',\n\t\t(target) => `${target} TSRX does not support \\`for await...of\\` in TSRX templates.`,\n\t),\n\tTOP_LEVEL_AWAIT_USE_SERVER: tsrx(\n\t\t'TOP_LEVEL_AWAIT_USE_SERVER',\n\t\t'Top-level `await` in TSRX functions requires a module-level `\"use server\"` directive.',\n\t),\n\t/** Hono's ErrorBoundary calls its fallback with the error only. */\n\tTARGET_CATCH_RESET_UNSUPPORTED: tsrx(\n\t\t'TARGET_CATCH_RESET_UNSUPPORTED',\n\t\t'Hono JSX ErrorBoundary does not provide a reset callback. Use `@catch (error)` without a reset parameter.',\n\t),\n\t/** `target` is the target's name, and `name` the component's. */\n\tTARGET_COMPONENT_READ_BEFORE_DECLARATION: tsrx_with_values(\n\t\t'TARGET_COMPONENT_READ_BEFORE_DECLARATION',\n\t\t(target, name) =>\n\t\t\t`'${name}' is read here before its declaration. ${target} TSRX compiles the component to a constant, which is not hoisted like a function, and moving its declaration above this read would change what its prop defaults read. Move the declaration of '${name}' above this read.`,\n\t),\n\t/**\n\t * `target` is the target's name, `name` the prop's, and `example`, which can\n\t * be empty, an expression that reads the prop where it is used. Only Vue's\n\t * vue-jsx-vapor drops defaults.\n\t */\n\tTARGET_PROP_DEFAULT_UNSUPPORTED: tsrx_with_values(\n\t\t'TARGET_PROP_DEFAULT_UNSUPPORTED',\n\t\t(target, name, example) =>\n\t\t\t`${target} TSRX cannot keep this default for '${name}': vue-jsx-vapor turns destructured prop defaults into prop options and drops any default that is not a literal, an identifier, an object or array literal, or a function, so '${name}' would be undefined. ${read_prop_where_used(example)}`,\n\t),\n\t/**\n\t * `target` is the target's name, `path` the value's path in the props (such\n\t * as `s.a`), and `example`, which can be empty, an expression that reads the\n\t * value where it is used.\n\t */\n\tTARGET_PROP_NESTED_DEFAULT_UNSUPPORTED: tsrx_with_values(\n\t\t'TARGET_PROP_DEFAULT_UNSUPPORTED',\n\t\t(target, path, example) =>\n\t\t\t`${target} TSRX cannot keep this default for '${path}': vue-jsx-vapor applies a default inside a destructured prop only when the whole prop is missing, so it is lost whenever the prop is passed without this value. ${read_prop_where_used(example)}`,\n\t),\n\t/**\n\t * `target` is the target's name, and `fallback` the parameter's default as\n\t * written. Only Vue's vue-jsx-vapor skips a props parameter with a default.\n\t */\n\tTARGET_PROPS_PARAM_DEFAULT: tsrx_with_values(\n\t\t'TARGET_PROP_KEY_UNSUPPORTED',\n\t\t(target, fallback) =>\n\t\t\t`${target} TSRX cannot read a props parameter with a default: vue-jsx-vapor skips it, so this component gets no props. Remove \\`= ${fallback}\\`; Vue always passes a props object.`,\n\t),\n\t/**\n\t * `target` is the target's name, and `path` the path in the props of the\n\t * value the rest element destructures (such as `t`).\n\t */\n\tTARGET_PROP_NESTED_REST: tsrx_with_values(\n\t\t'TARGET_PROP_KEY_UNSUPPORTED',\n\t\t(target, path) =>\n\t\t\t`${target} TSRX cannot read this rest element inside '${path}': vue-jsx-vapor doesn't keep it as the rest of '${path}'. It gives the last rest element in the props pattern the component's attrs, an array's rest element the whole array, and any other the rest of '${path}' only as it was at setup. ${read_prop_where_used('')}`,\n\t),\n\t/**\n\t * `target` is the target's name, `name` the computed key, and `example`,\n\t * which can be empty, an expression that reads the prop where it is used.\n\t * Only Vue's vue-jsx-vapor reads a destructured prop by its key's name.\n\t */\n\tTARGET_PROP_KEY_COMPUTED: tsrx_with_values(\n\t\t'TARGET_PROP_KEY_UNSUPPORTED',\n\t\t(target, name, example) =>\n\t\t\t`${target} TSRX cannot read this computed prop key: vue-jsx-vapor reads \\`[${name}]\\` as the prop '${name}', whatever '${name}' holds. ${read_prop_where_used(example)}`,\n\t),\n\t/**\n\t * `target` is the target's name, `key` the key as written, and `example`,\n\t * which can be empty, an expression that reads the prop where it is used.\n\t */\n\tTARGET_PROP_KEY_UNSUPPORTED: tsrx_with_values(\n\t\t'TARGET_PROP_KEY_UNSUPPORTED',\n\t\t(target, key, example) =>\n\t\t\t`${target} TSRX cannot read the prop at \\`${key}\\`: vue-jsx-vapor reads a destructured prop only by a key that is a name, so this binding never gets the prop. ${read_prop_where_used(example)}`,\n\t),\n\tDEFINE_VAPOR_COMPONENT_BINDING: tsrx(\n\t\t'TARGET_RESERVED_NAME',\n\t\t\"Vue TSRX does not allow a binding named `defineVaporComponent`. vue-jsx-vapor finds components by calls to that exact name, and the compiler wraps each component in the one from 'vue-jsx-vapor', so the name can't be declared again or shadowed. Rename this binding.\",\n\t),\n\t// A warning. This one is for a child of an element or fragment, where the\n\t// `@` may have been meant as text.\n\tCODE_BLOCK_EXPRESSION_CHILD: tsrx(\n\t\t'CODE_BLOCK_EXPRESSION_ONLY',\n\t\t\"This @{…} is a code block, not '@' text and an expression: it runs the expression as a statement and renders nothing. To render '@' and the value, write {`@${value}`} or {'@' + value}; for the value alone, write {value}.\",\n\t),\n\t// A warning. This one is for anywhere else: a function body, a value, or\n\t// the output of another `@{ … }` or a directive body.\n\tCODE_BLOCK_EXPRESSION_ONLY: tsrx(\n\t\t'CODE_BLOCK_EXPRESSION_ONLY',\n\t\t'This @{…} code block holds only an expression statement, so it renders nothing. To render the value, end the block with output, such as @{ <>{value}</> }.',\n\t),\n\n\t// TSRX3xxx\n\tSTYLE_APPLY_VALUE: tsrx(\n\t\t'STYLE_APPLY_VALUE',\n\t\t\"The 'apply' attribute of a <style> block requires an expression value: apply={theme} or apply={[a, b]}.\",\n\t),\n\tSTYLE_APPLY_TARGET: tsrx_with_values(\n\t\t'STYLE_APPLY_TARGET',\n\t\t(name) =>\n\t\t\t`'${name}' is not a style block. An 'apply' target must be a variable, import, or member holding an assigned <style> block.`,\n\t),\n\tSTYLE_APPLY_BEFORE_DECLARATION: tsrx_with_values(\n\t\t'STYLE_APPLY_BEFORE_DECLARATION',\n\t\t(name) =>\n\t\t\t`'${name}' is applied before its declaration. Declare the style block before the block that applies it.`,\n\t),\n\tSTYLE_APPLY_DUPLICATE: tsrx(\n\t\t'STYLE_APPLY_DUPLICATE',\n\t\t\"A <style> block accepts a single 'apply' attribute; pass several themes as an array: apply={[a, b]}.\",\n\t),\n\tSTYLE_APPLY_UNSUPPORTED_HOST: tsrx(\n\t\t'STYLE_APPLY_UNSUPPORTED_HOST',\n\t\t\"The 'apply' attribute is only supported on scoped <style> blocks, not on <head> styles or resource styles.\",\n\t),\n\tSTYLE_RESERVED_CLASS_KEY: tsrx(\n\t\t'STYLE_RESERVED_CLASS_KEY',\n\t\t\"'$class' is reserved on assigned <style> blocks for the block's scope hash; rename the '.$class' selector.\",\n\t),\n\tSTYLE_STANDALONE_AT_MODULE_SCOPE: tsrx(\n\t\t'STYLE_STANDALONE_AT_MODULE_SCOPE',\n\t\t'A standalone <style> block is only allowed inside a template scope. At module scope assign it: const theme = <style>…</style>.',\n\t),\n\tSTYLE_STANDALONE_OUTSIDE_TEMPLATE: tsrx(\n\t\t'STYLE_STANDALONE_OUTSIDE_TEMPLATE',\n\t\t'A standalone <style> block with CSS text is TSRX template syntax and needs an enclosing @{ … } body or an @if/@for/@switch/@try body. In plain TSX give <style> an expression child instead: <style>{css}</style>. To declare a reusable block here, assign it: const theme = <style>…</style>.',\n\t),\n\tSTYLE_STANDALONE_NEEDS_FRAGMENT: tsrx(\n\t\t'STYLE_STANDALONE_NEEDS_FRAGMENT',\n\t\t'A standalone <style> block must be a child of an element or a fragment. Wrap it with the output it styles in a fragment: <><style>…</style><div>…</div></>.',\n\t),\n\tSTYLE_UNKNOWN_ATTRIBUTE: tsrx_with_values(\n\t\t'STYLE_UNKNOWN_ATTRIBUTE',\n\t\t(name) => `Unknown <style> attribute '${name}'. Scoped style blocks accept 'ref' and 'apply'.`,\n\t),\n\tCSS_GLOBAL_IN_PSEUDOCLASS: tsrx(\n\t\t'CSS_GLOBAL_PLACEMENT',\n\t\t'A :global selector cannot be inside a pseudoclass.',\n\t),\n\tCSS_GLOBAL_IN_MIDDLE: tsrx(\n\t\t'CSS_GLOBAL_PLACEMENT',\n\t\t':global(...) can be at the start or end of a selector sequence, but not in the middle.',\n\t),\n\tCSS_IMPORT: tsrx(\n\t\t'CSS_IMPORT',\n\t\t\"@import is not supported in <style> blocks: the imported rules would not be scoped. Share scoped styles with an assigned block (const theme = <style>…</style>) and apply={theme}. For global CSS, use :global in the block, or import the stylesheet in JavaScript: import './global.css'.\",\n\t),\n\tSTYLE_IN_EXPRESSION_CONTAINER: tsrx(\n\t\t'STYLE_IN_EXPRESSION_CONTAINER',\n\t\t'A <style> block inside an expression container, such as {<style>…</style>}, evaluates to its class map, so as a child it styles nothing. Remove the braces to write a standalone block in the element or fragment it styles: <><style>…</style><div>…</div></>. To reuse the block, assign it: const theme = <style>…</style>.',\n\t),\n\n\t// TSRX4xxx\n\tPLATFORM_REQUIRED: tsrx(\n\t\t'PLATFORM_REQUIRED',\n\t\t'Platform flag usage requires a configured TSRX platform. Set `tsrx.platform` in tsconfig.json and pass the same `platform` to the build integration (\"web\", \"ios\", or \"android\").',\n\t),\n\tRESERVED_IDENTIFIER_PREFIX: tsrx_with_values(\n\t\t'RESERVED_IDENTIFIER_PREFIX',\n\t\t(name, prefix) =>\n\t\t\t`Cannot declare a variable named \"${name}\" as identifiers starting with \"${prefix}\" are reserved`,\n\t),\n\t// acorn-typescript's wording, for `with { type: 'json', type: 'json' }`: an\n\t// ECMAScript early error that TypeScript doesn't report.\n\tDUPLICATED_ATTRIBUTE_KEY: tsrx('JAVASCRIPT_SYNTAX', 'Duplicated key in attributes'),\n\t// A deferred import without bindings (`import defer \"./a.js\"`). The proposal\n\t// allows only a namespace import, but TypeScript reads it as an ordinary\n\t// import without an error and leaves out `defer` (microsoft/TypeScript#64627).\n\tIMPORT_DEFER_NAMESPACE: tsrx(\n\t\t'JAVASCRIPT_SYNTAX',\n\t\t'`import defer` only supports a namespace import from a string literal.',\n\t),\n};\n\n/**\n * The errors TSRX reports for mistakes TypeScript also reports, each with\n * TypeScript's code for the same mistake. Most have TypeScript's wording too;\n * the ones in acorn's or acorn-typescript's wording are the upstream errors\n * TSRX raises itself where it reads the code in their place. A test checks the\n * wording of each against TypeScript's.\n */\nexport const TS_ERRORS = {\n\t// Tokens and names\n\t/** `token` is the token expected, such as `}`. */\n\tTOKEN_EXPECTED: with_values('TS1005', (token) => `'${token}' expected.`),\n\tIDENTIFIER_EXPECTED: { code: 'TS1003', message: 'Identifier expected.' },\n\tRESERVED_WORD_AS_IDENTIFIER: with_values(\n\t\t'TS1359',\n\t\t(word) => `Identifier expected. '${word}' is a reserved word that cannot be used here.`,\n\t),\n\tIDENTIFIER_OR_STRING_EXPECTED: {\n\t\tcode: 'TS1478',\n\t\tmessage: 'Identifier or string literal expected.',\n\t},\n\t// A word reserved only in strict mode (`let`, `static`, `yield`, …) used as a\n\t// name, which TypeScript's parser reads and its binder reports: TSRX's input\n\t// is a module, and inside a class TypeScript says so instead\n\t/** `word` is the word. */\n\tSTRICT_MODE_RESERVED_WORD: with_values(\n\t\t'TS1214',\n\t\t(word) =>\n\t\t\t`Identifier expected. '${word}' is a reserved word in strict mode. Modules are automatically in strict mode.`,\n\t),\n\t/** `word` is the word. */\n\tSTRICT_MODE_RESERVED_WORD_IN_CLASS: with_values(\n\t\t'TS1213',\n\t\t(word) =>\n\t\t\t`Identifier expected. '${word}' is a reserved word in strict mode. Class definitions are automatically in strict mode.`,\n\t),\n\tLET_DECLARATION_NAME: {\n\t\tcode: 'TS2480',\n\t\tmessage: \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\",\n\t},\n\tDECLARATION_EXPECTED: { code: 'TS1146', message: 'Declaration expected.' },\n\t// A name followed by another token where a statement ends (`a b;`), which\n\t// TypeScript's parser takes for a misspelled keyword when it can\n\tUNEXPECTED_KEYWORD_OR_IDENTIFIER: {\n\t\tcode: 'TS1434',\n\t\tmessage: 'Unexpected keyword or identifier.',\n\t},\n\t/** `suggestion` is the keyword, or the keyword and the rest of the name. */\n\tUNKNOWN_KEYWORD_OR_IDENTIFIER: with_values(\n\t\t'TS1435',\n\t\t(suggestion) => `Unknown keyword or identifier. Did you mean '${suggestion}'?`,\n\t),\n\t/** `kind` is `let`, `const`, `using` or `await using`. */\n\tBLOCK_SCOPED_DECLARATION_OUTSIDE_BLOCK: with_values(\n\t\t'TS1156',\n\t\t(kind) => `'${kind}' declarations can only be declared inside a block.`,\n\t),\n\t// A label before a `let`, `const` or `using` declaration. TypeScript's\n\t// message starts with a stray quote.\n\tLABEL_NOT_ALLOWED: { code: 'TS1344', message: \"'A label is not allowed here.\" },\n\tVARIABLE_DECLARATION_NOT_ALLOWED: {\n\t\tcode: 'TS1440',\n\t\tmessage: 'Variable declaration not allowed at this location.',\n\t},\n\tEXPRESSION_EXPECTED: { code: 'TS1109', message: 'Expression expected.' },\n\tOPTIONAL_CHAIN_TAGGED_TEMPLATE: {\n\t\tcode: 'TS1358',\n\t\tmessage: 'Tagged template expressions are not permitted in an optional chain.',\n\t},\n\tDECLARATION_OR_STATEMENT_EXPECTED: {\n\t\tcode: 'TS1128',\n\t\tmessage: 'Declaration or statement expected.',\n\t},\n\tLINE_BREAK_NOT_PERMITTED: { code: 'TS1142', message: 'Line break not permitted here.' },\n\tKEYWORD_ESCAPE: { code: 'TS1260', message: 'Keywords cannot contain escape characters.' },\n\t// A private name outside any class (see `parsePrivateIdent` in `plugin.js`)\n\tPRIVATE_IDENTIFIER_OUTSIDE_CLASS: {\n\t\tcode: 'TS18016',\n\t\tmessage: 'Private identifiers are not allowed outside class bodies.',\n\t},\n\n\t// The modifiers of a declaration, as TypeScript's checker words them\n\t// (`checkGrammarModifiers`)\n\tMODIFIER_ALREADY_SEEN: with_values(\n\t\t'TS1030',\n\t\t(modifier) => `'${modifier}' modifier already seen.`,\n\t),\n\tMODIFIER_MUST_PRECEDE: with_values(\n\t\t'TS1029',\n\t\t(modifier, other) => `'${modifier}' modifier must precede '${other}' modifier.`,\n\t),\n\tMODIFIER_CANNOT_BE_USED_WITH: with_values(\n\t\t'TS1243',\n\t\t(modifier, other) => `'${modifier}' modifier cannot be used with '${other}' modifier.`,\n\t),\n\tMODIFIER_IN_AMBIENT_CONTEXT: with_values(\n\t\t'TS1040',\n\t\t(modifier) => `'${modifier}' modifier cannot be used in an ambient context.`,\n\t),\n\tMODIFIER_CANNOT_BE_USED_HERE: with_values(\n\t\t'TS1042',\n\t\t(modifier) => `'${modifier}' modifier cannot be used here.`,\n\t),\n\tMODIFIER_ON_MODULE_ELEMENT: with_values(\n\t\t'TS1044',\n\t\t(modifier) => `'${modifier}' modifier cannot appear on a module or namespace element.`,\n\t),\n\tMODIFIER_ON_USING: with_values(\n\t\t'TS1491',\n\t\t(modifier) => `'${modifier}' modifier cannot appear on a 'using' declaration.`,\n\t),\n\tMODIFIER_ON_AWAIT_USING: with_values(\n\t\t'TS1495',\n\t\t(modifier) => `'${modifier}' modifier cannot appear on an 'await using' declaration.`,\n\t),\n\tMODIFIERS_CANNOT_APPEAR_HERE: { code: 'TS1184', message: 'Modifiers cannot appear here.' },\n\tMODIFIER_ON_CONSTRUCTOR: with_values(\n\t\t'TS1089',\n\t\t(modifier) => `'${modifier}' modifier cannot appear on a constructor declaration.`,\n\t),\n\tACCESSIBILITY_MODIFIER_ALREADY_SEEN: {\n\t\tcode: 'TS1028',\n\t\tmessage: 'Accessibility modifier already seen.',\n\t},\n\tREADONLY_MODIFIER_NOT_ALLOWED: {\n\t\tcode: 'TS1024',\n\t\tmessage: \"'readonly' modifier can only appear on a property declaration or index signature.\",\n\t},\n\tACCESSOR_MODIFIER_NOT_ALLOWED: {\n\t\tcode: 'TS1275',\n\t\tmessage: \"'accessor' modifier can only appear on a property declaration.\",\n\t},\n\tABSTRACT_MODIFIER_NOT_ALLOWED: {\n\t\tcode: 'TS1242',\n\t\tmessage: \"'abstract' modifier can only appear on a class, method, or property declaration.\",\n\t},\n\tDECLARE_MODIFIER_IN_AMBIENT_CONTEXT: {\n\t\tcode: 'TS1038',\n\t\tmessage: \"A 'declare' modifier cannot be used in an already ambient context.\",\n\t},\n\t/** Decorators on a class `static` block. */\n\tDECORATORS_NOT_VALID_HERE: { code: 'TS1206', message: 'Decorators are not valid here.' },\n\tMODIFIER_ON_IMPORT: with_values(\n\t\t'TS1079',\n\t\t(modifier) => `A '${modifier}' modifier cannot be used with an import declaration.`,\n\t),\n\tEXPORT_MODIFIER_ON_AUGMENTATION: {\n\t\tcode: 'TS2668',\n\t\tmessage:\n\t\t\t\"'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible.\",\n\t},\n\tREADONLY_TYPE_MODIFIER: {\n\t\tcode: 'TS1354',\n\t\tmessage: \"'readonly' type modifier is only permitted on array and tuple literal types.\",\n\t},\n\n\t// An import or export inside a block, which acorn reports as `'import' and\n\t// 'export' may only appear at the top level`, as TypeScript words it for each\n\t// kind of import or export\n\tNESTED_IMPORT: {\n\t\tcode: 'TS1232',\n\t\tmessage: 'An import declaration can only be used at the top level of a namespace or module.',\n\t},\n\tNESTED_EXPORT: {\n\t\tcode: 'TS1233',\n\t\tmessage: 'An export declaration can only be used at the top level of a namespace or module.',\n\t},\n\tNESTED_EXPORT_ASSIGNMENT: {\n\t\tcode: 'TS1231',\n\t\tmessage: 'An export assignment must be at the top level of a file or module declaration.',\n\t},\n\tNESTED_DEFAULT_EXPORT: {\n\t\tcode: 'TS1258',\n\t\tmessage: 'A default export must be at the top level of a file or module declaration.',\n\t},\n\tNESTED_NAMESPACE: {\n\t\tcode: 'TS1235',\n\t\tmessage: 'A namespace declaration is only allowed at the top level of a namespace or module.',\n\t},\n\tNESTED_GLOBAL_EXPORT: {\n\t\tcode: 'TS1316',\n\t\tmessage: 'Global module exports may only appear at top level.',\n\t},\n\n\t// `await` outside an async function, where only a namespace makes it parse\n\tAWAIT_EXPRESSION_NOT_ALLOWED: {\n\t\tcode: 'TS1308',\n\t\tmessage:\n\t\t\t\"'await' expressions are only allowed within async functions and at the top levels of modules.\",\n\t},\n\tFOR_AWAIT_NOT_ALLOWED: {\n\t\tcode: 'TS1103',\n\t\tmessage:\n\t\t\t\"'for await' loops are only allowed within async functions and at the top levels of modules.\",\n\t},\n\tAWAIT_USING_NOT_ALLOWED: {\n\t\tcode: 'TS2852',\n\t\tmessage:\n\t\t\t\"'await using' statements are only allowed within async functions and at the top levels of modules.\",\n\t},\n\t// TypeScript reports these from the checker (`checkGrammarImportClause`)\n\tIMPORT_DEFER_DEFAULT: {\n\t\tcode: 'TS18058',\n\t\tmessage: 'Default imports are not allowed in a deferred import.',\n\t},\n\tIMPORT_DEFER_NAMED: {\n\t\tcode: 'TS18059',\n\t\tmessage: 'Named imports are not allowed in a deferred import.',\n\t},\n\t// TypeScript 7.1 reports these two from the checker (`checkGrammarImportClause`)\n\tIMPORT_SOURCE_BINDING: {\n\t\tcode: 'TS18111',\n\t\tmessage: 'A source phase import must specify a local binding.',\n\t},\n\tIMPORT_SOURCE_NAMED: {\n\t\tcode: 'TS18112',\n\t\tmessage: 'Named and namespace imports are not allowed in a source phase import.',\n\t},\n\t// A call of `import.<name>`, which TypeScript reports from the checker\n\t// (`checkGrammarMetaProperty`). Without a call, it's TS17012\n\t// (`UPSTREAM_ERRORS.IMPORT_META_PROPERTY`).\n\t/** `name` is the name after `import.`. */\n\tIMPORT_META_PROPERTY_CALL: with_values(\n\t\t'TS18061',\n\t\t(name) =>\n\t\t\t`'${name}' is not a valid meta-property for keyword 'import'. Did you mean 'meta' or 'defer'?`,\n\t),\n\t// A module specifier that isn't a string, or a phase import from an inline\n\t// module (`import source m from server`)\n\tSTRING_LITERAL_EXPECTED: {\n\t\tcode: 'TS1141',\n\t\tmessage: 'String literal expected.',\n\t},\n\n\t// Declarations\n\tVARIABLE_DECLARATION_EXPECTED: { code: 'TS1134', message: 'Variable declaration expected.' },\n\tVARIABLE_DECLARATION_LIST_EMPTY: {\n\t\tcode: 'TS1123',\n\t\tmessage: 'Variable declaration list cannot be empty.',\n\t},\n\t/** `kind` is `const`, `using`, or `await using`. */\n\tDECLARATION_NOT_INITIALIZED: with_values(\n\t\t'TS1155',\n\t\t(kind) => `'${kind}' declarations must be initialized.`,\n\t),\n\tFOR_IN_USING: {\n\t\tcode: 'TS1493',\n\t\tmessage: \"The left-hand side of a 'for...in' statement cannot be a 'using' declaration.\",\n\t},\n\tFOR_IN_AWAIT_USING: {\n\t\tcode: 'TS1494',\n\t\tmessage: \"The left-hand side of a 'for...in' statement cannot be an 'await using' declaration.\",\n\t},\n\t// A `let`, `const` or `using` declaration's name declared again in the same\n\t// scope (see `declareName` in `plugin.js`)\n\tBLOCK_SCOPED_VARIABLE_REDECLARED: with_values(\n\t\t'TS2451',\n\t\t(name) => `Cannot redeclare block-scoped variable '${name}'.`,\n\t),\n\t// A `var` in a block below one that declares its name with `let`, `const`, or\n\t// `using` (see `declareName` in `plugin.js`). TypeScript gives the name for\n\t// both values.\n\tOUTER_SCOPED_VARIABLE_INITIALIZED: with_values(\n\t\t'TS2481',\n\t\t(name, declaration) =>\n\t\t\t`Cannot initialize outer scoped variable '${name}' in the same scope as block scoped declaration '${declaration}'.`,\n\t),\n\t// A `let`, `const`, or `using` declaration of a `catch` clause's parameter in\n\t// its block\n\tCATCH_PARAMETER_REDECLARED: with_values(\n\t\t'TS2492',\n\t\t(name) => `Cannot redeclare identifier '${name}' in catch clause.`,\n\t),\n\t// An enum and another declaration of its name but an enum or a namespace\n\tENUM_REDECLARED: {\n\t\tcode: 'TS2567',\n\t\tmessage: 'Enum declarations can only merge with namespace or other enum declarations.',\n\t},\n\t/** `name` is the name, or a string name in its quotes. */\n\tDUPLICATE_IDENTIFIER: with_values('TS2300', (name) => `Duplicate identifier '${name}'.`),\n\t// A second default export that TypeScript's binder can't merge with the first\n\tMULTIPLE_DEFAULT_EXPORTS: {\n\t\tcode: 'TS2528',\n\t\tmessage: 'A module cannot have multiple default exports.',\n\t},\n\tAMBIENT_IMPLEMENTATION: {\n\t\tcode: 'TS1183',\n\t\tmessage: 'An implementation cannot be declared in ambient contexts.',\n\t},\n\tIMPORT_ALIAS_IMPORT_TYPE: { code: 'TS1392', message: \"An import alias cannot use 'import type'\" },\n\tTYPE_IMPORT_DEFAULT_AND_NAMED: {\n\t\tcode: 'TS1363',\n\t\tmessage: 'A type-only import can specify a default import or named bindings, but not both.',\n\t},\n\n\t// Parameters\n\tSIGNATURE_PARAMETER_INITIALIZER: {\n\t\tcode: 'TS2371',\n\t\tmessage: 'A parameter initializer is only allowed in a function or constructor implementation.',\n\t},\n\tPATTERN_PARAMETER_PROPERTY: {\n\t\tcode: 'TS1187',\n\t\tmessage: 'A parameter property may not be declared using a binding pattern.',\n\t},\n\tREST_PARAMETER_PROPERTY: {\n\t\tcode: 'TS1317',\n\t\tmessage: 'A parameter property cannot be declared using a rest parameter.',\n\t},\n\tPARAMETER_PROPERTY_OUTSIDE_CONSTRUCTOR: {\n\t\tcode: 'TS2369',\n\t\tmessage: 'A parameter property is only allowed in a constructor implementation.',\n\t},\n\tREST_PARAMETER_INITIALIZER: {\n\t\tcode: 'TS1048',\n\t\tmessage: 'A rest parameter cannot have an initializer.',\n\t},\n\tREST_ELEMENT_INITIALIZER: {\n\t\tcode: 'TS1186',\n\t\tmessage: 'A rest element cannot have an initializer.',\n\t},\n\tOPTIONAL_REST_PARAMETER: { code: 'TS1047', message: 'A rest parameter cannot be optional.' },\n\tOPTIONAL_BINDING_PATTERN_PARAMETER: {\n\t\tcode: 'TS2463',\n\t\tmessage: 'A binding pattern parameter cannot be optional in an implementation signature.',\n\t},\n\n\t// acorn's wording, for the code TSRX reads in acorn's place\n\tUNEXPECTED_TOKEN: { code: 'TS1012', message: 'Unexpected token' },\n\tREST_PARAMETER_NOT_LAST: {\n\t\tcode: 'TS1014',\n\t\tmessage: 'A rest parameter must be last in a parameter list.',\n\t},\n\tREST_ELEMENT_NOT_LAST: {\n\t\tcode: 'TS2462',\n\t\tmessage: 'A rest element must be last in a destructuring pattern.',\n\t},\n\tREST_ELEMENT_TRAILING_COMMA: {\n\t\tcode: 'TS1013',\n\t\tmessage: 'Comma is not permitted after the rest element',\n\t},\n\tARGUMENT_NAME_CLASH: { code: 'TS2300', message: 'Argument name clash' },\n\tKEYWORD_ESCAPE_SEQUENCE: with_values(\n\t\t'TS1260',\n\t\t(keyword) => `Escape sequence in keyword ${keyword}`,\n\t),\n\tAWAIT_USING_OUTSIDE_ASYNC: {\n\t\tcode: 'TS2852',\n\t\tmessage: 'Await using cannot appear outside of async function',\n\t},\n\tFOR_IN_INITIALIZER: {\n\t\tcode: 'TS1189',\n\t\tmessage: 'for-in loop variable declaration may not have an initializer',\n\t},\n\tFOR_OF_INITIALIZER: {\n\t\tcode: 'TS1190',\n\t\tmessage: 'for-of loop variable declaration may not have an initializer',\n\t},\n\tMISSING_CATCH_OR_FINALLY: { code: 'TS1472', message: 'Missing catch or finally clause' },\n\tMULTIPLE_DEFAULT_CLAUSES: { code: 'TS1113', message: 'Multiple default clauses' },\n\tUSE_STRICT_NON_SIMPLE_PARAMETERS: {\n\t\tcode: 'TS1347',\n\t\tmessage: \"Illegal 'use strict' directive in function with non-simple parameter list\",\n\t},\n\n\t// acorn-typescript's wording, for a `}` in JSX text\n\tJSX_UNESCAPED_CLOSING_BRACE: {\n\t\tcode: 'TS1381',\n\t\tmessage: 'Unexpected token `}`. Did you mean `&rbrace;` or `{\"}\"}`?',\n\t},\n\t// TSRX's shorter wording of acorn-typescript's `JSX value should be either\n\t// an expression or a quoted JSX text`\n\tJSX_ATTRIBUTE_VALUE: {\n\t\tcode: 'TS1145',\n\t\tmessage: 'value should be either an expression or a quoted text',\n\t},\n\tONLY_STRING_ATTRIBUTE_VALUE: {\n\t\tcode: 'TS2858',\n\t\tmessage: 'Only string is supported as an attribute value',\n\t},\n\tTYPE_IMPORT_ARGUMENT: {\n\t\tcode: 'TS1141',\n\t\tmessage: 'Argument in a type import must be a string literal.',\n\t},\n\tUNEXPECTED_LEADING_DECORATOR: {\n\t\tcode: 'TS1206',\n\t\tmessage: 'Leading decorators must be attached to a class declaration.',\n\t},\n\tTYPE_CAST_IN_PARAMETER: {\n\t\tcode: 'TS1005',\n\t\tmessage: 'Unexpected type cast in parameter position.',\n\t},\n\tUNEXPECTED_TYPE_ANNOTATION: { code: 'TS1005', message: 'Did not expect a type annotation here.' },\n\tRESERVED_ARROW_TYPE_PARAMETER: {\n\t\tcode: 'TS7060',\n\t\tmessage:\n\t\t\t'This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.',\n\t},\n\t/** A type assertion written `<T>x` in a `.mts` or `.cts` file. */\n\tRESERVED_TYPE_ASSERTION: {\n\t\tcode: 'TS7059',\n\t\tmessage:\n\t\t\t'This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.',\n\t},\n};\n\n/**\n * An error that acorn or acorn-typescript raises in its own words, which TSRX\n * doesn't write: the pattern of its message, and TypeScript's code for the\n * same mistake. The code is TypeScript's diagnostic with the same wording, or\n * the one TypeScript reports for an input that raises the message (checked for\n * each), and `TSRX4003` where TypeScript accepts the code. `checker` marks one\n * that TypeScript reports from its checker though its parser reports the code\n * too, which `TS_SYNTAX_ERROR_CODES` lists: a regular expression's mistake,\n * `await` as a name in an async function (#1264).\n * @typedef {{ pattern: RegExp, code: string, checker?: boolean }} UpstreamError\n */\n\n/**\n * The upstream errors that TSRX's parser handles itself, by kind: see\n * `CHECKER_LEVEL_ERRORS` and `raise` in `plugin.js`. A comment names the\n * upstream functions that raise each.\n */\nexport const UPSTREAM_ERRORS = {\n\t// A redeclared variable, import, type alias, or private name. Where\n\t// TypeScript reports another code, the parser reports it instead: TS2451,\n\t// TS2481, TS2492, or TS2567 (see `declareName` in `plugin.js`).\n\t// acorn: declareName, parseClass; acorn-typescript: declareName\n\tREDECLARED: {\n\t\tpattern: /^(?:Identifier|type) '#?[^']+' has already been declared\\.?$/,\n\t\tcode: 'TS2300',\n\t},\n\t// acorn: parseTopLevel\n\tEXPORT_NOT_DEFINED: { pattern: /^Export '[^']+' is not defined$/, code: 'TS2304' },\n\t// acorn: toAssignable, checkLValSimple\n\tOPTIONAL_CHAIN_ASSIGNMENT: {\n\t\tpattern: /^Optional chaining cannot appear in left-hand side$/,\n\t\tcode: 'TS2779',\n\t},\n\t// acorn: parseImportMeta\n\tIMPORT_META_PROPERTY: {\n\t\tpattern: /^The only valid meta property for import is 'import\\.meta'$/,\n\t\tcode: 'TS17012',\n\t},\n\t// acorn: parseNew\n\tNEW_TARGET_OUTSIDE_FUNCTION: {\n\t\tpattern: /^'new\\.target' can only be used in functions and class static block$/,\n\t\tcode: 'TS17013',\n\t},\n\t// acorn: parseExprAtom\n\tSUPER_OUTSIDE_METHOD: { pattern: /^'super' keyword outside a method$/, code: 'TS2660' },\n\t// acorn: parseExprAtom\n\tSUPER_CALL_OUTSIDE_CONSTRUCTOR: {\n\t\tpattern: /^super\\(\\) call outside constructor of a subclass$/,\n\t\tcode: 'TS2337',\n\t},\n\t// acorn-typescript: callParseClassMemberWithIsStatic\n\tABSTRACT_METHOD_IN_CLASS: {\n\t\tpattern: /^Abstract methods can only appear within an abstract class\\.$/,\n\t\tcode: 'TS1244',\n\t},\n\t// acorn-typescript: parseVarStatement, parseClassField\n\tAMBIENT_INITIALIZER: {\n\t\tpattern: /^Initializers are not allowed in ambient contexts\\.$/,\n\t\tcode: 'TS1039',\n\t},\n\t// acorn-typescript: tsParseModifiers\n\tDUPLICATE_MODIFIER: { pattern: /^Duplicate modifier: '\\w+'\\.$/, code: 'TS1030' },\n\t// acorn-typescript: tsParseModifiers\n\tTYPE_MEMBER_MODIFIER: {\n\t\tpattern: /^'\\w+' modifier cannot appear on a type member\\.$/,\n\t\tcode: 'TS1070',\n\t},\n\t// acorn-typescript: tsParseModifiers\n\tTYPE_PARAMETER_MODIFIER: {\n\t\tpattern: /^'\\w+' modifier cannot appear on a type parameter\\.$/,\n\t\tcode: 'TS1273',\n\t},\n\t// acorn-typescript: tsParseModifiers\n\tVARIANCE_MODIFIER: {\n\t\tpattern:\n\t\t\t/^'\\w+' modifier can only appear on a type parameter of a class, interface or type alias\\.$/,\n\t\tcode: 'TS1274',\n\t},\n\t// acorn-typescript: parseClassField\n\tPRIVATE_ELEMENT_ACCESSIBILITY: {\n\t\tpattern: /^Private elements cannot have an accessibility modifier \\('\\w+'\\)\\.$/,\n\t\tcode: 'TS18010',\n\t},\n\t// acorn-typescript: parseClassField\n\tPRIVATE_ELEMENT_ABSTRACT: {\n\t\tpattern: /^Private elements cannot have the 'abstract' modifier\\.$/,\n\t\tcode: 'TS18019',\n\t},\n\t// acorn-typescript: parseClass\n\tDECORATED_CONSTRUCTOR: {\n\t\tpattern:\n\t\t\t/^Decorators can't be used with a constructor\\. Did you mean '@dec class \\{ \\.\\.\\. \\}'\\?$/,\n\t\tcode: 'TS1206',\n\t},\n};\n\n/**\n * acorn's and acorn-typescript's errors, which they raise as bare messages:\n * the lookup that gives each its code. A row is an {@link UpstreamError}, a\n * `[pattern, code]` pair, a `[pattern, code, 'checker']` triple for a checker\n * error with a code in `TS_SYNTAX_ERROR_CODES`, or the entry of a message TSRX\n * raises too in the same words, whose pattern is the entry's message with any\n * value in it. A comment names the upstream functions that raise each. The\n * first row that matches wins.\n * @returns {Array<UpstreamError | [RegExp, string] | [RegExp, string, 'checker'] | Diagnostic | DiagnosticWithValues>}\n */\nfunction upstream_lookup_rows() {\n\treturn [\n\t\t// acorn: unexpected, toAssignable\n\t\tTS_ERRORS.UNEXPECTED_TOKEN,\n\t\t// acorn: parseBindingList, checkPatternErrors, parseParenAndDistinguishExpression, parseProperty\n\t\tTS_ERRORS.REST_ELEMENT_TRAILING_COMMA,\n\t\t// acorn: checkPatternErrors, toAssignable\n\t\t[/^Assigning to rvalue$/, 'TS2364'],\n\t\t// acorn: checkPatternErrors\n\t\t[/^Parenthesized pattern$/, 'TS1005', 'checker'],\n\t\t// acorn: checkExpressionErrors\n\t\t[/^Shorthand property assignments are valid only in destructuring patterns$/, 'TS1312'],\n\t\t// acorn: checkExpressionErrors, checkPropClash\n\t\t[/^Redefinition of __proto__ property$/, 'TS1117'],\n\t\t// acorn: checkYieldAwaitInDefaultParams\n\t\t[/^Yield expression cannot be a default value$/, 'TS2523'],\n\t\t// acorn: checkYieldAwaitInDefaultParams\n\t\t[/^Await expression cannot be a default value$/, 'TS2524'],\n\t\t// acorn: parseTopLevel\n\t\tUPSTREAM_ERRORS.EXPORT_NOT_DEFINED,\n\t\t// acorn: parseStatement\n\t\t[\n\t\t\t/^Using declaration cannot appear in the top level when source type is `script` or in the bare case statement$/,\n\t\t\t'TSRX4003',\n\t\t],\n\t\t// acorn: parseStatement\n\t\t[/^Using declaration is not allowed in single-statement positions$/, 'TS1156'],\n\t\t// acorn: parseStatement, parseForStatement\n\t\tTS_ERRORS.AWAIT_USING_OUTSIDE_ASYNC,\n\t\t// acorn: parseBreakContinueStatement\n\t\t[/^Unsyntactic break$/, 'TS1105'],\n\t\t// acorn: parseBreakContinueStatement\n\t\t[/^Unsyntactic continue$/, 'TS1104'],\n\t\t// acorn: parseForAfterInit\n\t\t[/^Using declaration is not allowed in for-in loops$/, 'TS1493'],\n\t\t// acorn: parseReturnStatement\n\t\t[/^'return' outside of function$/, 'TS1108'],\n\t\t// acorn: parseSwitchStatement\n\t\tTS_ERRORS.MULTIPLE_DEFAULT_CLAUSES,\n\t\t// acorn: parseThrowStatement\n\t\t[/^Illegal newline after throw$/, 'TS1142'],\n\t\t// acorn: parseTryStatement\n\t\tTS_ERRORS.MISSING_CATCH_OR_FINALLY,\n\t\t// acorn: parseWithStatement\n\t\t[/^'with' in strict mode$/, 'TS1101'],\n\t\t// acorn: parseLabeledStatement\n\t\t[/^Label '[^']+' is already declared$/, 'TS1114'],\n\t\t// acorn: parseForIn\n\t\tTS_ERRORS.FOR_IN_INITIALIZER,\n\t\t// acorn: parseForIn\n\t\tTS_ERRORS.FOR_OF_INITIALIZER,\n\t\t// acorn: parseVar\n\t\t[/^Missing initializer in (?:const|using|await using) declaration$/, 'TS1155'],\n\t\t// acorn: parseVar\n\t\t[/^Complex binding patterns require an initialization value$/, 'TS1182'],\n\t\t// acorn: parseClass\n\t\t[/^Duplicate constructor in the same class$/, 'TS2392'],\n\t\t// acorn: declareName, parseClass; acorn-typescript: declareName\n\t\tUPSTREAM_ERRORS.REDECLARED,\n\t\t// acorn: parseClassElement\n\t\t[/^Constructor can't have get\\/set modifier$/, 'TS1341'],\n\t\t// acorn: parseClassElementName\n\t\t[/^Classes can't have an element named '#constructor'$/, 'TS18012'],\n\t\t// acorn: parseClassMethod\n\t\t[/^Constructor can't be a generator$/, 'TS1368'],\n\t\t// acorn: parseClassMethod\n\t\t[/^Constructor can't be an async method$/, 'TS1089'],\n\t\t// acorn: parseClassMethod\n\t\t[/^Classes may not have a static property named prototype$/, 'TS2699'],\n\t\t// acorn: parseClassMethod, parseGetterSetter\n\t\t[/^getter should have no params$/, 'TS1054'],\n\t\t// acorn: parseClassMethod, parseGetterSetter\n\t\t[/^setter should have exactly one param$/, 'TS1049'],\n\t\t// acorn: parseClassMethod, parseGetterSetter\n\t\t[/^Setter cannot use rest params$/, 'TS1053'],\n\t\t// acorn: parseClassField\n\t\t[/^Classes can't have a field named 'constructor'$/, 'TS18006'],\n\t\t// acorn: parseClassField\n\t\t[/^Classes can't have a static field named 'prototype'$/, 'TS2699'],\n\t\t// acorn: exitClassBody (a class uses a private name it doesn't declare). The\n\t\t// parser reports acorn's error for one outside any class, from\n\t\t// `parsePrivateIdent`, as TypeScript's TS18016 instead.\n\t\t[/^Private field '#.+' must be declared in an enclosing class$/, 'TS1111'],\n\t\t// acorn: parseExport\n\t\t[/^A string literal cannot be used as an exported binding without `from`\\.$/, 'TSRX4003'],\n\t\t// acorn: checkExport\n\t\t[/^Duplicate export '[^']+'$/, 'TS2300'],\n\t\t// acorn: parseModuleExportName\n\t\t[/^An export name cannot include a lone surrogate\\.$/, 'TSRX4003'],\n\t\t// acorn: toAssignable, parseSubscript, checkUnreserved\n\t\t[/^Cannot use 'await' as identifier inside an async function$/, 'TS1359', 'checker'],\n\t\t// acorn: toAssignable\n\t\t[/^Object pattern can't contain getter or setter$/, 'TS1136', 'checker'],\n\t\t// acorn: toAssignable\n\t\t[/^Rest elements cannot have a default value$/, 'TS1186'],\n\t\t// acorn: toAssignable\n\t\t[/^Only '=' operator can be used for specifying default value\\.$/, 'TS2364'],\n\t\t// acorn: toAssignable, checkLValSimple\n\t\tUPSTREAM_ERRORS.OPTIONAL_CHAIN_ASSIGNMENT,\n\t\t// acorn: checkLValSimple\n\t\t[/^Binding (?:eval|arguments) in strict mode$/, 'TS1100'],\n\t\t// acorn: checkLValSimple\n\t\t[/^Assigning to (?:eval|arguments) in strict mode$/, 'TS1100'],\n\t\t// acorn: checkLValSimple, for a word that TSRX reports as\n\t\t// `TS_ERRORS.STRICT_MODE_RESERVED_WORD` (see `raiseRecoverable` in `plugin.js`)\n\t\t[\n\t\t\t/^(?:Binding|Assigning to) (?:implements|interface|let|package|private|protected|public|static|yield) in strict mode$/,\n\t\t\t'TS1214',\n\t\t],\n\t\t// acorn: checkLValSimple, which TSRX reports as `TS_ERRORS.LET_DECLARATION_NAME`\n\t\t[/^let is disallowed as a lexically bound name$/, 'TS2480'],\n\t\t// acorn: checkLValSimple\n\t\tTS_ERRORS.ARGUMENT_NAME_CLASH,\n\t\t// acorn: checkLValSimple\n\t\t[/^Binding member expression$/, 'TS1005'],\n\t\t// acorn: checkLValSimple\n\t\t[/^Binding rvalue$/, 'TS2364'],\n\t\t// acorn: checkPropClash\n\t\t[/^Redefinition of property$/, 'TS1117'],\n\t\t// acorn: parseExprOp\n\t\t[\n\t\t\t/^Logical expressions and coalesce expressions cannot be mixed\\. Wrap either by parentheses$/,\n\t\t\t'TS5076',\n\t\t],\n\t\t// acorn: buildBinary\n\t\t[/^Private identifier can only be left side of binary expression$/, 'TS1451'],\n\t\t// acorn: parseMaybeUnary\n\t\t[/^Deleting local variable in strict mode$/, 'TS1102'],\n\t\t// acorn: parseMaybeUnary\n\t\t[/^Private fields can not be deleted$/, 'TS18011'],\n\t\t// acorn: parseSubscript\n\t\t[/^Optional chaining cannot appear in the callee of new expressions$/, 'TS1209'],\n\t\t// acorn: parseSubscript\n\t\t[/^Optional chaining cannot appear in the tag of tagged template expressions$/, 'TS1358'],\n\t\t// acorn: parseExprAtom\n\t\tUPSTREAM_ERRORS.SUPER_OUTSIDE_METHOD,\n\t\t// acorn: parseExprAtom\n\t\tUPSTREAM_ERRORS.SUPER_CALL_OUTSIDE_CONSTRUCTOR,\n\t\t// acorn: parseExprImport, parseNew, next\n\t\tTS_ERRORS.KEYWORD_ESCAPE_SEQUENCE,\n\t\t// acorn: parseImportMeta\n\t\tUPSTREAM_ERRORS.IMPORT_META_PROPERTY,\n\t\t// acorn: parseImportMeta\n\t\t[/^'import\\.meta' must not contain escaped characters$/, 'TSRX4003'],\n\t\t// acorn: parseNew\n\t\t[/^The only valid meta property for new is 'new\\.target'$/, 'TS17012'],\n\t\t// acorn: parseNew\n\t\t[/^'new\\.target' must not contain escaped characters$/, 'TSRX4003'],\n\t\t// acorn: parseNew\n\t\tUPSTREAM_ERRORS.NEW_TARGET_OUTSIDE_FUNCTION,\n\t\t// acorn: parseTemplateElement\n\t\t[/^Bad escape sequence in untagged template literal$/, 'TS1125'],\n\t\t// acorn: parseTemplate\n\t\t[/^Unterminated template literal$/, 'TS1160'],\n\t\t// acorn: parseFunctionBody\n\t\tTS_ERRORS.USE_STRICT_NON_SIMPLE_PARAMETERS,\n\t\t// acorn: checkUnreserved\n\t\t[/^Cannot use 'yield' as identifier inside a generator$/, 'TS1212'],\n\t\t// acorn: checkUnreserved\n\t\t[/^Cannot use 'arguments' in class field initializer$/, 'TS2815'],\n\t\t// acorn: checkUnreserved\n\t\t[/^Cannot use arguments in class static initialization block$/, 'TS2815'],\n\t\t// acorn: checkUnreserved\n\t\t[/^Cannot use await in class static initialization block$/, 'TS18037'],\n\t\t// acorn: checkUnreserved\n\t\t[/^Unexpected keyword '[^']+'$/, 'TS1359'],\n\t\t// acorn: checkUnreserved\n\t\t[/^Cannot use keyword 'await' outside an async function$/, 'TS1262'],\n\t\t// acorn: checkUnreserved, for a word that TSRX reports as\n\t\t// `TS_ERRORS.STRICT_MODE_RESERVED_WORD` (see `raiseRecoverable` in `plugin.js`)\n\t\t[\n\t\t\t/^The keyword '(?:implements|interface|let|package|private|protected|public|static|yield)' is reserved$/,\n\t\t\t'TS1214',\n\t\t],\n\t\t// acorn: checkUnreserved\n\t\t[/^The keyword '[^']+' is reserved$/, 'TS1212'],\n\t\t// acorn: validateRegExpFlags\n\t\t[/^Invalid regular expression flag$/, 'TS1499'],\n\t\t// acorn: validateRegExpFlags\n\t\t[/^Duplicate regular expression flag$/, 'TS1500'],\n\t\t// acorn: skipBlockComment\n\t\t[/^Unterminated comment$/, 'TS1010'],\n\t\t// acorn: readToken_numberSign, getTokenFromCode\n\t\t[/^Unexpected character '.+'$/, 'TS1127'],\n\t\t// acorn: readRegexp\n\t\t[/^Unterminated regular expression$/, 'TS1161'],\n\t\t// acorn: readInt\n\t\t[/^Numeric separator is not allowed in legacy octal numeric literals$/, 'TS6188'],\n\t\t// acorn: readInt\n\t\t[/^Numeric separator must be exactly one underscore$/, 'TS6189'],\n\t\t// acorn: readInt\n\t\t[/^Numeric separator is not allowed at the first of digits$/, 'TS6188'],\n\t\t// acorn: readInt\n\t\t[/^Numeric separator is not allowed at the last of digits$/, 'TS6188'],\n\t\t// acorn: readRadixNumber\n\t\t[/^Expected number in radix 16$/, 'TS1125'],\n\t\t// acorn: readRadixNumber\n\t\t[/^Expected number in radix 2$/, 'TS1177'],\n\t\t// acorn: readRadixNumber\n\t\t[/^Expected number in radix 8$/, 'TS1178'],\n\t\t// acorn: readRadixNumber, readNumber\n\t\t[/^Identifier directly after number$/, 'TS1351'],\n\t\t// acorn: readNumber\n\t\t[/^Invalid number$/, 'TS1124'],\n\t\t// acorn: readString\n\t\t[/^Unterminated string constant$/, 'TS1002'],\n\t\t// acorn: parseTemplate, readTmplToken, readInvalidTemplateToken\n\t\t[/^Unterminated template$/, 'TS1160'],\n\t\t// acorn: readCodePoint\n\t\t[/^Code point out of bounds$/, 'TS1198'],\n\t\t// acorn: readEscapedChar\n\t\t[/^Invalid escape sequence$/, 'TS1488'],\n\t\t// acorn: readEscapedChar\n\t\t[/^Invalid escape sequence in template string$/, 'TS1488'],\n\t\t// acorn: readEscapedChar\n\t\t[/^Octal literal in template string$/, 'TS1487'],\n\t\t// acorn: readEscapedChar\n\t\t[/^Octal literal in strict mode$/, 'TS1487'],\n\t\t// acorn: readHexChar\n\t\t[/^Bad character escape sequence$/, 'TS1125'],\n\t\t// acorn: readWord1\n\t\t[/^Expecting Unicode escape sequence \\\\uXXXX$/, 'TS1127'],\n\t\t// acorn: readWord1\n\t\t[/^Invalid Unicode escape$/, 'TS1127'],\n\t\t// acorn's regular expression validator, as `Invalid regular expression:\n\t\t// /{0}/: {1}`\n\t\t// acorn: regexp_pattern\n\t\t[/^Invalid regular expression: \\/.*\\/: Unmatched '\\)'$/, 'TS1508'],\n\t\t// acorn: regexp_pattern, regexp_disjunction\n\t\t[/^Invalid regular expression: \\/.*\\/: Lone quantifier brackets$/, 'TS1508'],\n\t\t// acorn: regexp_pattern, regexp_eatAtomEscape, regexp_eatClassAtom, regexp_eatClassStringDisjunction, regexp_eatHexEscapeSequence\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid escape$/, 'TS1535'],\n\t\t// acorn: regexp_pattern\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid named capture referenced$/, 'TS1532'],\n\t\t// acorn: regexp_disjunction, regexp_eatInvalidBracedQuantifier\n\t\t[/^Invalid regular expression: \\/.*\\/: Nothing to repeat$/, 'TS1507'],\n\t\t// acorn: regexp_eatTerm\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid quantifier$/, 'TS1507'],\n\t\t// acorn: regexp_eatAssertion, regexp_eatCapturingGroup, regexp_eatUncapturingGroup\n\t\t[/^Invalid regular expression: \\/.*\\/: Unterminated group$/, 'TS1005', 'checker'],\n\t\t// acorn: regexp_eatBracedQuantifier\n\t\t[/^Invalid regular expression: \\/.*\\/: numbers out of order in \\{\\} quantifier$/, 'TS1506'],\n\t\t// acorn: regexp_eatBracedQuantifier\n\t\t[/^Invalid regular expression: \\/.*\\/: Incomplete quantifier$/, 'TS1005', 'checker'],\n\t\t// acorn: regexp_eatUncapturingGroup\n\t\t[/^Invalid regular expression: \\/.*\\/: Duplicate regular expression modifiers$/, 'TS1500'],\n\t\t// acorn: regexp_eatUncapturingGroup\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid regular expression modifiers$/, 'TS1504'],\n\t\t// acorn: regexp_eatCapturingGroup, regexp_groupSpecifier\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid group$/, 'TS1005', 'checker'],\n\t\t// acorn: regexp_groupSpecifier\n\t\t[/^Invalid regular expression: \\/.*\\/: Duplicate capture group name$/, 'TS1515'],\n\t\t// acorn: regexp_eatGroupName\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid capture group name$/, 'TS1514'],\n\t\t// acorn: regexp_eatAtomEscape, regexp_eatRegExpUnicodeEscapeSequence\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid unicode escape$/, 'TS1198', 'checker'],\n\t\t// acorn: regexp_eatKGroupName\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid named reference$/, 'TS1510'],\n\t\t// acorn: regexp_eatCharacterClassEscape, regexp_validateUnicodePropertyNameAndValue, regexp_validateUnicodePropertyNameOrValue\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid property name$/, 'TS1529'],\n\t\t// acorn: regexp_validateUnicodePropertyNameAndValue\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid property value$/, 'TS1526'],\n\t\t// acorn: regexp_eatCharacterClass\n\t\t[/^Invalid regular expression: \\/.*\\/: Unterminated character class$/, 'TS1005', 'checker'],\n\t\t// acorn: regexp_eatCharacterClass, regexp_eatNestedClass\n\t\t[/^Invalid regular expression: \\/.*\\/: Negated character class may contain strings$/, 'TS1518'],\n\t\t// acorn: regexp_nonEmptyClassRanges\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid character class$/, 'TS1516'],\n\t\t// acorn: regexp_nonEmptyClassRanges, regexp_eatClassSetRange\n\t\t[/^Invalid regular expression: \\/.*\\/: Range out of order in character class$/, 'TS1517'],\n\t\t// acorn: regexp_eatClassAtom\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid class escape$/, 'TS1512'],\n\t\t// acorn: regexp_classSetExpression\n\t\t[/^Invalid regular expression: \\/.*\\/: Invalid character in character class$/, 'TS1508'],\n\t\t// acorn-typescript: jsx_parseAttributeValue\n\t\t[/^JSX attributes must only be assigned a non-empty expression$/, 'TS17000'],\n\t\t// acorn-typescript: jsx_parseAttributeValue\n\t\t[/^JSX value should be either an expression or a quoted JSX text$/, 'TS1145'],\n\t\t// acorn-typescript: jsx_parseElementAt\n\t\t[/^Expected corresponding JSX closing tag for <[^>]*>$/, 'TS17002'],\n\t\t// acorn-typescript: jsx_parseElementAt\n\t\t[/^Adjacent JSX elements must be wrapped in an enclosing tag$/, 'TS2657'],\n\t\t// acorn-typescript: parseWithEntries\n\t\tTSRX_ERRORS.DUPLICATED_ATTRIBUTE_KEY,\n\t\t// acorn-typescript: parseWithEntries\n\t\tTS_ERRORS.ONLY_STRING_ATTRIBUTE_VALUE,\n\t\t// acorn-typescript: tsParsePropertyOrMethodSignature\n\t\t[/^A 'get' accesor must not have any formal parameters\\.$/, 'TS1054'],\n\t\t// acorn-typescript: parseNew\n\t\t[/^Cannot use new with import\\(\\)$/, 'TS1109'],\n\t\t// acorn-typescript: parseTaggedTemplateExpression\n\t\t[/^Tagged Template Literals are not allowed in optionalChain\\.$/, 'TS1358'],\n\t\t// acorn-typescript: parseMethod\n\t\t[/^Method '.+' cannot have an implementation because it is marked abstract\\.$/, 'TS1245'],\n\t\t// acorn-typescript: parseClassField\n\t\t[/^Property '.+' cannot have an initializer because it is marked abstract\\.$/, 'TS1267'],\n\t\t// acorn-typescript: tsParsePropertyOrMethodSignature\n\t\t[/^'get' and 'set' accessors cannot declare 'this' parameters\\.$/, 'TS2784'],\n\t\t// acorn-typescript: tsParsePropertyOrMethodSignature\n\t\t[/^An accessor cannot have type parameters\\.$/, 'TS1094'],\n\t\t// acorn-typescript: tsTryNextParseConstantContext\n\t\t[/^Cannot find name '[^']+'\\.$/, 'TS2304'],\n\t\t// acorn-typescript: parsePostMemberNameModifiers\n\t\t[/^Class methods cannot have the 'declare' modifier\\.$/, 'TS1031'],\n\t\t// acorn-typescript: parsePostMemberNameModifiers\n\t\t[/^Class methods cannot have the 'readonly' modifier\\.$/, 'TS1024'],\n\t\t// acorn-typescript: parseVarStatement\n\t\t[\n\t\t\t/^A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference\\.$/,\n\t\t\t'TS1254',\n\t\t],\n\t\t// acorn-typescript: parseClassMethod\n\t\t[/^Type parameters cannot appear on a constructor declaration\\.$/, 'TS1092'],\n\t\t// acorn-typescript: parseClassMethod\n\t\t[/^'declare' is not allowed in (?:get|set)ters\\.$/, 'TS1031'],\n\t\t// acorn-typescript: parseVarStatement, parseClassField\n\t\tUPSTREAM_ERRORS.AMBIENT_INITIALIZER,\n\t\t// acorn-typescript: parseFunctionBody\n\t\tTS_ERRORS.AMBIENT_IMPLEMENTATION,\n\t\t// acorn-typescript: tsParseModifiers\n\t\tTS_ERRORS.ACCESSIBILITY_MODIFIER_ALREADY_SEEN,\n\t\t// acorn-typescript: tsParseModifiers\n\t\tUPSTREAM_ERRORS.DUPLICATE_MODIFIER,\n\t\t// acorn-typescript: tsParseHeritageClause\n\t\t[/^'(?:extends|implements)' list cannot be empty\\.$/, 'TS1097'],\n\t\t// acorn-typescript: tsParseTypeArguments\n\t\t[/^Type argument list cannot be empty\\.$/, 'TS1099'],\n\t\t// acorn-typescript: tsParseTypeParameters\n\t\t[/^Type parameter list cannot be empty\\.$/, 'TS1098'],\n\t\t// acorn-typescript: parseExportDeclaration\n\t\t[/^'export declare' must be followed by an ambient declaration\\.$/, 'TS1128'],\n\t\t// acorn-typescript: tsParseImportEqualsDeclaration\n\t\t[/^An import alias can not use 'import type'\\.$/, 'TS1392'],\n\t\t// acorn-typescript: tsParseModifiers (incompatible)\n\t\tTS_ERRORS.MODIFIER_CANNOT_BE_USED_WITH,\n\t\t// acorn-typescript: callParseClassMemberWithIsStatic\n\t\t[/^Index signatures cannot have the 'abstract' modifier\\.$/, 'TS1071'],\n\t\t// acorn-typescript: callParseClassMemberWithIsStatic\n\t\t[/^Index signatures cannot have an accessibility modifier \\('\\w+'\\)\\.$/, 'TS1071'],\n\t\t// acorn-typescript: callParseClassMemberWithIsStatic\n\t\t[/^Index signatures cannot have the 'declare' modifier\\.$/, 'TS1071'],\n\t\t// acorn-typescript: callParseClassMemberWithIsStatic\n\t\t[/^'override' modifier cannot appear on an index signature\\.$/, 'TS1071'],\n\t\t// acorn-typescript: tsParseModifiers\n\t\tUPSTREAM_ERRORS.TYPE_MEMBER_MODIFIER,\n\t\t// acorn-typescript: tsParseModifiers\n\t\tUPSTREAM_ERRORS.TYPE_PARAMETER_MODIFIER,\n\t\t// acorn-typescript: tsParseModifiers\n\t\tUPSTREAM_ERRORS.VARIANCE_MODIFIER,\n\t\t// acorn-typescript: tsParseModifiers (enforceOrder)\n\t\tTS_ERRORS.MODIFIER_MUST_PRECEDE,\n\t\t// acorn-typescript: parseSubscript\n\t\t[\n\t\t\t/^Invalid property access after an instantiation expression\\. You can either wrap the instantiation expression in parentheses, or delete the type arguments\\.$/,\n\t\t\t'TS1477',\n\t\t],\n\t\t// acorn-typescript: tsParseTupleElementType\n\t\t[/^Tuple members must be labeled with a simple identifier\\.$/, 'TS1005'],\n\t\t// acorn-typescript: tsParseInterfaceDeclaration\n\t\t[/^'interface' declarations must be followed by an identifier\\.$/, 'TS1438'],\n\t\t// acorn-typescript: callParseClassMemberWithIsStatic\n\t\tUPSTREAM_ERRORS.ABSTRACT_METHOD_IN_CLASS,\n\t\t// acorn-typescript: tsParseTupleType\n\t\t[/^A required element cannot follow an optional element\\.$/, 'TS1257'],\n\t\t// acorn-typescript: callParseClassMemberWithIsStatic\n\t\t[\n\t\t\t/^This member cannot have an 'override' modifier because its containing class does not extend another class\\.$/,\n\t\t\t'TS4112',\n\t\t],\n\t\t// acorn-typescript: parseBindingListItem\n\t\tTS_ERRORS.OPTIONAL_BINDING_PATTERN_PARAMETER,\n\t\t// acorn-typescript: parseClassField\n\t\tUPSTREAM_ERRORS.PRIVATE_ELEMENT_ABSTRACT,\n\t\t// acorn-typescript: parseClassField\n\t\tUPSTREAM_ERRORS.PRIVATE_ELEMENT_ACCESSIBILITY,\n\t\t// acorn-typescript: parseClassMethod\n\t\t[/^Private methods cannot have an accessibility modifier \\('\\w+'\\)\\.$/, 'TS18010'],\n\t\t// acorn-typescript: tsParsePropertyOrMethodSignature\n\t\tTS_ERRORS.READONLY_MODIFIER_NOT_ALLOWED,\n\t\t// acorn-typescript: tsParseTypeAssertion\n\t\tTS_ERRORS.RESERVED_ARROW_TYPE_PARAMETER,\n\t\t// acorn-typescript: tsParseTypeAssertion\n\t\tTS_ERRORS.RESERVED_TYPE_ASSERTION,\n\t\t// acorn-typescript: tsParsePropertyOrMethodSignature\n\t\t[/^A 'set' accessor cannot have an optional parameter\\.$/, 'TS1051'],\n\t\t// acorn-typescript: tsParsePropertyOrMethodSignature\n\t\t[/^A 'set' accessor cannot have rest parameter\\.$/, 'TS1053'],\n\t\t// acorn-typescript: tsParsePropertyOrMethodSignature\n\t\t[/^A 'set' accessor cannot have a return type annotation\\.$/, 'TS1095'],\n\t\t// acorn-typescript: callParseClassMemberWithIsStatic\n\t\t[/^Static class blocks cannot have any modifier\\.$/, 'TS1184'],\n\t\t// acorn-typescript: parseMaybeDefault\n\t\t[\n\t\t\t/^Type annotations must come before default assignments, e\\.g\\. instead of `age = 25: number` use `age: number = 25`\\.$/,\n\t\t\t'TS1005',\n\t\t],\n\t\t// acorn-typescript: parseImport\n\t\tTS_ERRORS.TYPE_IMPORT_DEFAULT_AND_NAMED,\n\t\t// acorn-typescript: parseTypeOnlyImportExportSpecifier\n\t\t[\n\t\t\t/^The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement\\.$/,\n\t\t\t'TS2207',\n\t\t],\n\t\t// acorn-typescript: parseTypeOnlyImportExportSpecifier\n\t\t[\n\t\t\t/^The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement\\.$/,\n\t\t\t'TS2206',\n\t\t],\n\t\t// acorn-typescript: parseAssignableListItem\n\t\tTS_ERRORS.PARAMETER_PROPERTY_OUTSIDE_CONSTRUCTOR,\n\t\t// acorn-typescript: tsCheckTypeAnnotationForReadOnly\n\t\tTS_ERRORS.READONLY_TYPE_MODIFIER,\n\t\t// acorn-typescript: tsCheckForInvalidTypeCasts\n\t\tTS_ERRORS.UNEXPECTED_TYPE_ANNOTATION,\n\t\t// acorn-typescript: toAssignable\n\t\tTS_ERRORS.TYPE_CAST_IN_PARAMETER,\n\t\t// acorn-typescript: tsParseImportType\n\t\tTS_ERRORS.TYPE_IMPORT_ARGUMENT,\n\t\t// acorn-typescript: parseAssignableListItem\n\t\tTS_ERRORS.PATTERN_PARAMETER_PROPERTY,\n\t\t// acorn-typescript: parseDecorators\n\t\tTS_ERRORS.UNEXPECTED_LEADING_DECORATOR,\n\t\t// acorn-typescript: parseClass\n\t\tUPSTREAM_ERRORS.DECORATED_CONSTRUCTOR,\n\t\t// acorn-typescript: parseClass\n\t\t[/^Decorators must be attached to a class element\\.$/, 'TS1146'],\n\t\t// acorn-typescript: parseProperty\n\t\t[/^Decorators can't be used with SpreadElement$/, 'TS1206'],\n\t];\n}\n\n/**\n * The pattern of an entry's message, with any value in it.\n * @param {Diagnostic | DiagnosticWithValues} entry\n * @returns {RegExp}\n */\nfunction message_pattern(entry) {\n\tconst placeholder = '\\0';\n\tconst message =\n\t\ttypeof entry === 'function'\n\t\t\t? entry(placeholder, placeholder, placeholder).message\n\t\t\t: entry.message;\n\tconst source = message\n\t\t.split(placeholder)\n\t\t.map((part) => part.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n\t\t.join('.+');\n\treturn new RegExp(`^${source}$`);\n}\n\n/**\n * {@link upstream_lookup_rows}, as the pattern of each row and the kind of\n * error it is: the entry, or the {@link UpstreamError}. Built on first use.\n * @type {Array<{ pattern: RegExp, error: UpstreamError | Diagnostic | DiagnosticWithValues }> | undefined}\n */\nlet upstream_lookup;\n\n/**\n * The kind of error an acorn or acorn-typescript `message` is, with its code:\n * the entry TSRX raises in the same words, or the {@link UpstreamError}.\n * @param {string} message\n * @returns {Diagnostic | DiagnosticWithValues | UpstreamError | undefined}\n */\nexport function get_upstream_error(message) {\n\tupstream_lookup ??= upstream_lookup_rows().map((row) => {\n\t\tif (Array.isArray(row)) {\n\t\t\t/** @type {UpstreamError} */\n\t\t\tconst error = { pattern: row[0], code: row[1] };\n\t\t\tif (row[2] === 'checker') error.checker = true;\n\t\t\treturn { pattern: row[0], error };\n\t\t}\n\t\tif ('pattern' in row) return { pattern: row.pattern, error: row };\n\t\treturn { pattern: message_pattern(row), error: row };\n\t});\n\treturn upstream_lookup.find((row) => row.pattern.test(message))?.error;\n}\n\n/**\n * The {@link Diagnostic} for an error acorn or acorn-typescript raises, with\n * its code from the lookup, if the lookup has it.\n * @param {string} message\n * @returns {{ code: string | undefined, message: string }}\n */\nexport function upstream_diagnostic(message) {\n\treturn { code: get_upstream_error(message)?.code, message };\n}\n","/** @import * as AST from 'estree' */\n/** @import {CodeMapping, CompileError} from '@tsrx/core/types' */\n/** @import {DiagnosticDirectives} from './protocol.js' */\n\nimport { DIAGNOSTIC_CODES } from '@tsrx/core/diagnostics';\nimport { DiagnosticDirectivePolicy } from './protocol.js';\n\n/**\n * The nodes whose generated code an error's directive covers: the innermost\n * statement, declaration, class or type member, or element that holds the\n * error.\n */\nconst HOLDER_TYPE =\n\t/(?:Statement|Declaration|Definition|Signature)$|^(?:StaticBlock|AccessorProperty|JSXElement|JSXFragment|JSXStyleElement)$/;\n\n/** Keys of a tree node that hold no child nodes, or nodes that aren't its children. */\nconst NOT_CHILDREN = new Set([\n\t'metadata',\n\t'loc',\n\t'range',\n\t'parent',\n\t'comments',\n\t'leadingComments',\n\t'trailingComments',\n]);\n\n/**\n * An `ignore` directive for each error the mapper reports, so that a mistake\n * shows once. TypeScript reports some mistakes itself from the generated code,\n * with a code of its own, and would show them next to the mapper's error. The\n * directive hides TypeScript's errors in the generated code of the statement,\n * class or type member, or element that holds the error, until the error is\n * fixed and the mapper stops sending it. The mapper's own errors are not\n * TypeScript's, so they stay.\n *\n * The ranges come from what every TSRX compiler returns, whatever its target:\n * the source tree (`sourceAst`) finds the node that holds an error, and the\n * mappings give that node's generated code. Without a source tree the error's\n * own span stands in. A node without mappings gets no directive.\n * @param {readonly CompileError[]} errors\n * @param {AST.Program | null} source_ast\n * @param {readonly CodeMapping[]} mappings\n * @param {number} original_length\n * @param {number} generated_length\n * @returns {DiagnosticDirectives | null}\n */\nexport function ignore_directives(errors, source_ast, mappings, original_length, generated_length) {\n\t/** @type {Array<[original_start: number, original_end: number, generated_start: number, generated_end: number]>} */\n\tconst ranges = [];\n\tfor (const error of errors) {\n\t\tif (typeof error.pos !== 'number') {\n\t\t\tcontinue;\n\t\t}\n\t\tconst on_tag = reported_on_tag(error);\n\t\tconst position = on_tag ? /** @type {number} */ (error.raisedAt) - 1 : error.pos;\n\t\tconst holder = source_ast ? holder_at(source_ast, position) : null;\n\t\tconst start = holder ? /** @type {number} */ (holder.start) : error.pos;\n\t\tconst end = holder\n\t\t\t? /** @type {number} */ (holder.end)\n\t\t\t: typeof error.end === 'number' && error.end > error.pos\n\t\t\t\t? error.end\n\t\t\t\t: error.pos + 1;\n\t\t// With nothing holding an unclosed tag, only its own code is covered. Its\n\t\t// anchor isn't that: it sits on whatever else is on its generated line.\n\t\tconst own_code = on_tag && !holder;\n\t\tfor (const generated of generated_ranges(mappings, start, end, own_code)) {\n\t\t\tranges.push([\n\t\t\t\tMath.min(start, original_length),\n\t\t\t\tMath.min(end, original_length),\n\t\t\t\tMath.min(generated[0], generated_length),\n\t\t\t\tMath.min(generated[1], generated_length),\n\t\t\t]);\n\t\t}\n\t}\n\tif (ranges.length === 0) {\n\t\treturn null;\n\t}\n\n\t// TypeScript rejects directives whose generated ranges overlap.\n\tranges.sort((a, b) => a[2] - b[2]);\n\t/** @type {typeof ranges} */\n\tconst merged = [];\n\tfor (const range of ranges) {\n\t\tconst last = merged.at(-1);\n\t\tif (last && range[2] < last[3]) {\n\t\t\tlast[0] = Math.min(last[0], range[0]);\n\t\t\tlast[1] = Math.max(last[1], range[1]);\n\t\t\tlast[3] = Math.max(last[3], range[3]);\n\t\t} else {\n\t\t\tmerged.push([...range]);\n\t\t}\n\t}\n\treturn {\n\t\tunusedExpectDirectiveDiagnostics: [],\n\t\tdirectives: merged.map(([original_start, original_end, generated_start, generated_end]) => [\n\t\t\toriginal_start,\n\t\t\toriginal_end - original_start,\n\t\t\tgenerated_start,\n\t\t\tgenerated_end,\n\t\t\tDiagnosticDirectivePolicy.Ignore,\n\t\t]),\n\t};\n}\n\n/**\n * Whether `error` is an unclosed tag reported on the tag and found where the\n * parser stopped, one before `raisedAt`: the end of its template, or the start\n * of a `<style>` or `<script>` body. Its directive holds there, not at the error:\n * the closing tag that recovery adds has no mapping, so TypeScript's error on it\n * could only show at the top of the file, and the tag's own statement can end\n * before it. At the end of the file nothing holds that place, as the tag's\n * declaration has stretched around the code that follows, which the directive\n * must not hide. A compiler from before tags were reported on themselves has its\n * error where the parser stopped already, with `raisedAt` no further than `end`,\n * and the mapper runs whichever compiler the project has.\n * @param {CompileError} error\n * @returns {boolean}\n */\nfunction reported_on_tag({ code, end, raisedAt }) {\n\treturn (\n\t\tcode === DIAGNOSTIC_CODES.UNCLOSED_TAG &&\n\t\ttypeof raisedAt === 'number' &&\n\t\ttypeof end === 'number' &&\n\t\traisedAt > end\n\t);\n}\n\n/**\n * The innermost holder node (see {@link HOLDER_TYPE}) that contains `position`,\n * found by descending from the root through the child that contains it.\n * @param {AST.Node} root\n * @param {number} position\n * @returns {AST.Node | null}\n */\nfunction holder_at(root, position) {\n\t/** @type {AST.Node | null} */\n\tlet holder = null;\n\t/** @type {AST.Node | null} */\n\tlet node = root;\n\twhile (node) {\n\t\tif (HOLDER_TYPE.test(node.type)) {\n\t\t\tholder = node;\n\t\t}\n\t\tnode = child_at(node, position);\n\t}\n\treturn holder;\n}\n\n/**\n * @param {AST.Node} node\n * @param {number} position\n * @returns {AST.Node | null}\n */\nfunction child_at(node, position) {\n\tfor (const [key, value] of Object.entries(node)) {\n\t\tif (NOT_CHILDREN.has(key) || !value || typeof value !== 'object') {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const child of Array.isArray(value) ? value : [value]) {\n\t\t\tif (\n\t\t\t\tchild &&\n\t\t\t\ttypeof child.type === 'string' &&\n\t\t\t\ttypeof child.start === 'number' &&\n\t\t\t\ttypeof child.end === 'number' &&\n\t\t\t\tchild.start <= position &&\n\t\t\t\tposition < child.end\n\t\t\t) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n}\n\n/**\n * The generated ranges of the mapped code between `start` and `end` in the\n * original. A node's generated code need not be in one piece: a compiler can\n * hoist part of it (a static element above the component), and a `<script>`\n * body is checked as a block at the end of the file. So each range runs from\n * the first to the last generated offset of the node's segments until code\n * mapped from outside the node follows, and the next of its segments starts a\n * new range; a range never covers another component's code. A segment of the\n * same length on both sides that encloses the original range, as a verbatim\n * `<script>` body does, gives the matching part of its generated text.\n * @param {readonly CodeMapping[]} mappings\n * @param {number} start\n * @param {number} end\n * @param {boolean} [own_code] Count only segments inside the range, and no\n * error's anchor. A segment that encloses the range doesn't count: a mapping of\n * the whole file can have the same length on both sides by chance. An anchor\n * still ends a range, as any code from outside the node does.\n * @returns {Array<[number, number]>}\n */\nfunction generated_ranges(mappings, start, end, own_code = false) {\n\t/** @type {Array<[generated_start: number, generated_end: number, inside: boolean]>} */\n\tconst segments = [];\n\tfor (const mapping of mappings) {\n\t\tfor (let i = 0; i < mapping.sourceOffsets.length; i++) {\n\t\t\tconst source = mapping.sourceOffsets[i];\n\t\t\tconst length = mapping.lengths[i];\n\t\t\tconst generated = mapping.generatedOffsets[i];\n\t\t\tconst generated_length = mapping.generatedLengths?.[i] ?? length;\n\t\t\tif (own_code && mapping.data?.customData?.diagnosticAnchor) {\n\t\t\t\tsegments.push([generated, generated + generated_length, false]);\n\t\t\t} else if (source >= start && source + length <= end) {\n\t\t\t\tsegments.push([generated, generated + generated_length, true]);\n\t\t\t} else if (\n\t\t\t\t!own_code &&\n\t\t\t\tsource <= start &&\n\t\t\t\tend <= source + length &&\n\t\t\t\tgenerated_length === length\n\t\t\t) {\n\t\t\t\tsegments.push([generated + start - source, generated + end - source, true]);\n\t\t\t} else {\n\t\t\t\tsegments.push([generated, generated + generated_length, false]);\n\t\t\t}\n\t\t}\n\t}\n\tsegments.sort((a, b) => a[0] - b[0] || a[1] - b[1]);\n\t/** @type {Array<[number, number]>} */\n\tconst ranges = [];\n\t/** @type {[number, number] | null} */\n\tlet range = null;\n\tfor (const [segment_start, segment_end, inside] of segments) {\n\t\tif (inside) {\n\t\t\tif (range) {\n\t\t\t\trange[1] = Math.max(range[1], segment_end);\n\t\t\t} else {\n\t\t\t\trange = [segment_start, segment_end];\n\t\t\t}\n\t\t} else if (range && segment_start >= range[1]) {\n\t\t\t// Code from elsewhere follows: the node's next segment starts a new range.\n\t\t\tif (range[1] > range[0]) ranges.push(range);\n\t\t\trange = null;\n\t\t}\n\t}\n\tif (range && range[1] > range[0]) ranges.push(range);\n\treturn ranges;\n}\n","/** @import * as AST from 'estree' */\n\n/**\n * Build a TypeScript stub that preserves a module's export surface while the\n * file cannot be compiled.\n *\n * Raw TSRX, or the last good TSX (which may carry type errors of its own),\n * would give the checker noise to report. Instead every\n * export from the last successful transform's source AST is re-declared as\n * `any` (both as a value and as a type, so `new X()`, `X.y` and `let v: X` all\n * keep resolving), re-exports from other modules are kept as written (including\n * their `type` modifiers, so `isolatedModules` and `verbatimModuleSyntax` do\n * not reject the stub), and the compile error is reported through the mapper's\n * own diagnostics. Importers keep resolving; the author sees one error at the\n * right place.\n * @param {AST.Program | null | undefined} program The last successfully parsed source AST, if any.\n * @returns {string}\n */\nexport function build_export_stub(program) {\n\t/** @type {string[]} */\n\tconst lines = [];\n\t/** @type {Set<string>} */\n\tconst names = new Set();\n\tlet has_default = false;\n\n\tfor (const statement of program?.body ?? []) {\n\t\tswitch (statement.type) {\n\t\t\tcase 'ExportAllDeclaration': {\n\t\t\t\tconst exported = statement.exported ? ` as ${print_name(statement.exported)}` : '';\n\t\t\t\tlines.push(\n\t\t\t\t\t`export ${type_modifier(statement)}*${exported} from ${JSON.stringify(String(statement.source.value))};`,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'ExportDefaultDeclaration':\n\t\t\t\thas_default = true;\n\t\t\t\tbreak;\n\t\t\tcase 'ExportNamedDeclaration': {\n\t\t\t\tif (statement.source) {\n\t\t\t\t\tconst statement_is_type = type_modifier(statement) !== '';\n\t\t\t\t\tconst specifiers = statement.specifiers.map((specifier) => {\n\t\t\t\t\t\tconst local = print_name(specifier.local);\n\t\t\t\t\t\tconst exported = print_name(specifier.exported);\n\t\t\t\t\t\t// `export type { A }` marks the statement; `export { type A }`\n\t\t\t\t\t\t// marks the specifier. Never write both.\n\t\t\t\t\t\tconst modifier = statement_is_type ? '' : type_modifier(specifier);\n\t\t\t\t\t\treturn `${modifier}${local === exported ? local : `${local} as ${exported}`}`;\n\t\t\t\t\t});\n\t\t\t\t\tlines.push(\n\t\t\t\t\t\t`export ${type_modifier(statement)}{ ${specifiers.join(', ')} } from ${JSON.stringify(String(statement.source.value))};`,\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfor (const specifier of statement.specifiers) {\n\t\t\t\t\tconst exported = export_name(specifier.exported);\n\t\t\t\t\tif (exported === 'default') has_default = true;\n\t\t\t\t\telse names.add(exported);\n\t\t\t\t}\n\t\t\t\tif (statement.declaration) {\n\t\t\t\t\tfor (const name of declaration_names(statement.declaration)) {\n\t\t\t\t\t\tnames.add(name);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t// A name no declaration can have (`null`, `if`, `string` for a type, an\n\t// arbitrary module namespace name such as `\"foo-bar\"`) is exported from a\n\t// local binding of another name.\n\tlet next_local = 0;\n\tfor (const name of names) {\n\t\tif (identifier_pattern.test(name) && !UNDECLARABLE_NAMES.has(name)) {\n\t\t\tlines.push(`export declare const ${name}: any;`);\n\t\t\tlines.push(`export type ${name} = any;`);\n\t\t\tcontinue;\n\t\t}\n\t\tlet local = `_$_export_${next_local++}`;\n\t\twhile (names.has(local)) local = `_$_export_${next_local++}`;\n\t\tlines.push(`declare const ${local}: any;`);\n\t\tlines.push(`type ${local} = any;`);\n\t\tlines.push(`export { ${local} as ${module_export_name(name)} };`);\n\t}\n\tif (has_default) {\n\t\tlines.push('declare const _default: any;');\n\t\tlines.push('export default _default;');\n\t}\n\tif (lines.length === 0) {\n\t\tlines.push('export {};');\n\t}\n\treturn lines.join('\\n') + '\\n';\n}\n\n/**\n * `type ` for a type-only export statement or specifier (the ESTree-TS\n * `exportKind` field), else the empty string.\n * @param {AST.Node} node\n * @returns {'type ' | ''}\n */\nfunction type_modifier(node) {\n\treturn /** @type {{ exportKind?: string }} */ (node).exportKind === 'type' ? 'type ' : '';\n}\n\nconst identifier_pattern = /^[\\p{ID_Start}_$][\\p{ID_Continue}$]*$/u;\n\n/**\n * Identifier names that `export declare const x: any; export type x = any;`\n * can't declare in a module: reserved words (TS1389), words reserved in strict\n * mode (TS1214), `await`, `let`, `arguments` and `eval`, the names of\n * TypeScript's own types (TS2457), and `as`, which `export type as` misreads.\n */\nconst UNDECLARABLE_NAMES = new Set([\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'new',\n\t'null',\n\t'return',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'implements',\n\t'interface',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\t'static',\n\t'yield',\n\t'await',\n\t'let',\n\t'arguments',\n\t'eval',\n\t'any',\n\t'bigint',\n\t'boolean',\n\t'never',\n\t'number',\n\t'object',\n\t'string',\n\t'symbol',\n\t'undefined',\n\t'unknown',\n\t'as',\n]);\n\n/**\n * The name an export binds, as a plain string: `a` for `export { a }` and\n * `foo-bar` for `export { \"foo-bar\" as a } from`.\n * @param {AST.Identifier | AST.Literal | AST.Expression} node\n * @returns {string}\n */\nfunction export_name(node) {\n\tif (node.type === 'Identifier') return node.name;\n\tif (node.type === 'Literal') return String(node.value);\n\treturn '';\n}\n\n/**\n * The name as it must be written back in a re-export: an identifier as is, an\n * arbitrary module namespace name (`export { \"foo-bar\" as a } from`,\n * `export * as \"ns-name\" from`) quoted, so the stub stays valid TypeScript.\n * @param {AST.Identifier | AST.Literal | AST.Expression} node\n * @returns {string}\n */\nfunction print_name(node) {\n\treturn module_export_name(export_name(node));\n}\n\n/**\n * A name as an export specifier takes it: any identifier name, reserved words\n * too, as is, and anything else quoted.\n * @param {string} name\n * @returns {string}\n */\nfunction module_export_name(name) {\n\treturn identifier_pattern.test(name) ? name : JSON.stringify(name);\n}\n\n/**\n * @param {AST.Declaration | AST.Node} declaration\n * @returns {string[]}\n */\nfunction declaration_names(declaration) {\n\tswitch (declaration.type) {\n\t\tcase 'VariableDeclaration':\n\t\t\treturn declaration.declarations.flatMap((declarator) => pattern_names(declarator.id));\n\t\tcase 'FunctionDeclaration':\n\t\tcase 'ClassDeclaration':\n\t\t\treturn declaration.id ? [declaration.id.name] : [];\n\t\tdefault: {\n\t\t\t// TypeScript declarations (interface, type alias, enum, module) all\n\t\t\t// carry an `id` identifier in the ESTree-TS shape.\n\t\t\tconst id = /** @type {{ id?: AST.Node }} */ (declaration).id;\n\t\t\treturn id && id.type === 'Identifier' ? [/** @type {AST.Identifier} */ (id).name] : [];\n\t\t}\n\t}\n}\n\n/**\n * @param {AST.Pattern} pattern\n * @returns {string[]}\n */\nfunction pattern_names(pattern) {\n\tswitch (pattern.type) {\n\t\tcase 'Identifier':\n\t\t\treturn [pattern.name];\n\t\tcase 'ObjectPattern':\n\t\t\treturn pattern.properties.flatMap((property) =>\n\t\t\t\tproperty.type === 'RestElement'\n\t\t\t\t\t? pattern_names(property.argument)\n\t\t\t\t\t: pattern_names(property.value),\n\t\t\t);\n\t\tcase 'ArrayPattern':\n\t\t\treturn pattern.elements.flatMap((element) => (element ? pattern_names(element) : []));\n\t\tcase 'RestElement':\n\t\t\treturn pattern_names(pattern.argument);\n\t\tcase 'AssignmentPattern':\n\t\t\treturn pattern_names(pattern.left);\n\t\tdefault:\n\t\t\treturn [];\n\t}\n}\n","/** @import {CodeMapping} from '@tsrx/core/types' */\n\nimport fs from 'node:fs';\nimport { fileURLToPath } from 'node:url';\n\n/**\n * The editor-only `ImportMetaEnv` / `ImportMeta` globals that `withPlatformTypes`\n * in `@tsrx/core` appends to the generated TSX of a module that keeps a platform\n * flag, exactly as it prints them, with the three flag value types captured.\n */\nconst PLATFORM_GLOBALS =\n\t/\\ndeclare global \\{\\n\\tinterface ImportMetaEnv \\{\\n\\t\\treadonly platform: string & \\{\\n\\t\\t\\treadonly web: (true|false|boolean);\\n\\t\\t\\treadonly ios: (true|false|boolean);\\n\\t\\t\\treadonly android: (true|false|boolean);\\n\\t\\t\\};\\n\\t\\}\\n\\tinterface ImportMeta \\{\\n\\t\\treadonly \\[key: `env\\$\\{string\\}`\\]: ImportMetaEnv;\\n\\t\\}\\n\\}\\n/;\n\n/** The `platform-globals/` file that declares each set of flag value types. */\nconst PLATFORM_FILES = new Map([\n\t['true,false,false', 'web'],\n\t['false,true,false', 'ios'],\n\t['false,false,true', 'android'],\n\t['boolean,boolean,boolean', 'unconfigured'],\n]);\n\n/** @type {Map<string, string | null>} */\nconst files = new Map();\n\n/**\n * Replace a module's copy of the platform globals in its generated TSX with a\n * reference to the shared file that declares the same globals. Native\n * TypeScript merges every module's copy into one `ImportMeta` and reports the\n * repeated index signature (TS2374), and declaration output keeps every\n * `declare global` block. The shared file is in the program once, and\n * declaration output drops a `/// <reference path>` directive.\n *\n * The copy is blanked in place, and the directive goes at the start of the\n * text, where TypeScript reads it, so every generated offset moves by its\n * length. A directive is not an import: organize imports and auto-import still\n * see only the module's own imports, and TypeScript 7 maps their edits only\n * when the last of them is the module's last import. Text without the exact\n * copy (another TSRX version, a third-party compiler), or that starts with a\n * hashbang, comes back unchanged.\n * @param {string} text\n * @param {readonly CodeMapping[]} mappings\n * @returns {{ text: string, mappings: readonly CodeMapping[] }}\n */\nexport function share_platform_globals(text, mappings) {\n\tconst match = PLATFORM_GLOBALS.exec(text);\n\tconst name = match && PLATFORM_FILES.get(match.slice(1).join(','));\n\tconst file = name && !text.startsWith('#!') ? platform_globals_file(name) : null;\n\tif (!match || !file) return { text, mappings };\n\tconst directive = `/// <reference path=\"${file}\" />\\n`;\n\tconst end = match.index + match[0].length;\n\treturn {\n\t\ttext: `${directive}${text.slice(0, match.index)}${match[0].replace(/[^\\n]/g, ' ')}${text.slice(end)}`,\n\t\tmappings: mappings.map((mapping) => ({\n\t\t\t...mapping,\n\t\t\tgeneratedOffsets: mapping.generatedOffsets.map((offset) => offset + directive.length),\n\t\t})),\n\t};\n}\n\n/**\n * The path of a `platform-globals/` file, with forward slashes. The directory\n * sits next to `src/` and `dist/`, so one relative URL serves both. A file\n * missing from the installed package, or a path a directive cannot quote,\n * leaves the copy in place.\n * @param {string} name\n * @returns {string | null}\n */\nfunction platform_globals_file(name) {\n\tlet file = files.get(name);\n\tif (file === undefined) {\n\t\tconst path = fileURLToPath(new URL(`../platform-globals/${name}.d.cts`, import.meta.url));\n\t\tfile = fs.existsSync(path) && !/[\"\\r\\n]/.test(path) ? path.replace(/\\\\/g, '/') : null;\n\t\tfiles.set(name, file);\n\t}\n\treturn file;\n}\n","/** @import {CodeMapping} from '@tsrx/core/types' */\n/** @import {SpanMapping, VerificationMapping} from './protocol.js' */\n\nimport { SpanMapFeature, SpanMapKind } from './protocol.js';\n\nconst semantic_features =\n\tSpanMapFeature.Hover |\n\tSpanMapFeature.SignatureHelp |\n\tSpanMapFeature.InlayHints |\n\tSpanMapFeature.SemanticTokens;\nconst completion_features = SpanMapFeature.Completion | SpanMapFeature.AutoInsert;\nconst navigation_features =\n\tSpanMapFeature.Definition |\n\tSpanMapFeature.TypeDefinition |\n\tSpanMapFeature.Implementation |\n\tSpanMapFeature.References |\n\tSpanMapFeature.DocumentHighlights |\n\tSpanMapFeature.Rename |\n\tSpanMapFeature.CallHierarchy |\n\tSpanMapFeature.CodeActions |\n\tSpanMapFeature.LinkedEditing;\nconst structure_features =\n\tSpanMapFeature.FoldingRanges |\n\tSpanMapFeature.SelectionRanges |\n\tSpanMapFeature.DocumentSymbols |\n\tSpanMapFeature.CodeLens;\n\nconst identifier_pattern = /^[\\p{ID_Start}_$][\\p{ID_Continue}$‌‍]*$/u;\n\n/**\n * @typedef {object} Candidate\n * @property {number} generatedStart\n * @property {number} generatedEnd\n * @property {number} originalStart\n * @property {number} originalEnd\n * @property {0 | 1 | 2} kind\n * @property {number} features\n * @property {boolean} [positionOnly] From a mapping with no Volar feature, not even\n * `verification`: it only places diagnostics, so coalescing may join it to\n * its neighbours like an unmapped gap.\n */\n\n/**\n * Translate a Volar `CodeMapping['data']` into content-mapper feature bits.\n *\n * `verification` has no bit: diagnostics always apply. Spans that carry CSS\n * class hover/definition metadata (`customData.hover` / `customData.definition`)\n * leave Hover and Definition off so the TSRX language server owns those\n * features. `semantic.shouldHighlight()` returning `false` (string-literal\n * spans) drops SemanticTokens.\n * @param {CodeMapping['data'] | undefined} data\n * @returns {number}\n */\nexport function features_from_mapping_data(data) {\n\tif (!data || typeof data !== 'object') return SpanMapFeature.None;\n\tlet features = SpanMapFeature.None;\n\tif (data.semantic) {\n\t\tfeatures |= semantic_features;\n\t\tif (typeof data.semantic === 'object' && data.semantic.shouldHighlight?.() === false) {\n\t\t\tfeatures &= ~SpanMapFeature.SemanticTokens;\n\t\t}\n\t}\n\tif (data.completion) {\n\t\tfeatures |= completion_features;\n\t}\n\tif (data.navigation) {\n\t\tfeatures |= navigation_features;\n\t\tif (typeof data.navigation === 'object') {\n\t\t\tif (data.navigation.shouldHighlight?.() === false) {\n\t\t\t\tfeatures &= ~SpanMapFeature.DocumentHighlights;\n\t\t\t}\n\t\t\tif (data.navigation.shouldRename?.() === false) {\n\t\t\t\tfeatures &= ~SpanMapFeature.Rename;\n\t\t\t}\n\t\t}\n\t}\n\tif (data.structure) {\n\t\tfeatures |= structure_features;\n\t}\n\tif (data.format) {\n\t\tfeatures |= SpanMapFeature.Formatting;\n\t}\n\tconst custom = data.customData;\n\tif (custom && (custom.hover !== undefined || custom.definition !== undefined)) {\n\t\tfeatures &= ~(SpanMapFeature.Hover | SpanMapFeature.Definition);\n\t}\n\treturn features;\n}\n\n/**\n * Convert the type-only transform's Volar mappings into a content-mapper span\n * map: an ordered, disjoint (in generated space) list of\n * `[generatedStart, generatedLength, originalStart, originalLength, kind, features]`.\n *\n * - Equal length and identical text → `Verbatim` (the only edit-safe kind).\n * - An identifier whose generated spelling differs (obfuscated `_$_` names,\n * renamed or capitalized identifiers) → `Alias`, so diagnostics that cover\n * the span exactly show the authored name.\n * - Anything else → `Atom`.\n *\n * The transform emits container spans (statements, control-flow bodies) that\n * enclose token spans. TypeScript requires generated spans to be disjoint, so\n * candidates are ranked Verbatim first, then shorter before longer, and a\n * candidate that overlaps an already selected span in generated space is\n * dropped. Overlap in original space is allowed by the protocol (one source\n * range may be projected several times) and is kept.\n *\n * Neighbouring Verbatim spans with equal feature bits whose gap is the same\n * text in both files are then coalesced into one span (see\n * {@link coalesce_verbatim_spans}), so a statement such as\n * `import { a } from './x';` is one edit-safe span rather than four tokens\n * with unmapped punctuation between them. TypeScript only applies text edits\n * (auto-import, rename, code actions) that fit inside a single Verbatim span.\n * A dropped candidate then keeps its uncovered edges (see\n * {@link map_dropped_edges}), so a diagnostic over a whole container starts and\n * ends where the container does in the original. Last, identical text left\n * between spans with different feature bits maps without features (see\n * {@link map_identical_gaps}).\n * @param {readonly CodeMapping[]} mappings\n * @param {string} generated_text\n * @param {string} original_text\n * @param {{ languageFeatures?: boolean }} [options] `languageFeatures: false` clears every feature bit (CLI-only projects).\n * @returns {SpanMapping[]}\n */\nexport function to_span_mappings(mappings, generated_text, original_text, options = {}) {\n\tconst language_features = options.languageFeatures !== false;\n\t/** @type {Candidate[]} */\n\tconst candidates = [];\n\n\tfor (const mapping of mappings) {\n\t\tconst count = Math.min(mapping.sourceOffsets.length, mapping.generatedOffsets.length);\n\t\tfor (let index = 0; index < count; index++) {\n\t\t\tconst original_start = mapping.sourceOffsets[index];\n\t\t\tconst generated_start = mapping.generatedOffsets[index];\n\t\t\tconst original_length = mapping.lengths[index] ?? mapping.lengths[0];\n\t\t\tconst generated_length =\n\t\t\t\tmapping.generatedLengths?.[index] ?? mapping.generatedLengths?.[0] ?? original_length;\n\t\t\tif (\n\t\t\t\t!Number.isInteger(original_start) ||\n\t\t\t\t!Number.isInteger(generated_start) ||\n\t\t\t\t!Number.isInteger(original_length) ||\n\t\t\t\t!Number.isInteger(generated_length) ||\n\t\t\t\toriginal_start < 0 ||\n\t\t\t\tgenerated_start < 0 ||\n\t\t\t\toriginal_length <= 0 ||\n\t\t\t\tgenerated_length <= 0\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst generated_end = generated_start + generated_length;\n\t\t\tconst original_end = original_start + original_length;\n\t\t\tif (generated_end > generated_text.length || original_end > original_text.length) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst generated_slice = generated_text.slice(generated_start, generated_end);\n\t\t\tconst original_slice = original_text.slice(original_start, original_end);\n\t\t\t/** @type {0 | 1 | 2} */\n\t\t\tlet kind;\n\t\t\tif (generated_length === original_length && generated_slice === original_slice) {\n\t\t\t\tkind = SpanMapKind.Verbatim;\n\t\t\t} else if (\n\t\t\t\tis_whole_identifier(generated_text, generated_start, generated_end) &&\n\t\t\t\tis_whole_token(original_text, original_start, original_end)\n\t\t\t) {\n\t\t\t\tkind = SpanMapKind.Alias;\n\t\t\t} else if (is_partial_identifier(original_text, original_start, original_end)) {\n\t\t\t\t// A fragment of an identifier (the transform's one-character file-start\n\t\t\t\t// anchor, `e` of `export` → `c` of a hoisted `const`) is not an entity.\n\t\t\t\t// Volar needed the anchor; under the content-mapper protocol it would\n\t\t\t\t// only make TypeScript project requests at the file start into\n\t\t\t\t// synthesized code.\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tkind = SpanMapKind.Atom;\n\t\t\t}\n\t\t\tcandidates.push({\n\t\t\t\tgeneratedStart: generated_start,\n\t\t\t\tgeneratedEnd: generated_end,\n\t\t\t\toriginalStart: original_start,\n\t\t\t\toriginalEnd: original_end,\n\t\t\t\tkind,\n\t\t\t\tfeatures: language_features\n\t\t\t\t\t? features_from_mapping_data(mapping.data)\n\t\t\t\t\t: SpanMapFeature.None,\n\t\t\t\tpositionOnly: is_position_only(mapping.data),\n\t\t\t});\n\t\t}\n\t}\n\n\tcandidates.sort(\n\t\t(left, right) =>\n\t\t\tNumber(left.kind !== SpanMapKind.Verbatim) - Number(right.kind !== SpanMapKind.Verbatim) ||\n\t\t\tleft.generatedEnd - left.generatedStart - (right.generatedEnd - right.generatedStart) ||\n\t\t\tleft.generatedStart - right.generatedStart ||\n\t\t\tleft.originalStart - right.originalStart,\n\t);\n\n\t/** @type {Candidate[]} */\n\tconst selected = [];\n\t/** @type {Candidate[]} */\n\tconst dropped = [];\n\tconst occupied = new IntervalSet();\n\tfor (const candidate of candidates) {\n\t\tif (occupied.add(candidate.generatedStart, candidate.generatedEnd)) {\n\t\t\tselected.push(candidate);\n\t\t} else {\n\t\t\tdropped.push(candidate);\n\t\t}\n\t}\n\n\tselected.sort((left, right) => left.generatedStart - right.generatedStart);\n\treturn map_identical_gaps(\n\t\tmap_dropped_edges(\n\t\t\textend_verbatim_spans_over_whitespace(\n\t\t\t\tcoalesce_verbatim_spans(selected, generated_text, original_text),\n\t\t\t\tgenerated_text,\n\t\t\t\toriginal_text,\n\t\t\t),\n\t\t\tdropped,\n\t\t\tgenerated_text,\n\t\t\toriginal_text,\n\t\t),\n\t\tgenerated_text,\n\t\toriginal_text,\n\t).map((candidate) => [\n\t\tcandidate.generatedStart,\n\t\tcandidate.generatedEnd - candidate.generatedStart,\n\t\tcandidate.originalStart,\n\t\tcandidate.originalEnd - candidate.originalStart,\n\t\tcandidate.kind,\n\t\tcandidate.features,\n\t]);\n}\n\n/**\n * Whether a mapping has no Volar feature at all, not even `verification`. The\n * transform emits such mappings only to give TypeScript 7 a place for\n * diagnostics (the brackets of a respaced literal); Volar ignores them.\n * @param {CodeMapping['data'] | undefined} data\n * @returns {boolean}\n */\nfunction is_position_only(data) {\n\treturn (\n\t\t!!data &&\n\t\ttypeof data === 'object' &&\n\t\t!data.verification &&\n\t\t!data.completion &&\n\t\t!data.semantic &&\n\t\t!data.navigation &&\n\t\t!data.structure &&\n\t\t!data.format\n\t);\n}\n\n/**\n * The transform's own mappings for diagnostics, for command-line checkers (the\n * `verificationMappings` mapper option): every mapping whose `data.verification`\n * is set, in the transform's order, with its offsets and lengths as emitted.\n * This is what `tsrx-tsc` hands Volar, so Volar's `SourceMap#toSourceRange`\n * (with `fallbackToAnyMatch`) over it maps a diagnostic exactly as `tsrx-tsc`\n * does. The grouping matters: Volar maps a range through one mapping that holds\n * both of its ends, such as the start and end points of a literal, and tries\n * mappings in this order, narrower first. When any mapping's verification is a\n * `shouldReport` callback, the result is empty: the callback depends on the\n * diagnostic and doesn't serialize, and leaving out only that mapping could\n * let an overlapping one map a diagnostic somewhere else.\n * @param {readonly CodeMapping[]} mappings\n * @returns {VerificationMapping[]}\n */\nexport function to_verification_mappings(mappings) {\n\t/** @type {VerificationMapping[]} */\n\tconst result = [];\n\tfor (const mapping of mappings) {\n\t\tconst verification = mapping.data?.verification;\n\t\tif (!verification) continue;\n\t\tif (typeof verification === 'object' && typeof verification.shouldReport === 'function') {\n\t\t\treturn [];\n\t\t}\n\t\tresult.push({\n\t\t\tsourceOffsets: [...mapping.sourceOffsets],\n\t\t\tgeneratedOffsets: [...mapping.generatedOffsets],\n\t\t\tlengths: [...mapping.lengths],\n\t\t\tgeneratedLengths: [...(mapping.generatedLengths ?? mapping.lengths)],\n\t\t\tdata: { verification: true },\n\t\t});\n\t}\n\treturn result;\n}\n\n/**\n * Merge runs of Verbatim spans, sorted by generated start, when the two spans\n * carry the same feature bits and the text between them is identical (and of\n * equal length) in the generated and the original file. The merged span is\n * Verbatim by construction: every position inside it maps with the same\n * offset and the same text. A position-only span joins a neighbour whatever\n * its features, and takes them, as the unmapped text it covers would.\n * @param {Candidate[]} spans\n * @param {string} generated_text\n * @param {string} original_text\n * @returns {Candidate[]}\n */\nexport function coalesce_verbatim_spans(spans, generated_text, original_text) {\n\t/** @type {Candidate[]} */\n\tconst merged = [];\n\tfor (const span of spans) {\n\t\tconst previous = merged[merged.length - 1];\n\t\tif (\n\t\t\tprevious &&\n\t\t\tprevious.kind === SpanMapKind.Verbatim &&\n\t\t\tspan.kind === SpanMapKind.Verbatim &&\n\t\t\t(previous.features === span.features || previous.positionOnly || span.positionOnly) &&\n\t\t\tspan.originalStart >= previous.originalEnd &&\n\t\t\tspan.generatedStart - previous.generatedEnd === span.originalStart - previous.originalEnd &&\n\t\t\tgenerated_text.slice(previous.generatedEnd, span.generatedStart) ===\n\t\t\t\toriginal_text.slice(previous.originalEnd, span.originalStart)\n\t\t) {\n\t\t\tprevious.generatedEnd = span.generatedEnd;\n\t\t\tprevious.originalEnd = span.originalEnd;\n\t\t\tif (previous.positionOnly && !span.positionOnly) {\n\t\t\t\tprevious.features = span.features;\n\t\t\t\tprevious.positionOnly = false;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tmerged.push({ ...span });\n\t}\n\treturn merged;\n}\n\n/**\n * Extend every Verbatim span forward over whitespace that is identical in the\n * generated and the original file, up to the next span in either file.\n *\n * TypeScript's edits routinely end at the start of the line after a statement\n * (an organize-imports edit for the import block ends after the last import's\n * newline), and TypeScript 7 discards a whole edit when any of its ranges does\n * not map. A span that stops at a statement's last character therefore made\n * \"Organize Imports\" a no-op on `.tsrx` files; covering the newline that follows\n * fixes that at no cost, since identical whitespace maps verbatim.\n * @param {Candidate[]} spans Sorted by generated start, non-overlapping.\n * @param {string} generated_text\n * @param {string} original_text\n * @returns {Candidate[]}\n */\nexport function extend_verbatim_spans_over_whitespace(spans, generated_text, original_text) {\n\tfor (let index = 0; index < spans.length; index++) {\n\t\tconst span = spans[index];\n\t\tif (span.kind !== SpanMapKind.Verbatim) continue;\n\t\tconst next = spans[index + 1];\n\t\tconst generated_limit = next ? next.generatedStart : generated_text.length;\n\t\tconst original_limit = next ? next.originalStart : original_text.length;\n\t\twhile (\n\t\t\tspan.generatedEnd < generated_limit &&\n\t\t\tspan.originalEnd < original_limit &&\n\t\t\tgenerated_text[span.generatedEnd] === original_text[span.originalEnd] &&\n\t\t\t/[ \\t\\r\\n]/.test(generated_text[span.generatedEnd])\n\t\t) {\n\t\t\tspan.generatedEnd++;\n\t\t\tspan.originalEnd++;\n\t\t}\n\t}\n\treturn spans;\n}\n\n/**\n * Map the uncovered edges of each candidate that lost to the spans it\n * overlaps: the part before its first span and the part after its last.\n *\n * A container (a whole import type, a statement) encloses the token spans that\n * beat it, and TypeScript reports some diagnostics over the whole container.\n * When the printed text differs from the source (`import( './x' )` printed\n * as `import('./x')`), the container's start lies in unmapped text, and\n * TypeScript would report the diagnostic at the nearest earlier mapped\n * position instead. An edge runs from the container's boundary to the\n * neighbouring span, in both files, so it maps only when that span's original\n * range starts (or ends) inside the container's. Each edge is split by\n * {@link split_edge} so that a node inside it without a span of its own keeps\n * its position. Edges carry no feature bits: they place diagnostics and change\n * no editor feature. Gaps between a container's spans get no edge;\n * {@link map_identical_gaps} maps the ones whose text is identical.\n * Candidates are visited shortest first, so a nested container's edge bounds\n * the edge of the one around it.\n * @param {Candidate[]} spans Sorted by generated start, non-overlapping.\n * @param {readonly Candidate[]} dropped\n * @param {string} generated_text\n * @param {string} original_text\n * @returns {Candidate[]}\n */\nexport function map_dropped_edges(spans, dropped, generated_text, original_text) {\n\tconst result = spans.slice();\n\t/**\n\t * @param {Candidate | null} edge\n\t * @param {boolean} trailing\n\t */\n\tconst add = (edge, trailing) => {\n\t\tif (!edge) return;\n\t\tfor (const span of split_edge(edge, generated_text, original_text, trailing)) {\n\t\t\tif (\n\t\t\t\tspan.kind === SpanMapKind.Atom &&\n\t\t\t\tis_partial_identifier(original_text, span.originalStart, span.originalEnd)\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresult.splice(last_span_at_or_before(result, span.generatedStart) + 1, 0, span);\n\t\t}\n\t};\n\tfor (const candidate of dropped) {\n\t\tadd(leading_edge(result, candidate), false);\n\t\tadd(trailing_edge(result, candidate), true);\n\t}\n\treturn result;\n}\n\n/**\n * @param {readonly Candidate[]} spans\n * @param {Candidate} candidate\n * @returns {Candidate | null}\n */\nfunction leading_edge(spans, candidate) {\n\tconst index = last_span_at_or_before(spans, candidate.generatedStart);\n\tif (index >= 0 && spans[index].generatedEnd > candidate.generatedStart) return null;\n\tconst next = spans[index + 1];\n\tif (\n\t\t!next ||\n\t\tnext.generatedStart >= candidate.generatedEnd ||\n\t\tnext.originalStart <= candidate.originalStart ||\n\t\tnext.originalStart > candidate.originalEnd\n\t) {\n\t\treturn null;\n\t}\n\treturn edge(\n\t\tcandidate.generatedStart,\n\t\tnext.generatedStart,\n\t\tcandidate.originalStart,\n\t\tnext.originalStart,\n\t\tSpanMapKind.Atom,\n\t);\n}\n\n/**\n * @param {readonly Candidate[]} spans\n * @param {Candidate} candidate\n * @returns {Candidate | null}\n */\nfunction trailing_edge(spans, candidate) {\n\tconst previous = spans[last_span_at_or_before(spans, candidate.generatedEnd - 1)];\n\tif (\n\t\t!previous ||\n\t\tprevious.generatedEnd >= candidate.generatedEnd ||\n\t\tprevious.generatedEnd <= candidate.generatedStart ||\n\t\tprevious.originalEnd < candidate.originalStart ||\n\t\tprevious.originalEnd >= candidate.originalEnd\n\t) {\n\t\treturn null;\n\t}\n\treturn edge(\n\t\tprevious.generatedEnd,\n\t\tcandidate.generatedEnd,\n\t\tprevious.originalEnd,\n\t\tcandidate.originalEnd,\n\t\tSpanMapKind.Atom,\n\t);\n}\n\n/**\n * Split an edge into `Verbatim` runs of the text it shares with the source,\n * matched from the container's boundary (the start of a leading edge, the end\n * of a trailing one) with whitespace that only one side has skipped, and one\n * `Atom` for whatever follows the first other difference. The printer mostly\n * changes spacing: in `Record< {}, 1 >`, printed `Record<{ }, 1>`, the `{` of\n * the `{}` that has no span of its own then maps to itself instead of to the\n * container's `<`. An edge whose boundary character differs stays one `Atom`,\n * and no run starts or ends inside an identifier.\n * @param {Candidate} whole\n * @param {string} generated_text\n * @param {string} original_text\n * @param {boolean} from_end\n * @returns {Candidate[]}\n */\nfunction split_edge(whole, generated_text, original_text, from_end) {\n\tconst generated = generated_text.slice(whole.generatedStart, whole.generatedEnd);\n\tconst original = original_text.slice(whole.originalStart, whole.originalEnd);\n\t/**\n\t * The character `index` steps from the boundary.\n\t * @param {string} text\n\t * @param {number} index\n\t */\n\tconst at = (text, index) => text[from_end ? text.length - 1 - index : index];\n\tif (at(generated, 0) !== at(original, 0)) return [whole];\n\n\t/** Runs as `[generated step, original step, length]`, in steps from the boundary. */\n\t/** @type {Array<[number, number, number]>} */\n\tconst runs = [];\n\tlet i = 0;\n\tlet j = 0;\n\twhile (i < generated.length && j < original.length) {\n\t\tconst g = at(generated, i);\n\t\tconst o = at(original, j);\n\t\tif (g === o) {\n\t\t\tconst run = runs.at(-1);\n\t\t\tif (run && run[0] + run[2] === i && run[1] + run[2] === j) run[2]++;\n\t\t\telse runs.push([i, j, 1]);\n\t\t\ti++;\n\t\t\tj++;\n\t\t} else if (/\\s/.test(g)) {\n\t\t\ti++;\n\t\t} else if (/\\s/.test(o)) {\n\t\t\tj++;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\t// Runs keep to identifier boundaries in both texts: skipped whitespace can\n\t// join or split identifiers. The runs from the first one that starts inside\n\t// an identifier, or the part of a run after its last boundary, go to the Atom.\n\t/** @param {string} text @param {number} index */\n\tconst splits = (text, index) =>\n\t\tidentifier_part.test(at(text, index - 1) ?? '') && identifier_part.test(at(text, index) ?? '');\n\t/** @type {Array<[number, number, number]>} */\n\tconst kept = [];\n\tfor (const [g, o, length] of runs) {\n\t\tif (splits(generated, g) || splits(original, o)) break;\n\t\tlet end = length;\n\t\twhile (end > 0 && (splits(generated, g + end) || splits(original, o + end))) end--;\n\t\tif (end > 0) kept.push([g, o, end]);\n\t\tif (end < length) break;\n\t}\n\tconst last = kept.at(-1);\n\tif (!last) return [whole];\n\t// The Atom starts where the last run ends.\n\ti = last[0] + last[2];\n\tj = last[1] + last[2];\n\n\t/** @type {Candidate[]} */\n\tconst spans = kept.map(([g, o, length]) =>\n\t\tfrom_end\n\t\t\t? edge_span(whole.generatedEnd - g - length, whole.originalEnd - o - length, length)\n\t\t\t: edge_span(whole.generatedStart + g, whole.originalStart + o, length),\n\t);\n\tif (i < generated.length && j < original.length) {\n\t\tspans.push(\n\t\t\tfrom_end\n\t\t\t\t? edge(\n\t\t\t\t\t\twhole.generatedStart,\n\t\t\t\t\t\twhole.generatedEnd - i,\n\t\t\t\t\t\twhole.originalStart,\n\t\t\t\t\t\twhole.originalEnd - j,\n\t\t\t\t\t\tSpanMapKind.Atom,\n\t\t\t\t\t)\n\t\t\t\t: edge(\n\t\t\t\t\t\twhole.generatedStart + i,\n\t\t\t\t\t\twhole.generatedEnd,\n\t\t\t\t\t\twhole.originalStart + j,\n\t\t\t\t\t\twhole.originalEnd,\n\t\t\t\t\t\tSpanMapKind.Atom,\n\t\t\t\t\t),\n\t\t);\n\t}\n\treturn spans;\n}\n\n/**\n * @param {number} generated_start\n * @param {number} original_start\n * @param {number} length\n * @returns {Candidate}\n */\nfunction edge_span(generated_start, original_start, length) {\n\treturn edge(\n\t\tgenerated_start,\n\t\tgenerated_start + length,\n\t\toriginal_start,\n\t\toriginal_start + length,\n\t\tSpanMapKind.Verbatim,\n\t);\n}\n\n/**\n * @param {number} generated_start\n * @param {number} generated_end\n * @param {number} original_start\n * @param {number} original_end\n * @param {0 | 1 | 2} kind\n * @returns {Candidate}\n */\nfunction edge(generated_start, generated_end, original_start, original_end, kind) {\n\treturn {\n\t\tgeneratedStart: generated_start,\n\t\tgeneratedEnd: generated_end,\n\t\toriginalStart: original_start,\n\t\toriginalEnd: original_end,\n\t\tkind,\n\t\tfeatures: SpanMapFeature.None,\n\t};\n}\n\n/**\n * The index of the last span that starts at or before `position`, or -1.\n * @param {readonly Candidate[]} spans Sorted by generated start.\n * @param {number} position\n */\nfunction last_span_at_or_before(spans, position) {\n\tlet low = 0;\n\tlet high = spans.length;\n\twhile (low < high) {\n\t\tconst middle = (low + high) >>> 1;\n\t\tif (spans[middle].generatedStart <= position) low = middle + 1;\n\t\telse high = middle;\n\t}\n\treturn low - 1;\n}\n\n/**\n * Give the text that follows a Verbatim span, and is identical in the generated\n * and the original file up to the next span in either file, a Verbatim span of\n * its own with no feature bits. TypeScript 7 offers no auto-import completion at\n * the end of a span that unmapped text separates from the next span, such as at\n * `helperB` in `{helperB()}<Button />`: the `<` of a tag maps with other features\n * than `helperB`, so `()}` joins neither span (#1028). The text keeps no features\n * of its neighbours, as when it was unmapped.\n * @param {Candidate[]} spans Sorted by generated start, non-overlapping.\n * @param {string} generated_text\n * @param {string} original_text\n * @returns {Candidate[]}\n */\nexport function map_identical_gaps(spans, generated_text, original_text) {\n\t/** @type {Candidate[]} */\n\tconst result = [];\n\tfor (let index = 0; index < spans.length; index++) {\n\t\tconst span = spans[index];\n\t\tresult.push(span);\n\t\tconst next = spans[index + 1];\n\t\tif (span.kind !== SpanMapKind.Verbatim || !next) continue;\n\t\tlet length = 0;\n\t\twhile (\n\t\t\tspan.generatedEnd + length < next.generatedStart &&\n\t\t\tspan.originalEnd + length < next.originalStart &&\n\t\t\tgenerated_text[span.generatedEnd + length] === original_text[span.originalEnd + length]\n\t\t) {\n\t\t\tlength++;\n\t\t}\n\t\tif (length === 0) continue;\n\t\tresult.push({\n\t\t\tgeneratedStart: span.generatedEnd,\n\t\t\tgeneratedEnd: span.generatedEnd + length,\n\t\t\toriginalStart: span.originalEnd,\n\t\t\toriginalEnd: span.originalEnd + length,\n\t\t\tkind: SpanMapKind.Verbatim,\n\t\t\tfeatures: SpanMapFeature.None,\n\t\t});\n\t}\n\treturn result;\n}\n\nconst identifier_part = /[\\p{ID_Continue}$\\u200c\\u200d]/u;\nconst token_part = /[\\p{ID_Continue}$#@\\u200c\\u200d]/u;\n\n/**\n * Whether `[start, end)` is a complete identifier in `text`: identifier\n * syntax inside and no identifier character touching either edge.\n * @param {string} text\n * @param {number} start\n * @param {number} end\n */\nfunction is_whole_identifier(text, start, end) {\n\treturn (\n\t\tidentifier_pattern.test(text.slice(start, end)) &&\n\t\t(start === 0 || !identifier_part.test(text[start - 1])) &&\n\t\t(end === text.length || !identifier_part.test(text[end]))\n\t);\n}\n\n/**\n * Whether `[start, end)` is a piece of a longer identifier in `text`:\n * identifier characters inside and an identifier character touching an edge.\n * @param {string} text\n * @param {number} start\n * @param {number} end\n */\nfunction is_partial_identifier(text, start, end) {\n\tconst slice = text.slice(start, end);\n\treturn (\n\t\tslice.length > 0 &&\n\t\t[...slice].every((character) => identifier_part.test(character)) &&\n\t\t((start > 0 && identifier_part.test(text[start - 1])) ||\n\t\t\t(end < text.length && identifier_part.test(text[end])))\n\t);\n}\n\n/**\n * Whether `[start, end)` is a complete authored token: no whitespace inside\n * and no token character (identifier characters plus the TSRX `#`/`@`\n * sigils) touching either edge.\n * @param {string} text\n * @param {number} start\n * @param {number} end\n */\nfunction is_whole_token(text, start, end) {\n\tconst slice = text.slice(start, end);\n\treturn (\n\t\tslice.length > 0 &&\n\t\t!/\\s/.test(slice) &&\n\t\t(start === 0 || !token_part.test(text[start - 1])) &&\n\t\t(end === text.length || !token_part.test(text[end]))\n\t);\n}\n\n/**\n * Sorted set of half-open intervals supporting an \"add if disjoint\" query.\n * Intervals are kept sorted by start in a plain array; a binary search finds\n * the neighbours to test, so adding is O(n) in the worst case, which is fine\n * for the few thousand spans a file produces.\n */\nclass IntervalSet {\n\t/** @type {number[]} */\n\t#starts = [];\n\t/** @type {number[]} */\n\t#ends = [];\n\n\t/**\n\t * @param {number} start\n\t * @param {number} end\n\t * @returns {boolean} Whether the interval was added (it overlapped nothing).\n\t */\n\tadd(start, end) {\n\t\tconst starts = this.#starts;\n\t\tlet low = 0;\n\t\tlet high = starts.length;\n\t\twhile (low < high) {\n\t\t\tconst middle = (low + high) >>> 1;\n\t\t\tif (starts[middle] < start) low = middle + 1;\n\t\t\telse high = middle;\n\t\t}\n\t\t// `low` is the first interval starting at or after `start`.\n\t\tif (low < starts.length && starts[low] < end) return false;\n\t\tif (low > 0 && this.#ends[low - 1] > start) return false;\n\t\tstarts.splice(low, 0, start);\n\t\tthis.#ends.splice(low, 0, end);\n\t\treturn true;\n\t}\n}\n","/** @import * as AST from 'estree' */\n/** @import {CompileError} from '@tsrx/core/types' */\n/** @import {InitializeParams, InitializeResult, OpenProjectParams, OpenProjectResult, TransformParams, TransformResult, MapperDiagnostic} from './protocol.js' */\n\nimport { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\nimport { NODE_CONFIG_HOST } from '@tsrx/typescript-plugin/src/config-host.js';\nimport { resolve_consumer_platform_for_file } from '@tsrx/typescript-plugin/src/consumer-compiler.js';\nimport { resolve_package_entry } from '@tsrx/typescript-plugin/src/package-resolution.js';\nimport {\n\tget_compiler_entry_for_file,\n\tinvalidateCompilerResolutionCaches,\n\trequire_tsrx_compiler,\n\tsource_uses_platform_flag,\n} from '@tsrx/typescript-plugin/src/language.js';\nimport { transform_tsrx } from '@tsrx/typescript-plugin/src/transform.js';\nimport { DIAGNOSTIC_SOURCE, MAPPER_CODES, TYPESCRIPT_CODE_PREFIX } from '@tsrx/core/diagnostics';\nimport { ignore_directives } from './diagnostic-directives.js';\nimport { build_export_stub } from './export-stub.js';\nimport { share_platform_globals } from './platform-globals.js';\nimport { to_span_mappings, to_verification_mappings } from './span-mappings.js';\n\nconst require = createRequire(import.meta.url);\nconst bare_package_specifier_pattern =\n\t/^(?:@[a-z0-9][a-z0-9._~-]*\\/)?[a-z0-9][a-z0-9._~-]*(?:\\/[A-Za-z0-9][A-Za-z0-9._~-]*)*$/;\n\n/**\n * The mapper entry's `options` object in tsconfig (`contentMappers[].options`)\n * or in an inferred-project contribution.\n * @typedef {object} MapperOptions\n * @property {string} [compiler] Bare package specifier of the TSRX compiler. Takes precedence over `tsrx.compiler` in the tsconfig chain.\n * @property {'web' | 'ios' | 'android'} [platform] Platform for `import.meta.env.platform` flags. Takes precedence over `tsrx.platform`.\n * @property {boolean} [languageFeatures] `false` clears every editor feature bit while keeping spans for diagnostics (CLI-only projects).\n * @property {boolean} [verificationMappings] `true` adds `verificationMappings` to each transform result: the transform's own diagnostics mappings, in Volar's shape and order, for command-line checkers. Off by default; TypeScript ignores the field.\n */\n\n/**\n * @typedef {object} ProjectState\n * @property {string | undefined} configFileName\n * @property {MapperOptions} options\n * @property {Set<string>} dependencies Files whose content affects transform output.\n * @property {Map<string, AST.Program>} lastGood Last successfully parsed source AST per file, for the compile-failure stub. Shared by every project state of a mapper (see {@link create_tsrx_content_mapper}).\n */\n\n/**\n * @typedef {object} ContentMapper\n * @property {(params: InitializeParams) => InitializeResult} initialize\n * @property {(params: OpenProjectParams) => OpenProjectResult} openProject\n * @property {(params: { projectHandle: string }) => void} closeProject\n * @property {(params: TransformParams) => TransformResult} transform\n */\n\n/**\n * Create the `.tsrx` content mapper. Each `projectHandle` owns its own state;\n * nothing is shared between projects except the process-wide compiler\n * resolution caches, which are keyed by directory and reset on every\n * `openProject`, and the last successfully parsed AST per file. The latter is\n * keyed by file name and independent of the project, and TypeScript reopens a\n * project (same or new handle) whenever its identity or a watched file\n * changes, so keeping it at the mapper level is what lets a file that still\n * fails to compile keep its export stub across a reopen.\n * The mapper needs no TypeScript of its own: tsconfig files are read and\n * compilers resolved through `@tsrx/typescript-plugin`'s own reader and\n * package walk, so the native compiler's `typescript` package (which has no\n * JavaScript API) can be the only TypeScript in a project.\n * @param {{ host?: import('@tsrx/typescript-plugin/src/config-host.js').ConfigHost }} [context]\n * @returns {ContentMapper}\n */\nexport function create_tsrx_content_mapper(context = {}) {\n\tconst host = context.host ?? NODE_CONFIG_HOST;\n\t/** @type {Map<string, ProjectState>} */\n\tconst projects = new Map();\n\t/** @type {Map<string, AST.Program>} */\n\tconst last_good = new Map();\n\t/** Transforms that arrive without a project handle. */\n\tconst standalone = create_project_state(undefined, {});\n\n\t/** @type {ContentMapper['initialize']} */\n\tfunction initialize(params) {\n\t\tif (!params.positionEncodings?.includes('utf-16')) {\n\t\t\tthrow new Error('@tsrx/content-mapper requires UTF-16 position encoding');\n\t\t}\n\t\treturn { positionEncoding: 'utf-16', diagnosticSource: DIAGNOSTIC_SOURCE };\n\t}\n\n\t/** @type {ContentMapper['openProject']} */\n\tfunction openProject(params) {\n\t\t// TypeScript reopens a project when its identity or a watched file\n\t\t// changes, which is exactly when directory-keyed discovery caches\n\t\t// (installed compilers, package manifests) may be stale.\n\t\tinvalidateCompilerResolutionCaches();\n\t\tconst { options, optionDiagnostics } = validate_options(params.options);\n\t\tconst state = create_project_state(params.configFileName || undefined, options);\n\t\tprojects.set(params.projectHandle, state);\n\n\t\t// Resolve the compiler once up front so the tsconfig chain and the\n\t\t// compiler manifest are known and can be watched.\n\t\ttry {\n\t\t\tresolve_compiler(state, probe_file_name(state));\n\t\t} catch {\n\t\t\t// Reported per file at transform time.\n\t\t}\n\n\t\tconst watchedFiles = [...state.dependencies].sort();\n\t\treturn {\n\t\t\tconfigIdentity: compute_identity(state, watchedFiles),\n\t\t\twatchedFiles,\n\t\t\t...(optionDiagnostics.length > 0 ? { optionDiagnostics } : null),\n\t\t};\n\t}\n\n\t/** @type {ContentMapper['closeProject']} */\n\tfunction closeProject(params) {\n\t\tprojects.delete(params.projectHandle);\n\t}\n\n\t/** @type {ContentMapper['transform']} */\n\tfunction transform(params) {\n\t\tconst state = params.projectHandle ? projects.get(params.projectHandle) : standalone;\n\t\tif (!state) {\n\t\t\tthrow new Error(`Unknown @tsrx/content-mapper project handle: ${params.projectHandle}`);\n\t\t}\n\t\tconst file_name = params.fileName.replace(/\\\\/g, '/');\n\t\tconst content = params.content;\n\n\t\t/** @type {import('@tsrx/typescript-plugin/src/transform.js').TSRXCompilerModule | null} */\n\t\tlet compiler;\n\t\ttry {\n\t\t\tcompiler = resolve_compiler(state, file_name);\n\t\t} catch (error) {\n\t\t\treturn failure(state, file_name, content, {\n\t\t\t\tstart: 0,\n\t\t\t\tlength: 0,\n\t\t\t\tcode: MAPPER_CODES.INVALID_CONFIG,\n\t\t\t\tmessageText: error_message(error),\n\t\t\t});\n\t\t}\n\t\tif (!compiler) {\n\t\t\treturn failure(state, file_name, content, {\n\t\t\t\tstart: 0,\n\t\t\t\tlength: 0,\n\t\t\t\tcode: MAPPER_CODES.NO_COMPILER,\n\t\t\t\tmessageText:\n\t\t\t\t\t`No TSRX compiler found for ${file_name}. Install a target compiler ` +\n\t\t\t\t\t'(for example @tsrx/react) next to the project, or select one with ' +\n\t\t\t\t\t'\"tsrx\": { \"compiler\": \"<package>\" } in tsconfig.json or ' +\n\t\t\t\t\t'\"options\": { \"compiler\": \"<package>\" } on the content mapper entry.',\n\t\t\t});\n\t\t}\n\n\t\t/** @type {'web' | 'ios' | 'android' | undefined} */\n\t\tlet platform;\n\t\ttry {\n\t\t\tplatform =\n\t\t\t\tstate.options.platform ??\n\t\t\t\tresolve_consumer_platform_for_file(file_name, {\n\t\t\t\t\tconfigFileName: state.configFileName,\n\t\t\t\t\tconfigHost: host,\n\t\t\t\t\tdependencies: state.dependencies,\n\t\t\t\t\trequirePlatformResolution: source_uses_platform_flag(content),\n\t\t\t\t});\n\t\t} catch (error) {\n\t\t\treturn failure(state, file_name, content, {\n\t\t\t\tstart: 0,\n\t\t\t\tlength: 0,\n\t\t\t\tcode: MAPPER_CODES.INVALID_CONFIG,\n\t\t\t\tmessageText: error_message(error),\n\t\t\t});\n\t\t}\n\n\t\tconst result = transform_tsrx(compiler, file_name, content, { platform });\n\t\tif (result.fatalError) {\n\t\t\t// The file has no generated code for TypeScript to check, so the error\n\t\t\t// goes to TypeScript whatever its code.\n\t\t\treturn failure(\n\t\t\t\tstate,\n\t\t\t\tfile_name,\n\t\t\t\tcontent,\n\t\t\t\tto_diagnostic(result.fatalError, content.length, MAPPER_CODES.COMPILE_ERROR),\n\t\t\t);\n\t\t}\n\t\tif (result.sourceAst) {\n\t\t\tstate.lastGood.set(file_name, result.sourceAst);\n\t\t}\n\n\t\t// The one generated output every consumer below reads, so that a rewrite of\n\t\t// the text and its mappings reaches the spans, the directives and the\n\t\t// verification mappings alike.\n\t\tconst generated = share_platform_globals(result.text, result.mappings);\n\t\tconst language_features = state.options.languageFeatures !== false;\n\t\tconst mappings = to_span_mappings(generated.mappings, generated.text, content, {\n\t\t\tlanguageFeatures: language_features,\n\t\t});\n\t\t// Every error goes to TypeScript, even one with a TypeScript code: the\n\t\t// generated code can lose the mistake (a repeated modifier, a rest\n\t\t// parameter's `?`), and then TypeScript never reports it. Where TypeScript\n\t\t// does, the directives hide its copy until the mapper's error is fixed.\n\t\t// A warning doesn't go: TypeScript shows each of the mapper's diagnostics\n\t\t// as an error, as the protocol has no severity, so `tsc` would fail on\n\t\t// code that compiles, and its directive would hide TypeScript's own\n\t\t// errors in the statement that holds it.\n\t\tconst errors = result.errors.filter((error) => error.severity !== 'warning');\n\t\tconst diagnostics = errors.map((error) =>\n\t\t\tto_diagnostic(error, content.length, MAPPER_CODES.USAGE_ERROR),\n\t\t);\n\t\tconst diagnosticDirectives = ignore_directives(\n\t\t\terrors,\n\t\t\tresult.sourceAst,\n\t\t\tgenerated.mappings,\n\t\t\tcontent.length,\n\t\t\tgenerated.text.length,\n\t\t);\n\t\treturn {\n\t\t\ttext: generated.text,\n\t\t\textension: '.tsx',\n\t\t\tmappings,\n\t\t\t...(diagnostics.length > 0 ? { diagnostics } : null),\n\t\t\t...(diagnosticDirectives ? { diagnosticDirectives } : null),\n\t\t\t...(state.options.verificationMappings\n\t\t\t\t? { verificationMappings: to_verification_mappings(generated.mappings) }\n\t\t\t\t: null),\n\t\t};\n\t}\n\n\t/**\n\t * @param {string | undefined} config_file_name\n\t * @param {MapperOptions} options\n\t * @returns {ProjectState}\n\t */\n\tfunction create_project_state(config_file_name, options) {\n\t\treturn {\n\t\t\tconfigFileName: config_file_name ? path.normalize(config_file_name) : undefined,\n\t\t\toptions,\n\t\t\tdependencies: new Set(),\n\t\t\tlastGood: last_good,\n\t\t};\n\t}\n\n\t/**\n\t * A `.tsrx` path inside the project directory, used to drive compiler\n\t * resolution before any real file is transformed.\n\t * @param {ProjectState} state\n\t */\n\tfunction probe_file_name(state) {\n\t\tconst dir = state.configFileName ? path.dirname(state.configFileName) : process.cwd();\n\t\treturn path.join(dir, '__tsrx_content_mapper_probe__.tsrx').replace(/\\\\/g, '/');\n\t}\n\n\t/**\n\t * Precedence: the mapper entry's `options.compiler` wins over `tsrx.compiler`\n\t * in the tsconfig chain, which wins over auto-detection of an installed\n\t * target compiler. Whatever is found, its `package.json` joins the watched\n\t * files so a compiler upgrade invalidates the project.\n\t * @param {ProjectState} state\n\t * @param {string} file_name\n\t * @returns {import('@tsrx/typescript-plugin/src/transform.js').TSRXCompilerModule | null}\n\t */\n\tfunction resolve_compiler(state, file_name) {\n\t\t/** @type {string | undefined} */\n\t\tlet entry;\n\t\tif (state.options.compiler !== undefined) {\n\t\t\tentry = resolve_declared_compiler(state, file_name, state.options.compiler);\n\t\t} else {\n\t\t\tentry = get_compiler_entry_for_file(file_name, {\n\t\t\t\tconfigFileName: state.configFileName,\n\t\t\t\tconfigHost: host,\n\t\t\t\tdependencies: state.dependencies,\n\t\t\t});\n\t\t}\n\t\tif (!entry) {\n\t\t\treturn null;\n\t\t}\n\t\tconst manifest = nearest_package_manifest(entry);\n\t\tif (manifest) {\n\t\t\tstate.dependencies.add(manifest);\n\t\t}\n\t\treturn require_tsrx_compiler(entry);\n\t}\n\n\t/**\n\t * @param {ProjectState} state\n\t * @param {string} file_name\n\t * @param {string} specifier\n\t * @returns {string}\n\t */\n\tfunction resolve_declared_compiler(state, file_name, specifier) {\n\t\tif (!bare_package_specifier_pattern.test(specifier)) {\n\t\t\tthrow new Error(\n\t\t\t\t`The content mapper option \"compiler\" must be a bare package specifier, got ${JSON.stringify(specifier)}.`,\n\t\t\t);\n\t\t}\n\t\tconst anchor = state.configFileName ?? file_name;\n\t\ttry {\n\t\t\treturn createRequire(anchor).resolve(specifier);\n\t\t} catch {\n\t\t\t// Node keeps a negative lookup after a package is installed; the\n\t\t\t// package walk reads manifests fresh.\n\t\t\tconst resolved = resolve_package_entry(specifier, path.dirname(anchor), { host });\n\t\t\tif (!resolved) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Unable to resolve the TSRX compiler ${JSON.stringify(specifier)} declared in the content mapper options from ${anchor}.`,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t}\n\t}\n\n\t/**\n\t * @param {ProjectState} state\n\t * @param {string[]} watched_files\n\t * @returns {string}\n\t */\n\tfunction compute_identity(state, watched_files) {\n\t\tconst hash = createHash('sha256');\n\t\thash.update(JSON.stringify(state.options));\n\t\thash.update('\\0');\n\t\tfor (const file of watched_files) {\n\t\t\thash.update(file);\n\t\t\thash.update('\\0');\n\t\t\thash.update(host.readFile(file) ?? '');\n\t\t\thash.update('\\0');\n\t\t}\n\t\treturn hash.digest('hex');\n\t}\n\n\t/**\n\t * @param {ProjectState} state\n\t * @param {string} file_name\n\t * @param {string} content\n\t * @param {MapperDiagnostic} diagnostic\n\t * @returns {TransformResult}\n\t */\n\tfunction failure(state, file_name, content, diagnostic) {\n\t\treturn {\n\t\t\ttext: build_export_stub(state.lastGood.get(file_name)),\n\t\t\textension: '.ts',\n\t\t\tmappings: [],\n\t\t\tdiagnostics: [clamp_diagnostic(diagnostic, content.length)],\n\t\t\t...(state.options.verificationMappings ? { verificationMappings: [] } : null),\n\t\t};\n\t}\n\n\treturn { initialize, openProject, closeProject, transform };\n}\n\n/**\n * @param {unknown} raw\n * @returns {{ options: MapperOptions, optionDiagnostics: NonNullable<OpenProjectResult['optionDiagnostics']> }}\n */\nexport function validate_options(raw) {\n\t/** @type {MapperOptions} */\n\tconst options = {};\n\t/** @type {NonNullable<OpenProjectResult['optionDiagnostics']>} */\n\tconst optionDiagnostics = [];\n\tif (raw === undefined || raw === null) {\n\t\treturn { options, optionDiagnostics };\n\t}\n\tif (typeof raw !== 'object' || Array.isArray(raw)) {\n\t\toptionDiagnostics.push({\n\t\t\tpath: [],\n\t\t\tmessageText: 'Content mapper options must be an object.',\n\t\t\tcode: MAPPER_CODES.INVALID_CONFIG,\n\t\t});\n\t\treturn { options, optionDiagnostics };\n\t}\n\tconst record = /** @type {Record<string, unknown>} */ (raw);\n\tfor (const key of Object.keys(record)) {\n\t\tconst value = record[key];\n\t\tswitch (key) {\n\t\t\tcase 'compiler':\n\t\t\t\tif (typeof value === 'string' && bare_package_specifier_pattern.test(value.trim())) {\n\t\t\t\t\toptions.compiler = value.trim();\n\t\t\t\t} else {\n\t\t\t\t\toptionDiagnostics.push({\n\t\t\t\t\t\tpath: [key],\n\t\t\t\t\t\tmessageText: '\"compiler\" must be a bare package specifier such as \"@tsrx/react\".',\n\t\t\t\t\t\tcode: MAPPER_CODES.INVALID_CONFIG,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'platform':\n\t\t\t\tif (value === 'web' || value === 'ios' || value === 'android') {\n\t\t\t\t\toptions.platform = value;\n\t\t\t\t} else {\n\t\t\t\t\toptionDiagnostics.push({\n\t\t\t\t\t\tpath: [key],\n\t\t\t\t\t\tmessageText: '\"platform\" must be \"web\", \"ios\", or \"android\".',\n\t\t\t\t\t\tcode: MAPPER_CODES.INVALID_CONFIG,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'languageFeatures':\n\t\t\tcase 'verificationMappings':\n\t\t\t\tif (typeof value === 'boolean') {\n\t\t\t\t\toptions[key] = value;\n\t\t\t\t} else {\n\t\t\t\t\toptionDiagnostics.push({\n\t\t\t\t\t\tpath: [key],\n\t\t\t\t\t\tmessageText: `\"${key}\" must be a boolean.`,\n\t\t\t\t\t\tcode: MAPPER_CODES.INVALID_CONFIG,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\toptionDiagnostics.push({\n\t\t\t\t\tpath: [key],\n\t\t\t\t\tmessageText: `Unknown content mapper option \"${key}\".`,\n\t\t\t\t\tcode: MAPPER_CODES.INVALID_CONFIG,\n\t\t\t\t});\n\t\t}\n\t}\n\treturn { options, optionDiagnostics };\n}\n\nconst TSRX_CODE = /^TSRX(\\d+)$/;\nconst TYPESCRIPT_CODE = /^TS(\\d+)$/;\n\n/**\n * Translate a compiler `CompileError` into a mapper diagnostic in original\n * offsets. TypeScript shows the mapper's diagnostics as `TSRX<number>`, so a\n * TSRX code goes as its number (`TSRX2002` → `2002`) and a TypeScript code as\n * `TYPESCRIPT_CODE_PREFIX` then its number (`TS1005` → `111005`), which keeps\n * the code in the message too. An error without either uses `fallback_code`\n * and keeps any other code in the message.\n * @param {CompileError} error\n * @param {number} content_length\n * @param {number} fallback_code\n * @returns {MapperDiagnostic}\n */\nexport function to_diagnostic(error, content_length, fallback_code) {\n\tconst start = typeof error.pos === 'number' ? error.pos : 0;\n\tconst end = typeof error.end === 'number' && error.end > start ? error.end : start + 1;\n\tconst code = typeof error.code === 'string' ? error.code : '';\n\tconst tsrx = TSRX_CODE.exec(code);\n\tconst typescript = TYPESCRIPT_CODE.exec(code);\n\tconst message = String(error.message ?? error);\n\treturn clamp_diagnostic(\n\t\t{\n\t\t\tstart,\n\t\t\tlength: end - start,\n\t\t\tcode: tsrx\n\t\t\t\t? Number(tsrx[1])\n\t\t\t\t: typescript\n\t\t\t\t\t? Number(`${TYPESCRIPT_CODE_PREFIX}${typescript[1]}`)\n\t\t\t\t\t: fallback_code,\n\t\t\tmessageText: code && !tsrx ? `${message} [${code}]` : message,\n\t\t},\n\t\tcontent_length,\n\t);\n}\n\n/**\n * @param {MapperDiagnostic} diagnostic\n * @param {number} content_length\n * @returns {MapperDiagnostic}\n */\nfunction clamp_diagnostic(diagnostic, content_length) {\n\tconst start = Math.max(0, Math.min(diagnostic.start, content_length));\n\tconst end = Math.max(start, Math.min(diagnostic.start + diagnostic.length, content_length));\n\treturn { ...diagnostic, start, length: end - start };\n}\n\n/**\n * @param {unknown} error\n * @returns {string}\n */\nfunction error_message(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n\n/**\n * The `package.json` that owns a compiler entry file, stopping at a\n * `node_modules` boundary.\n * @param {string} entry\n * @returns {string | undefined}\n */\nfunction nearest_package_manifest(entry) {\n\tlet dir = path.dirname(entry);\n\twhile (dir) {\n\t\tconst candidate = path.join(dir, 'package.json');\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tif (path.basename(dir) === 'node_modules') return undefined;\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) return undefined;\n\t\tdir = parent;\n\t}\n\treturn undefined;\n}\n\nexport { require };\n"],"x_google_ignoreList":[1,7,8,9,10,11,12,13,14,15],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAS,mCAAmC;CAC3C,MAAM,WAAW,cAAc,YAAY,GAAG;CAC9C,MAAM,UAAU,SAAS,QAAQ,cAAc,WAC9C,WAAW,OAAO,YAAY,IAAI,OAAO,YAAY,IAAI,OAAO,YAAY,CAC7E;CACA,IAAI,YAAY,UACf,OAAO;CAER,OAAO,CAAC,GAAG,WAAW,OAAO;AAC9B;;AAGA,IAAI;;AAGJ,SAAgB,gCAAgC;CAC/C,8BAA8B,iCAAiC;CAC/D,OAAO;AACR;;;;;AAMA,SAAS,KAAK,WAAW;CACxB,IAAI;EACH,OAAO,GAAG,SAAS,WAAW,EAAE,gBAAgB,MAAM,CAAC;CACxD,QAAQ;EACP;CACD;AACD;;AAGA,SAAgB,qBAAqB;CACpC,OAAO;EACN,aAAa,cAAc,KAAK,SAAS,CAAC,EAAE,OAAO,MAAM;EACzD,kBAAkB,mBAAmB,KAAK,cAAc,CAAC,EAAE,YAAY,MAAM;EAC7E,WAAW,cAAc;GACxB,IAAI;IACH,OAAO,GAAG,aAAa,WAAW,MAAM;GACzC,QAAQ;IACP;GACD;EACD;EACA,2BAA2B;EAC3B,kBAAkB,cAAc,KAAK,SAAS,CAAC,EAAE;EACjD,WAAW,cAAc;GACxB,IAAI;IACH,OAAO,GAAG,aAAa,SAAS;GACjC,QAAQ;IACP,OAAO;GACR;EACD;CACD;AACD;;AAGA,MAAa,mBAAmB,mBAAmB;;;;ACrFnD,MAAM,KAAE,MAAG,MAAI,QAAM,OAAO,KAAG;MAAS,KAAG,GAAE,MAAI,OAAO,uBAAO,IAAI,MAAM,IAAI,EAAE,KAAK,GAAG,GAAE,EAAC,MAAK,EAAC,CAAC;MAAE,IAAE;MAA6B,IAAE;MAA6B,IAAE;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