@angular/compiler-cli 19.2.1 → 19.2.2

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 (48) hide show
  1. package/bundles/chunk-J7S5XIBF.js +1 -1
  2. package/bundles/{chunk-GYTY2X5V.js → chunk-K42X3AUZ.js} +2 -2
  3. package/bundles/{chunk-J2ZUZS7X.js → chunk-RPCYQIAM.js} +205 -187
  4. package/bundles/chunk-RPCYQIAM.js.map +6 -0
  5. package/bundles/{chunk-RQP5TAHR.js → chunk-SBXBXYBO.js} +2 -2
  6. package/bundles/{chunk-YDD3LCLX.js → chunk-ZOCNWS5F.js} +59 -28
  7. package/bundles/chunk-ZOCNWS5F.js.map +6 -0
  8. package/bundles/{chunk-ZWSJXDI6.js → chunk-ZQNXTHLJ.js} +2 -2
  9. package/bundles/index.js +5 -5
  10. package/bundles/private/migrations.js +3 -3
  11. package/bundles/private/tooling.js +3 -3
  12. package/bundles/src/bin/ng_xi18n.js +4 -4
  13. package/bundles/src/bin/ngc.js +4 -4
  14. package/bundles_metadata.json +1 -1
  15. package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
  16. package/package.json +2 -2
  17. package/private/migrations.d.ts +1 -1
  18. package/src/ngtsc/annotations/common/src/evaluation.d.ts +1 -1
  19. package/src/ngtsc/annotations/common/src/util.d.ts +19 -2
  20. package/src/ngtsc/annotations/component/src/metadata.d.ts +2 -2
  21. package/src/ngtsc/annotations/component/src/resources.d.ts +2 -2
  22. package/src/ngtsc/annotations/index.d.ts +1 -1
  23. package/src/ngtsc/core/api/src/options.d.ts +8 -0
  24. package/src/ngtsc/core/src/compiler.d.ts +3 -3
  25. package/src/ngtsc/docs/src/function_extractor.d.ts +1 -1
  26. package/src/ngtsc/hmr/src/update_declaration.d.ts +3 -2
  27. package/src/ngtsc/metadata/index.d.ts +1 -1
  28. package/src/ngtsc/metadata/src/resource_registry.d.ts +9 -8
  29. package/src/ngtsc/typecheck/api/api.d.ts +22 -24
  30. package/src/ngtsc/typecheck/api/checker.d.ts +3 -3
  31. package/src/ngtsc/typecheck/api/context.d.ts +26 -17
  32. package/src/ngtsc/typecheck/diagnostics/src/diagnostic.d.ts +2 -2
  33. package/src/ngtsc/typecheck/diagnostics/src/id.d.ts +2 -2
  34. package/src/ngtsc/typecheck/src/checker.d.ts +6 -6
  35. package/src/ngtsc/typecheck/src/completion.d.ts +2 -2
  36. package/src/ngtsc/typecheck/src/context.d.ts +24 -26
  37. package/src/ngtsc/typecheck/src/diagnostics.d.ts +5 -5
  38. package/src/ngtsc/typecheck/src/dom.d.ts +5 -5
  39. package/src/ngtsc/typecheck/src/oob.d.ts +41 -45
  40. package/src/ngtsc/typecheck/src/source.d.ts +11 -11
  41. package/src/ngtsc/typecheck/src/tcb_util.d.ts +15 -15
  42. package/src/ngtsc/typecheck/src/template_symbol_builder.d.ts +3 -3
  43. package/src/ngtsc/typecheck/src/type_check_block.d.ts +3 -3
  44. package/bundles/chunk-J2ZUZS7X.js.map +0 -6
  45. package/bundles/chunk-YDD3LCLX.js.map +0 -6
  46. /package/bundles/{chunk-GYTY2X5V.js.map → chunk-K42X3AUZ.js.map} +0 -0
  47. /package/bundles/{chunk-RQP5TAHR.js.map → chunk-SBXBXYBO.js.map} +0 -0
  48. /package/bundles/{chunk-ZWSJXDI6.js.map → chunk-ZQNXTHLJ.js.map} +0 -0
@@ -103,8 +103,9 @@ function toR3Reference(origin, ref, context, refEmitter) {
103
103
  function isAngularCore(decorator) {
104
104
  return decorator.import !== null && decorator.import.from === CORE_MODULE;
105
105
  }
106
- function isAngularCoreReference(reference, symbolName) {
107
- return reference.ownedByModuleGuess === CORE_MODULE && reference.debugName === symbolName;
106
+ function isAngularCoreReferenceWithPotentialAliasing(reference, symbolName, isCore) {
107
+ var _a;
108
+ return (reference.ownedByModuleGuess === CORE_MODULE || isCore) && ((_a = reference.debugName) == null ? void 0 : _a.replace(/\$\d+$/, "")) === symbolName;
108
109
  }
109
110
  function findAngularDecorator(decorators, name, isCore) {
110
111
  return decorators.find((decorator) => isAngularDecorator(decorator, name, isCore));
@@ -171,17 +172,19 @@ function tryUnwrapForwardRef(node, reflector) {
171
172
  }
172
173
  return expr;
173
174
  }
174
- var forwardRefResolver = (fn, callExpr, resolve, unresolvable) => {
175
- if (!isAngularCoreReference(fn, "forwardRef") || callExpr.arguments.length !== 1) {
176
- return unresolvable;
177
- }
178
- const expanded = expandForwardRef(callExpr.arguments[0]);
179
- if (expanded !== null) {
180
- return resolve(expanded);
181
- } else {
182
- return unresolvable;
183
- }
184
- };
175
+ function createForwardRefResolver(isCore) {
176
+ return (fn, callExpr, resolve, unresolvable) => {
177
+ if (!isAngularCoreReferenceWithPotentialAliasing(fn, "forwardRef", isCore) || callExpr.arguments.length !== 1) {
178
+ return unresolvable;
179
+ }
180
+ const expanded = expandForwardRef(callExpr.arguments[0]);
181
+ if (expanded !== null) {
182
+ return resolve(expanded);
183
+ } else {
184
+ return unresolvable;
185
+ }
186
+ };
187
+ }
185
188
  function combineResolvers(resolvers) {
186
189
  return (fn, callExpr, resolve, unresolvable) => {
187
190
  for (const resolver of resolvers) {
@@ -2097,12 +2100,14 @@ var ResourceRegistry = class {
2097
2100
  }
2098
2101
  return this.externalTemplateToComponentsMap.get(template);
2099
2102
  }
2100
- registerResources(resources, component) {
2103
+ registerResources(resources, directive) {
2101
2104
  if (resources.template !== null) {
2102
- this.registerTemplate(resources.template, component);
2105
+ this.registerTemplate(resources.template, directive);
2103
2106
  }
2104
- for (const style of resources.styles) {
2105
- this.registerStyle(style, component);
2107
+ if (resources.styles !== null) {
2108
+ for (const style of resources.styles) {
2109
+ this.registerStyle(style, directive);
2110
+ }
2106
2111
  }
2107
2112
  }
2108
2113
  registerTemplate(templateResource, component) {
@@ -3513,12 +3518,12 @@ function assertLocalCompilationUnresolvedConst(compilationMode, value, nodeToHig
3513
3518
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/evaluation.mjs
3514
3519
  import { ViewEncapsulation } from "@angular/compiler";
3515
3520
  import ts13 from "typescript";
3516
- function resolveEnumValue(evaluator, metadata, field, enumSymbolName) {
3521
+ function resolveEnumValue(evaluator, metadata, field, enumSymbolName, isCore) {
3517
3522
  let resolved = null;
3518
3523
  if (metadata.has(field)) {
3519
3524
  const expr = metadata.get(field);
3520
3525
  const value = evaluator.evaluate(expr);
3521
- if (value instanceof EnumValue && isAngularCoreReference(value.enumRef, enumSymbolName)) {
3526
+ if (value instanceof EnumValue && isAngularCoreReferenceWithPotentialAliasing(value.enumRef, enumSymbolName, isCore)) {
3522
3527
  resolved = value.resolved;
3523
3528
  } else {
3524
3529
  throw createValueHasWrongTypeError(expr, value, `${field} must be a member of ${enumSymbolName} enum from @angular/core`);
@@ -3777,7 +3782,7 @@ var JitDeclarationRegistry = class {
3777
3782
 
3778
3783
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
3779
3784
  import { compileClassDebugInfo, compileHmrInitializer, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareComponentFromMetadata, compileDeferResolverFunction, ConstantPool as ConstantPool2, CssSelector as CssSelector4, DEFAULT_INTERPOLATION_CONFIG as DEFAULT_INTERPOLATION_CONFIG2, DomElementSchemaRegistry as DomElementSchemaRegistry3, ExternalExpr as ExternalExpr8, FactoryTarget as FactoryTarget3, makeBindingParser as makeBindingParser2, outputAst as o4, R3TargetBinder, R3TemplateDependencyKind, SelectorMatcher as SelectorMatcher3, ViewEncapsulation as ViewEncapsulation2 } from "@angular/compiler";
3780
- import ts47 from "typescript";
3785
+ import ts48 from "typescript";
3781
3786
 
3782
3787
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
3783
3788
  import ts15 from "typescript";
@@ -5005,7 +5010,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
5005
5010
  const sourceFile = clazz.getSourceFile();
5006
5011
  const type = wrapTypeReference(reflector, clazz);
5007
5012
  const rawHostDirectives = directive.get("hostDirectives") || null;
5008
- const hostDirectives = rawHostDirectives === null ? null : extractHostDirectives(rawHostDirectives, evaluator, compilationMode);
5013
+ const hostDirectives = rawHostDirectives === null ? null : extractHostDirectives(rawHostDirectives, evaluator, compilationMode, createForwardRefResolver(isCore));
5009
5014
  if (compilationMode !== CompilationMode.LOCAL && hostDirectives !== null) {
5010
5015
  referencesRegistry.add(clazz, ...hostDirectives.map((hostDir) => {
5011
5016
  if (!isHostDirectiveMetaForGlobalMode(hostDir)) {
@@ -5642,7 +5647,7 @@ function getHostBindingErrorNode(error, hostExpr) {
5642
5647
  }
5643
5648
  return hostExpr;
5644
5649
  }
5645
- function extractHostDirectives(rawHostDirectives, evaluator, compilationMode) {
5650
+ function extractHostDirectives(rawHostDirectives, evaluator, compilationMode, forwardRefResolver) {
5646
5651
  const resolved = evaluator.evaluate(rawHostDirectives, forwardRefResolver);
5647
5652
  if (!Array.isArray(resolved)) {
5648
5653
  throw createValueHasWrongTypeError(rawHostDirectives, resolved, "hostDirectives must be an array");
@@ -6238,6 +6243,7 @@ var NgModuleDecoratorHandler = class {
6238
6243
  this.jitDeclarationRegistry.jitDeclarations.add(node);
6239
6244
  return {};
6240
6245
  }
6246
+ const forwardRefResolver = createForwardRefResolver(this.isCore);
6241
6247
  const moduleResolvers = combineResolvers([
6242
6248
  createModuleWithProvidersResolver(this.reflector, this.isCore),
6243
6249
  forwardRefResolver
@@ -7575,7 +7581,7 @@ var TsCreateProgramDriver = class {
7575
7581
 
7576
7582
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/diagnostic.mjs
7577
7583
  import ts28 from "typescript";
7578
- function makeTemplateDiagnostic(templateId, mapping, span, category, code, messageText, relatedMessages) {
7584
+ function makeTemplateDiagnostic(id, mapping, span, category, code, messageText, relatedMessages) {
7579
7585
  var _a;
7580
7586
  if (mapping.type === "direct") {
7581
7587
  let relatedInformation = void 0;
@@ -7598,8 +7604,8 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
7598
7604
  category,
7599
7605
  messageText,
7600
7606
  file: mapping.node.getSourceFile(),
7601
- componentFile: mapping.node.getSourceFile(),
7602
- templateId,
7607
+ sourceFile: mapping.node.getSourceFile(),
7608
+ typeCheckId: id,
7603
7609
  start: span.start.offset,
7604
7610
  length: span.end.offset - span.start.offset,
7605
7611
  relatedInformation
@@ -7632,8 +7638,8 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
7632
7638
  code,
7633
7639
  messageText: addDiagnosticChain(messageText, [failureChain]),
7634
7640
  file: componentSf,
7635
- componentFile: componentSf,
7636
- templateId,
7641
+ sourceFile: componentSf,
7642
+ typeCheckId: id,
7637
7643
  start: mapping.node.getStart(),
7638
7644
  length: mapping.node.getEnd() - mapping.node.getStart(),
7639
7645
  relatedInformation
@@ -7653,8 +7659,8 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
7653
7659
  code,
7654
7660
  messageText,
7655
7661
  file: sf,
7656
- componentFile: componentSf,
7657
- templateId,
7662
+ sourceFile: componentSf,
7663
+ typeCheckId: id,
7658
7664
  start: span.start.offset,
7659
7665
  length: span.end.offset - span.start.offset,
7660
7666
  relatedInformation
@@ -7685,16 +7691,16 @@ function parseTemplateAsSourceFile(fileName, template) {
7685
7691
  }
7686
7692
 
7687
7693
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/id.mjs
7688
- var TEMPLATE_ID_MAP = Symbol("ngTemplateId");
7689
- function getTemplateId(clazz) {
7694
+ var TYPE_CHECK_ID_MAP = Symbol("TypeCheckId");
7695
+ function getTypeCheckId(clazz) {
7690
7696
  const sf = clazz.getSourceFile();
7691
- if (sf[TEMPLATE_ID_MAP] === void 0) {
7692
- sf[TEMPLATE_ID_MAP] = /* @__PURE__ */ new Map();
7697
+ if (sf[TYPE_CHECK_ID_MAP] === void 0) {
7698
+ sf[TYPE_CHECK_ID_MAP] = /* @__PURE__ */ new Map();
7693
7699
  }
7694
- if (sf[TEMPLATE_ID_MAP].get(clazz) === void 0) {
7695
- sf[TEMPLATE_ID_MAP].set(clazz, `tcb${sf[TEMPLATE_ID_MAP].size + 1}`);
7700
+ if (sf[TYPE_CHECK_ID_MAP].get(clazz) === void 0) {
7701
+ sf[TYPE_CHECK_ID_MAP].set(clazz, `tcb${sf[TYPE_CHECK_ID_MAP].size + 1}`);
7696
7702
  }
7697
- return sf[TEMPLATE_ID_MAP].get(clazz);
7703
+ return sf[TYPE_CHECK_ID_MAP].get(clazz);
7698
7704
  }
7699
7705
 
7700
7706
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
@@ -9059,7 +9065,7 @@ var RegistryDomSchemaChecker = class {
9059
9065
  checkElement(id, element, schemas, hostIsStandalone) {
9060
9066
  const name = element.name.replace(REMOVE_XHTML_REGEX, "");
9061
9067
  if (!REGISTRY.hasElement(name, schemas)) {
9062
- const mapping = this.resolver.getSourceMapping(id);
9068
+ const mapping = this.resolver.getTemplateSourceMapping(id);
9063
9069
  const schemas2 = `'${hostIsStandalone ? "@Component" : "@NgModule"}.schemas'`;
9064
9070
  let errorMsg = `'${name}' is not a known element:
9065
9071
  `;
@@ -9076,7 +9082,7 @@ var RegistryDomSchemaChecker = class {
9076
9082
  }
9077
9083
  checkProperty(id, element, name, span, schemas, hostIsStandalone) {
9078
9084
  if (!REGISTRY.hasProperty(element.name, name, schemas)) {
9079
- const mapping = this.resolver.getSourceMapping(id);
9085
+ const mapping = this.resolver.getTemplateSourceMapping(id);
9080
9086
  const decorator = hostIsStandalone ? "@Component" : "@NgModule";
9081
9087
  const schemas2 = `'${decorator}.schemas'`;
9082
9088
  let errorMsg = `Can't bind to '${name}' since it isn't a known property of '${element.name}'.`;
@@ -9326,22 +9332,22 @@ function requiresInlineTypeCheckBlock(ref, env, usedPipes, reflector) {
9326
9332
  return TcbInliningRequirement.None;
9327
9333
  }
9328
9334
  }
9329
- function getTemplateMapping(shimSf, position, resolver, isDiagnosticRequest) {
9335
+ function getSourceMapping(shimSf, position, resolver, isDiagnosticRequest) {
9330
9336
  const node = getTokenAtPosition(shimSf, position);
9331
9337
  const sourceLocation = findSourceLocation(node, shimSf, isDiagnosticRequest);
9332
9338
  if (sourceLocation === null) {
9333
9339
  return null;
9334
9340
  }
9335
- const mapping = resolver.getSourceMapping(sourceLocation.id);
9336
- const span = resolver.toParseSourceSpan(sourceLocation.id, sourceLocation.span);
9341
+ const mapping = resolver.getTemplateSourceMapping(sourceLocation.id);
9342
+ const span = resolver.toTemplateParseSourceSpan(sourceLocation.id, sourceLocation.span);
9337
9343
  if (span === null) {
9338
9344
  return null;
9339
9345
  }
9340
- return { sourceLocation, templateSourceMapping: mapping, span };
9346
+ return { sourceLocation, sourceMapping: mapping, span };
9341
9347
  }
9342
9348
  function findTypeCheckBlock(file, id, isDiagnosticRequest) {
9343
9349
  for (const stmt of file.statements) {
9344
- if (ts34.isFunctionDeclaration(stmt) && getTemplateId2(stmt, file, isDiagnosticRequest) === id) {
9350
+ if (ts34.isFunctionDeclaration(stmt) && getTemplateId(stmt, file, isDiagnosticRequest) === id) {
9345
9351
  return stmt;
9346
9352
  }
9347
9353
  }
@@ -9354,7 +9360,7 @@ function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
9354
9360
  }
9355
9361
  const span = readSpanComment(node, sourceFile);
9356
9362
  if (span !== null) {
9357
- const id = getTemplateId2(node, sourceFile, isDiagnosticsRequest);
9363
+ const id = getTemplateId(node, sourceFile, isDiagnosticsRequest);
9358
9364
  if (id === null) {
9359
9365
  return null;
9360
9366
  }
@@ -9364,7 +9370,7 @@ function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
9364
9370
  }
9365
9371
  return null;
9366
9372
  }
9367
- function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
9373
+ function getTemplateId(node, sourceFile, isDiagnosticRequest) {
9368
9374
  while (!ts34.isFunctionDeclaration(node)) {
9369
9375
  if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticRequest) {
9370
9376
  return null;
@@ -9606,53 +9612,53 @@ var OutOfBandDiagnosticRecorderImpl = class {
9606
9612
  get diagnostics() {
9607
9613
  return this._diagnostics;
9608
9614
  }
9609
- missingReferenceTarget(templateId, ref) {
9610
- const mapping = this.resolver.getSourceMapping(templateId);
9615
+ missingReferenceTarget(id, ref) {
9616
+ const mapping = this.resolver.getTemplateSourceMapping(id);
9611
9617
  const value = ref.value.trim();
9612
9618
  const errorMsg = `No directive found with exportAs '${value}'.`;
9613
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
9619
+ this._diagnostics.push(makeTemplateDiagnostic(id, mapping, ref.valueSpan || ref.sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
9614
9620
  }
9615
- missingPipe(templateId, ast) {
9621
+ missingPipe(id, ast) {
9616
9622
  if (this.recordedPipes.has(ast)) {
9617
9623
  return;
9618
9624
  }
9619
- const mapping = this.resolver.getSourceMapping(templateId);
9625
+ const mapping = this.resolver.getTemplateSourceMapping(id);
9620
9626
  const errorMsg = `No pipe found with name '${ast.name}'.`;
9621
- const sourceSpan = this.resolver.toParseSourceSpan(templateId, ast.nameSpan);
9627
+ const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, ast.nameSpan);
9622
9628
  if (sourceSpan === null) {
9623
9629
  throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
9624
9630
  }
9625
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
9631
+ this._diagnostics.push(makeTemplateDiagnostic(id, mapping, sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
9626
9632
  this.recordedPipes.add(ast);
9627
9633
  }
9628
- deferredPipeUsedEagerly(templateId, ast) {
9634
+ deferredPipeUsedEagerly(id, ast) {
9629
9635
  if (this.recordedPipes.has(ast)) {
9630
9636
  return;
9631
9637
  }
9632
- const mapping = this.resolver.getSourceMapping(templateId);
9638
+ const mapping = this.resolver.getTemplateSourceMapping(id);
9633
9639
  const errorMsg = `Pipe '${ast.name}' was imported via \`@Component.deferredImports\`, but was used outside of a \`@defer\` block in a template. To fix this, either use the '${ast.name}' pipe inside of a \`@defer\` block or import this dependency using the \`@Component.imports\` field.`;
9634
- const sourceSpan = this.resolver.toParseSourceSpan(templateId, ast.nameSpan);
9640
+ const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, ast.nameSpan);
9635
9641
  if (sourceSpan === null) {
9636
9642
  throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
9637
9643
  }
9638
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_PIPE_USED_EAGERLY), errorMsg));
9644
+ this._diagnostics.push(makeTemplateDiagnostic(id, mapping, sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_PIPE_USED_EAGERLY), errorMsg));
9639
9645
  this.recordedPipes.add(ast);
9640
9646
  }
9641
- deferredComponentUsedEagerly(templateId, element) {
9642
- const mapping = this.resolver.getSourceMapping(templateId);
9647
+ deferredComponentUsedEagerly(id, element) {
9648
+ const mapping = this.resolver.getTemplateSourceMapping(id);
9643
9649
  const errorMsg = `Element '${element.name}' contains a component or a directive that was imported via \`@Component.deferredImports\`, but the element itself is located outside of a \`@defer\` block in a template. To fix this, either use the '${element.name}' element inside of a \`@defer\` block or import referenced component/directive dependency using the \`@Component.imports\` field.`;
9644
9650
  const { start, end } = element.startSourceSpan;
9645
9651
  const absoluteSourceSpan = new AbsoluteSourceSpan2(start.offset, end.offset);
9646
- const sourceSpan = this.resolver.toParseSourceSpan(templateId, absoluteSourceSpan);
9652
+ const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, absoluteSourceSpan);
9647
9653
  if (sourceSpan === null) {
9648
9654
  throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${element.name}'.`);
9649
9655
  }
9650
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_DIRECTIVE_USED_EAGERLY), errorMsg));
9656
+ this._diagnostics.push(makeTemplateDiagnostic(id, mapping, sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_DIRECTIVE_USED_EAGERLY), errorMsg));
9651
9657
  }
9652
- duplicateTemplateVar(templateId, variable, firstDecl) {
9653
- const mapping = this.resolver.getSourceMapping(templateId);
9658
+ duplicateTemplateVar(id, variable, firstDecl) {
9659
+ const mapping = this.resolver.getTemplateSourceMapping(id);
9654
9660
  const errorMsg = `Cannot redeclare variable '${variable.name}' as it was previously declared elsewhere for the same template.`;
9655
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DUPLICATE_VARIABLE_DECLARATION), errorMsg, [
9661
+ this._diagnostics.push(makeTemplateDiagnostic(id, mapping, variable.sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DUPLICATE_VARIABLE_DECLARATION), errorMsg, [
9656
9662
  {
9657
9663
  text: `The variable '${firstDecl.name}' was first declared here.`,
9658
9664
  start: firstDecl.sourceSpan.start.offset,
@@ -9661,20 +9667,20 @@ var OutOfBandDiagnosticRecorderImpl = class {
9661
9667
  }
9662
9668
  ]));
9663
9669
  }
9664
- requiresInlineTcb(templateId, node) {
9665
- this._diagnostics.push(makeInlineDiagnostic(templateId, ErrorCode.INLINE_TCB_REQUIRED, node.name, `This component requires inline template type-checking, which is not supported by the current environment.`));
9670
+ requiresInlineTcb(id, node) {
9671
+ this._diagnostics.push(makeInlineDiagnostic(id, ErrorCode.INLINE_TCB_REQUIRED, node.name, `This component requires inline template type-checking, which is not supported by the current environment.`));
9666
9672
  }
9667
- requiresInlineTypeConstructors(templateId, node, directives) {
9673
+ requiresInlineTypeConstructors(id, node, directives) {
9668
9674
  let message;
9669
9675
  if (directives.length > 1) {
9670
9676
  message = `This component uses directives which require inline type constructors, which are not supported by the current environment.`;
9671
9677
  } else {
9672
9678
  message = `This component uses a directive which requires an inline type constructor, which is not supported by the current environment.`;
9673
9679
  }
9674
- this._diagnostics.push(makeInlineDiagnostic(templateId, ErrorCode.INLINE_TYPE_CTOR_REQUIRED, node.name, message, directives.map((dir) => makeRelatedInformation(dir.name, `Requires an inline type constructor.`))));
9680
+ this._diagnostics.push(makeInlineDiagnostic(id, ErrorCode.INLINE_TYPE_CTOR_REQUIRED, node.name, message, directives.map((dir) => makeRelatedInformation(dir.name, `Requires an inline type constructor.`))));
9675
9681
  }
9676
- suboptimalTypeInference(templateId, variables) {
9677
- const mapping = this.resolver.getSourceMapping(templateId);
9682
+ suboptimalTypeInference(id, variables) {
9683
+ const mapping = this.resolver.getTemplateSourceMapping(id);
9678
9684
  let diagnosticVar = null;
9679
9685
  for (const variable of variables) {
9680
9686
  if (diagnosticVar === null || variable.value === "" || variable.value === "$implicit") {
@@ -9693,10 +9699,10 @@ var OutOfBandDiagnosticRecorderImpl = class {
9693
9699
  const message = `This structural directive supports advanced type inference, but the current compiler configuration prevents its usage. The variable ${varIdentification} will have type 'any' as a result.
9694
9700
 
9695
9701
  Consider enabling the 'strictTemplates' option in your tsconfig.json for better type inference within this template.`;
9696
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan, ts37.DiagnosticCategory.Suggestion, ngErrorCode(ErrorCode.SUGGEST_SUBOPTIMAL_TYPE_INFERENCE), message));
9702
+ this._diagnostics.push(makeTemplateDiagnostic(id, mapping, diagnosticVar.keySpan, ts37.DiagnosticCategory.Suggestion, ngErrorCode(ErrorCode.SUGGEST_SUBOPTIMAL_TYPE_INFERENCE), message));
9697
9703
  }
9698
- splitTwoWayBinding(templateId, input, output, inputConsumer, outputConsumer) {
9699
- const mapping = this.resolver.getSourceMapping(templateId);
9704
+ splitTwoWayBinding(id, input, output, inputConsumer, outputConsumer) {
9705
+ const mapping = this.resolver.getTemplateSourceMapping(id);
9700
9706
  const errorMsg = `The property and event halves of the two-way binding '${input.name}' are not bound to the same target.
9701
9707
  Find more at https://angular.dev/guide/templates/two-way-binding#how-two-way-binding-works`;
9702
9708
  const relatedMessages = [];
@@ -9727,22 +9733,22 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
9727
9733
  sourceFile: outputConsumer.name.getSourceFile()
9728
9734
  });
9729
9735
  }
9730
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SPLIT_TWO_WAY_BINDING), errorMsg, relatedMessages));
9736
+ this._diagnostics.push(makeTemplateDiagnostic(id, mapping, input.keySpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SPLIT_TWO_WAY_BINDING), errorMsg, relatedMessages));
9731
9737
  }
9732
- missingRequiredInputs(templateId, element, directiveName, isComponent, inputAliases) {
9738
+ missingRequiredInputs(id, element, directiveName, isComponent, inputAliases) {
9733
9739
  const message = `Required input${inputAliases.length === 1 ? "" : "s"} ${inputAliases.map((n2) => `'${n2}'`).join(", ")} from ${isComponent ? "component" : "directive"} ${directiveName} must be specified.`;
9734
- this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), element.startSourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REQUIRED_INPUTS), message));
9740
+ this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), element.startSourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REQUIRED_INPUTS), message));
9735
9741
  }
9736
- illegalForLoopTrackAccess(templateId, block, access) {
9737
- const sourceSpan = this.resolver.toParseSourceSpan(templateId, access.sourceSpan);
9742
+ illegalForLoopTrackAccess(id, block, access) {
9743
+ const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, access.sourceSpan);
9738
9744
  if (sourceSpan === null) {
9739
9745
  throw new Error(`Assertion failure: no SourceLocation found for property read.`);
9740
9746
  }
9741
9747
  const messageVars = [block.item, ...block.contextVariables.filter((v) => v.value === "$index")].map((v) => `'${v.name}'`).join(", ");
9742
9748
  const message = `Cannot access '${access.name}' inside of a track expression. Only ${messageVars} and properties on the containing component are available to this expression.`;
9743
- this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.ILLEGAL_FOR_LOOP_TRACK_ACCESS), message));
9749
+ this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.ILLEGAL_FOR_LOOP_TRACK_ACCESS), message));
9744
9750
  }
9745
- inaccessibleDeferredTriggerElement(templateId, trigger) {
9751
+ inaccessibleDeferredTriggerElement(id, trigger) {
9746
9752
  let message;
9747
9753
  if (trigger.reference === null) {
9748
9754
  message = `Trigger cannot find reference. Make sure that the @defer block has a @placeholder with at least one root element node.`;
@@ -9751,9 +9757,9 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
9751
9757
  Check that an element with #${trigger.reference} exists in the same template and it's accessible from the @defer block.
9752
9758
  Deferred blocks can only access triggers in same view, a parent embedded view or the root view of the @placeholder block.`;
9753
9759
  }
9754
- this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), trigger.sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT), message));
9760
+ this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT), message));
9755
9761
  }
9756
- controlFlowPreventingContentProjection(templateId, category, projectionNode, componentName, slotSelector, controlFlowNode, preservesWhitespaces) {
9762
+ controlFlowPreventingContentProjection(id, category, projectionNode, componentName, slotSelector, controlFlowNode, preservesWhitespaces) {
9757
9763
  const blockName = controlFlowNode.nameSpan.toString().trim();
9758
9764
  const lines = [
9759
9765
  `Node matches the "${slotSelector}" slot of the "${componentName}" component, but will not be projected into the specific slot because the surrounding ${blockName} has more than one node at its root. To project the node in the right slot, you can:
@@ -9766,33 +9772,33 @@ Deferred blocks can only access triggers in same view, a parent embedded view or
9766
9772
  lines.push("Note: the host component has `preserveWhitespaces: true` which may cause whitespace to affect content projection.");
9767
9773
  }
9768
9774
  lines.push("", 'This check can be disabled using the `extendedDiagnostics.checks.controlFlowPreventingContentProjection = "suppress" compiler option.`');
9769
- this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), projectionNode.startSourceSpan, category, ngErrorCode(ErrorCode.CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION), lines.join("\n")));
9775
+ this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), projectionNode.startSourceSpan, category, ngErrorCode(ErrorCode.CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION), lines.join("\n")));
9770
9776
  }
9771
- illegalWriteToLetDeclaration(templateId, node, target) {
9772
- const sourceSpan = this.resolver.toParseSourceSpan(templateId, node.sourceSpan);
9777
+ illegalWriteToLetDeclaration(id, node, target) {
9778
+ const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, node.sourceSpan);
9773
9779
  if (sourceSpan === null) {
9774
9780
  throw new Error(`Assertion failure: no SourceLocation found for property write.`);
9775
9781
  }
9776
- this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.ILLEGAL_LET_WRITE), `Cannot assign to @let declaration '${target.name}'.`));
9782
+ this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.ILLEGAL_LET_WRITE), `Cannot assign to @let declaration '${target.name}'.`));
9777
9783
  }
9778
- letUsedBeforeDefinition(templateId, node, target) {
9779
- const sourceSpan = this.resolver.toParseSourceSpan(templateId, node.sourceSpan);
9784
+ letUsedBeforeDefinition(id, node, target) {
9785
+ const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, node.sourceSpan);
9780
9786
  if (sourceSpan === null) {
9781
9787
  throw new Error(`Assertion failure: no SourceLocation found for property read.`);
9782
9788
  }
9783
- this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.LET_USED_BEFORE_DEFINITION), `Cannot read @let declaration '${target.name}' before it has been defined.`));
9789
+ this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.LET_USED_BEFORE_DEFINITION), `Cannot read @let declaration '${target.name}' before it has been defined.`));
9784
9790
  }
9785
- conflictingDeclaration(templateId, decl) {
9786
- const mapping = this.resolver.getSourceMapping(templateId);
9791
+ conflictingDeclaration(id, decl) {
9792
+ const mapping = this.resolver.getTemplateSourceMapping(id);
9787
9793
  const errorMsg = `Cannot declare @let called '${decl.name}' as there is another symbol in the template with the same name.`;
9788
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, decl.sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.CONFLICTING_LET_DECLARATION), errorMsg));
9794
+ this._diagnostics.push(makeTemplateDiagnostic(id, mapping, decl.sourceSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.CONFLICTING_LET_DECLARATION), errorMsg));
9789
9795
  }
9790
9796
  };
9791
- function makeInlineDiagnostic(templateId, code, node, messageText, relatedInformation) {
9797
+ function makeInlineDiagnostic(id, code, node, messageText, relatedInformation) {
9792
9798
  return {
9793
9799
  ...makeDiagnostic(code, node, messageText, relatedInformation),
9794
- componentFile: node.getSourceFile(),
9795
- templateId
9800
+ sourceFile: node.getSourceFile(),
9801
+ typeCheckId: id
9796
9802
  };
9797
9803
  }
9798
9804
 
@@ -9839,7 +9845,7 @@ function addParseSpanInfo(node, span) {
9839
9845
  false
9840
9846
  );
9841
9847
  }
9842
- function addTemplateId(tcb, id) {
9848
+ function addTypeCheckId(tcb, id) {
9843
9849
  ts39.addSyntheticLeadingComment(tcb, ts39.SyntaxKind.MultiLineCommentTrivia, id, true);
9844
9850
  }
9845
9851
  function shouldReportDiagnostic(diagnostic) {
@@ -9859,7 +9865,7 @@ function translateDiagnostic(diagnostic, resolver) {
9859
9865
  if (diagnostic.file === void 0 || diagnostic.start === void 0) {
9860
9866
  return null;
9861
9867
  }
9862
- const fullMapping = getTemplateMapping(
9868
+ const fullMapping = getSourceMapping(
9863
9869
  diagnostic.file,
9864
9870
  diagnostic.start,
9865
9871
  resolver,
@@ -9868,7 +9874,7 @@ function translateDiagnostic(diagnostic, resolver) {
9868
9874
  if (fullMapping === null) {
9869
9875
  return null;
9870
9876
  }
9871
- const { sourceLocation, templateSourceMapping, span } = fullMapping;
9877
+ const { sourceLocation, sourceMapping: templateSourceMapping, span } = fullMapping;
9872
9878
  return makeTemplateDiagnostic(sourceLocation.id, templateSourceMapping, span, diagnostic.category, diagnostic.code, diagnostic.messageText);
9873
9879
  }
9874
9880
 
@@ -10292,7 +10298,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
10292
10298
  void 0,
10293
10299
  body
10294
10300
  );
10295
- addTemplateId(fnDecl, meta.id);
10301
+ addTypeCheckId(fnDecl, meta.id);
10296
10302
  return fnDecl;
10297
10303
  }
10298
10304
  var TcbOp = class {
@@ -11256,7 +11262,7 @@ var Context = class {
11256
11262
  return ts41.factory.createIdentifier(`_t${this.nextId++}`);
11257
11263
  }
11258
11264
  getPipeByName(name) {
11259
- if (!this.pipes.has(name)) {
11265
+ if (this.pipes === null || !this.pipes.has(name)) {
11260
11266
  return null;
11261
11267
  }
11262
11268
  return this.pipes.get(name);
@@ -12016,18 +12022,19 @@ var TypeCheckContextImpl = class {
12016
12022
  }
12017
12023
  opMap = /* @__PURE__ */ new Map();
12018
12024
  typeCtorPending = /* @__PURE__ */ new Set();
12019
- addTemplate(ref, binder, template, pipes, schemas, sourceMapping, file, parseErrors, isStandalone, preserveWhitespaces) {
12020
- if (!this.host.shouldCheckComponent(ref.node)) {
12025
+ addDirective(ref, binder, schemas, templateContext, isStandalone) {
12026
+ var _a;
12027
+ if (!this.host.shouldCheckClass(ref.node)) {
12021
12028
  return;
12022
12029
  }
12023
12030
  const fileData = this.dataForFile(ref.node.getSourceFile());
12024
- const shimData = this.pendingShimForComponent(ref.node);
12025
- const templateId = fileData.sourceManager.getTemplateId(ref.node);
12026
- const templateDiagnostics = [];
12027
- if (parseErrors !== null) {
12028
- templateDiagnostics.push(...getTemplateDiagnostics(parseErrors, templateId, sourceMapping));
12031
+ const shimData = this.pendingShimForClass(ref.node);
12032
+ const id = fileData.sourceManager.getTypeCheckId(ref.node);
12033
+ const templateParsingDiagnostics = [];
12034
+ if (templateContext !== null && templateContext.parseErrors !== null) {
12035
+ templateParsingDiagnostics.push(...getTemplateDiagnostics(templateContext.parseErrors, id, templateContext.sourceMapping));
12029
12036
  }
12030
- const boundTarget = binder.bind({ template });
12037
+ const boundTarget = binder.bind({ template: templateContext == null ? void 0 : templateContext.nodes });
12031
12038
  if (this.inlining === InliningMode.InlineOps) {
12032
12039
  for (const dir of boundTarget.getUsedDirectives()) {
12033
12040
  const dirRef = dir.ref;
@@ -12046,31 +12053,35 @@ var TypeCheckContextImpl = class {
12046
12053
  });
12047
12054
  }
12048
12055
  }
12049
- shimData.templates.set(templateId, {
12050
- template,
12056
+ shimData.data.set(id, {
12057
+ template: (templateContext == null ? void 0 : templateContext.nodes) || null,
12051
12058
  boundTarget,
12052
- templateDiagnostics
12059
+ templateParsingDiagnostics
12053
12060
  });
12054
12061
  const usedPipes = [];
12055
- for (const name of boundTarget.getUsedPipes()) {
12056
- if (!pipes.has(name)) {
12057
- continue;
12062
+ if (templateContext !== null) {
12063
+ for (const name of boundTarget.getUsedPipes()) {
12064
+ if (templateContext.pipes.has(name)) {
12065
+ usedPipes.push(templateContext.pipes.get(name).ref);
12066
+ }
12058
12067
  }
12059
- usedPipes.push(pipes.get(name).ref);
12060
12068
  }
12061
12069
  const inliningRequirement = requiresInlineTypeCheckBlock(ref, shimData.file, usedPipes, this.reflector);
12062
12070
  if (this.inlining === InliningMode.Error && inliningRequirement === TcbInliningRequirement.MustInline) {
12063
- shimData.oobRecorder.requiresInlineTcb(templateId, ref.node);
12071
+ shimData.oobRecorder.requiresInlineTcb(id, ref.node);
12064
12072
  this.perf.eventCount(PerfEvent.SkipGenerateTcbNoInline);
12065
12073
  return;
12066
12074
  }
12075
+ if (templateContext !== null) {
12076
+ fileData.sourceManager.captureTemplateSource(id, templateContext.sourceMapping, templateContext.file);
12077
+ }
12067
12078
  const meta = {
12068
- id: fileData.sourceManager.captureSource(ref.node, sourceMapping, file),
12079
+ id,
12069
12080
  boundTarget,
12070
- pipes,
12081
+ pipes: (templateContext == null ? void 0 : templateContext.pipes) || null,
12071
12082
  schemas,
12072
12083
  isStandalone,
12073
- preserveWhitespaces
12084
+ preserveWhitespaces: (_a = templateContext == null ? void 0 : templateContext.preserveWhitespaces) != null ? _a : false
12074
12085
  };
12075
12086
  this.perf.eventCount(PerfEvent.GenerateTcb);
12076
12087
  if (inliningRequirement !== TcbInliningRequirement.None && this.inlining === InliningMode.InlineOps) {
@@ -12156,7 +12167,7 @@ var TypeCheckContextImpl = class {
12156
12167
  ],
12157
12168
  hasInlines: pendingFileData.hasInlines,
12158
12169
  path: pendingShimData.file.fileName,
12159
- templates: pendingShimData.templates
12170
+ data: pendingShimData.data
12160
12171
  });
12161
12172
  const sfText = pendingShimData.file.render(false);
12162
12173
  updates.set(pendingShimData.file.fileName, {
@@ -12176,7 +12187,7 @@ var TypeCheckContextImpl = class {
12176
12187
  ops.push(new InlineTcbOp(ref, tcbMeta, this.config, this.reflector, shimData.domSchemaChecker, shimData.oobRecorder));
12177
12188
  fileData.hasInlines = true;
12178
12189
  }
12179
- pendingShimForComponent(node) {
12190
+ pendingShimForClass(node) {
12180
12191
  const fileData = this.dataForFile(node.getSourceFile());
12181
12192
  const shimPath = TypeCheckShimGenerator.shimFor(absoluteFromSourceFile(node.getSourceFile()));
12182
12193
  if (!fileData.shimData.has(shimPath)) {
@@ -12184,7 +12195,7 @@ var TypeCheckContextImpl = class {
12184
12195
  domSchemaChecker: new RegistryDomSchemaChecker(fileData.sourceManager),
12185
12196
  oobRecorder: new OutOfBandDiagnosticRecorderImpl(fileData.sourceManager),
12186
12197
  file: new TypeCheckFile(shimPath, this.config, this.refEmitter, this.reflector, this.compilerHost),
12187
- templates: /* @__PURE__ */ new Map()
12198
+ data: /* @__PURE__ */ new Map()
12188
12199
  });
12189
12200
  }
12190
12201
  return fileData.shimData.get(shimPath);
@@ -12325,23 +12336,21 @@ var TemplateSource = class {
12325
12336
  return this.lineStarts;
12326
12337
  }
12327
12338
  };
12328
- var TemplateSourceManager = class {
12339
+ var DirectiveSourceManager = class {
12329
12340
  templateSources = /* @__PURE__ */ new Map();
12330
- getTemplateId(node) {
12331
- return getTemplateId(node);
12341
+ getTypeCheckId(node) {
12342
+ return getTypeCheckId(node);
12332
12343
  }
12333
- captureSource(node, mapping, file) {
12334
- const id = getTemplateId(node);
12344
+ captureTemplateSource(id, mapping, file) {
12335
12345
  this.templateSources.set(id, new TemplateSource(mapping, file));
12336
- return id;
12337
12346
  }
12338
- getSourceMapping(id) {
12347
+ getTemplateSourceMapping(id) {
12339
12348
  if (!this.templateSources.has(id)) {
12340
- throw new Error(`Unexpected unknown template ID: ${id}`);
12349
+ throw new Error(`Unexpected unknown type check ID: ${id}`);
12341
12350
  }
12342
12351
  return this.templateSources.get(id).mapping;
12343
12352
  }
12344
- toParseSourceSpan(id, span) {
12353
+ toTemplateParseSourceSpan(id, span) {
12345
12354
  if (!this.templateSources.has(id)) {
12346
12355
  return null;
12347
12356
  }
@@ -12357,15 +12366,15 @@ var SymbolBuilder = class {
12357
12366
  tcbPath;
12358
12367
  tcbIsShim;
12359
12368
  typeCheckBlock;
12360
- templateData;
12369
+ typeCheckData;
12361
12370
  componentScopeReader;
12362
12371
  getTypeChecker;
12363
12372
  symbolCache = /* @__PURE__ */ new Map();
12364
- constructor(tcbPath, tcbIsShim, typeCheckBlock, templateData, componentScopeReader, getTypeChecker) {
12373
+ constructor(tcbPath, tcbIsShim, typeCheckBlock, typeCheckData, componentScopeReader, getTypeChecker) {
12365
12374
  this.tcbPath = tcbPath;
12366
12375
  this.tcbIsShim = tcbIsShim;
12367
12376
  this.typeCheckBlock = typeCheckBlock;
12368
- this.templateData = templateData;
12377
+ this.typeCheckData = typeCheckData;
12369
12378
  this.componentScopeReader = componentScopeReader;
12370
12379
  this.getTypeChecker = getTypeChecker;
12371
12380
  }
@@ -12495,12 +12504,12 @@ var SymbolBuilder = class {
12495
12504
  }
12496
12505
  getDirectiveMeta(host, directiveDeclaration) {
12497
12506
  var _a;
12498
- let directives = this.templateData.boundTarget.getDirectivesOfNode(host);
12507
+ let directives = this.typeCheckData.boundTarget.getDirectivesOfNode(host);
12499
12508
  const firstChild = host.children[0];
12500
12509
  if (firstChild instanceof TmplAstElement3) {
12501
12510
  const isMicrosyntaxTemplate = host instanceof TmplAstTemplate2 && sourceSpanEqual(firstChild.sourceSpan, host.sourceSpan);
12502
12511
  if (isMicrosyntaxTemplate) {
12503
- const firstChildDirectives = this.templateData.boundTarget.getDirectivesOfNode(firstChild);
12512
+ const firstChildDirectives = this.typeCheckData.boundTarget.getDirectivesOfNode(firstChild);
12504
12513
  if (firstChildDirectives !== null && directives !== null) {
12505
12514
  directives = directives.concat(firstChildDirectives);
12506
12515
  } else {
@@ -12521,7 +12530,7 @@ var SymbolBuilder = class {
12521
12530
  return scope.ngModule;
12522
12531
  }
12523
12532
  getSymbolOfBoundEvent(eventBinding) {
12524
- const consumer = this.templateData.boundTarget.getConsumerOfBinding(eventBinding);
12533
+ const consumer = this.typeCheckData.boundTarget.getConsumerOfBinding(eventBinding);
12525
12534
  if (consumer === null) {
12526
12535
  return null;
12527
12536
  }
@@ -12607,7 +12616,7 @@ var SymbolBuilder = class {
12607
12616
  return { kind: SymbolKind.Output, bindings };
12608
12617
  }
12609
12618
  getSymbolOfInputBinding(binding) {
12610
- const consumer = this.templateData.boundTarget.getConsumerOfBinding(binding);
12619
+ const consumer = this.typeCheckData.boundTarget.getConsumerOfBinding(binding);
12611
12620
  if (consumer === null) {
12612
12621
  return null;
12613
12622
  }
@@ -12727,7 +12736,7 @@ var SymbolBuilder = class {
12727
12736
  };
12728
12737
  }
12729
12738
  getSymbolOfReference(ref) {
12730
- const target = this.templateData.boundTarget.getReferenceTarget(ref);
12739
+ const target = this.typeCheckData.boundTarget.getReferenceTarget(ref);
12731
12740
  let node = findFirstMatchingNode(this.typeCheckBlock, {
12732
12741
  withSpan: ref.sourceSpan,
12733
12742
  filter: ts44.isVariableDeclaration
@@ -12832,7 +12841,7 @@ var SymbolBuilder = class {
12832
12841
  if (expression instanceof ASTWithSource2) {
12833
12842
  expression = expression.ast;
12834
12843
  }
12835
- const expressionTarget = this.templateData.boundTarget.getExpressionTarget(expression);
12844
+ const expressionTarget = this.typeCheckData.boundTarget.getExpressionTarget(expression);
12836
12845
  if (expressionTarget !== null) {
12837
12846
  return this.getSymbol(expressionTarget);
12838
12847
  }
@@ -13002,9 +13011,8 @@ var TemplateTypeCheckerImpl = class {
13002
13011
  if (!fileRecord.shimData.has(shimPath)) {
13003
13012
  return { data: null, tcb: null, tcbPath: shimPath, tcbIsShim: true };
13004
13013
  }
13005
- const templateId = fileRecord.sourceManager.getTemplateId(component);
13014
+ const id = fileRecord.sourceManager.getTypeCheckId(component);
13006
13015
  const shimRecord = fileRecord.shimData.get(shimPath);
13007
- const id = fileRecord.sourceManager.getTemplateId(component);
13008
13016
  const program = this.programDriver.getProgram();
13009
13017
  const shimSf = getSourceFileOrNull(program, shimPath);
13010
13018
  if (shimSf === null || !fileRecord.shimData.has(shimPath)) {
@@ -13020,8 +13028,8 @@ var TemplateTypeCheckerImpl = class {
13020
13028
  }
13021
13029
  }
13022
13030
  let data = null;
13023
- if (shimRecord.templates.has(templateId)) {
13024
- data = shimRecord.templates.get(templateId);
13031
+ if (shimRecord.data.has(id)) {
13032
+ data = shimRecord.data.get(id);
13025
13033
  }
13026
13034
  return { data, tcb, tcbPath, tcbIsShim: tcbPath === shimPath };
13027
13035
  }
@@ -13051,7 +13059,7 @@ var TemplateTypeCheckerImpl = class {
13051
13059
  }
13052
13060
  return null;
13053
13061
  }
13054
- getTemplateMappingAtTcbLocation(tcbLocation) {
13062
+ getSourceMappingAtTcbLocation(tcbLocation) {
13055
13063
  const fileRecord = this.getFileRecordForTcbLocation(tcbLocation);
13056
13064
  if (fileRecord === null) {
13057
13065
  return null;
@@ -13060,7 +13068,7 @@ var TemplateTypeCheckerImpl = class {
13060
13068
  if (shimSf === void 0) {
13061
13069
  return null;
13062
13070
  }
13063
- return getTemplateMapping(
13071
+ return getSourceMapping(
13064
13072
  shimSf,
13065
13073
  tcbLocation.positionInFile,
13066
13074
  fileRecord.sourceManager,
@@ -13092,8 +13100,8 @@ var TemplateTypeCheckerImpl = class {
13092
13100
  const shimSf = getSourceFileOrError(typeCheckProgram, shimPath);
13093
13101
  diagnostics.push(...typeCheckProgram.getSemanticDiagnostics(shimSf).map((diag) => convertDiagnostic(diag, fileRecord.sourceManager)));
13094
13102
  diagnostics.push(...shimRecord.genesisDiagnostics);
13095
- for (const templateData of shimRecord.templates.values()) {
13096
- diagnostics.push(...templateData.templateDiagnostics);
13103
+ for (const templateData of shimRecord.data.values()) {
13104
+ diagnostics.push(...templateData.templateParsingDiagnostics);
13097
13105
  }
13098
13106
  }
13099
13107
  return diagnostics.filter((diag) => diag !== null);
@@ -13109,7 +13117,7 @@ var TemplateTypeCheckerImpl = class {
13109
13117
  if (!fileRecord.shimData.has(shimPath)) {
13110
13118
  return [];
13111
13119
  }
13112
- const templateId = fileRecord.sourceManager.getTemplateId(component);
13120
+ const id = fileRecord.sourceManager.getTypeCheckId(component);
13113
13121
  const shimRecord = fileRecord.shimData.get(shimPath);
13114
13122
  const typeCheckProgram = this.programDriver.getProgram();
13115
13123
  const diagnostics = [];
@@ -13120,10 +13128,10 @@ var TemplateTypeCheckerImpl = class {
13120
13128
  const shimSf = getSourceFileOrError(typeCheckProgram, shimPath);
13121
13129
  diagnostics.push(...typeCheckProgram.getSemanticDiagnostics(shimSf).map((diag) => convertDiagnostic(diag, fileRecord.sourceManager)));
13122
13130
  diagnostics.push(...shimRecord.genesisDiagnostics);
13123
- for (const templateData of shimRecord.templates.values()) {
13124
- diagnostics.push(...templateData.templateDiagnostics);
13131
+ for (const templateData of shimRecord.data.values()) {
13132
+ diagnostics.push(...templateData.templateParsingDiagnostics);
13125
13133
  }
13126
- return diagnostics.filter((diag) => diag !== null && diag.templateId === templateId);
13134
+ return diagnostics.filter((diag) => diag !== null && diag.typeCheckId === id);
13127
13135
  });
13128
13136
  }
13129
13137
  getTypeCheckBlock(component) {
@@ -13159,7 +13167,7 @@ var TemplateTypeCheckerImpl = class {
13159
13167
  const sfPath = absoluteFromSourceFile(sf);
13160
13168
  const shimPath = TypeCheckShimGenerator.shimFor(sfPath);
13161
13169
  const fileData = this.getFileData(sfPath);
13162
- const templateId = fileData.sourceManager.getTemplateId(clazz);
13170
+ const id = fileData.sourceManager.getTypeCheckId(clazz);
13163
13171
  fileData.shimData.delete(shimPath);
13164
13172
  fileData.isComplete = false;
13165
13173
  this.isComplete = false;
@@ -13171,10 +13179,10 @@ var TemplateTypeCheckerImpl = class {
13171
13179
  makeTemplateDiagnostic(clazz, sourceSpan, category, errorCode, message, relatedInformation) {
13172
13180
  const sfPath = absoluteFromSourceFile(clazz.getSourceFile());
13173
13181
  const fileRecord = this.state.get(sfPath);
13174
- const templateId = fileRecord.sourceManager.getTemplateId(clazz);
13175
- const mapping = fileRecord.sourceManager.getSourceMapping(templateId);
13182
+ const id = fileRecord.sourceManager.getTypeCheckId(clazz);
13183
+ const mapping = fileRecord.sourceManager.getTemplateSourceMapping(id);
13176
13184
  return {
13177
- ...makeTemplateDiagnostic(templateId, mapping, sourceSpan, category, ngErrorCode(errorCode), message, relatedInformation),
13185
+ ...makeTemplateDiagnostic(id, mapping, sourceSpan, category, ngErrorCode(errorCode), message, relatedInformation),
13178
13186
  __ngCode: errorCode
13179
13187
  };
13180
13188
  }
@@ -13292,7 +13300,7 @@ var TemplateTypeCheckerImpl = class {
13292
13300
  if (!this.state.has(path)) {
13293
13301
  this.state.set(path, {
13294
13302
  hasInlines: false,
13295
- sourceManager: new TemplateSourceManager(),
13303
+ sourceManager: new DirectiveSourceManager(),
13296
13304
  isComplete: false,
13297
13305
  shimData: /* @__PURE__ */ new Map()
13298
13306
  });
@@ -13580,7 +13588,7 @@ var WholeProgramTypeCheckingHost = class {
13580
13588
  getSourceManager(sfPath) {
13581
13589
  return this.impl.getFileData(sfPath).sourceManager;
13582
13590
  }
13583
- shouldCheckComponent(node) {
13591
+ shouldCheckClass(node) {
13584
13592
  const sfPath = absoluteFromSourceFile(node.getSourceFile());
13585
13593
  const shimPath = TypeCheckShimGenerator.shimFor(sfPath);
13586
13594
  const fileData = this.impl.getFileData(sfPath);
@@ -13616,7 +13624,7 @@ var SingleFileTypeCheckingHost = class {
13616
13624
  this.assertPath(sfPath);
13617
13625
  return this.fileData.sourceManager;
13618
13626
  }
13619
- shouldCheckComponent(node) {
13627
+ shouldCheckClass(node) {
13620
13628
  if (this.sfPath !== absoluteFromSourceFile(node.getSourceFile())) {
13621
13629
  return false;
13622
13630
  }
@@ -13667,7 +13675,7 @@ function extractHmrDependencies(node, definition, factory, deferBlockMetadata, c
13667
13675
  var _a, _b;
13668
13676
  const name = ts45.isClassDeclaration(node) && node.name ? node.name.text : null;
13669
13677
  const visitor = new PotentialTopLevelReadsVisitor();
13670
- const sourceFile = node.getSourceFile();
13678
+ const sourceFile = ts45.getOriginalNode(node).getSourceFile();
13671
13679
  definition.expression.visitExpression(visitor, null);
13672
13680
  definition.statements.forEach((statement) => statement.visitStatement(visitor, null));
13673
13681
  (_a = factory.initializer) == null ? void 0 : _a.visitExpression(visitor, null);
@@ -13873,11 +13881,12 @@ function isConstEnumReference(node, reflection) {
13873
13881
  }
13874
13882
 
13875
13883
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/hmr/src/metadata.mjs
13884
+ import ts46 from "typescript";
13876
13885
  function extractHmrMetatadata(clazz, reflection, evaluator, compilerHost, rootDirs, definition, factory, deferBlockMetadata, classMetadata, debugInfo) {
13877
13886
  if (!reflection.isClass(clazz)) {
13878
13887
  return null;
13879
13888
  }
13880
- const sourceFile = clazz.getSourceFile();
13889
+ const sourceFile = ts46.getOriginalNode(clazz).getSourceFile();
13881
13890
  const filePath = getProjectRelativePath(sourceFile.fileName, rootDirs, compilerHost) || compilerHost.getCanonicalFileName(sourceFile.fileName);
13882
13891
  const dependencies = extractHmrDependencies(clazz, definition, factory, deferBlockMetadata, classMetadata, debugInfo, reflection, evaluator);
13883
13892
  if (dependencies === null) {
@@ -13895,8 +13904,8 @@ function extractHmrMetatadata(clazz, reflection, evaluator, compilerHost, rootDi
13895
13904
 
13896
13905
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/hmr/src/update_declaration.mjs
13897
13906
  import { compileHmrUpdateCallback } from "@angular/compiler";
13898
- import ts46 from "typescript";
13899
- function getHmrUpdateDeclaration(compilationResults, constantStatements, meta, sourceFile) {
13907
+ import ts47 from "typescript";
13908
+ function getHmrUpdateDeclaration(compilationResults, constantStatements, meta, declaration) {
13900
13909
  const namespaceSpecifiers = meta.namespaceDependencies.reduce((result, current) => {
13901
13910
  result.set(current.moduleName, current.assignedName);
13902
13911
  return result;
@@ -13907,10 +13916,11 @@ function getHmrUpdateDeclaration(compilationResults, constantStatements, meta, s
13907
13916
  rewriter: importRewriter
13908
13917
  });
13909
13918
  const callback = compileHmrUpdateCallback(compilationResults, constantStatements, meta);
13919
+ const sourceFile = ts47.getOriginalNode(declaration).getSourceFile();
13910
13920
  const node = translateStatement(sourceFile, callback, importManager);
13911
- return ts46.factory.updateFunctionDeclaration(node, [
13912
- ts46.factory.createToken(ts46.SyntaxKind.ExportKeyword),
13913
- ts46.factory.createToken(ts46.SyntaxKind.DefaultKeyword)
13921
+ return ts47.factory.updateFunctionDeclaration(node, [
13922
+ ts47.factory.createToken(ts47.SyntaxKind.ExportKeyword),
13923
+ ts47.factory.createToken(ts47.SyntaxKind.DefaultKeyword)
13914
13924
  ], node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body);
13915
13925
  }
13916
13926
  var HmrModuleImportRewriter = class {
@@ -14135,10 +14145,10 @@ var ComponentDecoratorHandler = class {
14135
14145
  return {};
14136
14146
  }
14137
14147
  const { decorator: component, metadata, inputs, outputs, hostDirectives, rawHostDirectives } = directiveResult;
14138
- const encapsulation = (_a = this.compilationMode !== CompilationMode.LOCAL ? resolveEnumValue(this.evaluator, component, "encapsulation", "ViewEncapsulation") : resolveEncapsulationEnumValueLocally(component.get("encapsulation"))) != null ? _a : ViewEncapsulation2.Emulated;
14148
+ const encapsulation = (_a = this.compilationMode !== CompilationMode.LOCAL ? resolveEnumValue(this.evaluator, component, "encapsulation", "ViewEncapsulation", this.isCore) : resolveEncapsulationEnumValueLocally(component.get("encapsulation"))) != null ? _a : ViewEncapsulation2.Emulated;
14139
14149
  let changeDetection = null;
14140
14150
  if (this.compilationMode !== CompilationMode.LOCAL) {
14141
- changeDetection = resolveEnumValue(this.evaluator, component, "changeDetection", "ChangeDetectionStrategy");
14151
+ changeDetection = resolveEnumValue(this.evaluator, component, "changeDetection", "ChangeDetectionStrategy", this.isCore);
14142
14152
  } else if (component.has("changeDetection")) {
14143
14153
  changeDetection = new o4.WrappedNodeExpr(component.get("changeDetection"));
14144
14154
  }
@@ -14186,7 +14196,7 @@ var ComponentDecoratorHandler = class {
14186
14196
  } else if (this.compilationMode !== CompilationMode.LOCAL && (rawImports || rawDeferredImports)) {
14187
14197
  const importResolvers = combineResolvers([
14188
14198
  createModuleWithProvidersResolver(this.reflector, this.isCore),
14189
- forwardRefResolver
14199
+ createForwardRefResolver(this.isCore)
14190
14200
  ]);
14191
14201
  const importDiagnostics = [];
14192
14202
  if (rawImports) {
@@ -14254,7 +14264,7 @@ var ComponentDecoratorHandler = class {
14254
14264
  path: absoluteFrom(template.declaration.resolvedTemplateUrl),
14255
14265
  expression: template.sourceMapping.node
14256
14266
  };
14257
- const relativeTemplatePath = getProjectRelativePath((_d = templateResource.path) != null ? _d : ts47.getOriginalNode(node).getSourceFile().fileName, this.rootDirs, this.compilerHost);
14267
+ const relativeTemplatePath = getProjectRelativePath((_d = templateResource.path) != null ? _d : ts48.getOriginalNode(node).getSourceFile().fileName, this.rootDirs, this.compilerHost);
14258
14268
  let styles = [];
14259
14269
  const externalStyles = [];
14260
14270
  const styleResources = extractInlineStyleResources(component);
@@ -14269,7 +14279,7 @@ var ComponentDecoratorHandler = class {
14269
14279
  externalStyles.push(resourceUrl);
14270
14280
  continue;
14271
14281
  }
14272
- if (styleUrl.source === 2 && ts47.isStringLiteralLike(styleUrl.expression)) {
14282
+ if (styleUrl.source === 2 && ts48.isStringLiteralLike(styleUrl.expression)) {
14273
14283
  styleResources.add({
14274
14284
  path: absoluteFrom(resourceUrl),
14275
14285
  expression: styleUrl.expression
@@ -14472,7 +14482,7 @@ var ComponentDecoratorHandler = class {
14472
14482
  }
14473
14483
  typeCheck(ctx, node, meta) {
14474
14484
  var _a;
14475
- if (this.typeCheckScopeRegistry === null || !ts47.isClassDeclaration(node)) {
14485
+ if (this.typeCheckScopeRegistry === null || !ts48.isClassDeclaration(node)) {
14476
14486
  return;
14477
14487
  }
14478
14488
  if (meta.isPoisoned && !this.usePoisonedData) {
@@ -14483,7 +14493,15 @@ var ComponentDecoratorHandler = class {
14483
14493
  return;
14484
14494
  }
14485
14495
  const binder = new R3TargetBinder(scope.matcher);
14486
- ctx.addTemplate(new Reference(node), binder, meta.template.diagNodes, scope.pipes, scope.schemas, meta.template.sourceMapping, meta.template.file, meta.template.errors, meta.meta.isStandalone, (_a = meta.meta.template.preserveWhitespaces) != null ? _a : false);
14496
+ const templateContext = {
14497
+ nodes: meta.template.diagNodes,
14498
+ pipes: scope.pipes,
14499
+ sourceMapping: meta.template.sourceMapping,
14500
+ file: meta.template.file,
14501
+ parseErrors: meta.template.errors,
14502
+ preserveWhitespaces: (_a = meta.meta.template.preserveWhitespaces) != null ? _a : false
14503
+ };
14504
+ ctx.addDirective(new Reference(node), binder, scope.schemas, templateContext, meta.meta.isStandalone);
14487
14505
  }
14488
14506
  extendedTemplateCheck(component, extendedTemplateChecker) {
14489
14507
  return extendedTemplateChecker.getDiagnosticsForComponent(component);
@@ -14863,7 +14881,7 @@ var ComponentDecoratorHandler = class {
14863
14881
  const debugInfo = analysis.classDebugInfo !== null ? compileClassDebugInfo(analysis.classDebugInfo).toStmt() : null;
14864
14882
  const hmrMeta = this.enableHmr ? extractHmrMetatadata(node, this.reflector, this.evaluator, this.compilerHost, this.rootDirs, def, fac, defer, classMetadata, debugInfo) : null;
14865
14883
  const res = compileResults(fac, def, classMetadata, "\u0275cmp", null, null, debugInfo, null);
14866
- return hmrMeta === null || res.length === 0 ? null : getHmrUpdateDeclaration(res, pool.statements, hmrMeta, node.getSourceFile());
14884
+ return hmrMeta === null || res.length === 0 ? null : getHmrUpdateDeclaration(res, pool.statements, hmrMeta, node);
14867
14885
  }
14868
14886
  locateDeferBlocksWithoutScope(template) {
14869
14887
  const deferBlocks = /* @__PURE__ */ new Map();
@@ -14898,12 +14916,12 @@ var ComponentDecoratorHandler = class {
14898
14916
  }
14899
14917
  collectExplicitlyDeferredSymbols(rawDeferredImports) {
14900
14918
  const deferredTypes = /* @__PURE__ */ new Map();
14901
- if (!ts47.isArrayLiteralExpression(rawDeferredImports)) {
14919
+ if (!ts48.isArrayLiteralExpression(rawDeferredImports)) {
14902
14920
  return deferredTypes;
14903
14921
  }
14904
14922
  for (const element of rawDeferredImports.elements) {
14905
14923
  const node = tryUnwrapForwardRef(element, this.reflector) || element;
14906
- if (!ts47.isIdentifier(node)) {
14924
+ if (!ts48.isIdentifier(node)) {
14907
14925
  continue;
14908
14926
  }
14909
14927
  const imp = this.reflector.getImportOfIdentifier(node);
@@ -14970,12 +14988,12 @@ var ComponentDecoratorHandler = class {
14970
14988
  }
14971
14989
  }
14972
14990
  registerDeferrableCandidates(componentClassDecl, importsExpr, isDeferredImport, allDeferredDecls, eagerlyUsedDecls, resolutionData) {
14973
- if (!ts47.isArrayLiteralExpression(importsExpr)) {
14991
+ if (!ts48.isArrayLiteralExpression(importsExpr)) {
14974
14992
  return;
14975
14993
  }
14976
14994
  for (const element of importsExpr.elements) {
14977
14995
  const node = tryUnwrapForwardRef(element, this.reflector) || element;
14978
- if (!ts47.isIdentifier(node)) {
14996
+ if (!ts48.isIdentifier(node)) {
14979
14997
  continue;
14980
14998
  }
14981
14999
  const imp = this.reflector.getImportOfIdentifier(node);
@@ -15109,7 +15127,7 @@ function isDefaultImport(node) {
15109
15127
 
15110
15128
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
15111
15129
  import { compileClassMetadata as compileClassMetadata3, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression3, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr10 } from "@angular/compiler";
15112
- import ts48 from "typescript";
15130
+ import ts49 from "typescript";
15113
15131
  var InjectableDecoratorHandler = class {
15114
15132
  reflector;
15115
15133
  evaluator;
@@ -15238,7 +15256,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
15238
15256
  };
15239
15257
  } else if (decorator.args.length === 1) {
15240
15258
  const metaNode = decorator.args[0];
15241
- if (!ts48.isObjectLiteralExpression(metaNode)) {
15259
+ if (!ts49.isObjectLiteralExpression(metaNode)) {
15242
15260
  throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
15243
15261
  }
15244
15262
  const meta = reflectObjectLiteral(metaNode);
@@ -15246,7 +15264,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
15246
15264
  let deps = void 0;
15247
15265
  if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
15248
15266
  const depsExpr = meta.get("deps");
15249
- if (!ts48.isArrayLiteralExpression(depsExpr)) {
15267
+ if (!ts49.isArrayLiteralExpression(depsExpr)) {
15250
15268
  throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, depsExpr, `@Injectable deps metadata must be an inline array`);
15251
15269
  }
15252
15270
  deps = depsExpr.elements.map((dep) => getDep(dep, reflector));
@@ -15331,12 +15349,12 @@ function getDep(dep, reflector) {
15331
15349
  }
15332
15350
  return true;
15333
15351
  }
15334
- if (ts48.isArrayLiteralExpression(dep)) {
15352
+ if (ts49.isArrayLiteralExpression(dep)) {
15335
15353
  dep.elements.forEach((el) => {
15336
15354
  let isDecorator = false;
15337
- if (ts48.isIdentifier(el)) {
15355
+ if (ts49.isIdentifier(el)) {
15338
15356
  isDecorator = maybeUpdateDecorator(el, reflector);
15339
- } else if (ts48.isNewExpression(el) && ts48.isIdentifier(el.expression)) {
15357
+ } else if (ts49.isNewExpression(el) && ts49.isIdentifier(el.expression)) {
15340
15358
  const token = el.arguments && el.arguments.length > 0 && el.arguments[0] || void 0;
15341
15359
  isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
15342
15360
  }
@@ -15350,7 +15368,7 @@ function getDep(dep, reflector) {
15350
15368
 
15351
15369
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
15352
15370
  import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5 } from "@angular/compiler";
15353
- import ts49 from "typescript";
15371
+ import ts50 from "typescript";
15354
15372
  var PipeSymbol = class extends SemanticSymbol {
15355
15373
  name;
15356
15374
  constructor(decl, name) {
@@ -15423,7 +15441,7 @@ var PipeDecoratorHandler = class {
15423
15441
  throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, "@Pipe must have exactly one argument");
15424
15442
  }
15425
15443
  const meta = unwrapExpression(decorator.args[0]);
15426
- if (!ts49.isObjectLiteralExpression(meta)) {
15444
+ if (!ts50.isObjectLiteralExpression(meta)) {
15427
15445
  throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@Pipe must have a literal argument");
15428
15446
  }
15429
15447
  const pipe = reflectObjectLiteral(meta);
@@ -15526,7 +15544,7 @@ var PipeDecoratorHandler = class {
15526
15544
  export {
15527
15545
  isAngularDecorator,
15528
15546
  getAngularDecorators,
15529
- forwardRefResolver,
15547
+ createForwardRefResolver,
15530
15548
  MetaKind,
15531
15549
  CompoundMetadataReader,
15532
15550
  DtsMetadataReader,
@@ -15596,4 +15614,4 @@ export {
15596
15614
  * Use of this source code is governed by an MIT-style license that can be
15597
15615
  * found in the LICENSE file at https://angular.dev/license
15598
15616
  */
15599
- //# sourceMappingURL=chunk-J2ZUZS7X.js.map
15617
+ //# sourceMappingURL=chunk-RPCYQIAM.js.map