@analogjs/vite-plugin-angular 3.0.0-alpha.98 → 3.0.0-beta.1

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.
Files changed (90) hide show
  1. package/migrations/migrate-setup-vitest/migrate-setup-vitest.js.map +1 -1
  2. package/migrations/update-3-0-0/migrate-setup-vitest.js +3 -2
  3. package/migrations/update-3-0-0/migrate-setup-vitest.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/lib/analog-plugin-interop.js +1 -1
  6. package/src/lib/analog-plugin-interop.js.map +1 -1
  7. package/src/lib/angular-build-optimizer-plugin.js +1 -1
  8. package/src/lib/angular-build-optimizer-plugin.js.map +1 -1
  9. package/src/lib/angular-jit-plugin.js +3 -4
  10. package/src/lib/angular-jit-plugin.js.map +1 -1
  11. package/src/lib/angular-vite-plugin.js +11 -8
  12. package/src/lib/angular-vite-plugin.js.map +1 -1
  13. package/src/lib/angular-vitest-plugin.js +1 -1
  14. package/src/lib/angular-vitest-plugin.js.map +1 -1
  15. package/src/lib/compilation-api/compilation-api-plugin.js +6 -5
  16. package/src/lib/compilation-api/compilation-api-plugin.js.map +1 -1
  17. package/src/lib/compilation-api/index.js +2 -1
  18. package/src/lib/compiler/angular-version.js +1 -1
  19. package/src/lib/compiler/angular-version.js.map +1 -1
  20. package/src/lib/compiler/class-field-lowering.js.map +1 -1
  21. package/src/lib/compiler/compile.js +24 -22
  22. package/src/lib/compiler/compile.js.map +1 -1
  23. package/src/lib/compiler/constants.js +4 -4
  24. package/src/lib/compiler/constants.js.map +1 -1
  25. package/src/lib/compiler/debug.js.map +1 -1
  26. package/src/lib/compiler/defer.js +1 -1
  27. package/src/lib/compiler/defer.js.map +1 -1
  28. package/src/lib/compiler/dts-reader.js +1 -1
  29. package/src/lib/compiler/dts-reader.js.map +1 -1
  30. package/src/lib/compiler/hmr.js.map +1 -1
  31. package/src/lib/compiler/index.js +9 -8
  32. package/src/lib/compiler/jit-metadata.d.ts +2 -0
  33. package/src/lib/compiler/jit-metadata.js +9 -4
  34. package/src/lib/compiler/jit-metadata.js.map +1 -1
  35. package/src/lib/compiler/jit-transform.js +60 -34
  36. package/src/lib/compiler/jit-transform.js.map +1 -1
  37. package/src/lib/compiler/js-emitter.js +2 -4
  38. package/src/lib/compiler/js-emitter.js.map +1 -1
  39. package/src/lib/compiler/metadata.js +26 -18
  40. package/src/lib/compiler/metadata.js.map +1 -1
  41. package/src/lib/compiler/registry.js.map +1 -1
  42. package/src/lib/compiler/resource-inliner.js.map +1 -1
  43. package/src/lib/compiler/style-ast.js.map +1 -1
  44. package/src/lib/compiler/type-elision.js +2 -2
  45. package/src/lib/compiler/type-elision.js.map +1 -1
  46. package/src/lib/compiler/utils.js +7 -5
  47. package/src/lib/compiler/utils.js.map +1 -1
  48. package/src/lib/compiler-plugin.js +7 -0
  49. package/src/lib/compiler-plugin.js.map +1 -1
  50. package/src/lib/component-resolvers.js +1 -1
  51. package/src/lib/component-resolvers.js.map +1 -1
  52. package/src/lib/encapsulation-plugin.js +3 -2
  53. package/src/lib/encapsulation-plugin.js.map +1 -1
  54. package/src/lib/fast-compile-plugin.js +3 -2
  55. package/src/lib/fast-compile-plugin.js.map +1 -1
  56. package/src/lib/host.js.map +1 -1
  57. package/src/lib/hot-update-batch.js +1 -1
  58. package/src/lib/hot-update-batch.js.map +1 -1
  59. package/src/lib/live-reload-plugin.js.map +1 -1
  60. package/src/lib/nx-folder-plugin.js.map +1 -1
  61. package/src/lib/plugins/file-replacements.plugin.js.map +1 -1
  62. package/src/lib/router-plugin.js.map +1 -1
  63. package/src/lib/style-preprocessor.js.map +1 -1
  64. package/src/lib/stylesheet-registry.js.map +1 -1
  65. package/src/lib/tools/src/builders/vite/vite-build.impl.js +2 -1
  66. package/src/lib/tools/src/builders/vite/vite-build.impl.js.map +1 -1
  67. package/src/lib/tools/src/builders/vite-dev-server/dev-server.impl.js +2 -1
  68. package/src/lib/tools/src/builders/vite-dev-server/dev-server.impl.js.map +1 -1
  69. package/src/lib/utils/compilation-shared.js.map +1 -1
  70. package/src/lib/utils/css-extension-resolver.js.map +1 -1
  71. package/src/lib/utils/css-preprocessor-workers.js.map +1 -1
  72. package/src/lib/utils/debug-harness.js.map +1 -1
  73. package/src/lib/utils/debug-log-file.js +2 -1
  74. package/src/lib/utils/debug-log-file.js.map +1 -1
  75. package/src/lib/utils/debug.js.map +1 -1
  76. package/src/lib/utils/devkit.js +1 -1
  77. package/src/lib/utils/devkit.js.map +1 -1
  78. package/src/lib/utils/jit-inline-styles.d.ts +3 -2
  79. package/src/lib/utils/jit-inline-styles.js +9 -5
  80. package/src/lib/utils/jit-inline-styles.js.map +1 -1
  81. package/src/lib/utils/plugin-config.js.map +1 -1
  82. package/src/lib/utils/rolldown.js.map +1 -1
  83. package/src/lib/utils/safe-module-paths.js.map +1 -1
  84. package/src/lib/utils/transform-cache.js.map +1 -1
  85. package/src/lib/utils/tsconfig-resolver.js +2 -1
  86. package/src/lib/utils/tsconfig-resolver.js.map +1 -1
  87. package/src/lib/utils/virtual-ids.js.map +1 -1
  88. package/src/lib/utils/virtual-resources.js.map +1 -1
  89. package/src/lib/virtual-modules-plugin.js +4 -1
  90. package/src/lib/virtual-modules-plugin.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"js-emitter.js","names":[],"sources":["../../../../src/lib/compiler/js-emitter.ts"],"sourcesContent":["import * as ts from 'typescript';\nimport * as o from '@angular/compiler';\n\n/** Shared printer — only used as fallback for complex WrappedNodeExpr (e.g. decorator args). */\nconst sharedPrinter = ts.createPrinter({ removeComments: true });\nconst emptySourceFile = ts.createSourceFile(\n '_.ts',\n '',\n ts.ScriptTarget.Latest,\n false,\n);\n\n// Operator metadata table — name, JS string, and precedence (higher = tighter\n// binding). Used to build version-aware lookup maps below.\n//\n// Why a runtime build instead of static `[o.BinaryOperator.Equals]: '=='`\n// literals: Angular's `BinaryOperator` enum gains members between major\n// versions (Assign and the 9 compound assignments were added in v21,\n// Exponentiation/In in v20, InstanceOf in v21). On older Angular versions\n// the missing members evaluate to `undefined` at module load time, and\n// every `[undefined]: '...'` entry collides on the single string key\n// `\"undefined\"` — last write wins. Pre-Phase-1, that gave the v19 install\n// `BINARY_OP_STR[\"undefined\"] === '??='`, so any expression with an\n// unknown operator emitted `??=` instead of failing loudly. Building the\n// table by iterating known names and skipping `undefined` values\n// eliminates the collision: members that don't exist on the installed\n// Angular are simply absent from the map.\n//\n// Precedence values match MDN's table, skipping levels not used by Angular\n// (bitwise XOR, shifts).\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence\nconst OP_DEFINITIONS: ReadonlyArray<\n readonly [name: string, str: string, precedence: number]\n> = [\n ['Assign', '=', 2],\n ['AdditionAssignment', '+=', 2],\n ['SubtractionAssignment', '-=', 2],\n ['MultiplicationAssignment', '*=', 2],\n ['DivisionAssignment', '/=', 2],\n ['RemainderAssignment', '%=', 2],\n ['ExponentiationAssignment', '**=', 2],\n ['AndAssignment', '&&=', 2],\n ['OrAssignment', '||=', 2],\n ['NullishCoalesceAssignment', '??=', 2],\n ['NullishCoalesce', '??', 4],\n ['Or', '||', 4],\n ['And', '&&', 5],\n ['BitwiseOr', '|', 6],\n ['BitwiseAnd', '&', 8],\n ['Equals', '==', 9],\n ['NotEquals', '!=', 9],\n ['Identical', '===', 9],\n ['NotIdentical', '!==', 9],\n ['Lower', '<', 10],\n ['LowerEquals', '<=', 10],\n ['Bigger', '>', 10],\n ['BiggerEquals', '>=', 10],\n ['In', 'in', 10],\n ['InstanceOf', 'instanceof', 10],\n ['Plus', '+', 12],\n ['Minus', '-', 12],\n ['Multiply', '*', 13],\n ['Divide', '/', 13],\n ['Modulo', '%', 13],\n ['Exponentiation', '**', 14],\n];\n\n/** Operator integer values that represent assignment forms (`=`, `+=`, etc.). */\nconst ASSIGNMENT_OP_NAMES: ReadonlySet<string> = new Set([\n 'Assign',\n 'AdditionAssignment',\n 'SubtractionAssignment',\n 'MultiplicationAssignment',\n 'DivisionAssignment',\n 'RemainderAssignment',\n 'ExponentiationAssignment',\n 'AndAssignment',\n 'OrAssignment',\n 'NullishCoalesceAssignment',\n]);\n\nconst BINARY_OP_STR = new Map<number, string>();\nconst BINARY_PRECEDENCE = new Map<number, number>();\nconst ASSIGNMENT_OP_VALUES = new Set<number>();\n\nfor (const [name, str, precedence] of OP_DEFINITIONS) {\n const value = (o.BinaryOperator as Record<string, unknown>)[name];\n if (typeof value !== 'number') continue;\n BINARY_OP_STR.set(value, str);\n BINARY_PRECEDENCE.set(value, precedence);\n if (ASSIGNMENT_OP_NAMES.has(name)) {\n ASSIGNMENT_OP_VALUES.add(value);\n }\n}\n\nconst UNARY_OP_STR = new Map<number, string>();\n\nfor (const [name, str] of [\n ['Plus', '+'],\n ['Minus', '-'],\n ['Increment', '++'],\n ['Decrement', '--'],\n] as const) {\n const value = (o.UnaryOperator as Record<string, unknown>)[name];\n if (typeof value !== 'number') continue;\n UNARY_OP_STR.set(value, str);\n}\n\n/** Returns true when `op` represents any kind of assignment (`=`, `+=`, etc.). */\nfunction isAssignmentOperator(op: o.BinaryOperator): boolean {\n return ASSIGNMENT_OP_VALUES.has(op);\n}\n\n/**\n * Determine whether a child expression needs parentheses when it appears\n * as an operand of `parentOp`.\n */\nfunction childNeedsParens(\n parentOp: o.BinaryOperator,\n child: o.Expression,\n isRhs: boolean,\n): boolean {\n if (!(child instanceof o.BinaryOperatorExpr)) return false;\n\n const childOp = child.operator;\n const parentPrec = BINARY_PRECEDENCE.get(parentOp);\n const childPrec = BINARY_PRECEDENCE.get(childOp);\n if (parentPrec === undefined || childPrec === undefined) return false;\n\n // ?? cannot appear with || or && without explicit grouping (JS spec)\n if (\n (parentOp === o.BinaryOperator.NullishCoalesce &&\n (childOp === o.BinaryOperator.And || childOp === o.BinaryOperator.Or)) ||\n (childOp === o.BinaryOperator.NullishCoalesce &&\n (parentOp === o.BinaryOperator.And || parentOp === o.BinaryOperator.Or))\n ) {\n return true;\n }\n\n // Child has strictly lower precedence\n if (childPrec < parentPrec) return true;\n\n // Same precedence — depends on associativity and position\n if (childPrec === parentPrec) {\n // ** is right-associative: LHS same-prec needs parens, RHS does not\n if (parentOp === o.BinaryOperator.Exponentiation) return !isRhs;\n // All other ops are left-associative: RHS same-prec needs parens\n return isRhs;\n }\n\n return false;\n}\n\n/**\n * Wrap a receiver expression in parens when emitting `<receiver>.name` or\n * `<receiver>.name(args)`. Two cases produce a JS parse error otherwise:\n *\n * 1. A `BinaryOperatorExpr` receiver: `a / 3600.toFixed(2)` parses as\n * `a / 3600.toFixed(2)` where `3600.toFixed` is read as the start of a\n * decimal literal followed by an identifier — an \"Invalid characters\n * after number\" error. Wrapping gives `(a / 3600).toFixed(2)`.\n * 2. A non-negative integer `LiteralExpr` receiver: `42.toFixed(2)` is\n * invalid for the same decimal-literal-ambiguity reason. Wrapping gives\n * `(42).toFixed(2)`. Negative numbers are already emitted as `(-42)` by\n * `visitLiteralExpr`. Floats (e.g. `4.5.toFixed`) and strings parse fine.\n *\n * Other expression kinds either already self-wrap (`ConditionalExpr`,\n * `UnaryOperatorExpr`) or are primary forms that don't need parens\n * (`ReadVarExpr`, `ReadPropExpr`, `InvokeFunctionExpr`, etc.).\n */\nfunction emitReceiverForMemberAccess(\n receiver: o.Expression,\n emitted: string,\n): string {\n if (receiver instanceof o.BinaryOperatorExpr) return '(' + emitted + ')';\n if (\n receiver instanceof o.LiteralExpr &&\n typeof receiver.value === 'number' &&\n receiver.value >= 0\n ) {\n return '(' + emitted + ')';\n }\n return emitted;\n}\n\n/** Polyfill for `__makeTemplateObject` used in downleveled `$localize` calls. */\nconst MAKE_TEMPLATE_OBJECT_POLYFILL =\n '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,\"raw\",{value:t}):e.raw=t,e})';\n\nconst SINGLE_QUOTE_ESCAPE_RE = /[\\\\'\\n\\r]/g;\n\n/** Escape a string for use as a single-quoted string literal. */\nfunction escapeForLocalize(input: string): string {\n const body = input.replace(SINGLE_QUOTE_ESCAPE_RE, (match) => {\n if (match === '\\n') return '\\\\n';\n if (match === '\\r') return '\\\\r';\n return `\\\\${match}`;\n });\n return `'${body}'`;\n}\n\n/**\n * Emits Angular output AST directly to JavaScript strings, bypassing\n * ts.factory node creation and ts.Printer serialization (~4x faster).\n */\nclass JSEmitter implements o.ExpressionVisitor, o.StatementVisitor {\n /** Set by compile() so WrappedNodeExpr fallback can print with correct source context. */\n static _currentSourceFile: ts.SourceFile | undefined;\n /** Set by compile() so OXC-based WrappedNodeExpr can slice original source. */\n static _currentSourceCode: string | undefined;\n\n private emitExpr(e: any): string {\n if (!e) return 'null';\n if (typeof e.visitExpression === 'function')\n return e.visitExpression(this, null);\n // Angular v21 LiteralMapPropertyAssignment: {key, value, quoted}\n if ('key' in e && 'value' in e) {\n const key = e.quoted ? JSON.stringify(e.key) : e.key;\n return key + ': ' + this.emitExpr(e.value);\n }\n return 'null';\n }\n visitWrappedNodeExpr(ast: o.WrappedNodeExpr<any>) {\n const node = ast.node;\n\n // Raw source text: already resolved to a string at wrap time\n if (typeof node === 'string') return node;\n\n // OXC AST nodes: identified by string `type` property + numeric start/end\n if (typeof node.type === 'string' && typeof node.start === 'number') {\n const src = JSEmitter._currentSourceCode;\n if (node.type === 'Identifier') return node.name;\n if (node.type === 'StringLiteral') return JSON.stringify(node.value);\n if (node.type === 'NumericLiteral') return String(node.value);\n if (node.type === 'BooleanLiteral') return node.value ? 'true' : 'false';\n if (node.type === 'NullLiteral') return 'null';\n if (node.type === 'TemplateLiteral' && !node.expressions?.length)\n return '`' + node.quasis[0].value.raw + '`';\n // Fallback: slice original source for complex OXC nodes\n if (src) return src.slice(node.start, node.end);\n return 'null';\n }\n\n // TypeScript AST nodes: identified by numeric `kind` property\n if (node.kind === ts.SyntaxKind.Identifier)\n return (node as ts.Identifier).escapedText as string;\n if (node.kind === ts.SyntaxKind.StringLiteral)\n return JSON.stringify((node as ts.StringLiteral).text);\n if (node.kind === ts.SyntaxKind.NumericLiteral)\n return (node as ts.NumericLiteral).text;\n if (node.kind === ts.SyntaxKind.TrueKeyword) return 'true';\n if (node.kind === ts.SyntaxKind.FalseKeyword) return 'false';\n if (node.kind === ts.SyntaxKind.NullKeyword) return 'null';\n if (node.kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral)\n return '`' + (node as ts.NoSubstitutionTemplateLiteral).text + '`';\n // Fallback for complex wrapped TS nodes (e.g. decorator arguments, array literals).\n // Use currentSourceFile when available for correct position-based printing.\n return sharedPrinter.printNode(\n ts.EmitHint.Unspecified,\n node,\n JSEmitter._currentSourceFile || emptySourceFile,\n );\n }\n visitExternalExpr(ast: o.ExternalExpr) {\n const name = ast.value.name;\n if (name === 'ngDevMode') return name;\n // When name is null/undefined, this is a bare module reference (e.g. ngImport: i0)\n if (!name) return 'i0';\n return 'i0.' + name;\n }\n visitLiteralExpr(ast: o.LiteralExpr) {\n const v = ast.value;\n if (typeof v === 'string') return JSON.stringify(v);\n if (typeof v === 'number') return v < 0 ? '(-' + -v + ')' : '' + v;\n if (typeof v === 'boolean') return v ? 'true' : 'false';\n if (v === undefined) return 'void 0';\n return 'null';\n }\n visitLiteralArrayExpr(ast: o.LiteralArrayExpr) {\n return '[' + ast.entries.map((e) => this.emitExpr(e)).join(', ') + ']';\n }\n visitLiteralMapExpr(ast: o.LiteralMapExpr) {\n return '{' + ast.entries.map((e) => this.emitExpr(e)).join(', ') + '}';\n }\n visitInvokeFunctionExpr(ast: o.InvokeFunctionExpr) {\n const fn = ast.fn.visitExpression(this, null);\n const args = ast.args.map((a: any) => this.emitExpr(a)).join(', ');\n // Wrap arrow/function expressions in parens for valid IIFE syntax. A\n // `WrappedNodeExpr` callee is a raw user expression (e.g. an\n // `@Injectable({ useFactory: (a, b) => … })` arrow); without parens the\n // argument list binds to the arrow's *body* (`… => new X(a, b)(args)`)\n // instead of invoking the arrow. Parenthesizing any wrapped callee is\n // always semantically safe.\n const call = ast.isOptional ? '?.(' : '(';\n\n if (\n ast.fn instanceof o.ArrowFunctionExpr ||\n ast.fn instanceof o.FunctionExpr ||\n ast.fn instanceof o.WrappedNodeExpr\n ) {\n return '(' + fn + ')' + call + args + ')';\n }\n return fn + call + args + ')';\n }\n visitReadVarExpr(ast: o.ReadVarExpr) {\n if (ast.name === 'this') return 'this';\n if (ast.name === 'super') return 'super';\n return ast.name!;\n }\n visitReadPropExpr(ast: o.ReadPropExpr) {\n const receiver = ast.receiver.visitExpression(this, null);\n return (\n emitReceiverForMemberAccess(ast.receiver, receiver) +\n (ast.isOptional ? '?.' : '.') +\n ast.name\n );\n }\n visitReadKeyExpr(ast: o.ReadKeyExpr) {\n const receiver = ast.receiver.visitExpression(this, null);\n return (\n emitReceiverForMemberAccess(ast.receiver, receiver) +\n (ast.isOptional ? '?.[' : '[') +\n ast.index.visitExpression(this, null) +\n ']'\n );\n }\n visitConditionalExpr(ast: o.ConditionalExpr) {\n return (\n '(' +\n ast.condition.visitExpression(this, null) +\n ' ? ' +\n ast.trueCase.visitExpression(this, null) +\n ' : ' +\n ast.falseCase!.visitExpression(this, null) +\n ')'\n );\n }\n visitBinaryOperatorExpr(ast: o.BinaryOperatorExpr) {\n // `BINARY_OP_STR.get(...)` returns `undefined` when the operator value\n // doesn't exist in the installed Angular's `BinaryOperator` enum (the\n // enum is missing 13 members on v19, 11 on v20). Falling back to `'='`\n // would silently produce wrong code; instead, we throw so the error\n // surfaces in the DEBUG output and the calling test fails loudly.\n const op = BINARY_OP_STR.get(ast.operator);\n if (op === undefined) {\n throw new Error(\n `[fast-compile] Unsupported BinaryOperator value ${ast.operator} ` +\n `on @angular/compiler ${o.VERSION?.full ?? '(unknown version)'}`,\n );\n }\n\n const lhsRaw = ast.lhs.visitExpression(this, null);\n const rhsRaw = ast.rhs.visitExpression(this, null);\n\n const lhs = childNeedsParens(ast.operator, ast.lhs, false)\n ? '(' + lhsRaw + ')'\n : lhsRaw;\n const rhs = childNeedsParens(ast.operator, ast.rhs, true)\n ? '(' + rhsRaw + ')'\n : rhsRaw;\n\n const expr = lhs + ' ' + op + ' ' + rhs;\n\n // Wrap assignments in parens so they work correctly as ternary conditions:\n // (tmp = val) ? a : b vs tmp = val ? a : b\n //\n // `isAssignmentOperator` is built at module load time from the operator\n // names that actually exist on the installed Angular's enum. This\n // works whether `Assign` is present (v21+) or absent (v19/v20) — on\n // older versions the assignment branch is simply unreachable because\n // Angular's compiler never constructs an Assign-operator expression.\n if (isAssignmentOperator(ast.operator)) {\n return '(' + expr + ')';\n }\n return expr;\n }\n visitNotExpr(ast: o.NotExpr) {\n return '!(' + ast.condition.visitExpression(this, null) + ')';\n }\n visitFunctionExpr(ast: o.FunctionExpr) {\n return (\n '(' +\n ast.params.map((p: any) => p.name).join(', ') +\n ') => {' +\n ast.statements.map((s: any) => s.visitStatement(this, null)).join(' ') +\n '}'\n );\n }\n visitArrowFunctionExpr(ast: o.ArrowFunctionExpr) {\n const params = '(' + ast.params.map((p: any) => p.name).join(', ') + ')';\n if (Array.isArray(ast.body))\n return (\n params +\n ' => {' +\n ast.body.map((s: any) => s.visitStatement(this, null)).join(' ') +\n '}'\n );\n const bodyExpr = (ast.body as o.Expression).visitExpression(this, null);\n // Wrap object literals in parens so `() => {key: val}` isn't parsed\n // as a block with a labeled statement.\n if (ast.body instanceof o.LiteralMapExpr) {\n return params + ' => (' + bodyExpr + ')';\n }\n return params + ' => ' + bodyExpr;\n }\n // `Write*Expr` visitors must wrap the assignment in parentheses so that\n // it composes correctly when nested inside higher-precedence parents\n // (e.g. as the test of a `ConditionalExpr`). Without the wrapping,\n // tmp = ctx.data() ? 0 : -1\n // parses as `tmp = (ctx.data() ? 0 : -1)` because assignment binds\n // looser than the ternary, which silently assigns the wrong value to\n // `tmp`. Angular's own `AbstractEmitterVisitor.visitWriteVarExpr`\n // applies the same context-sensitive wrapping (it skips the parens\n // when the assignment is a top-level statement to avoid `(x = 1);`\n // noise; we always wrap for simplicity — the redundant parens at\n // statement level are harmless).\n //\n // This matters specifically on Angular v19/v20, where assignment is\n // represented in the IR via `WriteVarExpr` / `AssignTemporaryExpr →\n // WriteVarExpr`. On v21+ the same construct is represented via\n // `BinaryOperatorExpr(Assign, ...)`, which `visitBinaryOperatorExpr`\n // already wraps via `isAssignmentOperator`. Without these wrappers,\n // `@if (data(); as item)` and similar conditional alias forms emit\n // runtime-broken code on v19/v20.\n visitWriteVarExpr(ast: any) {\n return '(' + ast.name + ' = ' + ast.value.visitExpression(this, null) + ')';\n }\n visitWritePropExpr(ast: any) {\n return (\n '(' +\n ast.receiver.visitExpression(this, null) +\n '.' +\n ast.name +\n ' = ' +\n ast.value.visitExpression(this, null) +\n ')'\n );\n }\n visitWriteKeyExpr(ast: any) {\n return (\n '(' +\n ast.receiver.visitExpression(this, null) +\n '[' +\n ast.index.visitExpression(this, null) +\n '] = ' +\n ast.value.visitExpression(this, null) +\n ')'\n );\n }\n visitInvokeMethodExpr(ast: any) {\n const receiver = ast.receiver.visitExpression(this, null);\n return (\n emitReceiverForMemberAccess(ast.receiver, receiver) +\n '.' +\n ast.name +\n '(' +\n ast.args.map((a: any) => this.emitExpr(a)).join(', ') +\n ')'\n );\n }\n visitTypeofExpr(ast: o.TypeofExpr) {\n return 'typeof ' + ast.expr.visitExpression(this, null);\n }\n visitUnaryOperatorExpr(ast: o.UnaryOperatorExpr) {\n const op = UNARY_OP_STR.get(ast.operator);\n if (op === undefined) {\n throw new Error(\n `[fast-compile] Unsupported UnaryOperator value ${ast.operator} ` +\n `on @angular/compiler ${o.VERSION?.full ?? '(unknown version)'}`,\n );\n }\n\n const operand = '(' + ast.expr.visitExpression(this, null) + ')';\n const isPostfix = 'isPrefix' in ast && ast.isPrefix === false;\n return '(' + (isPostfix ? operand + op : op + operand) + ')';\n }\n visitInstantiateExpr(ast: o.InstantiateExpr) {\n return (\n 'new (' +\n ast.classExpr.visitExpression(this, null) +\n ')(' +\n ast.args.map((a: any) => this.emitExpr(a)).join(', ') +\n ')'\n );\n }\n visitCommaExpr(ast: o.CommaExpr) {\n return ast.parts.map((p: any) => p.visitExpression(this, null)).join(', ');\n }\n visitParenthesizedExpr(ast: o.ParenthesizedExpr) {\n return '(' + ast.expr.visitExpression(this, null) + ')';\n }\n visitVoidExpr(ast: o.VoidExpr) {\n return 'void ' + ast.expr.visitExpression(this, null);\n }\n visitSpreadElementExpr(ast: o.SpreadElementExpr) {\n return '...' + (ast as any).expression.visitExpression(this, null);\n }\n visitDynamicImportExpr(ast: o.DynamicImportExpr) {\n return (\n 'import(' +\n (typeof ast.url === 'string'\n ? JSON.stringify(ast.url)\n : ast.url.visitExpression(this, null)) +\n ')'\n );\n }\n visitTemplateLiteralExpr(ast: o.TemplateLiteralExpr) {\n return (\n '`' +\n ast.elements[0].text +\n ast.expressions\n .map(\n (e: any, i: number) =>\n '${' +\n e.visitExpression(this, null) +\n '}' +\n ast.elements[i + 1].text,\n )\n .join('') +\n '`'\n );\n }\n visitTaggedTemplateLiteralExpr(ast: any) {\n const elements = ast.template.elements;\n const expressions = ast.template.expressions;\n const head = elements[0].text;\n const spans = expressions\n .map(\n (e: any, i: number) =>\n '${' + e.visitExpression(this, null) + '}' + elements[i + 1].text,\n )\n .join('');\n return ast.tag.visitExpression(this, null) + '`' + head + spans + '`';\n }\n visitLocalizedString(ast: o.LocalizedString) {\n // Emit the downleveled form:\n // $localize(makeTemplateObject(cooked, raw), expr1, expr2, ...)\n const parts: { cooked: string; raw: string }[] = [ast.serializeI18nHead()];\n for (let i = 1; i < ast.messageParts.length; i++) {\n parts.push(ast.serializeI18nTemplatePart(i));\n }\n const cooked = parts.map((p) => escapeForLocalize(p.cooked)).join(', ');\n const raw = parts.map((p) => escapeForLocalize(p.raw)).join(', ');\n const exprs = ast.expressions.map((e) => this.emitExpr(e));\n return (\n '$localize(' +\n MAKE_TEMPLATE_OBJECT_POLYFILL +\n '([' +\n cooked +\n '], [' +\n raw +\n '])' +\n (exprs.length > 0 ? ', ' + exprs.join(', ') : '') +\n ')'\n );\n }\n visitRegularExpressionLiteral(ast: any) {\n return '/' + (ast.body ?? ast.pattern) + '/' + ast.flags;\n }\n visitTemplateLiteralElementExpr(ast: o.TemplateLiteralElementExpr) {\n return JSON.stringify(ast.text);\n }\n // Statement visitors\n visitReturnStmt(stmt: o.ReturnStatement) {\n return 'return ' + stmt.value.visitExpression(this, null) + ';';\n }\n visitExpressionStmt(stmt: o.ExpressionStatement) {\n return stmt.expr.visitExpression(this, null) + ';';\n }\n visitIfStmt(stmt: o.IfStmt) {\n let s =\n 'if (' +\n stmt.condition.visitExpression(this, null) +\n ') {' +\n stmt.trueCase.map((s2: any) => s2.visitStatement(this, null)).join(' ') +\n '}';\n if (stmt.falseCase.length)\n s +=\n ' else {' +\n stmt.falseCase\n .map((s2: any) => s2.visitStatement(this, null))\n .join(' ') +\n '}';\n return s;\n }\n visitDeclareVarStmt(stmt: o.DeclareVarStmt) {\n const kw = stmt.hasModifier(o.StmtModifier.Final) ? 'const' : 'let';\n return (\n kw +\n ' ' +\n stmt.name +\n (stmt.value ? ' = ' + stmt.value.visitExpression(this, null) : '') +\n ';'\n );\n }\n visitDeclareFunctionStmt(stmt: o.DeclareFunctionStmt) {\n return (\n 'function ' +\n stmt.name +\n '(' +\n stmt.params.map((p: any) => p.name).join(', ') +\n ') {' +\n stmt.statements.map((s: any) => s.visitStatement(this, null)).join(' ') +\n '}'\n );\n }\n}\n\nconst stringEmitter = new JSEmitter();\n\n/** Emit Angular output AST expression directly to a JavaScript string. */\nexport function emitAngularExpr(expr: o.Expression): string {\n return expr.visitExpression(stringEmitter, null);\n}\n\n/** Emit Angular output AST statement directly to a JavaScript string. */\nexport function emitAngularStmt(stmt: o.Statement): string {\n return stmt.visitStatement(stringEmitter, null);\n}\n\n/** Set the current source file for WrappedNodeExpr fallback printing. */\nexport function setEmitterSourceFile(sf: ts.SourceFile | undefined): void {\n JSEmitter._currentSourceFile = sf;\n}\n\n/** Set the current source code for OXC-based WrappedNodeExpr slice fallback. */\nexport function setEmitterSourceCode(code: string | undefined): void {\n JSEmitter._currentS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;AACvC,SAAO,YAAY,KAAK,MAAM,gBAAgB,MAAM,KAAK,GAAG;;CAE9D,oBAAoB,MAA6B;AAC/C,SAAO,KAAK,KAAK,gBAAgB,MAAM,KAAK,GAAG;;CAEjD,YAAY,MAAgB;EAC1B,IAAI,IACF,SACA,KAAK,UAAU,gBAAgB,MAAM,KAAK,GAC1C,QACA,KAAK,SAAS,KAAK,OAAY,GAAG,eAAe,MAAM,KAAK,CAAC,CAAC,KAAK,IAAI,GACvE;AACF,MAAI,KAAK,UAAU,OACjB,MACE,YACA,KAAK,UACF,KAAK,OAAY,GAAG,eAAe,MAAM,KAAK,CAAC,CAC/C,KAAK,IAAI,GACZ;AACJ,SAAO;;CAET,oBAAoB,MAAwB;AAE1C,UADW,KAAK,YAAY,EAAE,aAAa,MAAM,GAAG,UAAU,SAG5D,MACA,KAAK,QACJ,KAAK,QAAQ,QAAQ,KAAK,MAAM,gBAAgB,MAAM,KAAK,GAAG,MAC/D;;CAGJ,yBAAyB,MAA6B;AACpD,SACE,cACA,KAAK,OACL,MACA,KAAK,OAAO,KAAK,MAAW,EAAE,KAAK,CAAC,KAAK,KAAK,GAC9C,QACA,KAAK,WAAW,KAAK,MAAW,EAAE,eAAe,MAAM,KAAK,CAAC,CAAC,KAAK,IAAI,GACvE;;;AAKN,IAAM,gBAAgB,IAAI,WAAW;;AAGrC,SAAgB,gBAAgB,MAA4B;AAC1D,QAAO,KAAK,gBAAgB,eAAe,KAAK;;;AAIlD,SAAgB,gBAAgB,MAA2B;AACzD,QAAO,KAAK,eAAe,eAAe,KAAK;;;AAIjD,SAAgB,qBAAqB,IAAqC;AACxE,WAAU,qBAAqB;;;AAIjC,SAAgB,qBAAqB,MAAgC;AACnE,WAAU,qBAAqB"}
1
+ {"version":3,"file":"js-emitter.js","names":[],"sources":["../../../../src/lib/compiler/js-emitter.ts"],"sourcesContent":["import * as ts from 'typescript';\nimport * as o from '@angular/compiler';\n\n/** Shared printer — only used as fallback for complex WrappedNodeExpr (e.g. decorator args). */\nconst sharedPrinter = ts.createPrinter({ removeComments: true });\nconst emptySourceFile = ts.createSourceFile(\n '_.ts',\n '',\n ts.ScriptTarget.Latest,\n false,\n);\n\n// Operator metadata table — name, JS string, and precedence (higher = tighter\n// binding). Used to build version-aware lookup maps below.\n//\n// Why a runtime build instead of static `[o.BinaryOperator.Equals]: '=='`\n// literals: Angular's `BinaryOperator` enum gains members between major\n// versions (Assign and the 9 compound assignments were added in v21,\n// Exponentiation/In in v20, InstanceOf in v21). On older Angular versions\n// the missing members evaluate to `undefined` at module load time, and\n// every `[undefined]: '...'` entry collides on the single string key\n// `\"undefined\"` — last write wins. Pre-Phase-1, that gave the v19 install\n// `BINARY_OP_STR[\"undefined\"] === '??='`, so any expression with an\n// unknown operator emitted `??=` instead of failing loudly. Building the\n// table by iterating known names and skipping `undefined` values\n// eliminates the collision: members that don't exist on the installed\n// Angular are simply absent from the map.\n//\n// Precedence values match MDN's table, skipping levels not used by Angular\n// (bitwise XOR, shifts).\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence\nconst OP_DEFINITIONS: ReadonlyArray<\n readonly [name: string, str: string, precedence: number]\n> = [\n ['Assign', '=', 2],\n ['AdditionAssignment', '+=', 2],\n ['SubtractionAssignment', '-=', 2],\n ['MultiplicationAssignment', '*=', 2],\n ['DivisionAssignment', '/=', 2],\n ['RemainderAssignment', '%=', 2],\n ['ExponentiationAssignment', '**=', 2],\n ['AndAssignment', '&&=', 2],\n ['OrAssignment', '||=', 2],\n ['NullishCoalesceAssignment', '??=', 2],\n ['NullishCoalesce', '??', 4],\n ['Or', '||', 4],\n ['And', '&&', 5],\n ['BitwiseOr', '|', 6],\n ['BitwiseAnd', '&', 8],\n ['Equals', '==', 9],\n ['NotEquals', '!=', 9],\n ['Identical', '===', 9],\n ['NotIdentical', '!==', 9],\n ['Lower', '<', 10],\n ['LowerEquals', '<=', 10],\n ['Bigger', '>', 10],\n ['BiggerEquals', '>=', 10],\n ['In', 'in', 10],\n ['InstanceOf', 'instanceof', 10],\n ['Plus', '+', 12],\n ['Minus', '-', 12],\n ['Multiply', '*', 13],\n ['Divide', '/', 13],\n ['Modulo', '%', 13],\n ['Exponentiation', '**', 14],\n];\n\n/** Operator integer values that represent assignment forms (`=`, `+=`, etc.). */\nconst ASSIGNMENT_OP_NAMES: ReadonlySet<string> = new Set([\n 'Assign',\n 'AdditionAssignment',\n 'SubtractionAssignment',\n 'MultiplicationAssignment',\n 'DivisionAssignment',\n 'RemainderAssignment',\n 'ExponentiationAssignment',\n 'AndAssignment',\n 'OrAssignment',\n 'NullishCoalesceAssignment',\n]);\n\nconst BINARY_OP_STR = new Map<number, string>();\nconst BINARY_PRECEDENCE = new Map<number, number>();\nconst ASSIGNMENT_OP_VALUES = new Set<number>();\n\nfor (const [name, str, precedence] of OP_DEFINITIONS) {\n const value = (o.BinaryOperator as Record<string, unknown>)[name];\n if (typeof value !== 'number') continue;\n BINARY_OP_STR.set(value, str);\n BINARY_PRECEDENCE.set(value, precedence);\n if (ASSIGNMENT_OP_NAMES.has(name)) {\n ASSIGNMENT_OP_VALUES.add(value);\n }\n}\n\nconst UNARY_OP_STR = new Map<number, string>();\n\nfor (const [name, str] of [\n ['Plus', '+'],\n ['Minus', '-'],\n ['Increment', '++'],\n ['Decrement', '--'],\n] as const) {\n const value = (o.UnaryOperator as Record<string, unknown>)[name];\n if (typeof value !== 'number') continue;\n UNARY_OP_STR.set(value, str);\n}\n\n/** Returns true when `op` represents any kind of assignment (`=`, `+=`, etc.). */\nfunction isAssignmentOperator(op: o.BinaryOperator): boolean {\n return ASSIGNMENT_OP_VALUES.has(op);\n}\n\n/**\n * Determine whether a child expression needs parentheses when it appears\n * as an operand of `parentOp`.\n */\nfunction childNeedsParens(\n parentOp: o.BinaryOperator,\n child: o.Expression,\n isRhs: boolean,\n): boolean {\n if (!(child instanceof o.BinaryOperatorExpr)) return false;\n\n const childOp = child.operator;\n const parentPrec = BINARY_PRECEDENCE.get(parentOp);\n const childPrec = BINARY_PRECEDENCE.get(childOp);\n if (parentPrec === undefined || childPrec === undefined) return false;\n\n // ?? cannot appear with || or && without explicit grouping (JS spec)\n if (\n (parentOp === o.BinaryOperator.NullishCoalesce &&\n (childOp === o.BinaryOperator.And || childOp === o.BinaryOperator.Or)) ||\n (childOp === o.BinaryOperator.NullishCoalesce &&\n (parentOp === o.BinaryOperator.And || parentOp === o.BinaryOperator.Or))\n ) {\n return true;\n }\n\n // Child has strictly lower precedence\n if (childPrec < parentPrec) return true;\n\n // Same precedence — depends on associativity and position\n if (childPrec === parentPrec) {\n // ** is right-associative: LHS same-prec needs parens, RHS does not\n if (parentOp === o.BinaryOperator.Exponentiation) return !isRhs;\n // All other ops are left-associative: RHS same-prec needs parens\n return isRhs;\n }\n\n return false;\n}\n\n/**\n * Wrap a receiver expression in parens when emitting `<receiver>.name` or\n * `<receiver>.name(args)`. Two cases produce a JS parse error otherwise:\n *\n * 1. A `BinaryOperatorExpr` receiver: `a / 3600.toFixed(2)` parses as\n * `a / 3600.toFixed(2)` where `3600.toFixed` is read as the start of a\n * decimal literal followed by an identifier — an \"Invalid characters\n * after number\" error. Wrapping gives `(a / 3600).toFixed(2)`.\n * 2. A non-negative integer `LiteralExpr` receiver: `42.toFixed(2)` is\n * invalid for the same decimal-literal-ambiguity reason. Wrapping gives\n * `(42).toFixed(2)`. Negative numbers are already emitted as `(-42)` by\n * `visitLiteralExpr`. Floats (e.g. `4.5.toFixed`) and strings parse fine.\n *\n * Other expression kinds either already self-wrap (`ConditionalExpr`,\n * `UnaryOperatorExpr`) or are primary forms that don't need parens\n * (`ReadVarExpr`, `ReadPropExpr`, `InvokeFunctionExpr`, etc.).\n */\nfunction emitReceiverForMemberAccess(\n receiver: o.Expression,\n emitted: string,\n): string {\n if (receiver instanceof o.BinaryOperatorExpr) return '(' + emitted + ')';\n if (\n receiver instanceof o.LiteralExpr &&\n typeof receiver.value === 'number' &&\n receiver.value >= 0\n ) {\n return '(' + emitted + ')';\n }\n return emitted;\n}\n\n/** Polyfill for `__makeTemplateObject` used in downleveled `$localize` calls. */\nconst MAKE_TEMPLATE_OBJECT_POLYFILL =\n '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,\"raw\",{value:t}):e.raw=t,e})';\n\nconst SINGLE_QUOTE_ESCAPE_RE = /[\\\\'\\n\\r]/g;\n\n/** Escape a string for use as a single-quoted string literal. */\nfunction escapeForLocalize(input: string): string {\n const body = input.replace(SINGLE_QUOTE_ESCAPE_RE, (match) => {\n if (match === '\\n') return '\\\\n';\n if (match === '\\r') return '\\\\r';\n return `\\\\${match}`;\n });\n return `'${body}'`;\n}\n\n/**\n * Emits Angular output AST directly to JavaScript strings, bypassing\n * ts.factory node creation and ts.Printer serialization (~4x faster).\n */\nclass JSEmitter implements o.ExpressionVisitor, o.StatementVisitor {\n /** Set by compile() so WrappedNodeExpr fallback can print with correct source context. */\n static _currentSourceFile: ts.SourceFile | undefined;\n /** Set by compile() so OXC-based WrappedNodeExpr can slice original source. */\n static _currentSourceCode: string | undefined;\n\n private emitExpr(e: any): string {\n if (!e) return 'null';\n if (typeof e.visitExpression === 'function')\n return e.visitExpression(this, null);\n // Angular v21 LiteralMapPropertyAssignment: {key, value, quoted}\n if ('key' in e && 'value' in e) {\n const key = e.quoted ? JSON.stringify(e.key) : e.key;\n return key + ': ' + this.emitExpr(e.value);\n }\n return 'null';\n }\n visitWrappedNodeExpr(ast: o.WrappedNodeExpr<any>) {\n const node = ast.node;\n\n // Raw source text: already resolved to a string at wrap time\n if (typeof node === 'string') return node;\n\n // OXC AST nodes: identified by string `type` property + numeric start/end\n if (typeof node.type === 'string' && typeof node.start === 'number') {\n const src = JSEmitter._currentSourceCode;\n if (node.type === 'Identifier') return node.name;\n if (node.type === 'StringLiteral') return JSON.stringify(node.value);\n if (node.type === 'NumericLiteral') return String(node.value);\n if (node.type === 'BooleanLiteral') return node.value ? 'true' : 'false';\n if (node.type === 'NullLiteral') return 'null';\n if (node.type === 'TemplateLiteral' && !node.expressions?.length)\n return '`' + node.quasis[0].value.raw + '`';\n // Fallback: slice original source for complex OXC nodes\n if (src) return src.slice(node.start, node.end);\n return 'null';\n }\n\n // TypeScript AST nodes: identified by numeric `kind` property\n if (node.kind === ts.SyntaxKind.Identifier)\n return (node as ts.Identifier).escapedText as string;\n if (node.kind === ts.SyntaxKind.StringLiteral)\n return JSON.stringify((node as ts.StringLiteral).text);\n if (node.kind === ts.SyntaxKind.NumericLiteral)\n return (node as ts.NumericLiteral).text;\n if (node.kind === ts.SyntaxKind.TrueKeyword) return 'true';\n if (node.kind === ts.SyntaxKind.FalseKeyword) return 'false';\n if (node.kind === ts.SyntaxKind.NullKeyword) return 'null';\n if (node.kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral)\n return '`' + (node as ts.NoSubstitutionTemplateLiteral).text + '`';\n // Fallback for complex wrapped TS nodes (e.g. decorator arguments, array literals).\n // Use currentSourceFile when available for correct position-based printing.\n return sharedPrinter.printNode(\n ts.EmitHint.Unspecified,\n node,\n JSEmitter._currentSourceFile || emptySourceFile,\n );\n }\n visitExternalExpr(ast: o.ExternalExpr) {\n const name = ast.value.name;\n if (name === 'ngDevMode') return name;\n // When name is null/undefined, this is a bare module reference (e.g. ngImport: i0)\n if (!name) return 'i0';\n return 'i0.' + name;\n }\n visitLiteralExpr(ast: o.LiteralExpr) {\n const v = ast.value;\n if (typeof v === 'string') return JSON.stringify(v);\n if (typeof v === 'number') return v < 0 ? '(-' + -v + ')' : '' + v;\n if (typeof v === 'boolean') return v ? 'true' : 'false';\n if (v === undefined) return 'void 0';\n return 'null';\n }\n visitLiteralArrayExpr(ast: o.LiteralArrayExpr) {\n return '[' + ast.entries.map((e) => this.emitExpr(e)).join(', ') + ']';\n }\n visitLiteralMapExpr(ast: o.LiteralMapExpr) {\n return '{' + ast.entries.map((e) => this.emitExpr(e)).join(', ') + '}';\n }\n visitInvokeFunctionExpr(ast: o.InvokeFunctionExpr) {\n const fn = ast.fn.visitExpression(this, null);\n const args = ast.args.map((a: any) => this.emitExpr(a)).join(', ');\n // Wrap arrow/function expressions in parens for valid IIFE syntax. A\n // `WrappedNodeExpr` callee is a raw user expression (e.g. an\n // `@Injectable({ useFactory: (a, b) => … })` arrow); without parens the\n // argument list binds to the arrow's *body* (`… => new X(a, b)(args)`)\n // instead of invoking the arrow. Parenthesizing any wrapped callee is\n // always semantically safe.\n const call = ast.isOptional ? '?.(' : '(';\n\n if (\n ast.fn instanceof o.ArrowFunctionExpr ||\n ast.fn instanceof o.FunctionExpr ||\n ast.fn instanceof o.WrappedNodeExpr\n ) {\n return '(' + fn + ')' + call + args + ')';\n }\n return fn + call + args + ')';\n }\n visitReadVarExpr(ast: o.ReadVarExpr) {\n if (ast.name === 'this') return 'this';\n if (ast.name === 'super') return 'super';\n return ast.name!;\n }\n visitReadPropExpr(ast: o.ReadPropExpr) {\n const receiver = ast.receiver.visitExpression(this, null);\n return (\n emitReceiverForMemberAccess(ast.receiver, receiver) +\n (ast.isOptional ? '?.' : '.') +\n ast.name\n );\n }\n visitReadKeyExpr(ast: o.ReadKeyExpr) {\n const receiver = ast.receiver.visitExpression(this, null);\n return (\n emitReceiverForMemberAccess(ast.receiver, receiver) +\n (ast.isOptional ? '?.[' : '[') +\n ast.index.visitExpression(this, null) +\n ']'\n );\n }\n visitConditionalExpr(ast: o.ConditionalExpr) {\n return (\n '(' +\n ast.condition.visitExpression(this, null) +\n ' ? ' +\n ast.trueCase.visitExpression(this, null) +\n ' : ' +\n ast.falseCase!.visitExpression(this, null) +\n ')'\n );\n }\n visitBinaryOperatorExpr(ast: o.BinaryOperatorExpr) {\n // `BINARY_OP_STR.get(...)` returns `undefined` when the operator value\n // doesn't exist in the installed Angular's `BinaryOperator` enum (the\n // enum is missing 13 members on v19, 11 on v20). Falling back to `'='`\n // would silently produce wrong code; instead, we throw so the error\n // surfaces in the DEBUG output and the calling test fails loudly.\n const op = BINARY_OP_STR.get(ast.operator);\n if (op === undefined) {\n throw new Error(\n `[fast-compile] Unsupported BinaryOperator value ${ast.operator} ` +\n `on @angular/compiler ${o.VERSION?.full ?? '(unknown version)'}`,\n );\n }\n\n const lhsRaw = ast.lhs.visitExpression(this, null);\n const rhsRaw = ast.rhs.visitExpression(this, null);\n\n const lhs = childNeedsParens(ast.operator, ast.lhs, false)\n ? '(' + lhsRaw + ')'\n : lhsRaw;\n const rhs = childNeedsParens(ast.operator, ast.rhs, true)\n ? '(' + rhsRaw + ')'\n : rhsRaw;\n\n const expr = lhs + ' ' + op + ' ' + rhs;\n\n // Wrap assignments in parens so they work correctly as ternary conditions:\n // (tmp = val) ? a : b vs tmp = val ? a : b\n //\n // `isAssignmentOperator` is built at module load time from the operator\n // names that actually exist on the installed Angular's enum. This\n // works whether `Assign` is present (v21+) or absent (v19/v20) — on\n // older versions the assignment branch is simply unreachable because\n // Angular's compiler never constructs an Assign-operator expression.\n if (isAssignmentOperator(ast.operator)) {\n return '(' + expr + ')';\n }\n return expr;\n }\n visitNotExpr(ast: o.NotExpr) {\n return '!(' + ast.condition.visitExpression(this, null) + ')';\n }\n visitFunctionExpr(ast: o.FunctionExpr) {\n return (\n '(' +\n ast.params.map((p: any) => p.name).join(', ') +\n ') => {' +\n ast.statements.map((s: any) => s.visitStatement(this, null)).join(' ') +\n '}'\n );\n }\n visitArrowFunctionExpr(ast: o.ArrowFunctionExpr) {\n const params = '(' + ast.params.map((p: any) => p.name).join(', ') + ')';\n if (Array.isArray(ast.body))\n return (\n params +\n ' => {' +\n ast.body.map((s: any) => s.visitStatement(this, null)).join(' ') +\n '}'\n );\n const bodyExpr = (ast.body as o.Expression).visitExpression(this, null);\n // Wrap object literals in parens so `() => {key: val}` isn't parsed\n // as a block with a labeled statement.\n if (ast.body instanceof o.LiteralMapExpr) {\n return params + ' => (' + bodyExpr + ')';\n }\n return params + ' => ' + bodyExpr;\n }\n // `Write*Expr` visitors must wrap the assignment in parentheses so that\n // it composes correctly when nested inside higher-precedence parents\n // (e.g. as the test of a `ConditionalExpr`). Without the wrapping,\n // tmp = ctx.data() ? 0 : -1\n // parses as `tmp = (ctx.data() ? 0 : -1)` because assignment binds\n // looser than the ternary, which silently assigns the wrong value to\n // `tmp`. Angular's own `AbstractEmitterVisitor.visitWriteVarExpr`\n // applies the same context-sensitive wrapping (it skips the parens\n // when the assignment is a top-level statement to avoid `(x = 1);`\n // noise; we always wrap for simplicity — the redundant parens at\n // statement level are harmless).\n //\n // This matters specifically on Angular v19/v20, where assignment is\n // represented in the IR via `WriteVarExpr` / `AssignTemporaryExpr →\n // WriteVarExpr`. On v21+ the same construct is represented via\n // `BinaryOperatorExpr(Assign, ...)`, which `visitBinaryOperatorExpr`\n // already wraps via `isAssignmentOperator`. Without these wrappers,\n // `@if (data(); as item)` and similar conditional alias forms emit\n // runtime-broken code on v19/v20.\n visitWriteVarExpr(ast: any) {\n return '(' + ast.name + ' = ' + ast.value.visitExpression(this, null) + ')';\n }\n visitWritePropExpr(ast: any) {\n return (\n '(' +\n ast.receiver.visitExpression(this, null) +\n '.' +\n ast.name +\n ' = ' +\n ast.value.visitExpression(this, null) +\n ')'\n );\n }\n visitWriteKeyExpr(ast: any) {\n return (\n '(' +\n ast.receiver.visitExpression(this, null) +\n '[' +\n ast.index.visitExpression(this, null) +\n '] = ' +\n ast.value.visitExpression(this, null) +\n ')'\n );\n }\n visitInvokeMethodExpr(ast: any) {\n const receiver = ast.receiver.visitExpression(this, null);\n return (\n emitReceiverForMemberAccess(ast.receiver, receiver) +\n '.' +\n ast.name +\n '(' +\n ast.args.map((a: any) => this.emitExpr(a)).join(', ') +\n ')'\n );\n }\n visitTypeofExpr(ast: o.TypeofExpr) {\n return 'typeof ' + ast.expr.visitExpression(this, null);\n }\n visitUnaryOperatorExpr(ast: o.UnaryOperatorExpr) {\n const op = UNARY_OP_STR.get(ast.operator);\n if (op === undefined) {\n throw new Error(\n `[fast-compile] Unsupported UnaryOperator value ${ast.operator} ` +\n `on @angular/compiler ${o.VERSION?.full ?? '(unknown version)'}`,\n );\n }\n\n const operand = '(' + ast.expr.visitExpression(this, null) + ')';\n const isPostfix = 'isPrefix' in ast && ast.isPrefix === false;\n return '(' + (isPostfix ? operand + op : op + operand) + ')';\n }\n visitInstantiateExpr(ast: o.InstantiateExpr) {\n return (\n 'new (' +\n ast.classExpr.visitExpression(this, null) +\n ')(' +\n ast.args.map((a: any) => this.emitExpr(a)).join(', ') +\n ')'\n );\n }\n visitCommaExpr(ast: o.CommaExpr) {\n return ast.parts.map((p: any) => p.visitExpression(this, null)).join(', ');\n }\n visitParenthesizedExpr(ast: o.ParenthesizedExpr) {\n return '(' + ast.expr.visitExpression(this, null) + ')';\n }\n visitVoidExpr(ast: o.VoidExpr) {\n return 'void ' + ast.expr.visitExpression(this, null);\n }\n visitSpreadElementExpr(ast: o.SpreadElementExpr) {\n return '...' + (ast as any).expression.visitExpression(this, null);\n }\n visitDynamicImportExpr(ast: o.DynamicImportExpr) {\n return (\n 'import(' +\n (typeof ast.url === 'string'\n ? JSON.stringify(ast.url)\n : ast.url.visitExpression(this, null)) +\n ')'\n );\n }\n visitTemplateLiteralExpr(ast: o.TemplateLiteralExpr) {\n return (\n '`' +\n ast.elements[0].text +\n ast.expressions\n .map(\n (e: any, i: number) =>\n '${' +\n e.visitExpression(this, null) +\n '}' +\n ast.elements[i + 1].text,\n )\n .join('') +\n '`'\n );\n }\n visitTaggedTemplateLiteralExpr(ast: any) {\n const elements = ast.template.elements;\n const expressions = ast.template.expressions;\n const head = elements[0].text;\n const spans = expressions\n .map(\n (e: any, i: number) =>\n '${' + e.visitExpression(this, null) + '}' + elements[i + 1].text,\n )\n .join('');\n return ast.tag.visitExpression(this, null) + '`' + head + spans + '`';\n }\n visitLocalizedString(ast: o.LocalizedString) {\n // Emit the downleveled form:\n // $localize(makeTemplateObject(cooked, raw), expr1, expr2, ...)\n const parts: { cooked: string; raw: string }[] = [ast.serializeI18nHead()];\n for (let i = 1; i < ast.messageParts.length; i++) {\n parts.push(ast.serializeI18nTemplatePart(i));\n }\n const cooked = parts.map((p) => escapeForLocalize(p.cooked)).join(', ');\n const raw = parts.map((p) => escapeForLocalize(p.raw)).join(', ');\n const exprs = ast.expressions.map((e) => this.emitExpr(e));\n return (\n '$localize(' +\n MAKE_TEMPLATE_OBJECT_POLYFILL +\n '([' +\n cooked +\n '], [' +\n raw +\n '])' +\n (exprs.length > 0 ? ', ' + exprs.join(', ') : '') +\n ')'\n );\n }\n visitRegularExpressionLiteral(ast: any) {\n return '/' + (ast.body ?? ast.pattern) + '/' + ast.flags;\n }\n visitTemplateLiteralElementExpr(ast: o.TemplateLiteralElementExpr) {\n return JSON.stringify(ast.text);\n }\n // Statement visitors\n visitReturnStmt(stmt: o.ReturnStatement) {\n return 'return ' + stmt.value.visitExpression(this, null) + ';';\n }\n visitExpressionStmt(stmt: o.ExpressionStatement) {\n return stmt.expr.visitExpression(this, null) + ';';\n }\n visitIfStmt(stmt: o.IfStmt) {\n let s =\n 'if (' +\n stmt.condition.visitExpression(this, null) +\n ') {' +\n stmt.trueCase.map((s2: any) => s2.visitStatement(this, null)).join(' ') +\n '}';\n if (stmt.falseCase.length)\n s +=\n ' else {' +\n stmt.falseCase\n .map((s2: any) => s2.visitStatement(this, null))\n .join(' ') +\n '}';\n return s;\n }\n visitDeclareVarStmt(stmt: o.DeclareVarStmt) {\n const kw = stmt.hasModifier(o.StmtModifier.Final) ? 'const' : 'let';\n return (\n kw +\n ' ' +\n stmt.name +\n (stmt.value ? ' = ' + stmt.value.visitExpression(this, null) : '') +\n ';'\n );\n }\n visitDeclareFunctionStmt(stmt: o.DeclareFunctionStmt) {\n return (\n 'function ' +\n stmt.name +\n '(' +\n stmt.params.map((p: any) => p.name).join(', ') +\n ') {' +\n stmt.statements.map((s: any) => s.visitStatement(this, null)).join(' ') +\n '}'\n );\n }\n}\n\nconst stringEmitter = new JSEmitter();\n\n/** Emit Angular output AST expression directly to a JavaScript string. */\nexport function emitAngularExpr(expr: o.Expression): string {\n return expr.visitExpression(stringEmitter, null);\n}\n\n/** Emit Angular output AST statement directly to a JavaScript string. */\nexport function emitAngularStmt(stmt: o.Statement): string {\n return stmt.visitStatement(stringEmitter, null);\n}\n\n/** Set the current source file for WrappedNodeExpr fallback printing. */\nexport function setEmitterSourceFile(sf: ts.SourceFile | undefined): void {\n JSEmitter._currentSourceFile = sf;\n}\n\n/** Set the current source code for OXC-based WrappedNodeExpr slice fallback. */\nexport function setEmitterSourceCode(code: string | undefined): void {\n JSEmitter._currentSourceCode = code;\n}\n"],"mappings":";;;;AAIA,IAAM,gBAAgB,GAAG,cAAc,EAAE,gBAAgB,KAAK,CAAC;AAC/D,IAAM,kBAAkB,GAAG,iBACzB,QACA,IACA,GAAG,aAAa,QAChB,KACF;AAqBA,IAAM,iBAEF;CACF;EAAC;EAAU;EAAK;CAAC;CACjB;EAAC;EAAsB;EAAM;CAAC;CAC9B;EAAC;EAAyB;EAAM;CAAC;CACjC;EAAC;EAA4B;EAAM;CAAC;CACpC;EAAC;EAAsB;EAAM;CAAC;CAC9B;EAAC;EAAuB;EAAM;CAAC;CAC/B;EAAC;EAA4B;EAAO;CAAC;CACrC;EAAC;EAAiB;EAAO;CAAC;CAC1B;EAAC;EAAgB;EAAO;CAAC;CACzB;EAAC;EAA6B;EAAO;CAAC;CACtC;EAAC;EAAmB;EAAM;CAAC;CAC3B;EAAC;EAAM;EAAM;CAAC;CACd;EAAC;EAAO;EAAM;CAAC;CACf;EAAC;EAAa;EAAK;CAAC;CACpB;EAAC;EAAc;EAAK;CAAC;CACrB;EAAC;EAAU;EAAM;CAAC;CAClB;EAAC;EAAa;EAAM;CAAC;CACrB;EAAC;EAAa;EAAO;CAAC;CACtB;EAAC;EAAgB;EAAO;CAAC;CACzB;EAAC;EAAS;EAAK;CAAE;CACjB;EAAC;EAAe;EAAM;CAAE;CACxB;EAAC;EAAU;EAAK;CAAE;CAClB;EAAC;EAAgB;EAAM;CAAE;CACzB;EAAC;EAAM;EAAM;CAAE;CACf;EAAC;EAAc;EAAc;C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AAI,CAAC,CAAC,KAAK,IAAI,IAC7C,QACA,KAAK,WAAW,KAAK,MAAW,EAAE,eAAe,MAAM,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,IACtE;CAEJ;AACF;AAEA,IAAM,gBAAgB,IAAI,UAAU;;AAGpC,SAAgB,gBAAgB,MAA4B;CAC1D,OAAO,KAAK,gBAAgB,eAAe,IAAI;AACjD;;AAGA,SAAgB,gBAAgB,MAA2B;CACzD,OAAO,KAAK,eAAe,eAAe,IAAI;AAChD;;AAGA,SAAgB,qBAAqB,IAAqC;CACxE,UAAU,qBAAqB;AACjC;;AAGA,SAAgB,qBAAqB,MAAgC;CACnE,UAAU,qBAAqB;AACjC"}
@@ -30,7 +30,14 @@ function getCallApi(call) {
30
30
  * Returns `null` if the node is not statically resolvable.
31
31
  */
32
32
  function stringValue(node, consts) {
33
+ while (node?.type === "TSAsExpression" || node?.type === "TSSatisfiesExpression" || node?.type === "ParenthesizedExpression") node = node.expression;
33
34
  if (node?.type === "StringLiteral") return node.value;
35
+ if (node?.type === "BinaryExpression" && node.operator === "+") {
36
+ const operand = (n) => n?.type === "Identifier" ? consts?.get(n.name) ?? null : stringValue(n, consts);
37
+ const left = operand(node.left);
38
+ const right = left === null ? null : operand(node.right);
39
+ return right === null ? null : left + right;
40
+ }
34
41
  if (node?.type === "Literal" && typeof node.value === "string") return node.value;
35
42
  if (node?.type === "TemplateLiteral") {
36
43
  const quasis = node.quasis ?? [];
@@ -94,6 +101,11 @@ function propKeyName(prop) {
94
101
  if (!prop.key) return null;
95
102
  return prop.key.name ?? prop.key.value ?? null;
96
103
  }
104
+ /** Resolve a host key or value to a string literal or same-file string const. */
105
+ function hostString(node, consts) {
106
+ if (node?.type === "Identifier") return consts?.get(node.name) ?? null;
107
+ return stringValue(node, consts);
108
+ }
97
109
  /**
98
110
  * Extract decorator metadata from an OXC decorator AST node.
99
111
  * Parses @Component, @Directive, @Pipe, @Injectable, @Service, @NgModule arguments.
@@ -137,12 +149,10 @@ function extractMetadata(dec, sourceCode, stringConsts) {
137
149
  switch (key) {
138
150
  case "host":
139
151
  if (valNode.type === "ObjectExpression") for (const hp of valNode.properties || []) {
140
- if (hp.type !== "ObjectProperty" && hp.type !== "Property") continue;
141
- const hKey = propKeyName(hp);
142
- if (!hKey) continue;
143
- const sv = stringValue(hp.value, stringConsts);
144
- const hVal = sv !== null ? sv : sourceCode.slice(hp.value.start, hp.value.end).replace(/^['"`]|['"`]$/g, "");
145
- meta.hostRaw[hKey.replace(/^['"`]|['"`]$/g, "")] = hVal;
152
+ const hKey = hp.computed ? hostString(hp.key, stringConsts) : propKeyName(hp);
153
+ const hVal = hostString(hp.value, stringConsts);
154
+ if (hKey === null || hVal === null) throw new Error(`[fast-compile] Cannot statically resolve host binding \`${sourceCode.slice(hp.start, hp.end)}\`. Only string literals and string constants declared in the same file are supported; use a string literal or @HostBinding/@HostListener instead.`);
155
+ meta.hostRaw[String(hKey).replace(/^['"`]|['"`]$/g, "")] = hVal;
146
156
  }
147
157
  break;
148
158
  case "changeDetection":
@@ -670,19 +680,17 @@ function extractConstructorDeps(classNode, sourceCode, typeOnlyImports) {
670
680
  case "Host":
671
681
  host = true;
672
682
  break;
673
- case "Attribute":
674
- if (args.length > 0) {
675
- const sv = stringValue(args[0]);
676
- if (sv !== null) {
677
- attributeToken = new o.LiteralExpr(sv);
678
- attributeNameType = new o.LiteralExpr(sv);
679
- } else {
680
- attributeToken = new o.WrappedNodeExpr(args[0]);
681
- attributeNameType = new o.LiteralExpr("unknown");
682
- }
683
- token = "";
683
+ case "Attribute": if (args.length > 0) {
684
+ const sv = stringValue(args[0]);
685
+ if (sv !== null) {
686
+ attributeToken = new o.LiteralExpr(sv);
687
+ attributeNameType = new o.LiteralExpr(sv);
688
+ } else {
689
+ attributeToken = new o.WrappedNodeExpr(args[0]);
690
+ attributeNameType = new o.LiteralExpr("unknown");
684
691
  }
685
- break;
692
+ token = "";
693
+ }
686
694
  }
687
695
  }
688
696
  if (!token && !attributeToken) {
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","names":[],"sources":["../../../../src/lib/compiler/metadata.ts"],"sourcesContent":["import * as o from '@angular/compiler';\nimport { unwrapForwardRefOxc } from './utils.js';\nimport { FIELD_DECORATORS, SIGNAL_APIS } from './constants.js';\n\nfunction getCallApi(call: any): { api: string; required: boolean } | null {\n const callee = call.callee;\n if (!callee) return null;\n\n if (callee.type === 'Identifier') {\n return { api: callee.name, required: false };\n }\n\n if (\n (callee.type === 'StaticMemberExpression' ||\n callee.type === 'MemberExpression') &&\n callee.object?.type === 'Identifier' &&\n callee.property?.name === 'required'\n ) {\n return { api: callee.object.name, required: true };\n }\n\n return null;\n}\n\n/**\n * Extract the string value from an OXC string literal or template literal node.\n *\n * If `consts` is provided, interpolated template literals (e.g.\n * `\\`hello ${NAME}\\``) are resolved when every `${...}` expression is a bare\n * `Identifier` whose name is present in the map. This lets metadata fields\n * such as `template:` reference module-level string constants via JS\n * template-literal interpolation:\n *\n * const tw = `text-zinc-700 hover:text-zinc-900`;\n * @Component({ template: `<a class=\"${tw}\">x</a>` })\n *\n * Returns `null` if the node is not statically resolvable.\n */\nfunction stringValue(node: any, consts?: Map<string, string>): string | null {\n if (node?.type === 'StringLiteral') return node.value;\n if (node?.type === 'Literal' && typeof node.value === 'string')\n return node.value;\n if (node?.type === 'TemplateLiteral') {\n const quasis = node.quasis ?? [];\n const expressions = node.expressions ?? [];\n if (expressions.length === 0) {\n return quasis[0]?.value?.cooked ?? null;\n }\n if (!consts) return null;\n let result = '';\n for (let i = 0; i < quasis.length; i++) {\n const cooked = quasis[i]?.value?.cooked;\n if (cooked == null) return null;\n result += cooked;\n if (i < expressions.length) {\n const expr = expressions[i];\n if (expr?.type !== 'Identifier') return null;\n const resolved = consts.get(expr.name);\n if (resolved == null) return null;\n result += resolved;\n }\n }\n return result;\n }\n return null;\n}\n\n/** Check if an OXC node is a string-like literal. */\nfunction isStringLike(node: any, consts?: Map<string, string>): boolean {\n return stringValue(node, consts) !== null;\n}\n\n/**\n * Walk the top-level statements of an OXC program and collect a map of\n * statically-resolvable string-valued `const NAME = ...` declarations.\n *\n * Used so decorator metadata fields like `template:` can reference\n * module-level Tailwind class chains (or any other string constants) via\n * JS template-literal interpolation. Resolution is iterative: a const may\n * reference earlier-resolved consts via `${other}` interpolation.\n *\n * Only `const` declarations are considered. Non-string initializers,\n * function calls, member access, and any expression that cannot be reduced\n * to a string at parse time are ignored.\n */\nexport function collectStringConstants(oxcProgram: any): Map<string, string> {\n const rawDecls = new Map<string, any>();\n for (const stmt of oxcProgram?.body || []) {\n const decl =\n stmt.type === 'ExportNamedDeclaration' ? stmt.declaration : stmt;\n if (!decl || decl.type !== 'VariableDeclaration' || decl.kind !== 'const')\n continue;\n for (const d of decl.declarations || []) {\n if (d.id?.type === 'Identifier' && d.init) {\n rawDecls.set(d.id.name, d.init);\n }\n }\n }\n\n const resolved = new Map<string, string>();\n // Iterative fixpoint: each pass resolves consts whose dependencies are\n // already known. Bounded by the number of declarations to prevent cycles.\n for (let pass = 0; pass < rawDecls.size + 1; pass++) {\n let progress = false;\n for (const [name, init] of rawDecls) {\n if (resolved.has(name)) continue;\n const value = stringValue(init, resolved);\n if (value !== null) {\n resolved.set(name, value);\n progress = true;\n }\n }\n if (!progress) break;\n }\n return resolved;\n}\n\n/** Get the property key name from an OXC object property. */\nfunction propKeyName(prop: any): string | null {\n if (!prop.key) return null;\n return prop.key.name ?? prop.key.value ?? null;\n}\n\n/**\n * Extract decorator metadata from an OXC decorator AST node.\n * Parses @Component, @Directive, @Pipe, @Injectable, @Service, @NgModule arguments.\n *\n * `stringConsts`, when provided, lets string-typed metadata fields\n * (`template`, `selector`, `templateUrl`, `styles`, `styleUrl`, `styleUrls`,\n * `name`, `exportAs`, `providedIn`) resolve module-level string constants\n * referenced via template-literal interpolation, e.g.\n * `template: \\`<div class=\"${tw}\">x</div>\\``.\n */\nexport function extractMetadata(\n dec: any | undefined,\n sourceCode: string,\n stringConsts?: Map<string, string>,\n): any {\n if (!dec) return null;\n const call = dec.expression;\n if (!call || call.type !== 'CallExpression') return null;\n const arg = call.arguments?.[0];\n const meta: any = {\n hostRaw: {},\n inputs: {},\n outputs: {},\n standalone: true,\n imports: [],\n providers: null,\n viewProviders: null,\n animations: null,\n changeDetection: null,\n encapsulation: null,\n preserveWhitespaces: false,\n exportAs: null,\n selector: undefined,\n styles: [],\n templateUrl: null,\n styleUrls: [],\n };\n if (!arg || arg.type !== 'ObjectExpression') return meta;\n\n for (const p of arg.properties || []) {\n if (p.type !== 'ObjectProperty' && p.type !== 'Property') continue;\n const key = propKeyName(p);\n if (!key) continue;\n const valNode = p.value;\n const valText = sourceCode.slice(valNode.start, valNode.end);\n\n switch (key) {\n case 'host':\n if (valNode.type === 'ObjectExpression') {\n for (const hp of valNode.properties || []) {\n if (hp.type !== 'ObjectProperty' && hp.type !== 'Property')\n continue;\n const hKey = propKeyName(hp);\n if (!hKey) continue;\n // Prefer the parsed string value so embedded quotes (e.g. the\n // empty `\"\"` in `'expr ? \"\" : null'`) survive. Falling back to\n // the source slice for non-string values keeps prior behavior\n // for unusual host bindings (e.g. references to constants).\n const sv = stringValue(hp.value, stringConsts);\n const hVal =\n sv !== null\n ? sv\n : sourceCode\n .slice(hp.value.start, hp.value.end)\n .replace(/^['\"`]|['\"`]$/g, '');\n meta.hostRaw[hKey.replace(/^['\"`]|['\"`]$/g, '')] = hVal;\n }\n }\n break;\n case 'changeDetection':\n meta.changeDetection = valText.includes('OnPush') ? 0 : 1;\n break;\n case 'encapsulation':\n meta.encapsulation = valText.includes('None')\n ? 2\n : valText.includes('ShadowDom')\n ? 3\n : 0;\n break;\n case 'preserveWhitespaces':\n meta.preserveWhitespaces = valText === 'true';\n break;\n case 'pure':\n case 'standalone':\n meta[key] = valText !== 'false';\n break;\n case 'template':\n case 'selector':\n case 'name':\n case 'exportAs':\n case 'templateUrl':\n case 'providedIn': {\n const sv = stringValue(valNode, stringConsts);\n if (sv !== null) {\n meta[key] = sv;\n } else if (valNode.type === 'TemplateLiteral') {\n // Template literal with `${...}` interpolations that couldn't\n // all be resolved at parse time (e.g. they reference imports\n // or non-string values). The previous fallback stripped every\n // quote character from the source, which silently corrupted\n // templates such as `<a class=\"${cls} foo\">…</a>` into\n // `<a class=${cls} foo>…</a>` — making Angular's HTML parser\n // fail with confusing errors like `Opening tag \"a\" not\n // terminated`. Instead, walk the quasis and substitute each\n // unresolved interpolation with the empty string so the\n // surrounding HTML (including quoted attributes) is preserved.\n const quasis = valNode.quasis ?? [];\n const expressions = valNode.expressions ?? [];\n let result = '';\n for (let i = 0; i < quasis.length; i++) {\n result += quasis[i]?.value?.cooked ?? '';\n if (i < expressions.length) {\n const expr = expressions[i];\n if (expr?.type === 'Identifier') {\n const resolved = stringConsts?.get(expr.name);\n if (resolved != null) {\n result += resolved;\n continue;\n }\n }\n // Unresolvable — substitute empty string. This keeps the\n // surrounding HTML well-formed even if the resulting class\n // list is incomplete.\n }\n }\n meta[key] = result;\n } else {\n // Non-string, non-template-literal expression. Strip only the\n // outermost JS string delimiters, not every embedded quote.\n meta[key] = valText.replace(/^['\"`]|['\"`]$/g, '');\n }\n if (key === 'exportAs') meta.exportAs = [meta.exportAs];\n break;\n }\n case 'styleUrl': {\n const sv = stringValue(valNode, stringConsts);\n meta.styleUrls = [sv !== null ? sv : valText.replace(/['\"`]/g, '')];\n break;\n }\n case 'styleUrls':\n if (valNode.type === 'ArrayExpression') {\n meta.styleUrls = (valNode.elements || []).map((e: any) => {\n const sv = stringValue(e, stringConsts);\n return sv !== null\n ? sv\n : sourceCode.slice(e.start, e.end).replace(/['\"`]/g, '');\n });\n }\n break;\n case 'styles':\n if (valNode.type === 'ArrayExpression') {\n meta.styles = (valNode.elements || []).map((e: any) => {\n const sv = stringValue(e, stringConsts);\n return sv !== null\n ? sv\n : sourceCode.slice(e.start, e.end).replace(/['\"`]/g, '');\n });\n } else {\n const sv = stringValue(valNode, stringConsts);\n if (sv !== null) meta.styles = [sv];\n }\n break;\n case 'imports':\n case 'animations':\n case 'rawImports':\n case 'declarations':\n case 'exports':\n case 'bootstrap':\n if (valNode.type === 'ArrayExpression') {\n meta[key] = (valNode.elements || []).map(\n (e: any) => new o.WrappedNodeExpr(unwrapForwardRefOxc(e)),\n );\n }\n break;\n case 'providers':\n case 'viewProviders':\n if (valNode.type === 'ArrayExpression') {\n meta[key] = (valNode.elements || []).map(\n (e: any) => new o.WrappedNodeExpr(unwrapForwardRefOxc(e)),\n );\n } else {\n // `providers: safeProviders` / `viewProviders: SHARED_PROVIDERS`\n // — a reference to a module-level const (or any non-literal\n // expression such as a spread or function call) rather than an\n // inline array literal. ngtsc's partial evaluator expands the\n // identifier to its array; fastCompile does no static evaluation,\n // so it cannot. But Angular emits injector/host `providers` as a\n // single Expression and flattens nested arrays at runtime, so the\n // reference can be passed through by value. Storing it as a bare\n // `o.Expression` (not an array) signals the emission sites to emit\n // it directly instead of wrapping it in a `LiteralArrayExpr`.\n // Without this, the whole `providers` list is silently dropped and\n // every token it provides fails at runtime with NG0201.\n meta[key] = new o.WrappedNodeExpr(valNode);\n }\n break;\n // @Injectable provider configuration. Pass these through to\n // compileInjectable so the emitted `ɵprov` reflects the user's\n // intent. `useClass`/`useExisting`/`useValue` are\n // `MaybeForwardRefExpression` (`{ expression, forwardRef }`);\n // `useFactory` is a bare `Expression`.\n case 'useClass':\n case 'useExisting':\n case 'useValue': {\n const unwrapped = unwrapForwardRefOxc(valNode);\n const isForwardRef =\n valNode.type === 'CallExpression' && unwrapped !== valNode;\n meta[key] = {\n expression: new o.WrappedNodeExpr(unwrapped),\n forwardRef: isForwardRef ? 2 : 0,\n };\n break;\n }\n case 'useFactory':\n meta[key] = new o.WrappedNodeExpr(valNode);\n break;\n // `@Injectable({ deps: [...] })` — the dependency list for `useFactory`\n // / `useClass`. Each entry is either a bare token or a flag array such\n // as `[new Optional(), new SkipSelf(), Token]`. Without parsing this the\n // emitted factory ignores the deps and calls the factory/ctor with no\n // arguments.\n case 'deps':\n if (valNode.type === 'ArrayExpression') {\n meta.deps = extractInjectableDeps(valNode, sourceCode);\n }\n break;\n // `@Service` configuration. `autoProvided` defaults to `true`, so only\n // an explicit `false` is meaningful; `factory` is a bare expression\n // forwarded to compileService.\n case 'autoProvided':\n meta.autoProvided = valText === 'true';\n break;\n case 'factory':\n meta.factory = new o.WrappedNodeExpr(valNode);\n break;\n case 'hostDirectives':\n if (valNode.type === 'ArrayExpression') {\n meta.hostDirectives = (valNode.elements || [])\n .map((el: any) => {\n // Bare identifier: hostDirectives: [MatTooltip]\n if (el.type === 'Identifier' || el.type === 'CallExpression') {\n const unwrapped = unwrapForwardRefOxc(el);\n const ref = {\n value: new o.WrappedNodeExpr(unwrapped),\n type: new o.WrappedNodeExpr(unwrapped),\n };\n return {\n directive: ref,\n isForwardReference: el.type === 'CallExpression',\n inputs: null,\n outputs: null,\n };\n }\n // Object form: { directive: MatTooltip, inputs: [...], outputs: [...] }\n if (el.type === 'ObjectExpression') {\n let directiveNode: any = null;\n let isForwardRef = false;\n let inputs: Record<string, string> | null = null;\n let outputs: Record<string, string> | null = null;\n for (const prop of el.properties || []) {\n if (\n prop.type !== 'ObjectProperty' &&\n prop.type !== 'Property'\n )\n continue;\n const pName = propKeyName(prop);\n if (pName === 'directive') {\n directiveNode = unwrapForwardRefOxc(prop.value);\n isForwardRef =\n prop.value?.type === 'CallExpression' &&\n sourceCode\n .slice(prop.value.start, prop.value.end)\n .includes('forwardRef');\n } else if (\n pName === 'inputs' &&\n prop.value?.type === 'ArrayExpression'\n ) {\n inputs = {};\n for (const e of prop.value.elements || []) {\n const sv = stringValue(e);\n if (sv !== null) {\n const [source, alias = source] = sv\n .split(':')\n .map((part: string) => part.trim());\n if (source) inputs[source] = alias;\n }\n }\n } else if (\n pName === 'outputs' &&\n prop.value?.type === 'ArrayExpression'\n ) {\n outputs = {};\n for (const e of prop.value.elements || []) {\n const sv = stringValue(e);\n if (sv !== null) {\n const [source, alias = source] = sv\n .split(':')\n .map((part: string) => part.trim());\n if (source) outputs[source] = alias;\n }\n }\n }\n }\n if (directiveNode) {\n const ref = {\n value: new o.WrappedNodeExpr(directiveNode),\n type: new o.WrappedNodeExpr(directiveNode),\n };\n return {\n directive: ref,\n isForwardReference: isForwardRef,\n inputs,\n outputs,\n };\n }\n }\n return null;\n })\n .filter(Boolean);\n }\n break;\n default:\n meta[key] = valText.replace(/['\"`]/g, '');\n }\n }\n return meta;\n}\n\n/**\n * Detect signal-based APIs on class members: input(), model(), output(),\n * viewChild(), contentChild(), viewChildren(), contentChildren().\n */\nexport function detectSignals(classNode: any, sourceCode: string) {\n const inputs: any = {},\n outputs: any = {},\n viewQueries: any[] = [],\n contentQueries: any[] = [];\n\n const members: any[] = classNode.body?.body || [];\n\n for (const m of members) {\n if (\n m.type !== 'PropertyDefinition' ||\n !m.key?.name ||\n !m.value ||\n m.value.type !== 'CallExpression'\n )\n continue;\n\n const name: string = m.key.name;\n const signalCall = getCallApi(m.value);\n if (!signalCall) continue;\n\n const { api, required } = signalCall;\n if (!SIGNAL_APIS.has(api)) continue;\n\n // Skip signal synthesis when an explicit Angular decorator already\n // covers the same field. Mirrors Angular's transform behavior\n // (input_function.ts:42-48 et al.) and the JIT fix in\n // jit-metadata.ts. Without this, the downstream merge in compile.ts\n // overwrites decorator-derived metadata or, worse, concats duplicate\n // query entries that fire twice.\n const explicit = new Set<string>();\n for (const dec of m.decorators || []) {\n const decName: string | undefined = dec.expression?.callee?.name;\n if (decName && FIELD_DECORATORS.has(decName)) explicit.add(decName);\n }\n const hasInput = explicit.has('Input');\n const hasOutput = explicit.has('Output');\n const hasQuery =\n explicit.has('ViewChild') ||\n explicit.has('ViewChildren') ||\n explicit.has('ContentChild') ||\n explicit.has('ContentChildren');\n if (api === 'input' && hasInput) continue;\n if (api === 'model' && (hasInput || hasOutput)) continue;\n if ((api === 'output' || api === 'outputFromObservable') && hasOutput) {\n continue;\n }\n if (\n (api === 'viewChild' ||\n api === 'viewChildren' ||\n api === 'contentChild' ||\n api === 'contentChildren') &&\n hasQuery\n ) {\n continue;\n }\n\n const args: any[] = m.value.arguments || [];\n\n // 1. SIGNAL INPUTS (Standard & Required)\n if (api === 'input') {\n let alias: string | null = null;\n const optionsArg = required ? args[0] : args[1];\n if (optionsArg?.type === 'ObjectExpression') {\n for (const prop of optionsArg.properties || []) {\n if (prop.type !== 'ObjectProperty' && prop.type !== 'Property')\n continue;\n if (propKeyName(prop) === 'alias') {\n const sv = stringValue(prop.value);\n if (sv !== null) alias = sv;\n }\n }\n }\n inputs[name] = {\n classPropertyName: name,\n // The binding (public) name is the alias if provided, otherwise\n // the class property name. Without honoring `alias`, host\n // directives that map by public name (e.g.\n // `inputs: ['aria-label']` against `ariaLabel = input(null, {\n // alias: 'aria-label' })`) fail at runtime with NG0311.\n bindingPropertyName: alias ?? name,\n isSignal: true,\n required,\n // Always null for signal inputs. The input() factory already\n // applies the user's transform internally; forwarding it to the\n // directive metadata would make Angular's emitter set the\n // HasDecoratorInputTransform flag, causing the transform to run\n // again via the runtime input setter. Mirrors upstream\n // input_function.ts:74.\n transform: null,\n };\n }\n\n // 2. MODEL SIGNALS (Writable Inputs)\n else if (api === 'model') {\n // model() supports the same options object as input(); honor `alias`\n // for the same reason (host-directive mappings use the public name).\n let alias: string | null = null;\n const optionsArg = required ? args[0] : args[1];\n if (optionsArg?.type === 'ObjectExpression') {\n for (const prop of optionsArg.properties || []) {\n if (prop.type !== 'ObjectProperty' && prop.type !== 'Property')\n continue;\n if (propKeyName(prop) === 'alias') {\n const sv = stringValue(prop.value);\n if (sv !== null) alias = sv;\n }\n }\n }\n inputs[name] = {\n classPropertyName: name,\n bindingPropertyName: alias ?? name,\n isSignal: true,\n // Propagate `.required` so the runtime enforces the unbound-required\n // check. Without this, `model.required(...)` accepts an unbound parent\n // and the model signal stays at its undefined initial value silently.\n required,\n };\n // The compiled `outputs` field is `{ classPropertyName: bindingName }`.\n // Angular inverts this at runtime via\n // `parseAndConvertOutputsForDefinition`, producing the lookup map\n // `{ bindingName: classPropertyName }` used by `listenToOutput`.\n // For a `model()` signal, the class property is `name` and the\n // binding event is `${aliasOrName}Change`, and the model signal\n // itself is the subscribable, so `instance[name]` is what\n // `listenToOutput` needs to resolve.\n outputs[name] = (alias ?? name) + 'Change';\n }\n\n // 3. SIGNAL QUERIES (viewChild, contentChild)\n else if (\n api === 'viewChild' ||\n api === 'viewChildren' ||\n api === 'contentChild' ||\n api === 'contentChildren'\n ) {\n const isViewQuery = api === 'viewChild' || api === 'viewChildren';\n const isChildrenQuery =\n api === 'viewChildren' || api === 'contentChildren';\n\n const firstArg = args[0];\n const sv = stringValue(firstArg);\n\n // Parse the optional second-arg options object for `read` and\n // (content queries only) `descendants`. Without this, queries like\n // `viewChild('ref', { read: ElementRef })` and\n // `contentChildren(Foo, { descendants: false })` silently lose\n // their options at runtime.\n let read: any = null;\n // Defaults match Angular's signal-query API and the decorator\n // path (`isView || isFirst` in detectFieldDecorators):\n // viewChild → true (view queries always traverse)\n // viewChildren → true\n // contentChild → true (single-result content queries\n // traverse by default)\n // contentChildren → false (multi-result content queries are\n // shallow unless explicitly opted in)\n let descendants = isViewQuery || !isChildrenQuery;\n const optArg = args[1];\n if (optArg?.type === 'ObjectExpression') {\n for (const prop of optArg.properties || []) {\n if (prop.type !== 'ObjectProperty' && prop.type !== 'Property')\n continue;\n const k = propKeyName(prop);\n if (k === 'read') {\n read = new o.WrappedNodeExpr(unwrapForwardRefOxc(prop.value));\n } else if (k === 'descendants') {\n const t = prop.value?.type;\n if (\n t === 'BooleanLiteral' ||\n (t === 'Literal' && typeof prop.value.value === 'boolean')\n ) {\n descendants = prop.value.value;\n }\n }\n }\n }\n\n const query = {\n propertyName: name,\n // Class predicates must be wrapped in an `R3QueryReference`\n // (`{ forwardRef, expression }`); Angular's `getQueryPredicate`\n // dispatches on `predicate.forwardRef` and reads\n // `predicate.expression`, so a bare `WrappedNodeExpr` is silently\n // dropped to `undefined` and emitted as `null`, leaving the query\n // with no target. `0 = ForwardRefHandling.None`.\n predicate:\n sv !== null\n ? [sv]\n : { forwardRef: 0, expression: new o.WrappedNodeExpr(firstArg) },\n first: !isChildrenQuery,\n descendants,\n read,\n static: false,\n emitFlags: 0,\n isSignal: true,\n };\n\n if (isViewQuery) viewQueries.push(query);\n else contentQueries.push(query);\n }\n\n // 4. STANDARD OUTPUTS (output() and outputFromObservable())\n else if (api === 'output' || api === 'outputFromObservable') {\n let alias = name;\n // outputFromObservable(observable, options) — options is args[1].\n // output(options) — options is args[0]. Mirrors upstream\n // output_function.ts:81.\n const optArg = api === 'outputFromObservable' ? args[1] : args[0];\n if (optArg?.type === 'ObjectExpression') {\n for (const prop of optArg.properties || []) {\n if (\n (prop.type === 'ObjectProperty' || prop.type === 'Property') &&\n propKeyName(prop) === 'alias'\n ) {\n const sv = stringValue(prop.value);\n if (sv !== null) alias = sv;\n }\n }\n }\n outputs[name] = alias;\n }\n }\n\n return { inputs, outputs, viewQueries, contentQueries };\n}\n\n/**\n * Detect decorator-based field metadata: @Input, @Output, @ViewChild,\n * @ContentChild, @ViewChildren, @ContentChildren, @HostBinding, @HostListener.\n */\nexport function detectFieldDecorators(classNode: any, sourceCode: string) {\n const inputs: any = {};\n const outputs: any = {};\n const viewQueries: any[] = [];\n const contentQueries: any[] = [];\n const hostProperties: Record<string, string> = {};\n const hostListeners: Record<string, string> = {};\n\n const members: any[] = classNode.body?.body || [];\n\n for (const member of members) {\n const decorators: any[] = member.decorators || [];\n if (decorators.length === 0) continue;\n\n const memberName: string = member.key?.name || '';\n\n for (const dec of decorators) {\n const expr = dec.expression;\n if (!expr || expr.type !== 'CallExpression') continue;\n const decName: string | undefined = expr.callee?.name;\n if (!decName) continue;\n const args: any[] = expr.arguments || [];\n\n switch (decName) {\n case 'Input': {\n let bindingName = memberName;\n let required = false;\n let transformFunction: any = null;\n\n if (args.length > 0) {\n const arg = args[0];\n const sv = stringValue(arg);\n if (sv !== null) {\n bindingName = sv;\n } else if (arg.type === 'ObjectExpression') {\n for (const prop of arg.properties || []) {\n if (prop.type !== 'ObjectProperty' && prop.type !== 'Property')\n continue;\n const k = propKeyName(prop);\n if (k === 'alias') {\n const asv = stringValue(prop.value);\n if (asv !== null) bindingName = asv;\n }\n if (k === 'required')\n required =\n sourceCode.slice(prop.value.start, prop.value.end) ===\n 'true';\n if (k === 'transform')\n transformFunction = new o.WrappedNodeExpr(prop.value);\n }\n }\n }\n\n inputs[memberName] = {\n classPropertyName: memberName,\n bindingPropertyName: bindingName,\n isSignal: false,\n required,\n transformFunction,\n };\n break;\n }\n\n case 'Output': {\n const sv = args.length > 0 ? stringValue(args[0]) : null;\n const alias = sv !== null ? sv : memberName;\n outputs[memberName] = alias;\n break;\n }\n\n case 'ViewChild':\n case 'ViewChildren':\n case 'ContentChild':\n case 'ContentChildren': {\n const isView = decName.startsWith('View');\n const isFirst = decName === 'ViewChild' || decName === 'ContentChild';\n\n // Default predicate when no argument is given is the member\n // name. Class predicates (the non-string case) must be wrapped\n // in an `R3QueryReference` (`{ forwardRef, expression }`) so\n // Angular's `getQueryPredicate` can dispatch on `forwardRef`\n // and read `.expression`. A bare `WrappedNodeExpr` is silently\n // dropped to undefined and emitted as `null`.\n let predicate: any = [memberName];\n if (args.length > 0) {\n const pred = args[0];\n const sv = stringValue(pred);\n if (sv !== null) {\n predicate = [sv];\n } else {\n predicate = {\n forwardRef: 0,\n expression: new o.WrappedNodeExpr(unwrapForwardRefOxc(pred)),\n };\n }\n }\n\n let read: any = null;\n let isStatic = false;\n let descendants = isView || isFirst;\n\n if (args.length > 1 && args[1]?.type === 'ObjectExpression') {\n for (const prop of args[1].properties || []) {\n if (prop.type !== 'ObjectProperty' && prop.type !== 'Property')\n continue;\n const k = propKeyName(prop);\n if (k === 'read') read = new o.WrappedNodeExpr(prop.value);\n if (k === 'static')\n isStatic =\n sourceCode.slice(prop.value.start, prop.value.end) === 'true';\n if (k === 'descendants')\n descendants =\n sourceCode.slice(prop.value.start, prop.value.end) === 'true';\n }\n }\n\n const query = {\n propertyName: memberName,\n predicate,\n first: isFirst,\n descendants,\n read,\n static: isStatic,\n emitFlags: 0,\n isSignal: false,\n };\n\n if (isView) viewQueries.push(query);\n else contentQueries.push(query);\n break;\n }\n\n case 'HostBinding': {\n const sv = args.length > 0 ? stringValue(args[0]) : null;\n const target = sv !== null ? sv : memberName;\n hostProperties[target] = memberName;\n break;\n }\n\n case 'HostListener': {\n const sv = args.length > 0 ? stringValue(args[0]) : null;\n if (sv !== null) {\n const event = sv;\n let handler = `${memberName}()`;\n if (args.length > 1 && args[1]?.type === 'ArrayExpression') {\n const handlerArgs = (args[1].elements || [])\n .map((e: any) => stringValue(e))\n .filter((v: string | null): v is string => v !== null)\n .join(', ');\n handler = `${memberName}(${handlerArgs})`;\n }\n hostListeners[event] = handler;\n }\n break;\n }\n }\n }\n }\n\n return {\n inputs,\n outputs,\n viewQueries,\n contentQueries,\n hostProperties,\n hostListeners,\n };\n}\n\n/**\n * Analyze constructor parameters for dependency injection.\n * Returns:\n * - R3DependencyMetadata[] for normal constructors\n * - null if class extends another without own constructor (use inherited factory)\n * - 'invalid' if any parameter has a type-only import token\n *\n * Accepts an OXC ClassDeclaration node and the original source string.\n */\n/**\n * Parse an `@Injectable({ deps: [...] })` dependency list into\n * R3DependencyMetadata. Each element is either a bare token expression or a\n * flag array combining DI modifiers with the token, e.g.\n * `[new Optional(), new SkipSelf(), Token]` or `[new Inject(TOKEN)]`.\n */\nfunction extractInjectableDeps(depsNode: any, sourceCode: string): any[] {\n const deps: any[] = [];\n for (const el of depsNode.elements || []) {\n if (!el) continue;\n let tokenNode: any = el;\n let optional = false,\n self = false,\n skipSelf = false,\n host = false;\n\n if (el.type === 'ArrayExpression') {\n // Flag array: zero or more `new <Modifier>()` instances plus the token.\n tokenNode = null;\n for (const item of el.elements || []) {\n if (!item) continue;\n if (item.type === 'NewExpression') {\n switch (item.callee?.name) {\n case 'Optional':\n optional = true;\n continue;\n case 'Self':\n self = true;\n continue;\n case 'SkipSelf':\n skipSelf = true;\n continue;\n case 'Host':\n host = true;\n continue;\n case 'Inject':\n tokenNode = item.arguments?.[0] ?? null;\n continue;\n }\n }\n // Bare token (identifier, member expression, `new InjectionToken()`…)\n tokenNode = item;\n }\n }\n\n // Unwrap `forwardRef(() => TOKEN)` to TOKEN so the emitted factory\n // references the token directly — matching `extractConstructorDeps` and\n // covering every form (`deps: [forwardRef(...)]`,\n // `[new Inject(forwardRef(...))]`, `[[new Optional(), forwardRef(...)]]`).\n const resolvedToken = tokenNode ? unwrapForwardRefOxc(tokenNode) : null;\n const tokenStr = resolvedToken\n ? sourceCode.slice(resolvedToken.start, resolvedToken.end)\n : null;\n deps.push({\n token: tokenStr\n ? new o.WrappedNodeExpr(tokenStr)\n : new o.LiteralExpr(null),\n attributeNameType: null,\n host,\n optional,\n self,\n skipSelf,\n });\n }\n return deps;\n}\n\nexport function extractConstructorDeps(\n classNode: any,\n sourceCode: string,\n typeOnlyImports: Set<string>,\n): any[] | 'invalid' | null {\n const heritage: any[] = classNode.superClass ? [classNode.superClass] : [];\n const hasSuper = heritage.length > 0;\n\n const members: any[] = classNode.body?.body || [];\n const ctors = members.filter(\n (m: any) => m.type === 'MethodDefinition' && m.kind === 'constructor',\n );\n // With overloaded constructors, only the implementation carries the real\n // parameter list and parameter decorators; the overload *signatures* have\n // `value.body === null`. Picking the first constructor would read an\n // overload signature and emit a factory missing the remaining deps.\n const ctor = ctors.find((m: any) => m.value?.body != null) ?? ctors[0];\n\n if (!ctor) {\n return hasSuper ? null : [];\n }\n\n const params: any[] = ctor.value?.params?.items || ctor.value?.params || [];\n const deps: any[] = [];\n let invalid = false;\n\n for (const param of params) {\n let token: string | null = null;\n // For `@Attribute(...)` the injected value is the attribute name itself,\n // not a type token. `attributeToken` holds that name expression (a string\n // literal for `@Attribute('name')`, or the raw expression for a computed\n // name like `@Attribute(dynamicAttrName())`); `attributeNameType` being\n // non-null flags the dep as an attribute injection so the factory emits\n // `ɵɵinjectAttribute(<name>)` instead of `ɵɵdirectiveInject(...)`.\n let attributeToken: any = null;\n let attributeNameType: any = null;\n let host = false,\n optional = false,\n self = false,\n skipSelf = false;\n\n // Handle TSParameterProperty (e.g., constructor(private foo: Bar))\n const actualParam =\n param.type === 'TSParameterProperty' ? param.parameter : param;\n const typeAnn =\n actualParam?.typeAnnotation?.typeAnnotation ??\n param?.typeAnnotation?.typeAnnotation;\n\n // Extract type annotation as token\n if (typeAnn) {\n if (typeAnn.type === 'TSTypeReference' && typeAnn.typeName) {\n token =\n typeAnn.typeName.name ??\n sourceCode.slice(typeAnn.typeName.start, typeAnn.typeName.end);\n } else if (typeAnn.type === 'TSUnionType') {\n // Filter out null/undefined/void arms — `T | null` and\n // `T | undefined` are common patterns that should resolve to T.\n // Anything else (multiple TypeReference arms, primitives, etc.)\n // is ambiguous and ngtsc rejects it. Mark as invalid so the\n // factory falls through to ɵɵinvalidFactory rather than\n // silently picking the first arm.\n const nonNullTypes = (typeAnn.types || []).filter((t: any) => {\n if (!t) return false;\n if (t.type === 'TSNullKeyword') return false;\n if (t.type === 'TSUndefinedKeyword') return false;\n if (t.type === 'TSVoidKeyword') return false;\n if (\n t.type === 'TSLiteralType' &&\n (t.literal?.type === 'NullLiteral' ||\n (t.literal?.type === 'Literal' && t.literal.value === null))\n ) {\n return false;\n }\n return true;\n });\n if (\n nonNullTypes.length === 1 &&\n nonNullTypes[0].type === 'TSTypeReference' &&\n nonNullTypes[0].typeName\n ) {\n const t = nonNullTypes[0];\n token =\n t.typeName.name ??\n sourceCode.slice(t.typeName.start, t.typeName.end);\n } else {\n // Ambiguous union — no suitable injection token.\n invalid = true;\n continue;\n }\n } else if (typeAnn.type === 'TSIntersectionType') {\n // Intersection types (`A & B`) have no single injection token.\n invalid = true;\n continue;\n }\n }\n\n // Process parameter decorators (may live on TSParameterProperty or inner param)\n const paramDecs: any[] = [\n ...(param.decorators || []),\n ...(param.type === 'TSParameterProperty' && actualParam?.decorators\n ? actualParam.decorators\n : []),\n ];\n for (const dec of paramDecs) {\n const expr = dec.expression;\n if (!expr || expr.type !== 'CallExpression') continue;\n const decName: string | undefined = expr.callee?.name;\n if (!decName) continue;\n const args: any[] = expr.arguments || [];\n\n switch (decName) {\n case 'Inject':\n if (args.length > 0) {\n const sv = stringValue(args[0]);\n if (sv !== null) {\n token = sv;\n } else {\n // Unwrap `@Inject(forwardRef(() => TOKEN))` so the\n // emitted token references TOKEN directly. Without this\n // the raw `forwardRef(() => TOKEN)` source slice would\n // appear in the factory output, producing broken code\n // that calls forwardRef at definition time.\n const unwrapped = unwrapForwardRefOxc(args[0]);\n token = sourceCode.slice(unwrapped.start, unwrapped.end);\n }\n }\n break;\n case 'Optional':\n optional = true;\n break;\n case 'Self':\n self = true;\n break;\n case 'SkipSelf':\n skipSelf = true;\n break;\n case 'Host':\n host = true;\n break;\n case 'Attribute':\n if (args.length > 0) {\n const sv = stringValue(args[0]);\n if (sv !== null) {\n attributeToken = new o.LiteralExpr(sv);\n attributeNameType = new o.LiteralExpr(sv);\n } else {\n // Computed attribute name, e.g. `@Attribute(dynamicAttrName())`.\n // ngtsc emits `ɵɵinjectAttribute(<expr>)`; pass the expression\n // through by value. `attributeNameType` only feeds the (unused)\n // `.d.ts` type, so a placeholder is sufficient to flag the dep.\n attributeToken = new o.WrappedNodeExpr(args[0]);\n attributeNameType = new o.LiteralExpr('unknown');\n }\n token = '';\n }\n break;\n }\n }\n\n if (!token && !attributeToken) {\n invalid = true;\n continue;\n }\n\n if (token && typeOnlyImports.has(token)) {\n invalid = true;\n continue;\n }\n\n deps.push({\n token:\n attributeToken ??\n (token ? new o.WrappedNodeExpr(token) : new o.LiteralExpr(null)),\n attributeNameType,\n host,\n optional,\n self,\n skipSelf,\n });\n }\n\n return invalid ? 'invalid' : deps;\n}\n"],"mappings":";;;;AAIA,SAAS,WAAW,MAAsD;CACxE,MAAM,SAAS,KAAK;AACpB,KAAI,CAAC,OAAQ,QAAO;AAEpB,KAAI,OAAO,SAAS,aAClB,QAAO;EAAE,KAAK,OAAO;EAAM,UA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SAAS,GAAG;MACnB,MAAM,KAAK,YAAY,KAAK,GAAG;AAC/B,UAAI,OAAO,MAAM;AACf,wBAAiB,IAAI,EAAE,YAAY,GAAG;AACtC,2BAAoB,IAAI,EAAE,YAAY,GAAG;aACpC;AAKL,wBAAiB,IAAI,EAAE,gBAAgB,KAAK,GAAG;AAC/C,2BAAoB,IAAI,EAAE,YAAY,UAAU;;AAElD,cAAQ;;AAEV;;;AAIN,MAAI,CAAC,SAAS,CAAC,gBAAgB;AAC7B,aAAU;AACV;;AAGF,MAAI,SAAS,gBAAgB,IAAI,MAAM,EAAE;AACvC,aAAU;AACV;;AAGF,OAAK,KAAK;GACR,OACE,mBACC,QAAQ,IAAI,EAAE,gBAAgB,MAAM,GAAG,IAAI,EAAE,YAAY,KAAK;GACjE;GACA;GACA;GACA;GACA;GACD,CAAC;;AAGJ,QAAO,UAAU,YAAY"}
1
+ {"version":3,"file":"metadata.js","names":[],"sources":["../../../../src/lib/compiler/metadata.ts"],"sourcesContent":["import * as o from '@angular/compiler';\nimport { unwrapForwardRefOxc } from './utils.js';\nimport { FIELD_DECORATORS, SIGNAL_APIS } from './constants.js';\n\nfunction getCallApi(call: any): { api: string; required: boolean } | null {\n const callee = call.callee;\n if (!callee) return null;\n\n if (callee.type === 'Identifier') {\n return { api: callee.name, required: false };\n }\n\n if (\n (callee.type === 'StaticMemberExpression' ||\n callee.type === 'MemberExpression') &&\n callee.object?.type === 'Identifier' &&\n callee.property?.name === 'required'\n ) {\n return { api: callee.object.name, required: true };\n }\n\n return null;\n}\n\n/**\n * Extract the string value from an OXC string literal or template literal node.\n *\n * If `consts` is provided, interpolated template literals (e.g.\n * `\\`hello ${NAME}\\``) are resolved when every `${...}` expression is a bare\n * `Identifier` whose name is present in the map. This lets metadata fields\n * such as `template:` reference module-level string constants via JS\n * template-literal interpolation:\n *\n * const tw = `text-zinc-700 hover:text-zinc-900`;\n * @Component({ template: `<a class=\"${tw}\">x</a>` })\n *\n * Returns `null` if the node is not statically resolvable.\n */\nfunction stringValue(node: any, consts?: Map<string, string>): string | null {\n // Type-only wrappers such as `'x' as const` and parentheses don't change the value.\n while (\n node?.type === 'TSAsExpression' ||\n node?.type === 'TSSatisfiesExpression' ||\n node?.type === 'ParenthesizedExpression'\n )\n node = node.expression;\n if (node?.type === 'StringLiteral') return node.value;\n if (node?.type === 'BinaryExpression' && node.operator === '+') {\n const operand = (n: any) =>\n n?.type === 'Identifier'\n ? (consts?.get(n.name) ?? null)\n : stringValue(n, consts);\n const left = operand(node.left);\n const right = left === null ? null : operand(node.right);\n return right === null ? null : left + right;\n }\n if (node?.type === 'Literal' && typeof node.value === 'string')\n return node.value;\n if (node?.type === 'TemplateLiteral') {\n const quasis = node.quasis ?? [];\n const expressions = node.expressions ?? [];\n if (expressions.length === 0) {\n return quasis[0]?.value?.cooked ?? null;\n }\n if (!consts) return null;\n let result = '';\n for (let i = 0; i < quasis.length; i++) {\n const cooked = quasis[i]?.value?.cooked;\n if (cooked == null) return null;\n result += cooked;\n if (i < expressions.length) {\n const expr = expressions[i];\n if (expr?.type !== 'Identifier') return null;\n const resolved = consts.get(expr.name);\n if (resolved == null) return null;\n result += resolved;\n }\n }\n return result;\n }\n return null;\n}\n\n/** Check if an OXC node is a string-like literal. */\nfunction isStringLike(node: any, consts?: Map<string, string>): boolean {\n return stringValue(node, consts) !== null;\n}\n\n/**\n * Walk the top-level statements of an OXC program and collect a map of\n * statically-resolvable string-valued `const NAME = ...` declarations.\n *\n * Used so decorator metadata fields like `template:` can reference\n * module-level Tailwind class chains (or any other string constants) via\n * JS template-literal interpolation. Resolution is iterative: a const may\n * reference earlier-resolved consts via `${other}` interpolation.\n *\n * Only `const` declarations are considered. Non-string initializers,\n * function calls, member access, and any expression that cannot be reduced\n * to a string at parse time are ignored.\n */\nexport function collectStringConstants(oxcProgram: any): Map<string, string> {\n const rawDecls = new Map<string, any>();\n for (const stmt of oxcProgram?.body || []) {\n const decl =\n stmt.type === 'ExportNamedDeclaration' ? stmt.declaration : stmt;\n if (!decl || decl.type !== 'VariableDeclaration' || decl.kind !== 'const')\n continue;\n for (const d of decl.declarations || []) {\n if (d.id?.type === 'Identifier' && d.init) {\n rawDecls.set(d.id.name, d.init);\n }\n }\n }\n\n const resolved = new Map<string, string>();\n // Iterative fixpoint: each pass resolves consts whose dependencies are\n // already known. Bounded by the number of declarations to prevent cycles.\n for (let pass = 0; pass < rawDecls.size + 1; pass++) {\n let progress = false;\n for (const [name, init] of rawDecls) {\n if (resolved.has(name)) continue;\n const value = stringValue(init, resolved);\n if (value !== null) {\n resolved.set(name, value);\n progress = true;\n }\n }\n if (!progress) break;\n }\n return resolved;\n}\n\n/** Get the property key name from an OXC object property. */\nfunction propKeyName(prop: any): string | null {\n if (!prop.key) return null;\n return prop.key.name ?? prop.key.value ?? null;\n}\n\n/** Resolve a host key or value to a string literal or same-file string const. */\nfunction hostString(node: any, consts?: Map<string, string>): string | null {\n if (node?.type === 'Identifier') return consts?.get(node.name) ?? null;\n return stringValue(node, consts);\n}\n\n/**\n * Extract decorator metadata from an OXC decorator AST node.\n * Parses @Component, @Directive, @Pipe, @Injectable, @Service, @NgModule arguments.\n *\n * `stringConsts`, when provided, lets string-typed metadata fields\n * (`template`, `selector`, `templateUrl`, `styles`, `styleUrl`, `styleUrls`,\n * `name`, `exportAs`, `providedIn`) resolve module-level string constants\n * referenced via template-literal interpolation, e.g.\n * `template: \\`<div class=\"${tw}\">x</div>\\``.\n */\nexport function extractMetadata(\n dec: any | undefined,\n sourceCode: string,\n stringConsts?: Map<string, string>,\n): any {\n if (!dec) return null;\n const call = dec.expression;\n if (!call || call.type !== 'CallExpression') return null;\n const arg = call.arguments?.[0];\n const meta: any = {\n hostRaw: {},\n inputs: {},\n outputs: {},\n standalone: true,\n imports: [],\n providers: null,\n viewProviders: null,\n animations: null,\n changeDetection: null,\n encapsulation: null,\n preserveWhitespaces: false,\n exportAs: null,\n selector: undefined,\n styles: [],\n templateUrl: null,\n styleUrls: [],\n };\n if (!arg || arg.type !== 'ObjectExpression') return meta;\n\n for (const p of arg.properties || []) {\n if (p.type !== 'ObjectProperty' && p.type !== 'Property') continue;\n const key = propKeyName(p);\n if (!key) continue;\n const valNode = p.value;\n const valText = sourceCode.slice(valNode.start, valNode.end);\n\n switch (key) {\n case 'host':\n if (valNode.type === 'ObjectExpression') {\n for (const hp of valNode.properties || []) {\n const hKey = hp.computed\n ? hostString(hp.key, stringConsts)\n : propKeyName(hp);\n const hVal = hostString(hp.value, stringConsts);\n // Spreads, imported constants, and other expressions cannot be\n // evaluated without a ts.Program; fail instead of emitting the\n // identifier name as the binding.\n if (hKey === null || hVal === null) {\n throw new Error(\n `[fast-compile] Cannot statically resolve host binding \\`${sourceCode.slice(hp.start, hp.end)}\\`. ` +\n 'Only string literals and string constants declared in the same file are supported; ' +\n 'use a string literal or @HostBinding/@HostListener instead.',\n );\n }\n meta.hostRaw[String(hKey).replace(/^['\"`]|['\"`]$/g, '')] = hVal;\n }\n }\n break;\n case 'changeDetection':\n meta.changeDetection = valText.includes('OnPush') ? 0 : 1;\n break;\n case 'encapsulation':\n meta.encapsulation = valText.includes('None')\n ? 2\n : valText.includes('ShadowDom')\n ? 3\n : 0;\n break;\n case 'preserveWhitespaces':\n meta.preserveWhitespaces = valText === 'true';\n break;\n case 'pure':\n case 'standalone':\n meta[key] = valText !== 'false';\n break;\n case 'template':\n case 'selector':\n case 'name':\n case 'exportAs':\n case 'templateUrl':\n case 'providedIn': {\n const sv = stringValue(valNode, stringConsts);\n if (sv !== null) {\n meta[key] = sv;\n } else if (valNode.type === 'TemplateLiteral') {\n // Template literal with `${...}` interpolations that couldn't\n // all be resolved at parse time (e.g. they reference imports\n // or non-string values). The previous fallback stripped every\n // quote character from the source, which silently corrupted\n // templates such as `<a class=\"${cls} foo\">…</a>` into\n // `<a class=${cls} foo>…</a>` — making Angular's HTML parser\n // fail with confusing errors like `Opening tag \"a\" not\n // terminated`. Instead, walk the quasis and substitute each\n // unresolved interpolation with the empty string so the\n // surrounding HTML (including quoted attributes) is preserved.\n const quasis = valNode.quasis ?? [];\n const expressions = valNode.expressions ?? [];\n let result = '';\n for (let i = 0; i < quasis.length; i++) {\n result += quasis[i]?.value?.cooked ?? '';\n if (i < expressions.length) {\n const expr = expressions[i];\n if (expr?.type === 'Identifier') {\n const resolved = stringConsts?.get(expr.name);\n if (resolved != null) {\n result += resolved;\n continue;\n }\n }\n // Unresolvable — substitute empty string. This keeps the\n // surrounding HTML well-formed even if the resulting class\n // list is incomplete.\n }\n }\n meta[key] = result;\n } else {\n // Non-string, non-template-literal expression. Strip only the\n // outermost JS string delimiters, not every embedded quote.\n meta[key] = valText.replace(/^['\"`]|['\"`]$/g, '');\n }\n if (key === 'exportAs') meta.exportAs = [meta.exportAs];\n break;\n }\n case 'styleUrl': {\n const sv = stringValue(valNode, stringConsts);\n meta.styleUrls = [sv !== null ? sv : valText.replace(/['\"`]/g, '')];\n break;\n }\n case 'styleUrls':\n if (valNode.type === 'ArrayExpression') {\n meta.styleUrls = (valNode.elements || []).map((e: any) => {\n const sv = stringValue(e, stringConsts);\n return sv !== null\n ? sv\n : sourceCode.slice(e.start, e.end).replace(/['\"`]/g, '');\n });\n }\n break;\n case 'styles':\n if (valNode.type === 'ArrayExpression') {\n meta.styles = (valNode.elements || []).map((e: any) => {\n const sv = stringValue(e, stringConsts);\n return sv !== null\n ? sv\n : sourceCode.slice(e.start, e.end).replace(/['\"`]/g, '');\n });\n } else {\n const sv = stringValue(valNode, stringConsts);\n if (sv !== null) meta.styles = [sv];\n }\n break;\n case 'imports':\n case 'animations':\n case 'rawImports':\n case 'declarations':\n case 'exports':\n case 'bootstrap':\n if (valNode.type === 'ArrayExpression') {\n meta[key] = (valNode.elements || []).map(\n (e: any) => new o.WrappedNodeExpr(unwrapForwardRefOxc(e)),\n );\n }\n break;\n case 'providers':\n case 'viewProviders':\n if (valNode.type === 'ArrayExpression') {\n meta[key] = (valNode.elements || []).map(\n (e: any) => new o.WrappedNodeExpr(unwrapForwardRefOxc(e)),\n );\n } else {\n // `providers: safeProviders` / `viewProviders: SHARED_PROVIDERS`\n // — a reference to a module-level const (or any non-literal\n // expression such as a spread or function call) rather than an\n // inline array literal. ngtsc's partial evaluator expands the\n // identifier to its array; fastCompile does no static evaluation,\n // so it cannot. But Angular emits injector/host `providers` as a\n // single Expression and flattens nested arrays at runtime, so the\n // reference can be passed through by value. Storing it as a bare\n // `o.Expression` (not an array) signals the emission sites to emit\n // it directly instead of wrapping it in a `LiteralArrayExpr`.\n // Without this, the whole `providers` list is silently dropped and\n // every token it provides fails at runtime with NG0201.\n meta[key] = new o.WrappedNodeExpr(valNode);\n }\n break;\n // @Injectable provider configuration. Pass these through to\n // compileInjectable so the emitted `ɵprov` reflects the user's\n // intent. `useClass`/`useExisting`/`useValue` are\n // `MaybeForwardRefExpression` (`{ expression, forwardRef }`);\n // `useFactory` is a bare `Expression`.\n case 'useClass':\n case 'useExisting':\n case 'useValue': {\n const unwrapped = unwrapForwardRefOxc(valNode);\n const isForwardRef =\n valNode.type === 'CallExpression' && unwrapped !== valNode;\n meta[key] = {\n expression: new o.WrappedNodeExpr(unwrapped),\n forwardRef: isForwardRef ? 2 : 0,\n };\n break;\n }\n case 'useFactory':\n meta[key] = new o.WrappedNodeExpr(valNode);\n break;\n // `@Injectable({ deps: [...] })` — the dependency list for `useFactory`\n // / `useClass`. Each entry is either a bare token or a flag array such\n // as `[new Optional(), new SkipSelf(), Token]`. Without parsing this the\n // emitted factory ignores the deps and calls the factory/ctor with no\n // arguments.\n case 'deps':\n if (valNode.type === 'ArrayExpression') {\n meta.deps = extractInjectableDeps(valNode, sourceCode);\n }\n break;\n // `@Service` configuration. `autoProvided` defaults to `true`, so only\n // an explicit `false` is meaningful; `factory` is a bare expression\n // forwarded to compileService.\n case 'autoProvided':\n meta.autoProvided = valText === 'true';\n break;\n case 'factory':\n meta.factory = new o.WrappedNodeExpr(valNode);\n break;\n case 'hostDirectives':\n if (valNode.type === 'ArrayExpression') {\n meta.hostDirectives = (valNode.elements || [])\n .map((el: any) => {\n // Bare identifier: hostDirectives: [MatTooltip]\n if (el.type === 'Identifier' || el.type === 'CallExpression') {\n const unwrapped = unwrapForwardRefOxc(el);\n const ref = {\n value: new o.WrappedNodeExpr(unwrapped),\n type: new o.WrappedNodeExpr(unwrapped),\n };\n return {\n directive: ref,\n isForwardReference: el.type === 'CallExpression',\n inputs: null,\n outputs: null,\n };\n }\n // Object form: { directive: MatTooltip, inputs: [...], outputs: [...] }\n if (el.type === 'ObjectExpression') {\n let directiveNode: any = null;\n let isForwardRef = false;\n let inputs: Record<string, string> | null = null;\n let outputs: Record<string, string> | null = null;\n for (const prop of el.properties || []) {\n if (\n prop.type !== 'ObjectProperty' &&\n prop.type !== 'Property'\n )\n continue;\n const pName = propKeyName(prop);\n if (pName === 'directive') {\n directiveNode = unwrapForwardRefOxc(prop.value);\n isForwardRef =\n prop.value?.type === 'CallExpression' &&\n sourceCode\n .slice(prop.value.start, prop.value.end)\n .includes('forwardRef');\n } else if (\n pName === 'inputs' &&\n prop.value?.type === 'ArrayExpression'\n ) {\n inputs = {};\n for (const e of prop.value.elements || []) {\n const sv = stringValue(e);\n if (sv !== null) {\n const [source, alias = source] = sv\n .split(':')\n .map((part: string) => part.trim());\n if (source) inputs[source] = alias;\n }\n }\n } else if (\n pName === 'outputs' &&\n prop.value?.type === 'ArrayExpression'\n ) {\n outputs = {};\n for (const e of prop.value.elements || []) {\n const sv = stringValue(e);\n if (sv !== null) {\n const [source, alias = source] = sv\n .split(':')\n .map((part: string) => part.trim());\n if (source) outputs[source] = alias;\n }\n }\n }\n }\n if (directiveNode) {\n const ref = {\n value: new o.WrappedNodeExpr(directiveNode),\n type: new o.WrappedNodeExpr(directiveNode),\n };\n return {\n directive: ref,\n isForwardReference: isForwardRef,\n inputs,\n outputs,\n };\n }\n }\n return null;\n })\n .filter(Boolean);\n }\n break;\n default:\n meta[key] = valText.replace(/['\"`]/g, '');\n }\n }\n return meta;\n}\n\n/**\n * Detect signal-based APIs on class members: input(), model(), output(),\n * viewChild(), contentChild(), viewChildren(), contentChildren().\n */\nexport function detectSignals(classNode: any, sourceCode: string) {\n const inputs: any = {},\n outputs: any = {},\n viewQueries: any[] = [],\n contentQueries: any[] = [];\n\n const members: any[] = classNode.body?.body || [];\n\n for (const m of members) {\n if (\n m.type !== 'PropertyDefinition' ||\n !m.key?.name ||\n !m.value ||\n m.value.type !== 'CallExpression'\n )\n continue;\n\n const name: string = m.key.name;\n const signalCall = getCallApi(m.value);\n if (!signalCall) continue;\n\n const { api, required } = signalCall;\n if (!SIGNAL_APIS.has(api)) continue;\n\n // Skip signal synthesis when an explicit Angular decorator already\n // covers the same field. Mirrors Angular's transform behavior\n // (input_function.ts:42-48 et al.) and the JIT fix in\n // jit-metadata.ts. Without this, the downstream merge in compile.ts\n // overwrites decorator-derived metadata or, worse, concats duplicate\n // query entries that fire twice.\n const explicit = new Set<string>();\n for (const dec of m.decorators || []) {\n const decName: string | undefined = dec.expression?.callee?.name;\n if (decName && FIELD_DECORATORS.has(decName)) explicit.add(decName);\n }\n const hasInput = explicit.has('Input');\n const hasOutput = explicit.has('Output');\n const hasQuery =\n explicit.has('ViewChild') ||\n explicit.has('ViewChildren') ||\n explicit.has('ContentChild') ||\n explicit.has('ContentChildren');\n if (api === 'input' && hasInput) continue;\n if (api === 'model' && (hasInput || hasOutput)) continue;\n if ((api === 'output' || api === 'outputFromObservable') && hasOutput) {\n continue;\n }\n if (\n (api === 'viewChild' ||\n api === 'viewChildren' ||\n api === 'contentChild' ||\n api === 'contentChildren') &&\n hasQuery\n ) {\n continue;\n }\n\n const args: any[] = m.value.arguments || [];\n\n // 1. SIGNAL INPUTS (Standard & Required)\n if (api === 'input') {\n let alias: string | null = null;\n const optionsArg = required ? args[0] : args[1];\n if (optionsArg?.type === 'ObjectExpression') {\n for (const prop of optionsArg.properties || []) {\n if (prop.type !== 'ObjectProperty' && prop.type !== 'Property')\n continue;\n if (propKeyName(prop) === 'alias') {\n const sv = stringValue(prop.value);\n if (sv !== null) alias = sv;\n }\n }\n }\n inputs[name] = {\n classPropertyName: name,\n // The binding (public) name is the alias if provided, otherwise\n // the class property name. Without honoring `alias`, host\n // directives that map by public name (e.g.\n // `inputs: ['aria-label']` against `ariaLabel = input(null, {\n // alias: 'aria-label' })`) fail at runtime with NG0311.\n bindingPropertyName: alias ?? name,\n isSignal: true,\n required,\n // Always null for signal inputs. The input() factory already\n // applies the user's transform internally; forwarding it to the\n // directive metadata would make Angular's emitter set the\n // HasDecoratorInputTransform flag, causing the transform to run\n // again via the runtime input setter. Mirrors upstream\n // input_function.ts:74.\n transform: null,\n };\n }\n\n // 2. MODEL SIGNALS (Writable Inputs)\n else if (api === 'model') {\n // model() supports the same options object as input(); honor `alias`\n // for the same reason (host-directive mappings use the public name).\n let alias: string | null = null;\n const optionsArg = required ? args[0] : args[1];\n if (optionsArg?.type === 'ObjectExpression') {\n for (const prop of optionsArg.properties || []) {\n if (prop.type !== 'ObjectProperty' && prop.type !== 'Property')\n continue;\n if (propKeyName(prop) === 'alias') {\n const sv = stringValue(prop.value);\n if (sv !== null) alias = sv;\n }\n }\n }\n inputs[name] = {\n classPropertyName: name,\n bindingPropertyName: alias ?? name,\n isSignal: true,\n // Propagate `.required` so the runtime enforces the unbound-required\n // check. Without this, `model.required(...)` accepts an unbound parent\n // and the model signal stays at its undefined initial value silently.\n required,\n };\n // The compiled `outputs` field is `{ classPropertyName: bindingName }`.\n // Angular inverts this at runtime via\n // `parseAndConvertOutputsForDefinition`, producing the lookup map\n // `{ bindingName: classPropertyName }` used by `listenToOutput`.\n // For a `model()` signal, the class property is `name` and the\n // binding event is `${aliasOrName}Change`, and the model signal\n // itself is the subscribable, so `instance[name]` is what\n // `listenToOutput` needs to resolve.\n outputs[name] = (alias ?? name) + 'Change';\n }\n\n // 3. SIGNAL QUERIES (viewChild, contentChild)\n else if (\n api === 'viewChild' ||\n api === 'viewChildren' ||\n api === 'contentChild' ||\n api === 'contentChildren'\n ) {\n const isViewQuery = api === 'viewChild' || api === 'viewChildren';\n const isChildrenQuery =\n api === 'viewChildren' || api === 'contentChildren';\n\n const firstArg = args[0];\n const sv = stringValue(firstArg);\n\n // Parse the optional second-arg options object for `read` and\n // (content queries only) `descendants`. Without this, queries like\n // `viewChild('ref', { read: ElementRef })` and\n // `contentChildren(Foo, { descendants: false })` silently lose\n // their options at runtime.\n let read: any = null;\n // Defaults match Angular's signal-query API and the decorator\n // path (`isView || isFirst` in detectFieldDecorators):\n // viewChild → true (view queries always traverse)\n // viewChildren → true\n // contentChild → true (single-result content queries\n // traverse by default)\n // contentChildren → false (multi-result content queries are\n // shallow unless explicitly opted in)\n let descendants = isViewQuery || !isChildrenQuery;\n const optArg = args[1];\n if (optArg?.type === 'ObjectExpression') {\n for (const prop of optArg.properties || []) {\n if (prop.type !== 'ObjectProperty' && prop.type !== 'Property')\n continue;\n const k = propKeyName(prop);\n if (k === 'read') {\n read = new o.WrappedNodeExpr(unwrapForwardRefOxc(prop.value));\n } else if (k === 'descendants') {\n const t = prop.value?.type;\n if (\n t === 'BooleanLiteral' ||\n (t === 'Literal' && typeof prop.value.value === 'boolean')\n ) {\n descendants = prop.value.value;\n }\n }\n }\n }\n\n const query = {\n propertyName: name,\n // Class predicates must be wrapped in an `R3QueryReference`\n // (`{ forwardRef, expression }`); Angular's `getQueryPredicate`\n // dispatches on `predicate.forwardRef` and reads\n // `predicate.expression`, so a bare `WrappedNodeExpr` is silently\n // dropped to `undefined` and emitted as `null`, leaving the query\n // with no target. `0 = ForwardRefHandling.None`.\n predicate:\n sv !== null\n ? [sv]\n : { forwardRef: 0, expression: new o.WrappedNodeExpr(firstArg) },\n first: !isChildrenQuery,\n descendants,\n read,\n static: false,\n emitFlags: 0,\n isSignal: true,\n };\n\n if (isViewQuery) viewQueries.push(query);\n else contentQueries.push(query);\n }\n\n // 4. STANDARD OUTPUTS (output() and outputFromObservable())\n else if (api === 'output' || api === 'outputFromObservable') {\n let alias = name;\n // outputFromObservable(observable, options) — options is args[1].\n // output(options) — options is args[0]. Mirrors upstream\n // output_function.ts:81.\n const optArg = api === 'outputFromObservable' ? args[1] : args[0];\n if (optArg?.type === 'ObjectExpression') {\n for (const prop of optArg.properties || []) {\n if (\n (prop.type === 'ObjectProperty' || prop.type === 'Property') &&\n propKeyName(prop) === 'alias'\n ) {\n const sv = stringValue(prop.value);\n if (sv !== null) alias = sv;\n }\n }\n }\n outputs[name] = alias;\n }\n }\n\n return { inputs, outputs, viewQueries, contentQueries };\n}\n\n/**\n * Detect decorator-based field metadata: @Input, @Output, @ViewChild,\n * @ContentChild, @ViewChildren, @ContentChildren, @HostBinding, @HostListener.\n */\nexport function detectFieldDecorators(classNode: any, sourceCode: string) {\n const inputs: any = {};\n const outputs: any = {};\n const viewQueries: any[] = [];\n const contentQueries: any[] = [];\n const hostProperties: Record<string, string> = {};\n const hostListeners: Record<string, string> = {};\n\n const members: any[] = classNode.body?.body || [];\n\n for (const member of members) {\n const decorators: any[] = member.decorators || [];\n if (decorators.length === 0) continue;\n\n const memberName: string = member.key?.name || '';\n\n for (const dec of decorators) {\n const expr = dec.expression;\n if (!expr || expr.type !== 'CallExpression') continue;\n const decName: string | undefined = expr.callee?.name;\n if (!decName) continue;\n const args: any[] = expr.arguments || [];\n\n switch (decName) {\n case 'Input': {\n let bindingName = memberName;\n let required = false;\n let transformFunction: any = null;\n\n if (args.length > 0) {\n const arg = args[0];\n const sv = stringValue(arg);\n if (sv !== null) {\n bindingName = sv;\n } else if (arg.type === 'ObjectExpression') {\n for (const prop of arg.properties || []) {\n if (prop.type !== 'ObjectProperty' && prop.type !== 'Property')\n continue;\n const k = propKeyName(prop);\n if (k === 'alias') {\n const asv = stringValue(prop.value);\n if (asv !== null) bindingName = asv;\n }\n if (k === 'required')\n required =\n sourceCode.slice(prop.value.start, prop.value.end) ===\n 'true';\n if (k === 'transform')\n transformFunction = new o.WrappedNodeExpr(prop.value);\n }\n }\n }\n\n inputs[memberName] = {\n classPropertyName: memberName,\n bindingPropertyName: bindingName,\n isSignal: false,\n required,\n transformFunction,\n };\n break;\n }\n\n case 'Output': {\n const sv = args.length > 0 ? stringValue(args[0]) : null;\n const alias = sv !== null ? sv : memberName;\n outputs[memberName] = alias;\n break;\n }\n\n case 'ViewChild':\n case 'ViewChildren':\n case 'ContentChild':\n case 'ContentChildren': {\n const isView = decName.startsWith('View');\n const isFirst = decName === 'ViewChild' || decName === 'ContentChild';\n\n // Default predicate when no argument is given is the member\n // name. Class predicates (the non-string case) must be wrapped\n // in an `R3QueryReference` (`{ forwardRef, expression }`) so\n // Angular's `getQueryPredicate` can dispatch on `forwardRef`\n // and read `.expression`. A bare `WrappedNodeExpr` is silently\n // dropped to undefined and emitted as `null`.\n let predicate: any = [memberName];\n if (args.length > 0) {\n const pred = args[0];\n const sv = stringValue(pred);\n if (sv !== null) {\n predicate = [sv];\n } else {\n predicate = {\n forwardRef: 0,\n expression: new o.WrappedNodeExpr(unwrapForwardRefOxc(pred)),\n };\n }\n }\n\n let read: any = null;\n let isStatic = false;\n let descendants = isView || isFirst;\n\n if (args.length > 1 && args[1]?.type === 'ObjectExpression') {\n for (const prop of args[1].properties || []) {\n if (prop.type !== 'ObjectProperty' && prop.type !== 'Property')\n continue;\n const k = propKeyName(prop);\n if (k === 'read') read = new o.WrappedNodeExpr(prop.value);\n if (k === 'static')\n isStatic =\n sourceCode.slice(prop.value.start, prop.value.end) === 'true';\n if (k === 'descendants')\n descendants =\n sourceCode.slice(prop.value.start, prop.value.end) === 'true';\n }\n }\n\n const query = {\n propertyName: memberName,\n predicate,\n first: isFirst,\n descendants,\n read,\n static: isStatic,\n emitFlags: 0,\n isSignal: false,\n };\n\n if (isView) viewQueries.push(query);\n else contentQueries.push(query);\n break;\n }\n\n case 'HostBinding': {\n const sv = args.length > 0 ? stringValue(args[0]) : null;\n const target = sv !== null ? sv : memberName;\n hostProperties[target] = memberName;\n break;\n }\n\n case 'HostListener': {\n const sv = args.length > 0 ? stringValue(args[0]) : null;\n if (sv !== null) {\n const event = sv;\n let handler = `${memberName}()`;\n if (args.length > 1 && args[1]?.type === 'ArrayExpression') {\n const handlerArgs = (args[1].elements || [])\n .map((e: any) => stringValue(e))\n .filter((v: string | null): v is string => v !== null)\n .join(', ');\n handler = `${memberName}(${handlerArgs})`;\n }\n hostListeners[event] = handler;\n }\n break;\n }\n }\n }\n }\n\n return {\n inputs,\n outputs,\n viewQueries,\n contentQueries,\n hostProperties,\n hostListeners,\n };\n}\n\n/**\n * Analyze constructor parameters for dependency injection.\n * Returns:\n * - R3DependencyMetadata[] for normal constructors\n * - null if class extends another without own constructor (use inherited factory)\n * - 'invalid' if any parameter has a type-only import token\n *\n * Accepts an OXC ClassDeclaration node and the original source string.\n */\n/**\n * Parse an `@Injectable({ deps: [...] })` dependency list into\n * R3DependencyMetadata. Each element is either a bare token expression or a\n * flag array combining DI modifiers with the token, e.g.\n * `[new Optional(), new SkipSelf(), Token]` or `[new Inject(TOKEN)]`.\n */\nfunction extractInjectableDeps(depsNode: any, sourceCode: string): any[] {\n const deps: any[] = [];\n for (const el of depsNode.elements || []) {\n if (!el) continue;\n let tokenNode: any = el;\n let optional = false,\n self = false,\n skipSelf = false,\n host = false;\n\n if (el.type === 'ArrayExpression') {\n // Flag array: zero or more `new <Modifier>()` instances plus the token.\n tokenNode = null;\n for (const item of el.elements || []) {\n if (!item) continue;\n if (item.type === 'NewExpression') {\n switch (item.callee?.name) {\n case 'Optional':\n optional = true;\n continue;\n case 'Self':\n self = true;\n continue;\n case 'SkipSelf':\n skipSelf = true;\n continue;\n case 'Host':\n host = true;\n continue;\n case 'Inject':\n tokenNode = item.arguments?.[0] ?? null;\n continue;\n }\n }\n // Bare token (identifier, member expression, `new InjectionToken()`…)\n tokenNode = item;\n }\n }\n\n // Unwrap `forwardRef(() => TOKEN)` to TOKEN so the emitted factory\n // references the token directly — matching `extractConstructorDeps` and\n // covering every form (`deps: [forwardRef(...)]`,\n // `[new Inject(forwardRef(...))]`, `[[new Optional(), forwardRef(...)]]`).\n const resolvedToken = tokenNode ? unwrapForwardRefOxc(tokenNode) : null;\n const tokenStr = resolvedToken\n ? sourceCode.slice(resolvedToken.start, resolvedToken.end)\n : null;\n deps.push({\n token: tokenStr\n ? new o.WrappedNodeExpr(tokenStr)\n : new o.LiteralExpr(null),\n attributeNameType: null,\n host,\n optional,\n self,\n skipSelf,\n });\n }\n return deps;\n}\n\nexport function extractConstructorDeps(\n classNode: any,\n sourceCode: string,\n typeOnlyImports: Set<string>,\n): any[] | 'invalid' | null {\n const heritage: any[] = classNode.superClass ? [classNode.superClass] : [];\n const hasSuper = heritage.length > 0;\n\n const members: any[] = classNode.body?.body || [];\n const ctors = members.filter(\n (m: any) => m.type === 'MethodDefinition' && m.kind === 'constructor',\n );\n // With overloaded constructors, only the implementation carries the real\n // parameter list and parameter decorators; the overload *signatures* have\n // `value.body === null`. Picking the first constructor would read an\n // overload signature and emit a factory missing the remaining deps.\n const ctor = ctors.find((m: any) => m.value?.body != null) ?? ctors[0];\n\n if (!ctor) {\n return hasSuper ? null : [];\n }\n\n const params: any[] = ctor.value?.params?.items || ctor.value?.params || [];\n const deps: any[] = [];\n let invalid = false;\n\n for (const param of params) {\n let token: string | null = null;\n // For `@Attribute(...)` the injected value is the attribute name itself,\n // not a type token. `attributeToken` holds that name expression (a string\n // literal for `@Attribute('name')`, or the raw expression for a computed\n // name like `@Attribute(dynamicAttrName())`); `attributeNameType` being\n // non-null flags the dep as an attribute injection so the factory emits\n // `ɵɵinjectAttribute(<name>)` instead of `ɵɵdirectiveInject(...)`.\n let attributeToken: any = null;\n let attributeNameType: any = null;\n let host = false,\n optional = false,\n self = false,\n skipSelf = false;\n\n // Handle TSParameterProperty (e.g., constructor(private foo: Bar))\n const actualParam =\n param.type === 'TSParameterProperty' ? param.parameter : param;\n const typeAnn =\n actualParam?.typeAnnotation?.typeAnnotation ??\n param?.typeAnnotation?.typeAnnotation;\n\n // Extract type annotation as token\n if (typeAnn) {\n if (typeAnn.type === 'TSTypeReference' && typeAnn.typeName) {\n token =\n typeAnn.typeName.name ??\n sourceCode.slice(typeAnn.typeName.start, typeAnn.typeName.end);\n } else if (typeAnn.type === 'TSUnionType') {\n // Filter out null/undefined/void arms — `T | null` and\n // `T | undefined` are common patterns that should resolve to T.\n // Anything else (multiple TypeReference arms, primitives, etc.)\n // is ambiguous and ngtsc rejects it. Mark as invalid so the\n // factory falls through to ɵɵinvalidFactory rather than\n // silently picking the first arm.\n const nonNullTypes = (typeAnn.types || []).filter((t: any) => {\n if (!t) return false;\n if (t.type === 'TSNullKeyword') return false;\n if (t.type === 'TSUndefinedKeyword') return false;\n if (t.type === 'TSVoidKeyword') return false;\n if (\n t.type === 'TSLiteralType' &&\n (t.literal?.type === 'NullLiteral' ||\n (t.literal?.type === 'Literal' && t.literal.value === null))\n ) {\n return false;\n }\n return true;\n });\n if (\n nonNullTypes.length === 1 &&\n nonNullTypes[0].type === 'TSTypeReference' &&\n nonNullTypes[0].typeName\n ) {\n const t = nonNullTypes[0];\n token =\n t.typeName.name ??\n sourceCode.slice(t.typeName.start, t.typeName.end);\n } else {\n // Ambiguous union — no suitable injection token.\n invalid = true;\n continue;\n }\n } else if (typeAnn.type === 'TSIntersectionType') {\n // Intersection types (`A & B`) have no single injection token.\n invalid = true;\n continue;\n }\n }\n\n // Process parameter decorators (may live on TSParameterProperty or inner param)\n const paramDecs: any[] = [\n ...(param.decorators || []),\n ...(param.type === 'TSParameterProperty' && actualParam?.decorators\n ? actualParam.decorators\n : []),\n ];\n for (const dec of paramDecs) {\n const expr = dec.expression;\n if (!expr || expr.type !== 'CallExpression') continue;\n const decName: string | undefined = expr.callee?.name;\n if (!decName) continue;\n const args: any[] = expr.arguments || [];\n\n switch (decName) {\n case 'Inject':\n if (args.length > 0) {\n const sv = stringValue(args[0]);\n if (sv !== null) {\n token = sv;\n } else {\n // Unwrap `@Inject(forwardRef(() => TOKEN))` so the\n // emitted token references TOKEN directly. Without this\n // the raw `forwardRef(() => TOKEN)` source slice would\n // appear in the factory output, producing broken code\n // that calls forwardRef at definition time.\n const unwrapped = unwrapForwardRefOxc(args[0]);\n token = sourceCode.slice(unwrapped.start, unwrapped.end);\n }\n }\n break;\n case 'Optional':\n optional = true;\n break;\n case 'Self':\n self = true;\n break;\n case 'SkipSelf':\n skipSelf = true;\n break;\n case 'Host':\n host = true;\n break;\n case 'Attribute':\n if (args.length > 0) {\n const sv = stringValue(args[0]);\n if (sv !== null) {\n attributeToken = new o.LiteralExpr(sv);\n attributeNameType = new o.LiteralExpr(sv);\n } else {\n // Computed attribute name, e.g. `@Attribute(dynamicAttrName())`.\n // ngtsc emits `ɵɵinjectAttribute(<expr>)`; pass the expression\n // through by value. `attributeNameType` only feeds the (unused)\n // `.d.ts` type, so a placeholder is sufficient to flag the dep.\n attributeToken = new o.WrappedNodeExpr(args[0]);\n attributeNameType = new o.LiteralExpr('unknown');\n }\n token = '';\n }\n break;\n }\n }\n\n if (!token && !attributeToken) {\n invalid = true;\n continue;\n }\n\n if (token && typeOnlyImports.has(token)) {\n invalid = true;\n continue;\n }\n\n deps.push({\n token:\n attributeToken ??\n (token ? new o.WrappedNodeExpr(token) : new o.LiteralExpr(null)),\n attributeNameType,\n host,\n optional,\n self,\n skipSelf,\n });\n }\n\n return invalid ? 'invalid' : deps;\n}\n"],"mappings":";;;;AAIA,SAAS,WAAW,MAAsD;CACxE,MAAM,SAAS,KAAK;CACpB,IAAI,CAAC,QAAQ,OAAO;CAEpB,IAAI,OAAO,SAAS,cAClB,OAAO;EAAE,KAAK,OAAO;EAAM,UAAU;CAAM;CAG7C,KACG,OAAO,SAAS,4BACf,OAAO,SAAS,uBAClB,OAAO,QAAQ,SAAS,gBACxB,OAAO,UAAU,SAAS,YAE1B,OAAO;EAAE,KAAK,OAAO,OAAO;EAAM,UAAU;CAAK;CAGnD,OAAO;AACT;;;;;;;;;;;;;;;AAgBA,SAAS,YAAY,MAAW,QAA6C;CAE3E,OACE,MAAM,SAAS,oBACf,MAAM,SAAS,2BACf,MAAM,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