@angular/compiler 14.0.0-next.7 → 14.0.0-rc.0

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 (151) hide show
  1. package/esm2020/src/compiler.mjs +4 -3
  2. package/esm2020/src/compiler_facade_interface.mjs +7 -1
  3. package/esm2020/src/core.mjs +6 -6
  4. package/esm2020/src/expression_parser/parser.mjs +12 -12
  5. package/esm2020/src/i18n/i18n_parser.mjs +3 -3
  6. package/esm2020/src/jit_compiler_facade.mjs +76 -44
  7. package/esm2020/src/ml_parser/html_whitespaces.mjs +2 -2
  8. package/esm2020/src/ml_parser/lexer.mjs +37 -37
  9. package/esm2020/src/ml_parser/parser.mjs +41 -41
  10. package/esm2020/src/parse_util.mjs +2 -2
  11. package/esm2020/src/render3/partial/api.mjs +1 -1
  12. package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
  13. package/esm2020/src/render3/partial/component.mjs +28 -37
  14. package/esm2020/src/render3/partial/directive.mjs +6 -3
  15. package/esm2020/src/render3/partial/factory.mjs +1 -1
  16. package/esm2020/src/render3/partial/injectable.mjs +1 -1
  17. package/esm2020/src/render3/partial/injector.mjs +1 -1
  18. package/esm2020/src/render3/partial/ng_module.mjs +3 -3
  19. package/esm2020/src/render3/partial/pipe.mjs +6 -3
  20. package/esm2020/src/render3/r3_ast.mjs +3 -3
  21. package/esm2020/src/render3/r3_factory.mjs +6 -6
  22. package/esm2020/src/render3/r3_identifiers.mjs +4 -1
  23. package/esm2020/src/render3/r3_module_compiler.mjs +45 -8
  24. package/esm2020/src/render3/r3_pipe_compiler.mjs +5 -1
  25. package/esm2020/src/render3/util.mjs +4 -4
  26. package/esm2020/src/render3/view/api.mjs +7 -2
  27. package/esm2020/src/render3/view/compiler.mjs +45 -35
  28. package/esm2020/src/render3/view/i18n/get_msg_utils.mjs +58 -5
  29. package/esm2020/src/render3/view/i18n/meta.mjs +4 -4
  30. package/esm2020/src/render3/view/i18n/util.mjs +2 -2
  31. package/esm2020/src/render3/view/style_parser.mjs +20 -20
  32. package/esm2020/src/render3/view/styling_builder.mjs +8 -8
  33. package/esm2020/src/render3/view/template.mjs +45 -32
  34. package/esm2020/src/render3/view/util.mjs +14 -5
  35. package/esm2020/src/selector.mjs +10 -10
  36. package/esm2020/src/shadow_css.mjs +2 -2
  37. package/esm2020/src/template_parser/binding_parser.mjs +9 -9
  38. package/esm2020/src/util.mjs +8 -8
  39. package/esm2020/src/version.mjs +1 -1
  40. package/fesm2015/compiler.mjs +492 -325
  41. package/fesm2015/compiler.mjs.map +1 -1
  42. package/fesm2015/testing.mjs +1 -1
  43. package/fesm2020/compiler.mjs +500 -338
  44. package/fesm2020/compiler.mjs.map +1 -1
  45. package/fesm2020/testing.mjs +1 -1
  46. package/index.d.ts +4964 -5
  47. package/package.json +3 -3
  48. package/testing/index.d.ts +22 -5
  49. package/compiler.d.ts +0 -8
  50. package/public_api.d.ts +0 -13
  51. package/src/assertions.d.ts +0 -8
  52. package/src/chars.d.ts +0 -75
  53. package/src/compiler.d.ts +0 -77
  54. package/src/compiler_facade_interface.d.ts +0 -284
  55. package/src/compiler_util/expression_converter.d.ts +0 -71
  56. package/src/config.d.ts +0 -25
  57. package/src/constant_pool.d.ts +0 -37
  58. package/src/core.d.ts +0 -216
  59. package/src/expression_parser/ast.d.ts +0 -440
  60. package/src/expression_parser/lexer.d.ts +0 -47
  61. package/src/expression_parser/parser.d.ts +0 -315
  62. package/src/i18n/big_integer.d.ts +0 -108
  63. package/src/i18n/digest.d.ts +0 -44
  64. package/src/i18n/extractor_merger.d.ts +0 -27
  65. package/src/i18n/i18n_ast.d.ts +0 -148
  66. package/src/i18n/i18n_html_parser.d.ts +0 -19
  67. package/src/i18n/i18n_parser.d.ts +0 -18
  68. package/src/i18n/index.d.ts +0 -15
  69. package/src/i18n/message_bundle.d.ts +0 -28
  70. package/src/i18n/parse_util.d.ts +0 -14
  71. package/src/i18n/serializers/placeholder.d.ts +0 -25
  72. package/src/i18n/serializers/serializer.d.ts +0 -46
  73. package/src/i18n/serializers/xliff.d.ts +0 -19
  74. package/src/i18n/serializers/xliff2.d.ts +0 -19
  75. package/src/i18n/serializers/xmb.d.ts +0 -22
  76. package/src/i18n/serializers/xml_helper.d.ts +0 -52
  77. package/src/i18n/serializers/xtb.d.ts +0 -20
  78. package/src/i18n/translation_bundle.d.ts +0 -27
  79. package/src/injectable_compiler_2.d.ts +0 -24
  80. package/src/jit_compiler_facade.d.ts +0 -46
  81. package/src/ml_parser/ast.d.ts +0 -89
  82. package/src/ml_parser/entities.d.ts +0 -9
  83. package/src/ml_parser/html_parser.d.ts +0 -13
  84. package/src/ml_parser/html_tags.d.ts +0 -33
  85. package/src/ml_parser/html_whitespaces.d.ts +0 -45
  86. package/src/ml_parser/icu_ast_expander.d.ts +0 -42
  87. package/src/ml_parser/interpolation_config.d.ts +0 -14
  88. package/src/ml_parser/lexer.d.ts +0 -114
  89. package/src/ml_parser/parser.d.ts +0 -26
  90. package/src/ml_parser/tags.d.ts +0 -29
  91. package/src/ml_parser/tokens.d.ts +0 -141
  92. package/src/ml_parser/xml_parser.d.ts +0 -13
  93. package/src/ml_parser/xml_tags.d.ts +0 -24
  94. package/src/output/abstract_emitter.d.ts +0 -66
  95. package/src/output/abstract_js_emitter.d.ts +0 -19
  96. package/src/output/map_util.d.ts +0 -18
  97. package/src/output/output_ast.d.ts +0 -575
  98. package/src/output/output_jit.d.ts +0 -73
  99. package/src/output/output_jit_trusted_types.d.ts +0 -43
  100. package/src/output/source_map.d.ts +0 -29
  101. package/src/parse_util.d.ts +0 -75
  102. package/src/render3/partial/api.d.ts +0 -441
  103. package/src/render3/partial/class_metadata.d.ts +0 -10
  104. package/src/render3/partial/component.d.ts +0 -39
  105. package/src/render3/partial/directive.d.ts +0 -13
  106. package/src/render3/partial/factory.d.ts +0 -3
  107. package/src/render3/partial/injectable.d.ts +0 -19
  108. package/src/render3/partial/injector.d.ts +0 -3
  109. package/src/render3/partial/ng_module.d.ts +0 -3
  110. package/src/render3/partial/pipe.d.ts +0 -12
  111. package/src/render3/partial/util.d.ts +0 -33
  112. package/src/render3/r3_ast.d.ts +0 -211
  113. package/src/render3/r3_class_metadata_compiler.d.ts +0 -35
  114. package/src/render3/r3_factory.d.ts +0 -94
  115. package/src/render3/r3_identifiers.d.ts +0 -180
  116. package/src/render3/r3_injector_compiler.d.ts +0 -18
  117. package/src/render3/r3_jit.d.ts +0 -22
  118. package/src/render3/r3_module_compiler.d.ts +0 -77
  119. package/src/render3/r3_pipe_compiler.d.ts +0 -50
  120. package/src/render3/r3_template_transform.d.ts +0 -24
  121. package/src/render3/util.d.ts +0 -94
  122. package/src/render3/view/api.d.ts +0 -328
  123. package/src/render3/view/compiler.d.ts +0 -86
  124. package/src/render3/view/i18n/context.d.ts +0 -68
  125. package/src/render3/view/i18n/get_msg_utils.d.ts +0 -13
  126. package/src/render3/view/i18n/icu_serializer.d.ts +0 -9
  127. package/src/render3/view/i18n/localize_utils.d.ts +0 -24
  128. package/src/render3/view/i18n/meta.d.ts +0 -78
  129. package/src/render3/view/i18n/util.d.ts +0 -78
  130. package/src/render3/view/style_parser.d.ts +0 -18
  131. package/src/render3/view/styling_builder.d.ts +0 -211
  132. package/src/render3/view/t2_api.d.ts +0 -152
  133. package/src/render3/view/t2_binder.d.ts +0 -57
  134. package/src/render3/view/template.d.ts +0 -450
  135. package/src/render3/view/util.d.ts +0 -94
  136. package/src/resource_loader.d.ts +0 -17
  137. package/src/schema/dom_element_schema_registry.d.ts +0 -45
  138. package/src/schema/dom_security_schema.d.ts +0 -11
  139. package/src/schema/element_schema_registry.d.ts +0 -29
  140. package/src/schema/trusted_types_sinks.d.ts +0 -15
  141. package/src/selector.d.ts +0 -105
  142. package/src/shadow_css.d.ts +0 -76
  143. package/src/style_url_resolver.d.ts +0 -8
  144. package/src/template_parser/binding_parser.d.ts +0 -91
  145. package/src/template_parser/template_preparser.d.ts +0 -24
  146. package/src/util.d.ts +0 -42
  147. package/src/version.d.ts +0 -14
  148. package/testing/package.json +0 -9
  149. package/testing/public_api.d.ts +0 -13
  150. package/testing/src/testing.d.ts +0 -23
  151. package/testing/testing.d.ts +0 -4
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.7
2
+ * @license Angular v14.0.0-rc.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -211,7 +211,7 @@ class CssSelector {
211
211
  let inNot = false;
212
212
  _SELECTOR_REGEXP.lastIndex = 0;
213
213
  while (match = _SELECTOR_REGEXP.exec(selector)) {
214
- if (match[1 /* NOT */]) {
214
+ if (match[1 /* SelectorRegexp.NOT */]) {
215
215
  if (inNot) {
216
216
  throw new Error('Nesting :not in a selector is not allowed');
217
217
  }
@@ -219,31 +219,31 @@ class CssSelector {
219
219
  current = new CssSelector();
220
220
  cssSelector.notSelectors.push(current);
221
221
  }
222
- const tag = match[2 /* TAG */];
222
+ const tag = match[2 /* SelectorRegexp.TAG */];
223
223
  if (tag) {
224
- const prefix = match[3 /* PREFIX */];
224
+ const prefix = match[3 /* SelectorRegexp.PREFIX */];
225
225
  if (prefix === '#') {
226
226
  // #hash
227
- current.addAttribute('id', tag.substr(1));
227
+ current.addAttribute('id', tag.slice(1));
228
228
  }
229
229
  else if (prefix === '.') {
230
230
  // Class
231
- current.addClassName(tag.substr(1));
231
+ current.addClassName(tag.slice(1));
232
232
  }
233
233
  else {
234
234
  // Element
235
235
  current.setElement(tag);
236
236
  }
237
237
  }
238
- const attribute = match[4 /* ATTRIBUTE */];
238
+ const attribute = match[4 /* SelectorRegexp.ATTRIBUTE */];
239
239
  if (attribute) {
240
- current.addAttribute(current.unescapeAttribute(attribute), match[6 /* ATTRIBUTE_VALUE */]);
240
+ current.addAttribute(current.unescapeAttribute(attribute), match[6 /* SelectorRegexp.ATTRIBUTE_VALUE */]);
241
241
  }
242
- if (match[7 /* NOT_END */]) {
242
+ if (match[7 /* SelectorRegexp.NOT_END */]) {
243
243
  inNot = false;
244
244
  current = cssSelector;
245
245
  }
246
- if (match[8 /* SEPARATOR */]) {
246
+ if (match[8 /* SelectorRegexp.SEPARATOR */]) {
247
247
  if (inNot) {
248
248
  throw new Error('Multiple selectors in :not are not supported');
249
249
  }
@@ -611,26 +611,26 @@ var MissingTranslationStrategy;
611
611
  })(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
612
612
  function parserSelectorToSimpleSelector(selector) {
613
613
  const classes = selector.classNames && selector.classNames.length ?
614
- [8 /* CLASS */, ...selector.classNames] :
614
+ [8 /* SelectorFlags.CLASS */, ...selector.classNames] :
615
615
  [];
616
616
  const elementName = selector.element && selector.element !== '*' ? selector.element : '';
617
617
  return [elementName, ...selector.attrs, ...classes];
618
618
  }
619
619
  function parserSelectorToNegativeSelector(selector) {
620
620
  const classes = selector.classNames && selector.classNames.length ?
621
- [8 /* CLASS */, ...selector.classNames] :
621
+ [8 /* SelectorFlags.CLASS */, ...selector.classNames] :
622
622
  [];
623
623
  if (selector.element) {
624
624
  return [
625
- 1 /* NOT */ | 4 /* ELEMENT */, selector.element, ...selector.attrs, ...classes
625
+ 1 /* SelectorFlags.NOT */ | 4 /* SelectorFlags.ELEMENT */, selector.element, ...selector.attrs, ...classes
626
626
  ];
627
627
  }
628
628
  else if (selector.attrs.length) {
629
- return [1 /* NOT */ | 2 /* ATTRIBUTE */, ...selector.attrs, ...classes];
629
+ return [1 /* SelectorFlags.NOT */ | 2 /* SelectorFlags.ATTRIBUTE */, ...selector.attrs, ...classes];
630
630
  }
631
631
  else {
632
632
  return selector.classNames && selector.classNames.length ?
633
- [1 /* NOT */ | 8 /* CLASS */, ...selector.classNames] :
633
+ [1 /* SelectorFlags.NOT */ | 8 /* SelectorFlags.CLASS */, ...selector.classNames] :
634
634
  [];
635
635
  }
636
636
  }
@@ -756,13 +756,13 @@ class Version {
756
756
  this.patch = splits.slice(2).join('.');
757
757
  }
758
758
  }
759
- const __window = typeof window !== 'undefined' && window;
760
- const __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
761
- self instanceof WorkerGlobalScope && self;
762
- const __global = typeof global !== 'undefined' && global;
763
- // Check __global first, because in Node tests both __global and __window may be defined and _global
764
- // should be __global in that case.
765
- const _global = __global || __window || __self;
759
+ // Check `global` first, because in Node tests both `global` and `window` may be defined and our
760
+ // `_global` variable should point to the NodeJS `global` in that case. Note: Typeof/Instanceof
761
+ // checks are considered side-effects in Terser. We explicitly mark this as side-effect free:
762
+ // https://github.com/terser/terser/issues/250.
763
+ const _global = ( /* @__PURE__ */(() => (typeof global !== 'undefined' && global) || (typeof window !== 'undefined' && window) ||
764
+ (typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
765
+ self instanceof WorkerGlobalScope && self))());
766
766
  function newArray(size, value) {
767
767
  const list = [];
768
768
  for (let i = 0; i < size; i++) {
@@ -2796,6 +2796,7 @@ Identifiers.stylePropInterpolate7 = { name: 'ɵɵstylePropInterpolate7', moduleN
2796
2796
  Identifiers.stylePropInterpolate8 = { name: 'ɵɵstylePropInterpolate8', moduleName: CORE };
2797
2797
  Identifiers.stylePropInterpolateV = { name: 'ɵɵstylePropInterpolateV', moduleName: CORE };
2798
2798
  Identifiers.nextContext = { name: 'ɵɵnextContext', moduleName: CORE };
2799
+ Identifiers.resetView = { name: 'ɵɵresetView', moduleName: CORE };
2799
2800
  Identifiers.templateCreate = { name: 'ɵɵtemplate', moduleName: CORE };
2800
2801
  Identifiers.text = { name: 'ɵɵtext', moduleName: CORE };
2801
2802
  Identifiers.enableBindings = { name: 'ɵɵenableBindings', moduleName: CORE };
@@ -2906,6 +2907,7 @@ Identifiers.ModuleWithProviders = {
2906
2907
  Identifiers.defineNgModule = { name: 'ɵɵdefineNgModule', moduleName: CORE };
2907
2908
  Identifiers.declareNgModule = { name: 'ɵɵngDeclareNgModule', moduleName: CORE };
2908
2909
  Identifiers.setNgModuleScope = { name: 'ɵɵsetNgModuleScope', moduleName: CORE };
2910
+ Identifiers.registerNgModuleType = { name: 'ɵɵregisterNgModuleType', moduleName: CORE };
2909
2911
  Identifiers.PipeDeclaration = { name: 'ɵɵPipeDeclaration', moduleName: CORE };
2910
2912
  Identifiers.definePipe = { name: 'ɵɵdefinePipe', moduleName: CORE };
2911
2913
  Identifiers.declarePipe = { name: 'ɵɵngDeclarePipe', moduleName: CORE };
@@ -2918,6 +2920,7 @@ Identifiers.contentQuery = { name: 'ɵɵcontentQuery', moduleName: CORE };
2918
2920
  Identifiers.NgOnChangesFeature = { name: 'ɵɵNgOnChangesFeature', moduleName: CORE };
2919
2921
  Identifiers.InheritDefinitionFeature = { name: 'ɵɵInheritDefinitionFeature', moduleName: CORE };
2920
2922
  Identifiers.CopyDefinitionFeature = { name: 'ɵɵCopyDefinitionFeature', moduleName: CORE };
2923
+ Identifiers.StandaloneFeature = { name: 'ɵɵStandaloneFeature', moduleName: CORE };
2921
2924
  Identifiers.ProvidersFeature = { name: 'ɵɵProvidersFeature', moduleName: CORE };
2922
2925
  Identifiers.listener = { name: 'ɵɵlistener', moduleName: CORE };
2923
2926
  Identifiers.getInheritedFactory = {
@@ -3659,10 +3662,10 @@ function createMayBeForwardRefExpression(expression, forwardRef) {
3659
3662
  */
3660
3663
  function convertFromMaybeForwardRefExpression({ expression, forwardRef }) {
3661
3664
  switch (forwardRef) {
3662
- case 0 /* None */:
3663
- case 1 /* Wrapped */:
3665
+ case 0 /* ForwardRefHandling.None */:
3666
+ case 1 /* ForwardRefHandling.Wrapped */:
3664
3667
  return expression;
3665
- case 2 /* Unwrapped */:
3668
+ case 2 /* ForwardRefHandling.Unwrapped */:
3666
3669
  return generateForwardRef(expression);
3667
3670
  }
3668
3671
  }
@@ -3786,14 +3789,14 @@ function compileInjectDependency(dep, target, index) {
3786
3789
  }
3787
3790
  else if (dep.attributeNameType === null) {
3788
3791
  // Build up the injection flags according to the metadata.
3789
- const flags = 0 /* Default */ | (dep.self ? 2 /* Self */ : 0) |
3790
- (dep.skipSelf ? 4 /* SkipSelf */ : 0) | (dep.host ? 1 /* Host */ : 0) |
3791
- (dep.optional ? 8 /* Optional */ : 0) |
3792
- (target === FactoryTarget$1.Pipe ? 16 /* ForPipe */ : 0);
3792
+ const flags = 0 /* InjectFlags.Default */ | (dep.self ? 2 /* InjectFlags.Self */ : 0) |
3793
+ (dep.skipSelf ? 4 /* InjectFlags.SkipSelf */ : 0) | (dep.host ? 1 /* InjectFlags.Host */ : 0) |
3794
+ (dep.optional ? 8 /* InjectFlags.Optional */ : 0) |
3795
+ (target === FactoryTarget$1.Pipe ? 16 /* InjectFlags.ForPipe */ : 0);
3793
3796
  // If this dependency is optional or otherwise has non-default flags, then additional
3794
3797
  // parameters describing how to inject the dependency must be passed to the inject function
3795
3798
  // that's being used.
3796
- let flagsParam = (flags !== 0 /* Default */ || dep.optional) ? literal(flags) : null;
3799
+ let flagsParam = (flags !== 0 /* InjectFlags.Default */ || dep.optional) ? literal(flags) : null;
3797
3800
  // Build up the arguments to the injectFn call.
3798
3801
  const injectArgs = [dep.token];
3799
3802
  if (flagsParam) {
@@ -3964,8 +3967,8 @@ class BoundEvent {
3964
3967
  this.keySpan = keySpan;
3965
3968
  }
3966
3969
  static fromParsedEvent(event) {
3967
- const target = event.type === 0 /* Regular */ ? event.targetOrPhase : null;
3968
- const phase = event.type === 1 /* Animation */ ? event.targetOrPhase : null;
3970
+ const target = event.type === 0 /* ParsedEventType.Regular */ ? event.targetOrPhase : null;
3971
+ const phase = event.type === 1 /* ParsedEventType.Animation */ ? event.targetOrPhase : null;
3969
3972
  if (event.keySpan === undefined) {
3970
3973
  throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${event.name}: ${event.sourceSpan}`);
3971
3974
  }
@@ -4789,7 +4792,7 @@ function assembleBoundTextPlaceholders(meta, bindingStartIndex = 0, contextId =
4789
4792
  * @param useCamelCase whether to camelCase the placeholder name when formatting.
4790
4793
  * @returns A new map of formatted placeholder names to expressions.
4791
4794
  */
4792
- function i18nFormatPlaceholderNames(params = {}, useCamelCase) {
4795
+ function formatI18nPlaceholderNamesInMap(params = {}, useCamelCase) {
4793
4796
  const _params = {};
4794
4797
  if (params && Object.keys(params).length) {
4795
4798
  Object.keys(params).forEach(key => _params[formatI18nPlaceholderName(key, useCamelCase)] = params[key]);
@@ -4872,6 +4875,12 @@ const IMPLICIT_REFERENCE = '$implicit';
4872
4875
  const NON_BINDABLE_ATTR = 'ngNonBindable';
4873
4876
  /** Name for the variable keeping track of the context returned by `ɵɵrestoreView`. */
4874
4877
  const RESTORED_VIEW_CONTEXT_NAME = 'restoredCtx';
4878
+ /**
4879
+ * Maximum length of a single instruction chain. Because our output AST uses recursion, we're
4880
+ * limited in how many expressions we can nest before we reach the call stack limit. This
4881
+ * length is set very conservatively in order to reduce the chance of problems.
4882
+ */
4883
+ const MAX_CHAIN_LENGTH = 500;
4875
4884
  /** Instructions that support chaining. */
4876
4885
  const CHAINABLE_INSTRUCTIONS = new Set([
4877
4886
  Identifiers.element,
@@ -5017,10 +5026,10 @@ function getQueryPredicate(query, constantPool) {
5017
5026
  else {
5018
5027
  // The original predicate may have been wrapped in a `forwardRef()` call.
5019
5028
  switch (query.predicate.forwardRef) {
5020
- case 0 /* None */:
5021
- case 2 /* Unwrapped */:
5029
+ case 0 /* ForwardRefHandling.None */:
5030
+ case 2 /* ForwardRefHandling.Unwrapped */:
5022
5031
  return query.predicate.expression;
5023
- case 1 /* Wrapped */:
5032
+ case 1 /* ForwardRefHandling.Wrapped */:
5024
5033
  return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
5025
5034
  }
5026
5035
  }
@@ -5097,16 +5106,18 @@ function getInstructionStatements(instructions) {
5097
5106
  const statements = [];
5098
5107
  let pendingExpression = null;
5099
5108
  let pendingExpressionType = null;
5109
+ let chainLength = 0;
5100
5110
  for (const current of instructions) {
5101
5111
  const resolvedParams = (typeof current.paramsOrFn === 'function' ? current.paramsOrFn() : current.paramsOrFn) ??
5102
5112
  [];
5103
5113
  const params = Array.isArray(resolvedParams) ? resolvedParams : [resolvedParams];
5104
5114
  // If the current instruction is the same as the previous one
5105
5115
  // and it can be chained, add another call to the chain.
5106
- if (pendingExpressionType === current.reference &&
5116
+ if (chainLength < MAX_CHAIN_LENGTH && pendingExpressionType === current.reference &&
5107
5117
  CHAINABLE_INSTRUCTIONS.has(pendingExpressionType)) {
5108
5118
  // We'll always have a pending expression when there's a pending expression type.
5109
5119
  pendingExpression = pendingExpression.callFn(params, pendingExpression.sourceSpan);
5120
+ chainLength++;
5110
5121
  }
5111
5122
  else {
5112
5123
  if (pendingExpression !== null) {
@@ -5114,6 +5125,7 @@ function getInstructionStatements(instructions) {
5114
5125
  }
5115
5126
  pendingExpression = invokeInstruction(current.span, current.reference, params);
5116
5127
  pendingExpressionType = current.reference;
5128
+ chainLength = 0;
5117
5129
  }
5118
5130
  }
5119
5131
  // Since the current instruction adds the previous one to the statements,
@@ -5428,7 +5440,7 @@ class ParseLocation {
5428
5440
  const ch = source.charCodeAt(offset);
5429
5441
  if (ch == $LF) {
5430
5442
  line--;
5431
- const priorLine = source.substr(0, offset - 1).lastIndexOf(String.fromCharCode($LF));
5443
+ const priorLine = source.substring(0, offset - 1).lastIndexOf(String.fromCharCode($LF));
5432
5444
  col = priorLine > 0 ? offset - priorLine : offset;
5433
5445
  }
5434
5446
  else {
@@ -5982,20 +5994,49 @@ class R3JitReflector {
5982
5994
  * Use of this source code is governed by an MIT-style license that can be
5983
5995
  * found in the LICENSE file at https://angular.io/license
5984
5996
  */
5997
+ /**
5998
+ * How the selector scope of an NgModule (its declarations, imports, and exports) should be emitted
5999
+ * as a part of the NgModule definition.
6000
+ */
6001
+ var R3SelectorScopeMode;
6002
+ (function (R3SelectorScopeMode) {
6003
+ /**
6004
+ * Emit the declarations inline into the module definition.
6005
+ *
6006
+ * This option is useful in certain contexts where it's known that JIT support is required. The
6007
+ * tradeoff here is that this emit style prevents directives and pipes from being tree-shaken if
6008
+ * they are unused, but the NgModule is used.
6009
+ */
6010
+ R3SelectorScopeMode[R3SelectorScopeMode["Inline"] = 0] = "Inline";
6011
+ /**
6012
+ * Emit the declarations using a side effectful function call, `ɵɵsetNgModuleScope`, that is
6013
+ * guarded with the `ngJitMode` flag.
6014
+ *
6015
+ * This form of emit supports JIT and can be optimized away if the `ngJitMode` flag is set to
6016
+ * false, which allows unused directives and pipes to be tree-shaken.
6017
+ */
6018
+ R3SelectorScopeMode[R3SelectorScopeMode["SideEffect"] = 1] = "SideEffect";
6019
+ /**
6020
+ * Don't generate selector scopes at all.
6021
+ *
6022
+ * This is useful for contexts where JIT support is known to be unnecessary.
6023
+ */
6024
+ R3SelectorScopeMode[R3SelectorScopeMode["Omit"] = 2] = "Omit";
6025
+ })(R3SelectorScopeMode || (R3SelectorScopeMode = {}));
5985
6026
  /**
5986
6027
  * Construct an `R3NgModuleDef` for the given `R3NgModuleMetadata`.
5987
6028
  */
5988
6029
  function compileNgModule(meta) {
5989
- const { internalType, bootstrap, declarations, imports, exports, schemas, containsForwardDecls, emitInline, id } = meta;
6030
+ const { adjacentType, internalType, bootstrap, declarations, imports, exports, schemas, containsForwardDecls, selectorScopeMode, id } = meta;
5990
6031
  const statements = [];
5991
6032
  const definitionMap = new DefinitionMap();
5992
6033
  definitionMap.set('type', internalType);
5993
6034
  if (bootstrap.length > 0) {
5994
6035
  definitionMap.set('bootstrap', refsToArray(bootstrap, containsForwardDecls));
5995
6036
  }
5996
- // If requested to emit scope information inline, pass the `declarations`, `imports` and `exports`
5997
- // to the `ɵɵdefineNgModule()` call. The JIT compilation uses this.
5998
- if (emitInline) {
6037
+ if (selectorScopeMode === R3SelectorScopeMode.Inline) {
6038
+ // If requested to emit scope information inline, pass the `declarations`, `imports` and
6039
+ // `exports` to the `ɵɵdefineNgModule()` call directly.
5999
6040
  if (declarations.length > 0) {
6000
6041
  definitionMap.set('declarations', refsToArray(declarations, containsForwardDecls));
6001
6042
  }
@@ -6006,19 +6047,27 @@ function compileNgModule(meta) {
6006
6047
  definitionMap.set('exports', refsToArray(exports, containsForwardDecls));
6007
6048
  }
6008
6049
  }
6009
- // If not emitting inline, the scope information is not passed into `ɵɵdefineNgModule` as it would
6010
- // prevent tree-shaking of the declarations, imports and exports references.
6011
- else {
6050
+ else if (selectorScopeMode === R3SelectorScopeMode.SideEffect) {
6051
+ // In this mode, scope information is not passed into `ɵɵdefineNgModule` as it
6052
+ // would prevent tree-shaking of the declarations, imports and exports references. Instead, it's
6053
+ // patched onto the NgModule definition with a `ɵɵsetNgModuleScope` call that's guarded by the
6054
+ // `ngJitMode` flag.
6012
6055
  const setNgModuleScopeCall = generateSetNgModuleScopeCall(meta);
6013
6056
  if (setNgModuleScopeCall !== null) {
6014
6057
  statements.push(setNgModuleScopeCall);
6015
6058
  }
6016
6059
  }
6060
+ else {
6061
+ // Selector scope emit was not requested, so skip it.
6062
+ }
6017
6063
  if (schemas !== null && schemas.length > 0) {
6018
6064
  definitionMap.set('schemas', literalArr(schemas.map(ref => ref.value)));
6019
6065
  }
6020
6066
  if (id !== null) {
6021
6067
  definitionMap.set('id', id);
6068
+ // Generate a side-effectful call to register this NgModule by its id, as per the semantics of
6069
+ // NgModule ids.
6070
+ statements.push(importExpr(Identifiers.registerNgModuleType).callFn([adjacentType, id]).toStmt());
6022
6071
  }
6023
6072
  const expression = importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()], undefined, true);
6024
6073
  const type = createNgModuleType(meta);
@@ -6114,6 +6163,9 @@ function compilePipeFromMetadata(metadata) {
6114
6163
  definitionMapValues.push({ key: 'type', value: metadata.type.value, quoted: false });
6115
6164
  // e.g. `pure: true`
6116
6165
  definitionMapValues.push({ key: 'pure', value: literal(metadata.pure), quoted: false });
6166
+ if (metadata.isStandalone) {
6167
+ definitionMapValues.push({ key: 'standalone', value: literal(true), quoted: false });
6168
+ }
6117
6169
  const expression = importExpr(Identifiers.definePipe).callFn([literalMap(definitionMapValues)], undefined, true);
6118
6170
  const type = createPipeType(metadata);
6119
6171
  return { expression, type, statements: [] };
@@ -6122,9 +6174,24 @@ function createPipeType(metadata) {
6122
6174
  return new ExpressionType(importExpr(Identifiers.PipeDeclaration, [
6123
6175
  typeWithParameters(metadata.type.type, metadata.typeArgumentCount),
6124
6176
  new ExpressionType(new LiteralExpr(metadata.pipeName)),
6177
+ new ExpressionType(new LiteralExpr(metadata.isStandalone)),
6125
6178
  ]));
6126
6179
  }
6127
6180
 
6181
+ /**
6182
+ * @license
6183
+ * Copyright Google LLC All Rights Reserved.
6184
+ *
6185
+ * Use of this source code is governed by an MIT-style license that can be
6186
+ * found in the LICENSE file at https://angular.io/license
6187
+ */
6188
+ var R3TemplateDependencyKind;
6189
+ (function (R3TemplateDependencyKind) {
6190
+ R3TemplateDependencyKind[R3TemplateDependencyKind["Directive"] = 0] = "Directive";
6191
+ R3TemplateDependencyKind[R3TemplateDependencyKind["Pipe"] = 1] = "Pipe";
6192
+ R3TemplateDependencyKind[R3TemplateDependencyKind["NgModule"] = 2] = "NgModule";
6193
+ })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
6194
+
6128
6195
  /**
6129
6196
  * @license
6130
6197
  * Copyright Google LLC All Rights Reserved.
@@ -7965,7 +8032,7 @@ class ShadowCss {
7965
8032
  this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);
7966
8033
  }
7967
8034
  else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
7968
- rule.selector.startsWith('@document')) {
8035
+ rule.selector.startsWith('@document') || rule.selector.startsWith('@layer')) {
7969
8036
  content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
7970
8037
  }
7971
8038
  else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) {
@@ -8374,7 +8441,7 @@ function parse(value) {
8374
8441
  const styles = [];
8375
8442
  let i = 0;
8376
8443
  let parenDepth = 0;
8377
- let quote = 0 /* QuoteNone */;
8444
+ let quote = 0 /* Char.QuoteNone */;
8378
8445
  let valueStart = 0;
8379
8446
  let propStart = 0;
8380
8447
  let currentProp = null;
@@ -8382,41 +8449,41 @@ function parse(value) {
8382
8449
  while (i < value.length) {
8383
8450
  const token = value.charCodeAt(i++);
8384
8451
  switch (token) {
8385
- case 40 /* OpenParen */:
8452
+ case 40 /* Char.OpenParen */:
8386
8453
  parenDepth++;
8387
8454
  break;
8388
- case 41 /* CloseParen */:
8455
+ case 41 /* Char.CloseParen */:
8389
8456
  parenDepth--;
8390
8457
  break;
8391
- case 39 /* QuoteSingle */:
8458
+ case 39 /* Char.QuoteSingle */:
8392
8459
  // valueStart needs to be there since prop values don't
8393
8460
  // have quotes in CSS
8394
8461
  valueHasQuotes = valueHasQuotes || valueStart > 0;
8395
- if (quote === 0 /* QuoteNone */) {
8396
- quote = 39 /* QuoteSingle */;
8462
+ if (quote === 0 /* Char.QuoteNone */) {
8463
+ quote = 39 /* Char.QuoteSingle */;
8397
8464
  }
8398
- else if (quote === 39 /* QuoteSingle */ && value.charCodeAt(i - 1) !== 92 /* BackSlash */) {
8399
- quote = 0 /* QuoteNone */;
8465
+ else if (quote === 39 /* Char.QuoteSingle */ && value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */) {
8466
+ quote = 0 /* Char.QuoteNone */;
8400
8467
  }
8401
8468
  break;
8402
- case 34 /* QuoteDouble */:
8469
+ case 34 /* Char.QuoteDouble */:
8403
8470
  // same logic as above
8404
8471
  valueHasQuotes = valueHasQuotes || valueStart > 0;
8405
- if (quote === 0 /* QuoteNone */) {
8406
- quote = 34 /* QuoteDouble */;
8472
+ if (quote === 0 /* Char.QuoteNone */) {
8473
+ quote = 34 /* Char.QuoteDouble */;
8407
8474
  }
8408
- else if (quote === 34 /* QuoteDouble */ && value.charCodeAt(i - 1) !== 92 /* BackSlash */) {
8409
- quote = 0 /* QuoteNone */;
8475
+ else if (quote === 34 /* Char.QuoteDouble */ && value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */) {
8476
+ quote = 0 /* Char.QuoteNone */;
8410
8477
  }
8411
8478
  break;
8412
- case 58 /* Colon */:
8413
- if (!currentProp && parenDepth === 0 && quote === 0 /* QuoteNone */) {
8479
+ case 58 /* Char.Colon */:
8480
+ if (!currentProp && parenDepth === 0 && quote === 0 /* Char.QuoteNone */) {
8414
8481
  currentProp = hyphenate(value.substring(propStart, i - 1).trim());
8415
8482
  valueStart = i;
8416
8483
  }
8417
8484
  break;
8418
- case 59 /* Semicolon */:
8419
- if (currentProp && valueStart > 0 && parenDepth === 0 && quote === 0 /* QuoteNone */) {
8485
+ case 59 /* Char.Semicolon */:
8486
+ if (currentProp && valueStart > 0 && parenDepth === 0 && quote === 0 /* Char.QuoteNone */) {
8420
8487
  const styleVal = value.substring(valueStart, i - 1).trim();
8421
8488
  styles.push(currentProp, valueHasQuotes ? stripUnnecessaryQuotes(styleVal) : styleVal);
8422
8489
  propStart = i;
@@ -8428,7 +8495,7 @@ function parse(value) {
8428
8495
  }
8429
8496
  }
8430
8497
  if (currentProp && valueStart) {
8431
- const styleVal = value.substr(valueStart).trim();
8498
+ const styleVal = value.slice(valueStart).trim();
8432
8499
  styles.push(currentProp, valueHasQuotes ? stripUnnecessaryQuotes(styleVal) : styleVal);
8433
8500
  }
8434
8501
  return styles;
@@ -8436,7 +8503,7 @@ function parse(value) {
8436
8503
  function stripUnnecessaryQuotes(value) {
8437
8504
  const qS = value.charCodeAt(0);
8438
8505
  const qE = value.charCodeAt(value.length - 1);
8439
- if (qS == qE && (qS == 39 /* QuoteSingle */ || qS == 34 /* QuoteDouble */)) {
8506
+ if (qS == qE && (qS == 39 /* Char.QuoteSingle */ || qS == 34 /* Char.QuoteDouble */)) {
8440
8507
  const tempValue = value.substring(1, value.length - 1);
8441
8508
  // special case to avoid using a multi-quoted string that was just chomped
8442
8509
  // (e.g. `font-family: "Verdana", "sans-serif"`)
@@ -8587,13 +8654,13 @@ class StylingBuilder {
8587
8654
  let binding = null;
8588
8655
  let name = input.name;
8589
8656
  switch (input.type) {
8590
- case 0 /* Property */:
8657
+ case 0 /* BindingType.Property */:
8591
8658
  binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);
8592
8659
  break;
8593
- case 3 /* Style */:
8660
+ case 3 /* BindingType.Style */:
8594
8661
  binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);
8595
8662
  break;
8596
- case 2 /* Class */:
8663
+ case 2 /* BindingType.Class */:
8597
8664
  binding = this.registerClassInput(name, false, input.value, input.sourceSpan);
8598
8665
  break;
8599
8666
  }
@@ -8606,7 +8673,7 @@ class StylingBuilder {
8606
8673
  const isClass = !isStyle && (name === 'class' || prefix === 'class.' || prefix === 'class!');
8607
8674
  if (isStyle || isClass) {
8608
8675
  const isMapBased = name.charAt(5) !== '.'; // style.prop or class.prop makes this a no
8609
- const property = name.substr(isMapBased ? 5 : 6); // the dot explains why there's a +1
8676
+ const property = name.slice(isMapBased ? 5 : 6); // the dot explains why there's a +1
8610
8677
  if (isStyle) {
8611
8678
  binding = this.registerStyleInput(property, isMapBased, expression, sourceSpan);
8612
8679
  }
@@ -8692,14 +8759,14 @@ class StylingBuilder {
8692
8759
  populateInitialStylingAttrs(attrs) {
8693
8760
  // [CLASS_MARKER, 'foo', 'bar', 'baz' ...]
8694
8761
  if (this._initialClassValues.length) {
8695
- attrs.push(literal(1 /* Classes */));
8762
+ attrs.push(literal(1 /* AttributeMarker.Classes */));
8696
8763
  for (let i = 0; i < this._initialClassValues.length; i++) {
8697
8764
  attrs.push(literal(this._initialClassValues[i]));
8698
8765
  }
8699
8766
  }
8700
8767
  // [STYLE_MARKER, 'width', '200px', 'height', '100px', ...]
8701
8768
  if (this._initialStyleValues.length) {
8702
- attrs.push(literal(2 /* Styles */));
8769
+ attrs.push(literal(2 /* AttributeMarker.Styles */));
8703
8770
  for (let i = 0; i < this._initialStyleValues.length; i += 2) {
8704
8771
  attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));
8705
8772
  }
@@ -8880,7 +8947,7 @@ function parseProperty(name) {
8880
8947
  let property = name;
8881
8948
  const unitIndex = name.lastIndexOf('.');
8882
8949
  if (unitIndex > 0) {
8883
- suffix = name.substr(unitIndex + 1);
8950
+ suffix = name.slice(unitIndex + 1);
8884
8951
  property = name.substring(0, unitIndex);
8885
8952
  }
8886
8953
  return { property, suffix, hasOverrideFlag };
@@ -9431,9 +9498,9 @@ class Parser$1 {
9431
9498
  this._checkNoInterpolation(input, location, interpolationConfig);
9432
9499
  const sourceToLex = this._stripComments(input);
9433
9500
  const tokens = this._lexer.tokenize(sourceToLex);
9434
- let flags = 1 /* Action */;
9501
+ let flags = 1 /* ParseFlags.Action */;
9435
9502
  if (isAssignmentEvent) {
9436
- flags |= 2 /* AssignmentEvent */;
9503
+ flags |= 2 /* ParseFlags.AssignmentEvent */;
9437
9504
  }
9438
9505
  const ast = new _ParseAST(input, location, absoluteOffset, tokens, flags, this.errors, 0).parseChain();
9439
9506
  return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);
@@ -9462,7 +9529,7 @@ class Parser$1 {
9462
9529
  this._checkNoInterpolation(input, location, interpolationConfig);
9463
9530
  const sourceToLex = this._stripComments(input);
9464
9531
  const tokens = this._lexer.tokenize(sourceToLex);
9465
- return new _ParseAST(input, location, absoluteOffset, tokens, 0 /* None */, this.errors, 0)
9532
+ return new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0)
9466
9533
  .parseChain();
9467
9534
  }
9468
9535
  /**
@@ -9493,7 +9560,7 @@ class Parser$1 {
9493
9560
  */
9494
9561
  parseTemplateBindings(templateKey, templateValue, templateUrl, absoluteKeyOffset, absoluteValueOffset) {
9495
9562
  const tokens = this._lexer.tokenize(templateValue);
9496
- const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, 0 /* None */, this.errors, 0 /* relative offset */);
9563
+ const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0 /* relative offset */);
9497
9564
  return parser.parseTemplateBindings({
9498
9565
  source: templateKey,
9499
9566
  span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length),
@@ -9508,7 +9575,7 @@ class Parser$1 {
9508
9575
  const expressionText = expressions[i].text;
9509
9576
  const sourceToLex = this._stripComments(expressionText);
9510
9577
  const tokens = this._lexer.tokenize(sourceToLex);
9511
- const ast = new _ParseAST(input, location, absoluteOffset, tokens, 0 /* None */, this.errors, offsets[i])
9578
+ const ast = new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, offsets[i])
9512
9579
  .parseChain();
9513
9580
  expressionNodes.push(ast);
9514
9581
  }
@@ -9522,7 +9589,7 @@ class Parser$1 {
9522
9589
  parseInterpolationExpression(expression, location, absoluteOffset) {
9523
9590
  const sourceToLex = this._stripComments(expression);
9524
9591
  const tokens = this._lexer.tokenize(sourceToLex);
9525
- const ast = new _ParseAST(expression, location, absoluteOffset, tokens, 0 /* None */, this.errors, 0)
9592
+ const ast = new _ParseAST(expression, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0)
9526
9593
  .parseChain();
9527
9594
  const strings = ['', '']; // The prefix and suffix strings are both empty
9528
9595
  return this.createInterpolationAst(strings, [ast], expression, location, absoluteOffset);
@@ -9878,7 +9945,7 @@ class _ParseAST {
9878
9945
  const expr = this.parsePipe();
9879
9946
  exprs.push(expr);
9880
9947
  if (this.consumeOptionalCharacter($SEMICOLON)) {
9881
- if (!(this.parseFlags & 1 /* Action */)) {
9948
+ if (!(this.parseFlags & 1 /* ParseFlags.Action */)) {
9882
9949
  this.error('Binding expression cannot contain chained expression');
9883
9950
  }
9884
9951
  while (this.consumeOptionalCharacter($SEMICOLON)) {
@@ -9902,7 +9969,7 @@ class _ParseAST {
9902
9969
  const start = this.inputIndex;
9903
9970
  let result = this.parseExpression();
9904
9971
  if (this.consumeOptionalOperator('|')) {
9905
- if (this.parseFlags & 1 /* Action */) {
9972
+ if (this.parseFlags & 1 /* ParseFlags.Action */) {
9906
9973
  this.error('Cannot have a pipe in an action expression');
9907
9974
  }
9908
9975
  do {
@@ -10254,7 +10321,7 @@ class _ParseAST {
10254
10321
  }
10255
10322
  else {
10256
10323
  if (this.consumeOptionalAssignment()) {
10257
- if (!(this.parseFlags & 1 /* Action */)) {
10324
+ if (!(this.parseFlags & 1 /* ParseFlags.Action */)) {
10258
10325
  this.error('Bindings cannot contain assignments');
10259
10326
  return new EmptyExpr(this.span(start), this.sourceSpan(start));
10260
10327
  }
@@ -10286,7 +10353,7 @@ class _ParseAST {
10286
10353
  // primary expression is substituted as LHS of the assignment operator to achieve
10287
10354
  // two-way-binding, such that the LHS could be the non-null operator. The grammar doesn't
10288
10355
  // naturally allow for this syntax, so assignment events are parsed specially.
10289
- if ((this.parseFlags & 2 /* AssignmentEvent */) && this.next.isOperator('!') &&
10356
+ if ((this.parseFlags & 2 /* ParseFlags.AssignmentEvent */) && this.next.isOperator('!') &&
10290
10357
  this.peek(1).isOperator('=')) {
10291
10358
  // First skip over the ! operator.
10292
10359
  this.advance();
@@ -10608,7 +10675,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
10608
10675
  let tokenIndex = 0;
10609
10676
  while (tokenIndex < interpolatedTokens.length) {
10610
10677
  const currentToken = interpolatedTokens[tokenIndex];
10611
- if (currentToken.type === 9 /* ENCODED_ENTITY */) {
10678
+ if (currentToken.type === 9 /* MlParserTokenType.ENCODED_ENTITY */) {
10612
10679
  const [decoded, encoded] = currentToken.parts;
10613
10680
  consumedInOriginalTemplate += encoded.length;
10614
10681
  consumedInInput += decoded.length;
@@ -13006,14 +13073,14 @@ class _Tokenizer {
13006
13073
  else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) {
13007
13074
  // In (possibly interpolated) text the end of the text is given by `isTextEnd()`, while
13008
13075
  // the premature end of an interpolation is given by the start of a new HTML element.
13009
- this._consumeWithInterpolation(5 /* TEXT */, 8 /* INTERPOLATION */, () => this._isTextEnd(), () => this._isTagStart());
13076
+ this._consumeWithInterpolation(5 /* TokenType.TEXT */, 8 /* TokenType.INTERPOLATION */, () => this._isTextEnd(), () => this._isTagStart());
13010
13077
  }
13011
13078
  }
13012
13079
  catch (e) {
13013
13080
  this.handleError(e);
13014
13081
  }
13015
13082
  }
13016
- this._beginToken(24 /* EOF */);
13083
+ this._beginToken(24 /* TokenType.EOF */);
13017
13084
  this._endToken([]);
13018
13085
  }
13019
13086
  /**
@@ -13157,7 +13224,7 @@ class _Tokenizer {
13157
13224
  return char;
13158
13225
  }
13159
13226
  _consumeEntity(textTokenType) {
13160
- this._beginToken(9 /* ENCODED_ENTITY */);
13227
+ this._beginToken(9 /* TokenType.ENCODED_ENTITY */);
13161
13228
  const start = this._cursor.clone();
13162
13229
  this._cursor.advance();
13163
13230
  if (this._attemptCharCode($HASH)) {
@@ -13203,7 +13270,7 @@ class _Tokenizer {
13203
13270
  }
13204
13271
  }
13205
13272
  _consumeRawText(consumeEntities, endMarkerPredicate) {
13206
- this._beginToken(consumeEntities ? 6 /* ESCAPABLE_RAW_TEXT */ : 7 /* RAW_TEXT */);
13273
+ this._beginToken(consumeEntities ? 6 /* TokenType.ESCAPABLE_RAW_TEXT */ : 7 /* TokenType.RAW_TEXT */);
13207
13274
  const parts = [];
13208
13275
  while (true) {
13209
13276
  const tagCloseStart = this._cursor.clone();
@@ -13215,8 +13282,8 @@ class _Tokenizer {
13215
13282
  if (consumeEntities && this._cursor.peek() === $AMPERSAND) {
13216
13283
  this._endToken([this._processCarriageReturns(parts.join(''))]);
13217
13284
  parts.length = 0;
13218
- this._consumeEntity(6 /* ESCAPABLE_RAW_TEXT */);
13219
- this._beginToken(6 /* ESCAPABLE_RAW_TEXT */);
13285
+ this._consumeEntity(6 /* TokenType.ESCAPABLE_RAW_TEXT */);
13286
+ this._beginToken(6 /* TokenType.ESCAPABLE_RAW_TEXT */);
13220
13287
  }
13221
13288
  else {
13222
13289
  parts.push(this._readChar());
@@ -13225,25 +13292,25 @@ class _Tokenizer {
13225
13292
  this._endToken([this._processCarriageReturns(parts.join(''))]);
13226
13293
  }
13227
13294
  _consumeComment(start) {
13228
- this._beginToken(10 /* COMMENT_START */, start);
13295
+ this._beginToken(10 /* TokenType.COMMENT_START */, start);
13229
13296
  this._requireCharCode($MINUS);
13230
13297
  this._endToken([]);
13231
13298
  this._consumeRawText(false, () => this._attemptStr('-->'));
13232
- this._beginToken(11 /* COMMENT_END */);
13299
+ this._beginToken(11 /* TokenType.COMMENT_END */);
13233
13300
  this._requireStr('-->');
13234
13301
  this._endToken([]);
13235
13302
  }
13236
13303
  _consumeCdata(start) {
13237
- this._beginToken(12 /* CDATA_START */, start);
13304
+ this._beginToken(12 /* TokenType.CDATA_START */, start);
13238
13305
  this._requireStr('CDATA[');
13239
13306
  this._endToken([]);
13240
13307
  this._consumeRawText(false, () => this._attemptStr(']]>'));
13241
- this._beginToken(13 /* CDATA_END */);
13308
+ this._beginToken(13 /* TokenType.CDATA_END */);
13242
13309
  this._requireStr(']]>');
13243
13310
  this._endToken([]);
13244
13311
  }
13245
13312
  _consumeDocType(start) {
13246
- this._beginToken(18 /* DOC_TYPE */, start);
13313
+ this._beginToken(18 /* TokenType.DOC_TYPE */, start);
13247
13314
  const contentStart = this._cursor.clone();
13248
13315
  this._attemptUntilChar($GT);
13249
13316
  const content = this._cursor.getChars(contentStart);
@@ -13297,12 +13364,12 @@ class _Tokenizer {
13297
13364
  if (e instanceof _ControlFlowError) {
13298
13365
  if (openTagToken) {
13299
13366
  // We errored before we could close the opening tag, so it is incomplete.
13300
- openTagToken.type = 4 /* INCOMPLETE_TAG_OPEN */;
13367
+ openTagToken.type = 4 /* TokenType.INCOMPLETE_TAG_OPEN */;
13301
13368
  }
13302
13369
  else {
13303
13370
  // When the start tag is invalid, assume we want a "<" as text.
13304
13371
  // Back to back text tokens are merged at the end.
13305
- this._beginToken(5 /* TEXT */, start);
13372
+ this._beginToken(5 /* TokenType.TEXT */, start);
13306
13373
  this._endToken(['<']);
13307
13374
  }
13308
13375
  return;
@@ -13329,13 +13396,13 @@ class _Tokenizer {
13329
13396
  this._attemptCharCodeUntilFn(isNotWhitespace);
13330
13397
  return this._attemptCharCode($GT);
13331
13398
  });
13332
- this._beginToken(3 /* TAG_CLOSE */);
13399
+ this._beginToken(3 /* TokenType.TAG_CLOSE */);
13333
13400
  this._requireCharCodeUntilFn(code => code === $GT, 3);
13334
13401
  this._cursor.advance(); // Consume the `>`
13335
13402
  this._endToken([prefix, tagName]);
13336
13403
  }
13337
13404
  _consumeTagOpenStart(start) {
13338
- this._beginToken(0 /* TAG_OPEN_START */, start);
13405
+ this._beginToken(0 /* TokenType.TAG_OPEN_START */, start);
13339
13406
  const parts = this._consumePrefixAndName();
13340
13407
  return this._endToken(parts);
13341
13408
  }
@@ -13344,7 +13411,7 @@ class _Tokenizer {
13344
13411
  if (attrNameStart === $SQ || attrNameStart === $DQ) {
13345
13412
  throw this._createError(_unexpectedCharacterErrorMsg(attrNameStart), this._cursor.getSpan());
13346
13413
  }
13347
- this._beginToken(14 /* ATTR_NAME */);
13414
+ this._beginToken(14 /* TokenType.ATTR_NAME */);
13348
13415
  const prefixAndName = this._consumePrefixAndName();
13349
13416
  this._endToken(prefixAndName);
13350
13417
  }
@@ -13356,27 +13423,27 @@ class _Tokenizer {
13356
13423
  // In an attribute then end of the attribute value and the premature end to an interpolation
13357
13424
  // are both triggered by the `quoteChar`.
13358
13425
  const endPredicate = () => this._cursor.peek() === quoteChar;
13359
- this._consumeWithInterpolation(16 /* ATTR_VALUE_TEXT */, 17 /* ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
13426
+ this._consumeWithInterpolation(16 /* TokenType.ATTR_VALUE_TEXT */, 17 /* TokenType.ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
13360
13427
  this._consumeQuote(quoteChar);
13361
13428
  }
13362
13429
  else {
13363
13430
  const endPredicate = () => isNameEnd(this._cursor.peek());
13364
- this._consumeWithInterpolation(16 /* ATTR_VALUE_TEXT */, 17 /* ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
13431
+ this._consumeWithInterpolation(16 /* TokenType.ATTR_VALUE_TEXT */, 17 /* TokenType.ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
13365
13432
  }
13366
13433
  }
13367
13434
  _consumeQuote(quoteChar) {
13368
- this._beginToken(15 /* ATTR_QUOTE */);
13435
+ this._beginToken(15 /* TokenType.ATTR_QUOTE */);
13369
13436
  this._requireCharCode(quoteChar);
13370
13437
  this._endToken([String.fromCodePoint(quoteChar)]);
13371
13438
  }
13372
13439
  _consumeTagOpenEnd() {
13373
- const tokenType = this._attemptCharCode($SLASH) ? 2 /* TAG_OPEN_END_VOID */ : 1 /* TAG_OPEN_END */;
13440
+ const tokenType = this._attemptCharCode($SLASH) ? 2 /* TokenType.TAG_OPEN_END_VOID */ : 1 /* TokenType.TAG_OPEN_END */;
13374
13441
  this._beginToken(tokenType);
13375
13442
  this._requireCharCode($GT);
13376
13443
  this._endToken([]);
13377
13444
  }
13378
13445
  _consumeTagClose(start) {
13379
- this._beginToken(3 /* TAG_CLOSE */, start);
13446
+ this._beginToken(3 /* TokenType.TAG_CLOSE */, start);
13380
13447
  this._attemptCharCodeUntilFn(isNotWhitespace);
13381
13448
  const prefixAndName = this._consumePrefixAndName();
13382
13449
  this._attemptCharCodeUntilFn(isNotWhitespace);
@@ -13384,11 +13451,11 @@ class _Tokenizer {
13384
13451
  this._endToken(prefixAndName);
13385
13452
  }
13386
13453
  _consumeExpansionFormStart() {
13387
- this._beginToken(19 /* EXPANSION_FORM_START */);
13454
+ this._beginToken(19 /* TokenType.EXPANSION_FORM_START */);
13388
13455
  this._requireCharCode($LBRACE);
13389
13456
  this._endToken([]);
13390
- this._expansionCaseStack.push(19 /* EXPANSION_FORM_START */);
13391
- this._beginToken(7 /* RAW_TEXT */);
13457
+ this._expansionCaseStack.push(19 /* TokenType.EXPANSION_FORM_START */);
13458
+ this._beginToken(7 /* TokenType.RAW_TEXT */);
13392
13459
  const condition = this._readUntil($COMMA);
13393
13460
  const normalizedCondition = this._processCarriageReturns(condition);
13394
13461
  if (this._i18nNormalizeLineEndingsInICUs) {
@@ -13404,32 +13471,32 @@ class _Tokenizer {
13404
13471
  }
13405
13472
  this._requireCharCode($COMMA);
13406
13473
  this._attemptCharCodeUntilFn(isNotWhitespace);
13407
- this._beginToken(7 /* RAW_TEXT */);
13474
+ this._beginToken(7 /* TokenType.RAW_TEXT */);
13408
13475
  const type = this._readUntil($COMMA);
13409
13476
  this._endToken([type]);
13410
13477
  this._requireCharCode($COMMA);
13411
13478
  this._attemptCharCodeUntilFn(isNotWhitespace);
13412
13479
  }
13413
13480
  _consumeExpansionCaseStart() {
13414
- this._beginToken(20 /* EXPANSION_CASE_VALUE */);
13481
+ this._beginToken(20 /* TokenType.EXPANSION_CASE_VALUE */);
13415
13482
  const value = this._readUntil($LBRACE).trim();
13416
13483
  this._endToken([value]);
13417
13484
  this._attemptCharCodeUntilFn(isNotWhitespace);
13418
- this._beginToken(21 /* EXPANSION_CASE_EXP_START */);
13485
+ this._beginToken(21 /* TokenType.EXPANSION_CASE_EXP_START */);
13419
13486
  this._requireCharCode($LBRACE);
13420
13487
  this._endToken([]);
13421
13488
  this._attemptCharCodeUntilFn(isNotWhitespace);
13422
- this._expansionCaseStack.push(21 /* EXPANSION_CASE_EXP_START */);
13489
+ this._expansionCaseStack.push(21 /* TokenType.EXPANSION_CASE_EXP_START */);
13423
13490
  }
13424
13491
  _consumeExpansionCaseEnd() {
13425
- this._beginToken(22 /* EXPANSION_CASE_EXP_END */);
13492
+ this._beginToken(22 /* TokenType.EXPANSION_CASE_EXP_END */);
13426
13493
  this._requireCharCode($RBRACE);
13427
13494
  this._endToken([]);
13428
13495
  this._attemptCharCodeUntilFn(isNotWhitespace);
13429
13496
  this._expansionCaseStack.pop();
13430
13497
  }
13431
13498
  _consumeExpansionFormEnd() {
13432
- this._beginToken(23 /* EXPANSION_FORM_END */);
13499
+ this._beginToken(23 /* TokenType.EXPANSION_FORM_END */);
13433
13500
  this._requireCharCode($RBRACE);
13434
13501
  this._endToken([]);
13435
13502
  this._expansionCaseStack.pop();
@@ -13579,12 +13646,12 @@ class _Tokenizer {
13579
13646
  _isInExpansionCase() {
13580
13647
  return this._expansionCaseStack.length > 0 &&
13581
13648
  this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
13582
- 21 /* EXPANSION_CASE_EXP_START */;
13649
+ 21 /* TokenType.EXPANSION_CASE_EXP_START */;
13583
13650
  }
13584
13651
  _isInExpansionForm() {
13585
13652
  return this._expansionCaseStack.length > 0 &&
13586
13653
  this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
13587
- 19 /* EXPANSION_FORM_START */;
13654
+ 19 /* TokenType.EXPANSION_FORM_START */;
13588
13655
  }
13589
13656
  isExpansionFormStart() {
13590
13657
  if (this._cursor.peek() !== $LBRACE) {
@@ -13631,9 +13698,9 @@ function mergeTextTokens(srcTokens) {
13631
13698
  let lastDstToken = undefined;
13632
13699
  for (let i = 0; i < srcTokens.length; i++) {
13633
13700
  const token = srcTokens[i];
13634
- if ((lastDstToken && lastDstToken.type === 5 /* TEXT */ && token.type === 5 /* TEXT */) ||
13635
- (lastDstToken && lastDstToken.type === 16 /* ATTR_VALUE_TEXT */ &&
13636
- token.type === 16 /* ATTR_VALUE_TEXT */)) {
13701
+ if ((lastDstToken && lastDstToken.type === 5 /* TokenType.TEXT */ && token.type === 5 /* TokenType.TEXT */) ||
13702
+ (lastDstToken && lastDstToken.type === 16 /* TokenType.ATTR_VALUE_TEXT */ &&
13703
+ token.type === 16 /* TokenType.ATTR_VALUE_TEXT */)) {
13637
13704
  lastDstToken.parts[0] += token.parts[0];
13638
13705
  lastDstToken.sourceSpan.end = token.sourceSpan.end;
13639
13706
  }
@@ -13864,7 +13931,7 @@ class EscapedCharacterCursor extends PlainCharacterCursor {
13864
13931
  }
13865
13932
  }
13866
13933
  decodeHexDigits(start, length) {
13867
- const hex = this.input.substr(start.internalState.offset, length);
13934
+ const hex = this.input.slice(start.internalState.offset, start.internalState.offset + length);
13868
13935
  const charCode = parseInt(hex, 16);
13869
13936
  if (!isNaN(charCode)) {
13870
13937
  return charCode;
@@ -13926,28 +13993,28 @@ class _TreeBuilder {
13926
13993
  this._advance();
13927
13994
  }
13928
13995
  build() {
13929
- while (this._peek.type !== 24 /* EOF */) {
13930
- if (this._peek.type === 0 /* TAG_OPEN_START */ ||
13931
- this._peek.type === 4 /* INCOMPLETE_TAG_OPEN */) {
13996
+ while (this._peek.type !== 24 /* TokenType.EOF */) {
13997
+ if (this._peek.type === 0 /* TokenType.TAG_OPEN_START */ ||
13998
+ this._peek.type === 4 /* TokenType.INCOMPLETE_TAG_OPEN */) {
13932
13999
  this._consumeStartTag(this._advance());
13933
14000
  }
13934
- else if (this._peek.type === 3 /* TAG_CLOSE */) {
14001
+ else if (this._peek.type === 3 /* TokenType.TAG_CLOSE */) {
13935
14002
  this._consumeEndTag(this._advance());
13936
14003
  }
13937
- else if (this._peek.type === 12 /* CDATA_START */) {
14004
+ else if (this._peek.type === 12 /* TokenType.CDATA_START */) {
13938
14005
  this._closeVoidElement();
13939
14006
  this._consumeCdata(this._advance());
13940
14007
  }
13941
- else if (this._peek.type === 10 /* COMMENT_START */) {
14008
+ else if (this._peek.type === 10 /* TokenType.COMMENT_START */) {
13942
14009
  this._closeVoidElement();
13943
14010
  this._consumeComment(this._advance());
13944
14011
  }
13945
- else if (this._peek.type === 5 /* TEXT */ || this._peek.type === 7 /* RAW_TEXT */ ||
13946
- this._peek.type === 6 /* ESCAPABLE_RAW_TEXT */) {
14012
+ else if (this._peek.type === 5 /* TokenType.TEXT */ || this._peek.type === 7 /* TokenType.RAW_TEXT */ ||
14013
+ this._peek.type === 6 /* TokenType.ESCAPABLE_RAW_TEXT */) {
13947
14014
  this._closeVoidElement();
13948
14015
  this._consumeText(this._advance());
13949
14016
  }
13950
- else if (this._peek.type === 19 /* EXPANSION_FORM_START */) {
14017
+ else if (this._peek.type === 19 /* TokenType.EXPANSION_FORM_START */) {
13951
14018
  this._consumeExpansion(this._advance());
13952
14019
  }
13953
14020
  else {
@@ -13973,11 +14040,11 @@ class _TreeBuilder {
13973
14040
  }
13974
14041
  _consumeCdata(_startToken) {
13975
14042
  this._consumeText(this._advance());
13976
- this._advanceIf(13 /* CDATA_END */);
14043
+ this._advanceIf(13 /* TokenType.CDATA_END */);
13977
14044
  }
13978
14045
  _consumeComment(token) {
13979
- const text = this._advanceIf(7 /* RAW_TEXT */);
13980
- this._advanceIf(11 /* COMMENT_END */);
14046
+ const text = this._advanceIf(7 /* TokenType.RAW_TEXT */);
14047
+ this._advanceIf(11 /* TokenType.COMMENT_END */);
13981
14048
  const value = text != null ? text.parts[0].trim() : null;
13982
14049
  this._addToParent(new Comment(value, token.sourceSpan));
13983
14050
  }
@@ -13986,14 +14053,14 @@ class _TreeBuilder {
13986
14053
  const type = this._advance();
13987
14054
  const cases = [];
13988
14055
  // read =
13989
- while (this._peek.type === 20 /* EXPANSION_CASE_VALUE */) {
14056
+ while (this._peek.type === 20 /* TokenType.EXPANSION_CASE_VALUE */) {
13990
14057
  const expCase = this._parseExpansionCase();
13991
14058
  if (!expCase)
13992
14059
  return; // error
13993
14060
  cases.push(expCase);
13994
14061
  }
13995
14062
  // read the final }
13996
- if (this._peek.type !== 23 /* EXPANSION_FORM_END */) {
14063
+ if (this._peek.type !== 23 /* TokenType.EXPANSION_FORM_END */) {
13997
14064
  this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));
13998
14065
  return;
13999
14066
  }
@@ -14004,7 +14071,7 @@ class _TreeBuilder {
14004
14071
  _parseExpansionCase() {
14005
14072
  const value = this._advance();
14006
14073
  // read {
14007
- if (this._peek.type !== 21 /* EXPANSION_CASE_EXP_START */) {
14074
+ if (this._peek.type !== 21 /* TokenType.EXPANSION_CASE_EXP_START */) {
14008
14075
  this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '{'.`));
14009
14076
  return null;
14010
14077
  }
@@ -14014,7 +14081,7 @@ class _TreeBuilder {
14014
14081
  if (!exp)
14015
14082
  return null;
14016
14083
  const end = this._advance();
14017
- exp.push({ type: 24 /* EOF */, parts: [], sourceSpan: end.sourceSpan });
14084
+ exp.push({ type: 24 /* TokenType.EOF */, parts: [], sourceSpan: end.sourceSpan });
14018
14085
  // parse everything in between { and }
14019
14086
  const expansionCaseParser = new _TreeBuilder(exp, this.getTagDefinition);
14020
14087
  expansionCaseParser.build();
@@ -14028,14 +14095,14 @@ class _TreeBuilder {
14028
14095
  }
14029
14096
  _collectExpansionExpTokens(start) {
14030
14097
  const exp = [];
14031
- const expansionFormStack = [21 /* EXPANSION_CASE_EXP_START */];
14098
+ const expansionFormStack = [21 /* TokenType.EXPANSION_CASE_EXP_START */];
14032
14099
  while (true) {
14033
- if (this._peek.type === 19 /* EXPANSION_FORM_START */ ||
14034
- this._peek.type === 21 /* EXPANSION_CASE_EXP_START */) {
14100
+ if (this._peek.type === 19 /* TokenType.EXPANSION_FORM_START */ ||
14101
+ this._peek.type === 21 /* TokenType.EXPANSION_CASE_EXP_START */) {
14035
14102
  expansionFormStack.push(this._peek.type);
14036
14103
  }
14037
- if (this._peek.type === 22 /* EXPANSION_CASE_EXP_END */) {
14038
- if (lastOnStack(expansionFormStack, 21 /* EXPANSION_CASE_EXP_START */)) {
14104
+ if (this._peek.type === 22 /* TokenType.EXPANSION_CASE_EXP_END */) {
14105
+ if (lastOnStack(expansionFormStack, 21 /* TokenType.EXPANSION_CASE_EXP_START */)) {
14039
14106
  expansionFormStack.pop();
14040
14107
  if (expansionFormStack.length === 0)
14041
14108
  return exp;
@@ -14045,8 +14112,8 @@ class _TreeBuilder {
14045
14112
  return null;
14046
14113
  }
14047
14114
  }
14048
- if (this._peek.type === 23 /* EXPANSION_FORM_END */) {
14049
- if (lastOnStack(expansionFormStack, 19 /* EXPANSION_FORM_START */)) {
14115
+ if (this._peek.type === 23 /* TokenType.EXPANSION_FORM_END */) {
14116
+ if (lastOnStack(expansionFormStack, 19 /* TokenType.EXPANSION_FORM_START */)) {
14050
14117
  expansionFormStack.pop();
14051
14118
  }
14052
14119
  else {
@@ -14054,7 +14121,7 @@ class _TreeBuilder {
14054
14121
  return null;
14055
14122
  }
14056
14123
  }
14057
- if (this._peek.type === 24 /* EOF */) {
14124
+ if (this._peek.type === 24 /* TokenType.EOF */) {
14058
14125
  this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
14059
14126
  return null;
14060
14127
  }
@@ -14073,18 +14140,18 @@ class _TreeBuilder {
14073
14140
  tokens[0] = { type: token.type, sourceSpan: token.sourceSpan, parts: [text] };
14074
14141
  }
14075
14142
  }
14076
- while (this._peek.type === 8 /* INTERPOLATION */ || this._peek.type === 5 /* TEXT */ ||
14077
- this._peek.type === 9 /* ENCODED_ENTITY */) {
14143
+ while (this._peek.type === 8 /* TokenType.INTERPOLATION */ || this._peek.type === 5 /* TokenType.TEXT */ ||
14144
+ this._peek.type === 9 /* TokenType.ENCODED_ENTITY */) {
14078
14145
  token = this._advance();
14079
14146
  tokens.push(token);
14080
- if (token.type === 8 /* INTERPOLATION */) {
14147
+ if (token.type === 8 /* TokenType.INTERPOLATION */) {
14081
14148
  // For backward compatibility we decode HTML entities that appear in interpolation
14082
14149
  // expressions. This is arguably a bug, but it could be a considerable breaking change to
14083
14150
  // fix it. It should be addressed in a larger project to refactor the entire parser/lexer
14084
14151
  // chain after View Engine has been removed.
14085
14152
  text += token.parts.join('').replace(/&([^;]+);/g, decodeEntity);
14086
14153
  }
14087
- else if (token.type === 9 /* ENCODED_ENTITY */) {
14154
+ else if (token.type === 9 /* TokenType.ENCODED_ENTITY */) {
14088
14155
  text += token.parts[0];
14089
14156
  }
14090
14157
  else {
@@ -14105,14 +14172,14 @@ class _TreeBuilder {
14105
14172
  _consumeStartTag(startTagToken) {
14106
14173
  const [prefix, name] = startTagToken.parts;
14107
14174
  const attrs = [];
14108
- while (this._peek.type === 14 /* ATTR_NAME */) {
14175
+ while (this._peek.type === 14 /* TokenType.ATTR_NAME */) {
14109
14176
  attrs.push(this._consumeAttr(this._advance()));
14110
14177
  }
14111
14178
  const fullName = this._getElementFullName(prefix, name, this._getParentElement());
14112
14179
  let selfClosing = false;
14113
14180
  // Note: There could have been a tokenizer error
14114
14181
  // so that we don't get a token for the end tag...
14115
- if (this._peek.type === 2 /* TAG_OPEN_END_VOID */) {
14182
+ if (this._peek.type === 2 /* TokenType.TAG_OPEN_END_VOID */) {
14116
14183
  this._advance();
14117
14184
  selfClosing = true;
14118
14185
  const tagDef = this.getTagDefinition(fullName);
@@ -14120,7 +14187,7 @@ class _TreeBuilder {
14120
14187
  this.errors.push(TreeError.create(fullName, startTagToken.sourceSpan, `Only void and foreign elements can be self closed "${startTagToken.parts[1]}"`));
14121
14188
  }
14122
14189
  }
14123
- else if (this._peek.type === 1 /* TAG_OPEN_END */) {
14190
+ else if (this._peek.type === 1 /* TokenType.TAG_OPEN_END */) {
14124
14191
  this._advance();
14125
14192
  selfClosing = false;
14126
14193
  }
@@ -14135,7 +14202,7 @@ class _TreeBuilder {
14135
14202
  // element start tag also represents the end tag.
14136
14203
  this._popElement(fullName, span);
14137
14204
  }
14138
- else if (startTagToken.type === 4 /* INCOMPLETE_TAG_OPEN */) {
14205
+ else if (startTagToken.type === 4 /* TokenType.INCOMPLETE_TAG_OPEN */) {
14139
14206
  // We already know the opening tag is not complete, so it is unlikely it has a corresponding
14140
14207
  // close tag. Let's optimistically parse it as a full element and emit an error.
14141
14208
  this._popElement(fullName, null);
@@ -14192,7 +14259,7 @@ class _TreeBuilder {
14192
14259
  const fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);
14193
14260
  let attrEnd = attrName.sourceSpan.end;
14194
14261
  // Consume any quote
14195
- if (this._peek.type === 15 /* ATTR_QUOTE */) {
14262
+ if (this._peek.type === 15 /* TokenType.ATTR_QUOTE */) {
14196
14263
  this._advance();
14197
14264
  }
14198
14265
  // Consume the attribute value
@@ -14205,22 +14272,22 @@ class _TreeBuilder {
14205
14272
  // being able to consider `ATTR_VALUE_INTERPOLATION` as an option. This is because TS is not
14206
14273
  // able to see that `_advance()` will actually mutate `_peek`.
14207
14274
  const nextTokenType = this._peek.type;
14208
- if (nextTokenType === 16 /* ATTR_VALUE_TEXT */) {
14275
+ if (nextTokenType === 16 /* TokenType.ATTR_VALUE_TEXT */) {
14209
14276
  valueStartSpan = this._peek.sourceSpan;
14210
14277
  valueEnd = this._peek.sourceSpan.end;
14211
- while (this._peek.type === 16 /* ATTR_VALUE_TEXT */ ||
14212
- this._peek.type === 17 /* ATTR_VALUE_INTERPOLATION */ ||
14213
- this._peek.type === 9 /* ENCODED_ENTITY */) {
14278
+ while (this._peek.type === 16 /* TokenType.ATTR_VALUE_TEXT */ ||
14279
+ this._peek.type === 17 /* TokenType.ATTR_VALUE_INTERPOLATION */ ||
14280
+ this._peek.type === 9 /* TokenType.ENCODED_ENTITY */) {
14214
14281
  const valueToken = this._advance();
14215
14282
  valueTokens.push(valueToken);
14216
- if (valueToken.type === 17 /* ATTR_VALUE_INTERPOLATION */) {
14283
+ if (valueToken.type === 17 /* TokenType.ATTR_VALUE_INTERPOLATION */) {
14217
14284
  // For backward compatibility we decode HTML entities that appear in interpolation
14218
14285
  // expressions. This is arguably a bug, but it could be a considerable breaking change to
14219
14286
  // fix it. It should be addressed in a larger project to refactor the entire parser/lexer
14220
14287
  // chain after View Engine has been removed.
14221
14288
  value += valueToken.parts.join('').replace(/&([^;]+);/g, decodeEntity);
14222
14289
  }
14223
- else if (valueToken.type === 9 /* ENCODED_ENTITY */) {
14290
+ else if (valueToken.type === 9 /* TokenType.ENCODED_ENTITY */) {
14224
14291
  value += valueToken.parts[0];
14225
14292
  }
14226
14293
  else {
@@ -14230,7 +14297,7 @@ class _TreeBuilder {
14230
14297
  }
14231
14298
  }
14232
14299
  // Consume any quote
14233
- if (this._peek.type === 15 /* ATTR_QUOTE */) {
14300
+ if (this._peek.type === 15 /* TokenType.ATTR_QUOTE */) {
14234
14301
  const quoteToken = this._advance();
14235
14302
  attrEnd = quoteToken.sourceSpan.end;
14236
14303
  }
@@ -14360,7 +14427,7 @@ class WhitespaceVisitor {
14360
14427
  (context.prev instanceof Expansion || context.next instanceof Expansion);
14361
14428
  if (isNotBlank || hasExpansionSibling) {
14362
14429
  // Process the whitespace in the tokens of this Text node
14363
- const tokens = text.tokens.map(token => token.type === 5 /* TEXT */ ? createWhitespaceProcessedTextToken(token) : token);
14430
+ const tokens = text.tokens.map(token => token.type === 5 /* TokenType.TEXT */ ? createWhitespaceProcessedTextToken(token) : token);
14364
14431
  // Process the whitespace of the value of this Text node
14365
14432
  const value = processWhitespace(text.value);
14366
14433
  return new Text(value, text.sourceSpan, tokens, text.i18n);
@@ -15209,7 +15276,7 @@ class BindingParser {
15209
15276
  }
15210
15277
  createBoundElementProperty(elementSelector, boundProp, skipValidation = false, mapPropertyName = true) {
15211
15278
  if (boundProp.isAnimation) {
15212
- return new BoundElementProperty(boundProp.name, 4 /* Animation */, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);
15279
+ return new BoundElementProperty(boundProp.name, 4 /* BindingType.Animation */, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);
15213
15280
  }
15214
15281
  let unit = null;
15215
15282
  let bindingType = undefined;
@@ -15230,17 +15297,17 @@ class BindingParser {
15230
15297
  const name = boundPropertyName.substring(nsSeparatorIdx + 1);
15231
15298
  boundPropertyName = mergeNsAndName(ns, name);
15232
15299
  }
15233
- bindingType = 1 /* Attribute */;
15300
+ bindingType = 1 /* BindingType.Attribute */;
15234
15301
  }
15235
15302
  else if (parts[0] == CLASS_PREFIX) {
15236
15303
  boundPropertyName = parts[1];
15237
- bindingType = 2 /* Class */;
15304
+ bindingType = 2 /* BindingType.Class */;
15238
15305
  securityContexts = [SecurityContext.NONE];
15239
15306
  }
15240
15307
  else if (parts[0] == STYLE_PREFIX) {
15241
15308
  unit = parts.length > 2 ? parts[2] : null;
15242
15309
  boundPropertyName = parts[1];
15243
- bindingType = 3 /* Style */;
15310
+ bindingType = 3 /* BindingType.Style */;
15244
15311
  securityContexts = [SecurityContext.STYLE];
15245
15312
  }
15246
15313
  }
@@ -15249,7 +15316,7 @@ class BindingParser {
15249
15316
  const mappedPropName = this._schemaRegistry.getMappedPropName(boundProp.name);
15250
15317
  boundPropertyName = mapPropertyName ? mappedPropName : boundProp.name;
15251
15318
  securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, mappedPropName, false);
15252
- bindingType = 0 /* Property */;
15319
+ bindingType = 0 /* BindingType.Property */;
15253
15320
  if (!skipValidation) {
15254
15321
  this._validatePropertyOrAttributeName(mappedPropName, boundProp.sourceSpan, false);
15255
15322
  }
@@ -15262,7 +15329,7 @@ class BindingParser {
15262
15329
  this._reportError(`Event name is missing in binding`, sourceSpan);
15263
15330
  }
15264
15331
  if (isAnimationLabel(name)) {
15265
- name = name.substr(1);
15332
+ name = name.slice(1);
15266
15333
  if (keySpan !== undefined) {
15267
15334
  keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));
15268
15335
  }
@@ -15281,7 +15348,7 @@ class BindingParser {
15281
15348
  const eventName = matches[0];
15282
15349
  const phase = matches[1].toLowerCase();
15283
15350
  const ast = this._parseAction(expression, isAssignmentEvent, handlerSpan);
15284
- targetEvents.push(new ParsedEvent(eventName, phase, 1 /* Animation */, ast, sourceSpan, handlerSpan, keySpan));
15351
+ targetEvents.push(new ParsedEvent(eventName, phase, 1 /* ParsedEventType.Animation */, ast, sourceSpan, handlerSpan, keySpan));
15285
15352
  if (eventName.length === 0) {
15286
15353
  this._reportError(`Animation event name is missing in binding`, sourceSpan);
15287
15354
  }
@@ -15299,7 +15366,7 @@ class BindingParser {
15299
15366
  const [target, eventName] = splitAtColon(name, [null, name]);
15300
15367
  const ast = this._parseAction(expression, isAssignmentEvent, handlerSpan);
15301
15368
  targetMatchableAttrs.push([name, ast.source]);
15302
- targetEvents.push(new ParsedEvent(eventName, target, 0 /* Regular */, ast, sourceSpan, handlerSpan, keySpan));
15369
+ targetEvents.push(new ParsedEvent(eventName, target, 0 /* ParsedEventType.Regular */, ast, sourceSpan, handlerSpan, keySpan));
15303
15370
  // Don't detect directives for event names for now,
15304
15371
  // so don't add the event name to the matchableAttrs
15305
15372
  }
@@ -16380,8 +16447,8 @@ class _I18nVisitor {
16380
16447
  let hasInterpolation = false;
16381
16448
  for (const token of tokens) {
16382
16449
  switch (token.type) {
16383
- case 8 /* INTERPOLATION */:
16384
- case 17 /* ATTR_VALUE_INTERPOLATION */:
16450
+ case 8 /* TokenType.INTERPOLATION */:
16451
+ case 17 /* TokenType.ATTR_VALUE_INTERPOLATION */:
16385
16452
  hasInterpolation = true;
16386
16453
  const expression = token.parts[1];
16387
16454
  const baseName = extractPlaceholderName(expression) || 'INTERPOLATION';
@@ -16710,25 +16777,78 @@ function parseI18nMeta(meta = '') {
16710
16777
  function i18nMetaToJSDoc(meta) {
16711
16778
  const tags = [];
16712
16779
  if (meta.description) {
16713
- tags.push({ tagName: "desc" /* Desc */, text: meta.description });
16780
+ tags.push({ tagName: "desc" /* o.JSDocTagName.Desc */, text: meta.description });
16714
16781
  }
16715
16782
  else {
16716
16783
  // Suppress the JSCompiler warning that a `@desc` was not given for this message.
16717
- tags.push({ tagName: "suppress" /* Suppress */, text: '{msgDescriptions}' });
16784
+ tags.push({ tagName: "suppress" /* o.JSDocTagName.Suppress */, text: '{msgDescriptions}' });
16718
16785
  }
16719
16786
  if (meta.meaning) {
16720
- tags.push({ tagName: "meaning" /* Meaning */, text: meta.meaning });
16787
+ tags.push({ tagName: "meaning" /* o.JSDocTagName.Meaning */, text: meta.meaning });
16721
16788
  }
16722
16789
  return jsDocComment(tags);
16723
16790
  }
16724
16791
 
16725
16792
  /** Closure uses `goog.getMsg(message)` to lookup translations */
16726
16793
  const GOOG_GET_MSG = 'goog.getMsg';
16727
- function createGoogleGetMsgStatements(variable$1, message, closureVar, params) {
16794
+ /**
16795
+ * Generates a `goog.getMsg()` statement and reassignment. The template:
16796
+ *
16797
+ * ```html
16798
+ * <div i18n>Sent from {{ sender }} to <span class="receiver">{{ receiver }}</span></div>
16799
+ * ```
16800
+ *
16801
+ * Generates:
16802
+ *
16803
+ * ```typescript
16804
+ * const MSG_FOO = goog.getMsg(
16805
+ * // Message template.
16806
+ * 'Sent from {$interpolation} to {$startTagSpan}{$interpolation_1}{$closeTagSpan}.',
16807
+ * // Placeholder values, set to magic strings which get replaced by the Angular runtime.
16808
+ * {
16809
+ * 'interpolation': '\uFFFD0\uFFFD',
16810
+ * 'startTagSpan': '\uFFFD1\uFFFD',
16811
+ * 'interpolation_1': '\uFFFD2\uFFFD',
16812
+ * 'closeTagSpan': '\uFFFD3\uFFFD',
16813
+ * },
16814
+ * // Options bag.
16815
+ * {
16816
+ * // Maps each placeholder to the original Angular source code which generates it's value.
16817
+ * original_code: {
16818
+ * 'interpolation': '{{ sender }}',
16819
+ * 'startTagSpan': '<span class="receiver">',
16820
+ * 'interploation_1': '{{ receiver }}',
16821
+ * 'closeTagSpan': '</span>',
16822
+ * },
16823
+ * },
16824
+ * );
16825
+ * const I18N_0 = MSG_FOO;
16826
+ * ```
16827
+ */
16828
+ function createGoogleGetMsgStatements(variable$1, message, closureVar, placeholderValues) {
16728
16829
  const messageString = serializeI18nMessageForGetMsg(message);
16729
16830
  const args = [literal(messageString)];
16730
- if (Object.keys(params).length) {
16731
- args.push(mapLiteral(params, true));
16831
+ if (Object.keys(placeholderValues).length) {
16832
+ // Message template parameters containing the magic strings replaced by the Angular runtime with
16833
+ // real data, e.g. `{'interpolation': '\uFFFD0\uFFFD'}`.
16834
+ args.push(mapLiteral(formatI18nPlaceholderNamesInMap(placeholderValues, true /* useCamelCase */), true /* quoted */));
16835
+ // Message options object, which contains original source code for placeholders (as they are
16836
+ // present in a template, e.g.
16837
+ // `{original_code: {'interpolation': '{{ name }}', 'startTagSpan': '<span>'}}`.
16838
+ args.push(mapLiteral({
16839
+ original_code: literalMap(Object.keys(placeholderValues)
16840
+ .map((param) => ({
16841
+ key: formatI18nPlaceholderName(param),
16842
+ quoted: true,
16843
+ value: message.placeholders[param] ?
16844
+ // Get source span for typical placeholder if it exists.
16845
+ literal(message.placeholders[param].sourceSpan.toString()) :
16846
+ // Otherwise must be an ICU expression, get it's source span.
16847
+ literal(message.placeholderToMessage[param]
16848
+ .nodes.map((node) => node.sourceSpan.toString())
16849
+ .join('')),
16850
+ }))),
16851
+ }));
16732
16852
  }
16733
16853
  // /**
16734
16854
  // * @desc description of message
@@ -16917,14 +17037,28 @@ function prepareEventListenerParameters(eventAst, handlerName = null, scope = nu
16917
17037
  scope.getOrCreateSharedContextVar(0);
16918
17038
  const bindingStatements = convertActionBinding(scope, implicitReceiverExpr, handler, 'b', eventAst.handlerSpan, implicitReceiverAccesses, EVENT_BINDING_SCOPE_GLOBALS);
16919
17039
  const statements = [];
16920
- if (scope) {
17040
+ const variableDeclarations = scope?.variableDeclarations();
17041
+ const restoreViewStatement = scope?.restoreViewStatement();
17042
+ if (variableDeclarations) {
16921
17043
  // `variableDeclarations` needs to run first, because
16922
17044
  // `restoreViewStatement` depends on the result.
16923
- statements.push(...scope.variableDeclarations());
16924
- statements.unshift(...scope.restoreViewStatement());
17045
+ statements.push(...variableDeclarations);
16925
17046
  }
16926
17047
  statements.push(...bindingStatements);
16927
- const eventName = type === 1 /* Animation */ ? prepareSyntheticListenerName(name, phase) : name;
17048
+ if (restoreViewStatement) {
17049
+ statements.unshift(restoreViewStatement);
17050
+ // If there's a `restoreView` call, we need to reset the view at the end of the listener
17051
+ // in order to avoid a leak. If there's a `return` statement already, we wrap it in the
17052
+ // call, e.g. `return resetView(ctx.foo())`. Otherwise we add the call as the last statement.
17053
+ const lastStatement = statements[statements.length - 1];
17054
+ if (lastStatement instanceof ReturnStatement) {
17055
+ statements[statements.length - 1] = new ReturnStatement(invokeInstruction(lastStatement.value.sourceSpan, Identifiers.resetView, [lastStatement.value]));
17056
+ }
17057
+ else {
17058
+ statements.push(new ExpressionStatement(invokeInstruction(null, Identifiers.resetView, [])));
17059
+ }
17060
+ }
17061
+ const eventName = type === 1 /* ParsedEventType.Animation */ ? prepareSyntheticListenerName(name, phase) : name;
16928
17062
  const fnName = handlerName && sanitizeIdentifier(handlerName);
16929
17063
  const fnArgs = [];
16930
17064
  if (implicitReceiverAccesses.has(eventArgumentName)) {
@@ -17076,10 +17210,10 @@ class TemplateDefinitionBuilder {
17076
17210
  const creationVariables = this._bindingScope.viewSnapshotStatements();
17077
17211
  const updateVariables = this._bindingScope.variableDeclarations().concat(this._tempVariables);
17078
17212
  const creationBlock = creationStatements.length > 0 ?
17079
- [renderFlagCheckIfStmt(1 /* Create */, creationVariables.concat(creationStatements))] :
17213
+ [renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, creationVariables.concat(creationStatements))] :
17080
17214
  [];
17081
17215
  const updateBlock = updateStatements.length > 0 ?
17082
- [renderFlagCheckIfStmt(2 /* Update */, updateVariables.concat(updateStatements))] :
17216
+ [renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateVariables.concat(updateStatements))] :
17083
17217
  [];
17084
17218
  return fn(
17085
17219
  // i.e. (rf: RenderFlags, ctx: any)
@@ -17117,7 +17251,7 @@ class TemplateDefinitionBuilder {
17117
17251
  const scopedName = this._bindingScope.freshReferenceName();
17118
17252
  const retrievalLevel = this.level;
17119
17253
  const lhs = variable(variable$1.name + scopedName);
17120
- this._bindingScope.set(retrievalLevel, variable$1.name, lhs, 1 /* CONTEXT */, (scope, relativeLevel) => {
17254
+ this._bindingScope.set(retrievalLevel, variable$1.name, lhs, 1 /* DeclarationPriority.CONTEXT */, (scope, relativeLevel) => {
17121
17255
  let rhs;
17122
17256
  if (scope.bindingLevel === retrievalLevel) {
17123
17257
  if (scope.isListenerScope() && scope.hasRestoreViewVariable()) {
@@ -17370,7 +17504,7 @@ class TemplateDefinitionBuilder {
17370
17504
  element.inputs.forEach(input => {
17371
17505
  const stylingInputWasSet = stylingBuilder.registerBoundInput(input);
17372
17506
  if (!stylingInputWasSet) {
17373
- if (input.type === 0 /* Property */ && input.i18n) {
17507
+ if (input.type === 0 /* BindingType.Property */ && input.i18n) {
17374
17508
  boundI18nAttrs.push(input);
17375
17509
  }
17376
17510
  else {
@@ -17443,7 +17577,7 @@ class TemplateDefinitionBuilder {
17443
17577
  // Generate element input bindings
17444
17578
  allOtherInputs.forEach(input => {
17445
17579
  const inputType = input.type;
17446
- if (inputType === 4 /* Animation */) {
17580
+ if (inputType === 4 /* BindingType.Animation */) {
17447
17581
  const value = input.value.visit(this._valueConverter);
17448
17582
  // animation bindings can be presented in the following formats:
17449
17583
  // 1. [@binding]="fooExp"
@@ -17470,7 +17604,7 @@ class TemplateDefinitionBuilder {
17470
17604
  if (value !== undefined) {
17471
17605
  const params = [];
17472
17606
  const [attrNamespace, attrName] = splitNsName(input.name);
17473
- const isAttributeBinding = inputType === 1 /* Attribute */;
17607
+ const isAttributeBinding = inputType === 1 /* BindingType.Attribute */;
17474
17608
  const sanitizationRef = resolveSanitizationFn(input.securityContext, isAttributeBinding);
17475
17609
  if (sanitizationRef)
17476
17610
  params.push(sanitizationRef);
@@ -17486,7 +17620,7 @@ class TemplateDefinitionBuilder {
17486
17620
  }
17487
17621
  }
17488
17622
  this.allocateBindingSlots(value);
17489
- if (inputType === 0 /* Property */) {
17623
+ if (inputType === 0 /* BindingType.Property */) {
17490
17624
  if (value instanceof Interpolation) {
17491
17625
  // prop="{{value}}" and friends
17492
17626
  this.interpolatedUpdateInstruction(getPropertyInterpolationExpression(value), elementIndex, attrName, input, value, params);
@@ -17500,7 +17634,7 @@ class TemplateDefinitionBuilder {
17500
17634
  });
17501
17635
  }
17502
17636
  }
17503
- else if (inputType === 1 /* Attribute */) {
17637
+ else if (inputType === 1 /* BindingType.Attribute */) {
17504
17638
  if (value instanceof Interpolation && getInterpolationArgsLength(value) > 1) {
17505
17639
  // attr.name="text{{value}}" and friends
17506
17640
  this.interpolatedUpdateInstruction(getAttributeInterpolationExpression(value), elementIndex, attrName, input, value, params);
@@ -17665,7 +17799,7 @@ class TemplateDefinitionBuilder {
17665
17799
  // - all ICU vars (such as `VAR_SELECT` or `VAR_PLURAL`) are replaced with correct values
17666
17800
  const transformFn = (raw) => {
17667
17801
  const params = { ...vars, ...placeholders };
17668
- const formatted = i18nFormatPlaceholderNames(params, /* useCamelCase */ false);
17802
+ const formatted = formatI18nPlaceholderNamesInMap(params, /* useCamelCase */ false);
17669
17803
  return invokeInstruction(null, Identifiers.i18nPostprocess, [raw, mapLiteral(formatted, true)]);
17670
17804
  };
17671
17805
  // in case the whole i18n message is a single ICU - we do not need to
@@ -17896,13 +18030,13 @@ class TemplateDefinitionBuilder {
17896
18030
  const input = inputs[i];
17897
18031
  // We don't want the animation and attribute bindings in the
17898
18032
  // attributes array since they aren't used for directive matching.
17899
- if (input.type !== 4 /* Animation */ && input.type !== 1 /* Attribute */) {
18033
+ if (input.type !== 4 /* BindingType.Animation */ && input.type !== 1 /* BindingType.Attribute */) {
17900
18034
  addAttrExpr(input.name);
17901
18035
  }
17902
18036
  }
17903
18037
  for (let i = 0; i < outputs.length; i++) {
17904
18038
  const output = outputs[i];
17905
- if (output.type !== 1 /* Animation */) {
18039
+ if (output.type !== 1 /* ParsedEventType.Animation */) {
17906
18040
  addAttrExpr(output.name);
17907
18041
  }
17908
18042
  }
@@ -17911,15 +18045,15 @@ class TemplateDefinitionBuilder {
17911
18045
  // to the expressions. The marker is important because it tells the runtime
17912
18046
  // code that this is where attributes without values start...
17913
18047
  if (attrExprs.length !== attrsLengthBeforeInputs) {
17914
- attrExprs.splice(attrsLengthBeforeInputs, 0, literal(3 /* Bindings */));
18048
+ attrExprs.splice(attrsLengthBeforeInputs, 0, literal(3 /* core.AttributeMarker.Bindings */));
17915
18049
  }
17916
18050
  }
17917
18051
  if (templateAttrs.length) {
17918
- attrExprs.push(literal(4 /* Template */));
18052
+ attrExprs.push(literal(4 /* core.AttributeMarker.Template */));
17919
18053
  templateAttrs.forEach(attr => addAttrExpr(attr.name));
17920
18054
  }
17921
18055
  if (boundI18nAttrs.length) {
17922
- attrExprs.push(literal(6 /* I18n */));
18056
+ attrExprs.push(literal(6 /* core.AttributeMarker.I18n */));
17923
18057
  boundI18nAttrs.forEach(attr => addAttrExpr(attr.name));
17924
18058
  }
17925
18059
  return attrExprs;
@@ -17950,7 +18084,7 @@ class TemplateDefinitionBuilder {
17950
18084
  const variableName = this._bindingScope.freshReferenceName();
17951
18085
  const retrievalLevel = this.level;
17952
18086
  const lhs = variable(variableName);
17953
- this._bindingScope.set(retrievalLevel, reference.name, lhs, 0 /* DEFAULT */, (scope, relativeLevel) => {
18087
+ this._bindingScope.set(retrievalLevel, reference.name, lhs, 0 /* DeclarationPriority.DEFAULT */, (scope, relativeLevel) => {
17954
18088
  // e.g. nextContext(2);
17955
18089
  const nextContextStmt = relativeLevel > 0 ? [generateNextContextExpr(relativeLevel).toStmt()] : [];
17956
18090
  // e.g. const $foo$ = reference(1);
@@ -17964,7 +18098,7 @@ class TemplateDefinitionBuilder {
17964
18098
  prepareListenerParameter(tagName, outputAst, index) {
17965
18099
  return () => {
17966
18100
  const eventName = outputAst.name;
17967
- const bindingFnName = outputAst.type === 1 /* Animation */ ?
18101
+ const bindingFnName = outputAst.type === 1 /* ParsedEventType.Animation */ ?
17968
18102
  // synthetic @listener.foo values are treated the exact same as are standard listeners
17969
18103
  prepareSyntheticListenerFunctionName(eventName, outputAst.phase) :
17970
18104
  sanitizeIdentifier(eventName);
@@ -18084,7 +18218,7 @@ function getAttributeNameLiterals(name) {
18084
18218
  const nameLiteral = literal(attributeName);
18085
18219
  if (attributeNamespace) {
18086
18220
  return [
18087
- literal(0 /* NamespaceURI */), literal(attributeNamespace), nameLiteral
18221
+ literal(0 /* core.AttributeMarker.NamespaceURI */), literal(attributeNamespace), nameLiteral
18088
18222
  ];
18089
18223
  }
18090
18224
  return [nameLiteral];
@@ -18153,7 +18287,7 @@ class BindingScope {
18153
18287
  * @param declareLocalCallback The callback to invoke when declaring this local var
18154
18288
  * @param localRef Whether or not this is a local ref
18155
18289
  */
18156
- set(retrievalLevel, name, lhs, priority = 0 /* DEFAULT */, declareLocalCallback, localRef) {
18290
+ set(retrievalLevel, name, lhs, priority = 0 /* DeclarationPriority.DEFAULT */, declareLocalCallback, localRef) {
18157
18291
  if (this.map.has(name)) {
18158
18292
  if (localRef) {
18159
18293
  // Do not throw an error if it's a local ref and do not update existing value,
@@ -18209,7 +18343,7 @@ class BindingScope {
18209
18343
  return sharedCtxObj && sharedCtxObj.declare ? sharedCtxObj.lhs : null;
18210
18344
  }
18211
18345
  maybeGenerateSharedContextVar(value) {
18212
- if (value.priority === 1 /* CONTEXT */ &&
18346
+ if (value.priority === 1 /* DeclarationPriority.CONTEXT */ &&
18213
18347
  value.retrievalLevel < this.bindingLevel) {
18214
18348
  const sharedCtxObj = this.map.get(SHARED_CONTEXT_KEY + value.retrievalLevel);
18215
18349
  if (sharedCtxObj) {
@@ -18230,7 +18364,7 @@ class BindingScope {
18230
18364
  return [lhs.set(generateNextContextExpr(relativeLevel)).toConstDecl()];
18231
18365
  },
18232
18366
  declare: false,
18233
- priority: 2 /* SHARED_CONTEXT */,
18367
+ priority: 2 /* DeclarationPriority.SHARED_CONTEXT */,
18234
18368
  });
18235
18369
  }
18236
18370
  getComponentProperty(name) {
@@ -18253,16 +18387,15 @@ class BindingScope {
18253
18387
  }
18254
18388
  }
18255
18389
  restoreViewStatement() {
18256
- const statements = [];
18257
18390
  if (this.restoreViewVariable) {
18258
18391
  const restoreCall = invokeInstruction(null, Identifiers.restoreView, [this.restoreViewVariable]);
18259
18392
  // Either `const restoredCtx = restoreView($state$);` or `restoreView($state$);`
18260
18393
  // depending on whether it is being used.
18261
- statements.push(this.usesRestoredViewContext ?
18394
+ return this.usesRestoredViewContext ?
18262
18395
  variable(RESTORED_VIEW_CONTEXT_NAME).set(restoreCall).toConstDecl() :
18263
- restoreCall.toStmt());
18396
+ restoreCall.toStmt();
18264
18397
  }
18265
- return statements;
18398
+ return null;
18266
18399
  }
18267
18400
  viewSnapshotStatements() {
18268
18401
  // const $state$ = getCurrentView();
@@ -18328,7 +18461,7 @@ function getNgProjectAsLiteral(attribute) {
18328
18461
  // Parse the attribute value into a CssSelectorList. Note that we only take the
18329
18462
  // first selector, because we don't support multiple selectors in ngProjectAs.
18330
18463
  const parsedR3Selector = parseSelectorToR3Selector(attribute.value)[0];
18331
- return [literal(5 /* ProjectAs */), asLiteral(parsedR3Selector)];
18464
+ return [literal(5 /* core.AttributeMarker.ProjectAs */), asLiteral(parsedR3Selector)];
18332
18465
  }
18333
18466
  /**
18334
18467
  * Gets the instruction to generate for an interpolated property
@@ -18587,7 +18720,7 @@ const NG_I18N_CLOSURE_MODE = 'ngI18nClosureMode';
18587
18720
  function getTranslationDeclStmts(message, variable, closureVar, params = {}, transformFn) {
18588
18721
  const statements = [
18589
18722
  declareI18nVariable(variable),
18590
- ifStmt(createClosureModeGuard(), createGoogleGetMsgStatements(variable, message, closureVar, i18nFormatPlaceholderNames(params, /* useCamelCase */ true)), createLocalizeStatements(variable, message, i18nFormatPlaceholderNames(params, /* useCamelCase */ false))),
18723
+ ifStmt(createClosureModeGuard(), createGoogleGetMsgStatements(variable, message, closureVar, params), createLocalizeStatements(variable, message, formatI18nPlaceholderNamesInMap(params, /* useCamelCase */ false))),
18591
18724
  ];
18592
18725
  if (transformFn) {
18593
18726
  statements.push(new ExpressionStatement(variable.set(transformFn(variable))));
@@ -18652,6 +18785,9 @@ function baseDirectiveFields(meta, constantPool, bindingParser) {
18652
18785
  if (meta.exportAs !== null) {
18653
18786
  definitionMap.set('exportAs', literalArr(meta.exportAs.map(e => literal(e))));
18654
18787
  }
18788
+ if (meta.isStandalone) {
18789
+ definitionMap.set('standalone', literal(true));
18790
+ }
18655
18791
  return definitionMap;
18656
18792
  }
18657
18793
  /**
@@ -18678,6 +18814,10 @@ function addFeatures(definitionMap, meta) {
18678
18814
  if (meta.lifecycle.usesOnChanges) {
18679
18815
  features.push(importExpr(Identifiers.NgOnChangesFeature));
18680
18816
  }
18817
+ // TODO: better way of differentiating component vs directive metadata.
18818
+ if (meta.hasOwnProperty('template') && meta.isStandalone) {
18819
+ features.push(importExpr(Identifiers.StandaloneFeature));
18820
+ }
18681
18821
  if (features.length) {
18682
18822
  definitionMap.set('features', literalArr(features));
18683
18823
  }
@@ -18741,17 +18881,8 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
18741
18881
  definitionMap.set('consts', constsExpr);
18742
18882
  }
18743
18883
  definitionMap.set('template', templateFunctionExpression);
18744
- // e.g. `directives: [MyDirective]`
18745
- if (meta.directives.length > 0) {
18746
- const directivesList = literalArr(meta.directives.map(dir => dir.type));
18747
- const directivesExpr = compileDeclarationList(directivesList, meta.declarationListEmitMode);
18748
- definitionMap.set('directives', directivesExpr);
18749
- }
18750
- // e.g. `pipes: [MyPipe]`
18751
- if (meta.pipes.size > 0) {
18752
- const pipesList = literalArr(Array.from(meta.pipes.values()));
18753
- const pipesExpr = compileDeclarationList(pipesList, meta.declarationListEmitMode);
18754
- definitionMap.set('pipes', pipesExpr);
18884
+ if (meta.declarations.length > 0) {
18885
+ definitionMap.set('dependencies', compileDeclarationList(literalArr(meta.declarations.map(decl => decl.type)), meta.declarationListEmitMode));
18755
18886
  }
18756
18887
  if (meta.encapsulation === null) {
18757
18888
  meta.encapsulation = ViewEncapsulation.Emulated;
@@ -18761,8 +18892,15 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
18761
18892
  const styleValues = meta.encapsulation == ViewEncapsulation.Emulated ?
18762
18893
  compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR) :
18763
18894
  meta.styles;
18764
- const strings = styleValues.map(str => constantPool.getConstLiteral(literal(str)));
18765
- definitionMap.set('styles', literalArr(strings));
18895
+ const styleNodes = styleValues.reduce((result, style) => {
18896
+ if (style.trim().length > 0) {
18897
+ result.push(constantPool.getConstLiteral(literal(style)));
18898
+ }
18899
+ return result;
18900
+ }, []);
18901
+ if (styleNodes.length > 0) {
18902
+ definitionMap.set('styles', literalArr(styleNodes));
18903
+ }
18766
18904
  }
18767
18905
  else if (meta.encapsulation === ViewEncapsulation.Emulated) {
18768
18906
  // If there is no style, don't generate css selectors on elements
@@ -18789,8 +18927,9 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
18789
18927
  * to be consumed by upstream compilations.
18790
18928
  */
18791
18929
  function createComponentType(meta) {
18792
- const typeParams = createDirectiveTypeParams(meta);
18930
+ const typeParams = createBaseDirectiveTypeParams(meta);
18793
18931
  typeParams.push(stringArrayAsType(meta.template.ngContentSelectors));
18932
+ typeParams.push(expressionType(literal(meta.isStandalone)));
18794
18933
  return expressionType(importExpr(Identifiers.ComponentDeclaration, typeParams));
18795
18934
  }
18796
18935
  /**
@@ -18799,13 +18938,13 @@ function createComponentType(meta) {
18799
18938
  */
18800
18939
  function compileDeclarationList(list, mode) {
18801
18940
  switch (mode) {
18802
- case 0 /* Direct */:
18941
+ case 0 /* DeclarationListEmitMode.Direct */:
18803
18942
  // directives: [MyDir],
18804
18943
  return list;
18805
- case 1 /* Closure */:
18944
+ case 1 /* DeclarationListEmitMode.Closure */:
18806
18945
  // directives: function () { return [MyDir]; }
18807
18946
  return fn([], [new ReturnStatement(list)]);
18808
- case 2 /* ClosureResolved */:
18947
+ case 2 /* DeclarationListEmitMode.ClosureResolved */:
18809
18948
  // directives: function () { return [MyDir].map(ng.resolveForwardRef); }
18810
18949
  const resolvedList = list.prop('map').callFn([importExpr(Identifiers.resolveForwardRef)]);
18811
18950
  return fn([], [new ReturnStatement(resolvedList)]);
@@ -18823,9 +18962,9 @@ function prepareQueryParams(query, constantPool) {
18823
18962
  * @param query
18824
18963
  */
18825
18964
  function toQueryFlags(query) {
18826
- return (query.descendants ? 1 /* descendants */ : 0 /* none */) |
18827
- (query.static ? 2 /* isStatic */ : 0 /* none */) |
18828
- (query.emitDistinctChangesOnly ? 4 /* emitDistinctChangesOnly */ : 0 /* none */);
18965
+ return (query.descendants ? 1 /* QueryFlags.descendants */ : 0 /* QueryFlags.none */) |
18966
+ (query.static ? 2 /* QueryFlags.isStatic */ : 0 /* QueryFlags.none */) |
18967
+ (query.emitDistinctChangesOnly ? 4 /* QueryFlags.emitDistinctChangesOnly */ : 0 /* QueryFlags.none */);
18829
18968
  }
18830
18969
  function convertAttributesToExpressions(attributes) {
18831
18970
  const values = [];
@@ -18859,8 +18998,8 @@ function createContentQueriesFunction(queries, constantPool, name) {
18859
18998
  new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null),
18860
18999
  new FnParam('dirIndex', null)
18861
19000
  ], [
18862
- renderFlagCheckIfStmt(1 /* Create */, createStatements),
18863
- renderFlagCheckIfStmt(2 /* Update */, updateStatements)
19001
+ renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, createStatements),
19002
+ renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateStatements)
18864
19003
  ], INFERRED_TYPE, null, contentQueriesFnName);
18865
19004
  }
18866
19005
  function stringAsType(str) {
@@ -18881,7 +19020,7 @@ function stringArrayAsType(arr) {
18881
19020
  return arr.length > 0 ? expressionType(literalArr(arr.map(value => literal(value)))) :
18882
19021
  NONE_TYPE;
18883
19022
  }
18884
- function createDirectiveTypeParams(meta) {
19023
+ function createBaseDirectiveTypeParams(meta) {
18885
19024
  // On the type side, remove newlines from the selector as it will need to fit into a TypeScript
18886
19025
  // string literal, which must be on one line.
18887
19026
  const selectorForType = meta.selector !== null ? meta.selector.replace(/\n/g, '') : null;
@@ -18899,7 +19038,11 @@ function createDirectiveTypeParams(meta) {
18899
19038
  * to be consumed by upstream compilations.
18900
19039
  */
18901
19040
  function createDirectiveType(meta) {
18902
- const typeParams = createDirectiveTypeParams(meta);
19041
+ const typeParams = createBaseDirectiveTypeParams(meta);
19042
+ // Directives have no NgContentSelectors slot, but instead express a `never` type
19043
+ // so that future fields align.
19044
+ typeParams.push(NONE_TYPE);
19045
+ typeParams.push(expressionType(literal(meta.isStandalone)));
18903
19046
  return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams));
18904
19047
  }
18905
19048
  // Define and update any view queries
@@ -18922,8 +19065,8 @@ function createViewQueriesFunction(viewQueries, constantPool, name) {
18922
19065
  });
18923
19066
  const viewQueryFnName = name ? `${name}_Query` : null;
18924
19067
  return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [
18925
- renderFlagCheckIfStmt(1 /* Create */, createStatements),
18926
- renderFlagCheckIfStmt(2 /* Update */, updateStatements)
19068
+ renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, createStatements),
19069
+ renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateStatements)
18927
19070
  ], INFERRED_TYPE, null, viewQueryFnName);
18928
19071
  }
18929
19072
  // Return a host binding function or null if one is not necessary.
@@ -19063,10 +19206,10 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
19063
19206
  const hostBindingsFnName = name ? `${name}_HostBindings` : null;
19064
19207
  const statements = [];
19065
19208
  if (createInstructions.length > 0) {
19066
- statements.push(renderFlagCheckIfStmt(1 /* Create */, getInstructionStatements(createInstructions)));
19209
+ statements.push(renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, getInstructionStatements(createInstructions)));
19067
19210
  }
19068
19211
  if (updateInstructions.length > 0) {
19069
- statements.push(renderFlagCheckIfStmt(2 /* Update */, updateVariables.concat(getInstructionStatements(updateInstructions))));
19212
+ statements.push(renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateVariables.concat(getInstructionStatements(updateInstructions))));
19070
19213
  }
19071
19214
  return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], statements, INFERRED_TYPE, null, hostBindingsFnName);
19072
19215
  }
@@ -19107,12 +19250,12 @@ function createHostListeners(eventBindings, name) {
19107
19250
  const instructions = [];
19108
19251
  for (const binding of eventBindings) {
19109
19252
  let bindingName = binding.name && sanitizeIdentifier(binding.name);
19110
- const bindingFnName = binding.type === 1 /* Animation */ ?
19253
+ const bindingFnName = binding.type === 1 /* ParsedEventType.Animation */ ?
19111
19254
  prepareSyntheticListenerFunctionName(bindingName, binding.targetOrPhase) :
19112
19255
  bindingName;
19113
19256
  const handlerName = name && bindingName ? `${name}_${bindingFnName}_HostBindingHandler` : null;
19114
19257
  const params = prepareEventListenerParameters(BoundEvent.fromParsedEvent(binding), handlerName);
19115
- if (binding.type == 1 /* Animation */) {
19258
+ if (binding.type == 1 /* ParsedEventType.Animation */) {
19116
19259
  syntheticListenerParams.push(params);
19117
19260
  }
19118
19261
  else {
@@ -19161,7 +19304,7 @@ function parseHostBindings(host) {
19161
19304
  }
19162
19305
  }
19163
19306
  }
19164
- else if (matches[1 /* Binding */] != null) {
19307
+ else if (matches[1 /* HostBindingGroup.Binding */] != null) {
19165
19308
  if (typeof value !== 'string') {
19166
19309
  // TODO(alxhub): make this a diagnostic.
19167
19310
  throw new Error(`Property binding must be string`);
@@ -19169,14 +19312,14 @@ function parseHostBindings(host) {
19169
19312
  // synthetic properties (the ones that have a `@` as a prefix)
19170
19313
  // are still treated the same as regular properties. Therefore
19171
19314
  // there is no point in storing them in a separate map.
19172
- properties[matches[1 /* Binding */]] = value;
19315
+ properties[matches[1 /* HostBindingGroup.Binding */]] = value;
19173
19316
  }
19174
- else if (matches[2 /* Event */] != null) {
19317
+ else if (matches[2 /* HostBindingGroup.Event */] != null) {
19175
19318
  if (typeof value !== 'string') {
19176
19319
  // TODO(alxhub): make this a diagnostic.
19177
19320
  throw new Error(`Event binding must be string`);
19178
19321
  }
19179
- listeners[matches[2 /* Event */]] = value;
19322
+ listeners[matches[2 /* HostBindingGroup.Event */]] = value;
19180
19323
  }
19181
19324
  }
19182
19325
  return { attributes, listeners, properties, specialAttributes };
@@ -19261,10 +19404,10 @@ class CompilerFacadeImpl {
19261
19404
  internalType: new WrappedNodeExpr(facade.type),
19262
19405
  typeArgumentCount: facade.typeArgumentCount,
19263
19406
  providedIn: computeProvidedIn(facade.providedIn),
19264
- useClass: convertToProviderExpression(facade, USE_CLASS),
19265
- useFactory: wrapExpression(facade, USE_FACTORY),
19266
- useValue: convertToProviderExpression(facade, USE_VALUE),
19267
- useExisting: convertToProviderExpression(facade, USE_EXISTING),
19407
+ useClass: convertToProviderExpression(facade, 'useClass'),
19408
+ useFactory: wrapExpression(facade, 'useFactory'),
19409
+ useValue: convertToProviderExpression(facade, 'useValue'),
19410
+ useExisting: convertToProviderExpression(facade, 'useExisting'),
19268
19411
  deps: facade.deps?.map(convertR3DependencyMetadata),
19269
19412
  },
19270
19413
  /* resolveForwardRefs */ true);
@@ -19277,10 +19420,10 @@ class CompilerFacadeImpl {
19277
19420
  internalType: new WrappedNodeExpr(facade.type),
19278
19421
  typeArgumentCount: 0,
19279
19422
  providedIn: computeProvidedIn(facade.providedIn),
19280
- useClass: convertToProviderExpression(facade, USE_CLASS),
19281
- useFactory: wrapExpression(facade, USE_FACTORY),
19282
- useValue: convertToProviderExpression(facade, USE_VALUE),
19283
- useExisting: convertToProviderExpression(facade, USE_EXISTING),
19423
+ useClass: convertToProviderExpression(facade, 'useClass'),
19424
+ useFactory: wrapExpression(facade, 'useFactory'),
19425
+ useValue: convertToProviderExpression(facade, 'useValue'),
19426
+ useExisting: convertToProviderExpression(facade, 'useExisting'),
19284
19427
  deps: facade.deps?.map(convertR3DeclareDependencyMetadata),
19285
19428
  },
19286
19429
  /* resolveForwardRefs */ true);
@@ -19311,7 +19454,7 @@ class CompilerFacadeImpl {
19311
19454
  declarations: facade.declarations.map(wrapReference),
19312
19455
  imports: facade.imports.map(wrapReference),
19313
19456
  exports: facade.exports.map(wrapReference),
19314
- emitInline: true,
19457
+ selectorScopeMode: R3SelectorScopeMode.Inline,
19315
19458
  containsForwardDecls: false,
19316
19459
  schemas: facade.schemas ? facade.schemas.map(wrapReference) : null,
19317
19460
  id: facade.id ? new WrappedNodeExpr(facade.id) : null,
@@ -19347,7 +19490,8 @@ class CompilerFacadeImpl {
19347
19490
  ...convertDirectiveFacadeToMetadata(facade),
19348
19491
  selector: facade.selector || this.elementSchemaRegistry.getDefaultComponentElementName(),
19349
19492
  template,
19350
- declarationListEmitMode: 0 /* Direct */,
19493
+ declarations: facade.declarations.map(convertDeclarationFacadeToMetadata),
19494
+ declarationListEmitMode: 0 /* DeclarationListEmitMode.Direct */,
19351
19495
  styles: [...facade.styles, ...template.styles],
19352
19496
  encapsulation: facade.encapsulation,
19353
19497
  interpolation,
@@ -19419,10 +19563,6 @@ class CompilerFacadeImpl {
19419
19563
  return res['$def'];
19420
19564
  }
19421
19565
  }
19422
- const USE_CLASS = Object.keys({ useClass: null })[0];
19423
- const USE_FACTORY = Object.keys({ useFactory: null })[0];
19424
- const USE_VALUE = Object.keys({ useValue: null })[0];
19425
- const USE_EXISTING = Object.keys({ useExisting: null })[0];
19426
19566
  function convertToR3QueryMetadata(facade) {
19427
19567
  return {
19428
19568
  ...facade,
@@ -19448,7 +19588,7 @@ function convertQueryPredicate(predicate) {
19448
19588
  // The predicate is an array of strings so pass it through.
19449
19589
  predicate :
19450
19590
  // The predicate is a type - assume that we will need to unwrap any `forwardRef()` calls.
19451
- createMayBeForwardRefExpression(new WrappedNodeExpr(predicate), 1 /* Wrapped */);
19591
+ createMayBeForwardRefExpression(new WrappedNodeExpr(predicate), 1 /* ForwardRefHandling.Wrapped */);
19452
19592
  }
19453
19593
  function convertDirectiveFacadeToMetadata(facade) {
19454
19594
  const inputsFromMetadata = parseInputOutputs(facade.inputs || []);
@@ -19526,31 +19666,57 @@ function convertOpaqueValuesToExpressions(obj) {
19526
19666
  }
19527
19667
  return result;
19528
19668
  }
19529
- function convertDeclareComponentFacadeToMetadata(declaration, typeSourceSpan, sourceMapUrl) {
19530
- const { template, interpolation } = parseJitTemplate(declaration.template, declaration.type.name, sourceMapUrl, declaration.preserveWhitespaces ?? false, declaration.interpolation);
19669
+ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMapUrl) {
19670
+ const { template, interpolation } = parseJitTemplate(decl.template, decl.type.name, sourceMapUrl, decl.preserveWhitespaces ?? false, decl.interpolation);
19671
+ const declarations = [];
19672
+ if (decl.dependencies) {
19673
+ for (const innerDep of decl.dependencies) {
19674
+ switch (innerDep.kind) {
19675
+ case 'directive':
19676
+ case 'component':
19677
+ declarations.push(convertDirectiveDeclarationToMetadata(innerDep));
19678
+ break;
19679
+ case 'pipe':
19680
+ declarations.push(convertPipeDeclarationToMetadata(innerDep));
19681
+ break;
19682
+ }
19683
+ }
19684
+ }
19685
+ else if (decl.components || decl.directives || decl.pipes) {
19686
+ // Existing declarations on NPM may not be using the new `dependencies` merged field, and may
19687
+ // have separate fields for dependencies instead. Unify them for JIT compilation.
19688
+ decl.components &&
19689
+ declarations.push(...decl.components.map(dir => convertDirectiveDeclarationToMetadata(dir, /* isComponent */ true)));
19690
+ decl.directives &&
19691
+ declarations.push(...decl.directives.map(dir => convertDirectiveDeclarationToMetadata(dir)));
19692
+ decl.pipes && declarations.push(...convertPipeMapToMetadata(decl.pipes));
19693
+ }
19531
19694
  return {
19532
- ...convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan),
19695
+ ...convertDeclareDirectiveFacadeToMetadata(decl, typeSourceSpan),
19533
19696
  template,
19534
- styles: declaration.styles ?? [],
19535
- directives: (declaration.components ?? [])
19536
- .concat(declaration.directives ?? [])
19537
- .map(convertUsedDirectiveDeclarationToMetadata),
19538
- pipes: convertUsedPipesToMetadata(declaration.pipes),
19539
- viewProviders: declaration.viewProviders !== undefined ?
19540
- new WrappedNodeExpr(declaration.viewProviders) :
19697
+ styles: decl.styles ?? [],
19698
+ declarations,
19699
+ viewProviders: decl.viewProviders !== undefined ? new WrappedNodeExpr(decl.viewProviders) :
19541
19700
  null,
19542
- animations: declaration.animations !== undefined ? new WrappedNodeExpr(declaration.animations) :
19543
- null,
19544
- changeDetection: declaration.changeDetection ?? ChangeDetectionStrategy.Default,
19545
- encapsulation: declaration.encapsulation ?? ViewEncapsulation.Emulated,
19701
+ animations: decl.animations !== undefined ? new WrappedNodeExpr(decl.animations) : null,
19702
+ changeDetection: decl.changeDetection ?? ChangeDetectionStrategy.Default,
19703
+ encapsulation: decl.encapsulation ?? ViewEncapsulation.Emulated,
19546
19704
  interpolation,
19547
- declarationListEmitMode: 2 /* ClosureResolved */,
19705
+ declarationListEmitMode: 2 /* DeclarationListEmitMode.ClosureResolved */,
19548
19706
  relativeContextFilePath: '',
19549
19707
  i18nUseExternalIds: true,
19550
19708
  };
19551
19709
  }
19552
- function convertUsedDirectiveDeclarationToMetadata(declaration) {
19710
+ function convertDeclarationFacadeToMetadata(declaration) {
19711
+ return {
19712
+ ...declaration,
19713
+ type: new WrappedNodeExpr(declaration.type),
19714
+ };
19715
+ }
19716
+ function convertDirectiveDeclarationToMetadata(declaration, isComponent = null) {
19553
19717
  return {
19718
+ kind: R3TemplateDependencyKind.Directive,
19719
+ isComponent: isComponent || declaration.kind === 'component',
19554
19720
  selector: declaration.selector,
19555
19721
  type: new WrappedNodeExpr(declaration.type),
19556
19722
  inputs: declaration.inputs ?? [],
@@ -19558,16 +19724,24 @@ function convertUsedDirectiveDeclarationToMetadata(declaration) {
19558
19724
  exportAs: declaration.exportAs ?? null,
19559
19725
  };
19560
19726
  }
19561
- function convertUsedPipesToMetadata(declaredPipes) {
19562
- const pipes = new Map();
19563
- if (declaredPipes === undefined) {
19564
- return pipes;
19565
- }
19566
- for (const pipeName of Object.keys(declaredPipes)) {
19567
- const pipeType = declaredPipes[pipeName];
19568
- pipes.set(pipeName, new WrappedNodeExpr(pipeType));
19727
+ function convertPipeMapToMetadata(pipes) {
19728
+ if (!pipes) {
19729
+ return [];
19569
19730
  }
19570
- return pipes;
19731
+ return Object.keys(pipes).map(name => {
19732
+ return {
19733
+ kind: R3TemplateDependencyKind.Pipe,
19734
+ name,
19735
+ type: new WrappedNodeExpr(pipes[name]),
19736
+ };
19737
+ });
19738
+ }
19739
+ function convertPipeDeclarationToMetadata(pipe) {
19740
+ return {
19741
+ kind: R3TemplateDependencyKind.Pipe,
19742
+ name: pipe.name,
19743
+ type: new WrappedNodeExpr(pipe.type),
19744
+ };
19571
19745
  }
19572
19746
  function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces, interpolation) {
19573
19747
  const interpolationConfig = interpolation ? InterpolationConfig.fromArray(interpolation) : DEFAULT_INTERPOLATION_CONFIG;
@@ -19589,7 +19763,7 @@ function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces,
19589
19763
  */
19590
19764
  function convertToProviderExpression(obj, property) {
19591
19765
  if (obj.hasOwnProperty(property)) {
19592
- return createMayBeForwardRefExpression(new WrappedNodeExpr(obj[property]), 0 /* None */);
19766
+ return createMayBeForwardRefExpression(new WrappedNodeExpr(obj[property]), 0 /* ForwardRefHandling.None */);
19593
19767
  }
19594
19768
  else {
19595
19769
  return undefined;
@@ -19607,7 +19781,7 @@ function computeProvidedIn(providedIn) {
19607
19781
  const expression = typeof providedIn === 'function' ? new WrappedNodeExpr(providedIn) :
19608
19782
  new LiteralExpr(providedIn ?? null);
19609
19783
  // See `convertToProviderExpression()` for why this uses `ForwardRefHandling.None`.
19610
- return createMayBeForwardRefExpression(expression, 0 /* None */);
19784
+ return createMayBeForwardRefExpression(expression, 0 /* ForwardRefHandling.None */);
19611
19785
  }
19612
19786
  function convertR3DependencyMetadataArray(facades) {
19613
19787
  return facades == null ? null : facades.map(convertR3DependencyMetadata);
@@ -19714,7 +19888,7 @@ function publishFacade(global) {
19714
19888
  * Use of this source code is governed by an MIT-style license that can be
19715
19889
  * found in the LICENSE file at https://angular.io/license
19716
19890
  */
19717
- const VERSION = new Version('14.0.0-next.7');
19891
+ const VERSION = new Version('14.0.0-rc.0');
19718
19892
 
19719
19893
  /**
19720
19894
  * @license
@@ -21211,14 +21385,6 @@ var FactoryTarget;
21211
21385
  * found in the LICENSE file at https://angular.io/license
21212
21386
  */
21213
21387
 
21214
- /**
21215
- * @license
21216
- * Copyright Google LLC All Rights Reserved.
21217
- *
21218
- * Use of this source code is governed by an MIT-style license that can be
21219
- * found in the LICENSE file at https://angular.io/license
21220
- */
21221
-
21222
21388
  /**
21223
21389
  * @license
21224
21390
  * Copyright Google LLC All Rights Reserved.
@@ -21755,7 +21921,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21755
21921
  function compileDeclareClassMetadata(metadata) {
21756
21922
  const definitionMap = new DefinitionMap();
21757
21923
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21758
- definitionMap.set('version', literal('14.0.0-next.7'));
21924
+ definitionMap.set('version', literal('14.0.0-rc.0'));
21759
21925
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21760
21926
  definitionMap.set('type', metadata.type);
21761
21927
  definitionMap.set('decorators', metadata.decorators);
@@ -21855,7 +22021,7 @@ function compileDependency(dep) {
21855
22021
  *
21856
22022
  * Do not include any prerelease in these versions as they are ignored.
21857
22023
  */
21858
- const MINIMUM_PARTIAL_LINKER_VERSION$5 = '12.0.0';
22024
+ const MINIMUM_PARTIAL_LINKER_VERSION$5 = '14.0.0';
21859
22025
  /**
21860
22026
  * Compile a directive declaration defined by the `R3DirectiveMetadata`.
21861
22027
  */
@@ -21872,9 +22038,12 @@ function compileDeclareDirectiveFromMetadata(meta) {
21872
22038
  function createDirectiveDefinitionMap(meta) {
21873
22039
  const definitionMap = new DefinitionMap();
21874
22040
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
21875
- definitionMap.set('version', literal('14.0.0-next.7'));
22041
+ definitionMap.set('version', literal('14.0.0-rc.0'));
21876
22042
  // e.g. `type: MyDirective`
21877
22043
  definitionMap.set('type', meta.internalType);
22044
+ if (meta.isStandalone) {
22045
+ definitionMap.set('isStandalone', literal(meta.isStandalone));
22046
+ }
21878
22047
  // e.g. `selector: 'some-dir'`
21879
22048
  if (meta.selector !== null) {
21880
22049
  definitionMap.set('selector', literal(meta.selector));
@@ -21979,9 +22148,7 @@ function createComponentDefinitionMap(meta, template, templateInfo) {
21979
22148
  definitionMap.set('isInline', literal(true));
21980
22149
  }
21981
22150
  definitionMap.set('styles', toOptionalLiteralArray(meta.styles, literal));
21982
- definitionMap.set('components', compileUsedDirectiveMetadata(meta, directive => directive.isComponent === true));
21983
- definitionMap.set('directives', compileUsedDirectiveMetadata(meta, directive => directive.isComponent !== true));
21984
- definitionMap.set('pipes', compileUsedPipeMetadata(meta));
22151
+ definitionMap.set('dependencies', compileUsedDependenciesMetadata(meta));
21985
22152
  definitionMap.set('viewProviders', meta.viewProviders);
21986
22153
  definitionMap.set('animations', meta.animations);
21987
22154
  if (meta.changeDetection !== undefined) {
@@ -22037,43 +22204,35 @@ function computeEndLocation(file, contents) {
22037
22204
  } while (lineStart !== -1);
22038
22205
  return new ParseLocation(file, length, line, length - lastLineStart);
22039
22206
  }
22040
- /**
22041
- * Compiles the directives as registered in the component metadata into an array literal of the
22042
- * individual directives. If the component does not use any directives, then null is returned.
22043
- */
22044
- function compileUsedDirectiveMetadata(meta, predicate) {
22045
- const wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?
22207
+ function compileUsedDependenciesMetadata(meta) {
22208
+ const wrapType = meta.declarationListEmitMode !== 0 /* DeclarationListEmitMode.Direct */ ?
22046
22209
  generateForwardRef :
22047
22210
  (expr) => expr;
22048
- const directives = meta.directives.filter(predicate);
22049
- return toOptionalLiteralArray(directives, directive => {
22050
- const dirMeta = new DefinitionMap();
22051
- dirMeta.set('type', wrapType(directive.type));
22052
- dirMeta.set('selector', literal(directive.selector));
22053
- dirMeta.set('inputs', toOptionalLiteralArray(directive.inputs, literal));
22054
- dirMeta.set('outputs', toOptionalLiteralArray(directive.outputs, literal));
22055
- dirMeta.set('exportAs', toOptionalLiteralArray(directive.exportAs, literal));
22056
- return dirMeta.toLiteralMap();
22211
+ return toOptionalLiteralArray(meta.declarations, decl => {
22212
+ switch (decl.kind) {
22213
+ case R3TemplateDependencyKind.Directive:
22214
+ const dirMeta = new DefinitionMap();
22215
+ dirMeta.set('kind', literal(decl.isComponent ? 'component' : 'directive'));
22216
+ dirMeta.set('type', wrapType(decl.type));
22217
+ dirMeta.set('selector', literal(decl.selector));
22218
+ dirMeta.set('inputs', toOptionalLiteralArray(decl.inputs, literal));
22219
+ dirMeta.set('outputs', toOptionalLiteralArray(decl.outputs, literal));
22220
+ dirMeta.set('exportAs', toOptionalLiteralArray(decl.exportAs, literal));
22221
+ return dirMeta.toLiteralMap();
22222
+ case R3TemplateDependencyKind.Pipe:
22223
+ const pipeMeta = new DefinitionMap();
22224
+ pipeMeta.set('kind', literal('pipe'));
22225
+ pipeMeta.set('type', wrapType(decl.type));
22226
+ pipeMeta.set('name', literal(decl.name));
22227
+ return pipeMeta.toLiteralMap();
22228
+ case R3TemplateDependencyKind.NgModule:
22229
+ const ngModuleMeta = new DefinitionMap();
22230
+ ngModuleMeta.set('kind', literal('ngmodule'));
22231
+ ngModuleMeta.set('type', wrapType(decl.type));
22232
+ return ngModuleMeta.toLiteralMap();
22233
+ }
22057
22234
  });
22058
22235
  }
22059
- /**
22060
- * Compiles the pipes as registered in the component metadata into an object literal, where the
22061
- * pipe's name is used as key and a reference to its type as value. If the component does not use
22062
- * any pipes, then null is returned.
22063
- */
22064
- function compileUsedPipeMetadata(meta) {
22065
- if (meta.pipes.size === 0) {
22066
- return null;
22067
- }
22068
- const wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?
22069
- generateForwardRef :
22070
- (expr) => expr;
22071
- const entries = [];
22072
- for (const [name, pipe] of meta.pipes) {
22073
- entries.push({ key: name, value: wrapType(pipe), quoted: true });
22074
- }
22075
- return literalMap(entries);
22076
- }
22077
22236
 
22078
22237
  /**
22079
22238
  * @license
@@ -22093,7 +22252,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22093
22252
  function compileDeclareFactoryFunction(meta) {
22094
22253
  const definitionMap = new DefinitionMap();
22095
22254
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22096
- definitionMap.set('version', literal('14.0.0-next.7'));
22255
+ definitionMap.set('version', literal('14.0.0-rc.0'));
22097
22256
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22098
22257
  definitionMap.set('type', meta.internalType);
22099
22258
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22135,7 +22294,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22135
22294
  function createInjectableDefinitionMap(meta) {
22136
22295
  const definitionMap = new DefinitionMap();
22137
22296
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22138
- definitionMap.set('version', literal('14.0.0-next.7'));
22297
+ definitionMap.set('version', literal('14.0.0-rc.0'));
22139
22298
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22140
22299
  definitionMap.set('type', meta.internalType);
22141
22300
  // Only generate providedIn property if it has a non-null value
@@ -22193,7 +22352,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22193
22352
  function createInjectorDefinitionMap(meta) {
22194
22353
  const definitionMap = new DefinitionMap();
22195
22354
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22196
- definitionMap.set('version', literal('14.0.0-next.7'));
22355
+ definitionMap.set('version', literal('14.0.0-rc.0'));
22197
22356
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22198
22357
  definitionMap.set('type', meta.internalType);
22199
22358
  definitionMap.set('providers', meta.providers);
@@ -22217,7 +22376,7 @@ function createInjectorDefinitionMap(meta) {
22217
22376
  *
22218
22377
  * Do not include any prerelease in these versions as they are ignored.
22219
22378
  */
22220
- const MINIMUM_PARTIAL_LINKER_VERSION$1 = '12.0.0';
22379
+ const MINIMUM_PARTIAL_LINKER_VERSION$1 = '14.0.0';
22221
22380
  function compileDeclareNgModuleFromMetadata(meta) {
22222
22381
  const definitionMap = createNgModuleDefinitionMap(meta);
22223
22382
  const expression = importExpr(Identifiers.declareNgModule).callFn([definitionMap.toLiteralMap()]);
@@ -22230,7 +22389,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22230
22389
  function createNgModuleDefinitionMap(meta) {
22231
22390
  const definitionMap = new DefinitionMap();
22232
22391
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22233
- definitionMap.set('version', literal('14.0.0-next.7'));
22392
+ definitionMap.set('version', literal('14.0.0-rc.0'));
22234
22393
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22235
22394
  definitionMap.set('type', meta.internalType);
22236
22395
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22272,7 +22431,7 @@ function createNgModuleDefinitionMap(meta) {
22272
22431
  *
22273
22432
  * Do not include any prerelease in these versions as they are ignored.
22274
22433
  */
22275
- const MINIMUM_PARTIAL_LINKER_VERSION = '12.0.0';
22434
+ const MINIMUM_PARTIAL_LINKER_VERSION = '14.0.0';
22276
22435
  /**
22277
22436
  * Compile a Pipe declaration defined by the `R3PipeMetadata`.
22278
22437
  */
@@ -22288,10 +22447,13 @@ function compileDeclarePipeFromMetadata(meta) {
22288
22447
  function createPipeDefinitionMap(meta) {
22289
22448
  const definitionMap = new DefinitionMap();
22290
22449
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22291
- definitionMap.set('version', literal('14.0.0-next.7'));
22450
+ definitionMap.set('version', literal('14.0.0-rc.0'));
22292
22451
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22293
22452
  // e.g. `type: MyPipe`
22294
22453
  definitionMap.set('type', meta.internalType);
22454
+ if (meta.isStandalone) {
22455
+ definitionMap.set('isStandalone', literal(meta.isStandalone));
22456
+ }
22295
22457
  // e.g. `name: "myPipe"`
22296
22458
  definitionMap.set('name', literal(meta.pipeName));
22297
22459
  if (meta.pure === false) {
@@ -22338,5 +22500,5 @@ publishFacade(_global);
22338
22500
  * found in the LICENSE file at https://angular.io/license
22339
22501
  */
22340
22502
 
22341
- export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser$1 as Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, Identifiers as R3Identifiers, R3TargetBinder, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, TagContentType, TaggedTemplateExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, Text, ThisReceiver, BoundAttribute as TmplAstBoundAttribute, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, Element$1 as TmplAstElement, Icu$1 as TmplAstIcu, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, Variable as TmplAstVariable, Token, TokenType, TreeError, Type, TypeModifier, TypeofExpr, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, _ParseAST, compileClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDirectiveFromMetadata, compileFactoryFunction, compileInjectable, compileInjector, compileNgModule, compilePipeFromMetadata, computeMsgId, core, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isIdentifier, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, verifyHostBindings, visitAll };
22503
+ export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser$1 as Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, Identifiers as R3Identifiers, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, TagContentType, TaggedTemplateExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, Text, ThisReceiver, BoundAttribute as TmplAstBoundAttribute, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, Element$1 as TmplAstElement, Icu$1 as TmplAstIcu, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, Variable as TmplAstVariable, Token, TokenType, TreeError, Type, TypeModifier, TypeofExpr, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, _ParseAST, compileClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDirectiveFromMetadata, compileFactoryFunction, compileInjectable, compileInjector, compileNgModule, compilePipeFromMetadata, computeMsgId, core, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isIdentifier, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, verifyHostBindings, visitAll };
22342
22504
  //# sourceMappingURL=compiler.mjs.map