@angular/core 17.1.0-next.3 → 17.1.0-next.5

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 (79) hide show
  1. package/esm2022/primitives/signals/src/signal.mjs +2 -9
  2. package/esm2022/src/application/application_config.mjs +21 -0
  3. package/esm2022/src/application/application_init.mjs +188 -0
  4. package/esm2022/src/application/application_module.mjs +29 -0
  5. package/esm2022/src/application/application_ref.mjs +505 -0
  6. package/esm2022/src/application/application_tokens.mjs +121 -0
  7. package/esm2022/src/application/create_application.mjs +102 -0
  8. package/esm2022/src/authoring/input.mjs +41 -0
  9. package/esm2022/src/authoring/input_signal.mjs +10 -0
  10. package/esm2022/src/authoring/input_type_checking.mjs +9 -0
  11. package/esm2022/src/authoring.mjs +12 -0
  12. package/esm2022/src/change_detection/flags.mjs +16 -0
  13. package/esm2022/src/change_detection/scheduling/ng_zone_scheduling.mjs +164 -0
  14. package/esm2022/src/change_detection/scheduling/zoneless_scheduling.mjs +13 -0
  15. package/esm2022/src/compiler/compiler_facade_interface.mjs +1 -1
  16. package/esm2022/src/core.mjs +15 -7
  17. package/esm2022/src/core_private_export.mjs +8 -4
  18. package/esm2022/src/core_reactivity_export_internal.mjs +2 -2
  19. package/esm2022/src/core_render3_private_export.mjs +2 -2
  20. package/esm2022/src/error_handler.mjs +15 -1
  21. package/esm2022/src/event_emitter.mjs +1 -2
  22. package/esm2022/src/hydration/annotate.mjs +1 -1
  23. package/esm2022/src/hydration/api.mjs +2 -2
  24. package/esm2022/src/hydration/cleanup.mjs +1 -1
  25. package/esm2022/src/image_performance_warning.mjs +2 -2
  26. package/esm2022/src/linker/query_list.mjs +8 -6
  27. package/esm2022/src/metadata/do_bootstrap.mjs +1 -1
  28. package/esm2022/src/pending_tasks.mjs +57 -0
  29. package/esm2022/src/platform/platform.mjs +135 -0
  30. package/esm2022/src/platform/platform_core_providers.mjs +15 -0
  31. package/esm2022/src/platform/platform_ref.mjs +179 -0
  32. package/esm2022/src/render3/after_render_hooks.mjs +2 -2
  33. package/esm2022/src/render3/component_ref.mjs +13 -9
  34. package/esm2022/src/render3/instructions/change_detection.mjs +2 -4
  35. package/esm2022/src/render3/instructions/control_flow.mjs +5 -3
  36. package/esm2022/src/render3/instructions/mark_view_dirty.mjs +3 -2
  37. package/esm2022/src/render3/instructions/shared.mjs +3 -2
  38. package/esm2022/src/render3/interfaces/definition.mjs +1 -1
  39. package/esm2022/src/render3/interfaces/public_definitions.mjs +1 -1
  40. package/esm2022/src/render3/interfaces/view.mjs +1 -1
  41. package/esm2022/src/render3/list_reconciliation.mjs +58 -24
  42. package/esm2022/src/render3/util/change_detection_utils.mjs +3 -1
  43. package/esm2022/src/render3/util/misc_utils.mjs +2 -2
  44. package/esm2022/src/render3/util/view_utils.mjs +18 -5
  45. package/esm2022/src/render3/view_ref.mjs +8 -1
  46. package/esm2022/src/transfer_state.mjs +2 -2
  47. package/esm2022/src/util/performance.mjs +2 -2
  48. package/esm2022/src/version.mjs +6 -5
  49. package/esm2022/src/zone/ng_zone.mjs +10 -61
  50. package/esm2022/testing/src/component_fixture.mjs +20 -36
  51. package/esm2022/testing/src/logger.mjs +3 -3
  52. package/esm2022/testing/src/test_bed.mjs +5 -6
  53. package/fesm2022/core.mjs +1446 -1336
  54. package/fesm2022/core.mjs.map +1 -1
  55. package/fesm2022/primitives/signals.mjs +2 -9
  56. package/fesm2022/primitives/signals.mjs.map +1 -1
  57. package/fesm2022/rxjs-interop.mjs +1 -1
  58. package/fesm2022/testing.mjs +46 -64
  59. package/fesm2022/testing.mjs.map +1 -1
  60. package/index.d.ts +196 -43
  61. package/package.json +1 -1
  62. package/primitives/signals/index.d.ts +1 -1
  63. package/rxjs-interop/index.d.ts +1 -1
  64. package/schematics/migrations/block-template-entities/bundle.js +1019 -745
  65. package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
  66. package/schematics/migrations/compiler-options/bundle.js +13 -13
  67. package/schematics/migrations/transfer-state/bundle.js +13 -13
  68. package/schematics/ng-generate/control-flow-migration/bundle.js +1331 -854
  69. package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
  70. package/schematics/ng-generate/standalone-migration/bundle.js +2329 -1757
  71. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  72. package/testing/index.d.ts +6 -10
  73. package/esm2022/src/application_config.mjs +0 -21
  74. package/esm2022/src/application_init.mjs +0 -188
  75. package/esm2022/src/application_module.mjs +0 -29
  76. package/esm2022/src/application_ref.mjs +0 -997
  77. package/esm2022/src/application_tokens.mjs +0 -121
  78. package/esm2022/src/initial_render_pending_tasks.mjs +0 -49
  79. package/esm2022/src/platform_core_providers.mjs +0 -15
@@ -63,7 +63,7 @@ var __async = (__this, __arguments, generator) => {
63
63
  });
64
64
  };
65
65
 
66
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/index.mjs
66
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/index.mjs
67
67
  var block_template_entities_exports = {};
68
68
  __export(block_template_entities_exports, {
69
69
  default: () => block_template_entities_default
@@ -72,7 +72,7 @@ module.exports = __toCommonJS(block_template_entities_exports);
72
72
  var import_schematics = require("@angular-devkit/schematics");
73
73
  var import_path3 = require("path");
74
74
 
75
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
75
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
76
76
  var import_core = require("@angular-devkit/core");
77
77
  function getProjectTsConfigPaths(tree) {
78
78
  return __async(this, null, function* () {
@@ -152,11 +152,11 @@ function getWorkspace(tree) {
152
152
  });
153
153
  }
154
154
 
155
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
155
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
156
156
  var import_path = require("path");
157
157
  var import_typescript2 = __toESM(require("typescript"), 1);
158
158
 
159
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
159
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
160
160
  var path = __toESM(require("path"), 1);
161
161
  var import_typescript = __toESM(require("typescript"), 1);
162
162
  function parseTsconfigFile(tsconfigPath, basePath) {
@@ -173,7 +173,7 @@ function parseTsconfigFile(tsconfigPath, basePath) {
173
173
  return import_typescript.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
174
174
  }
175
175
 
176
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
176
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
177
177
  function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
178
178
  const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
179
179
  return import_typescript2.default.createProgram(rootNames, options, host);
@@ -206,7 +206,7 @@ function canMigrateFile(basePath, sourceFile, program) {
206
206
  return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
207
207
  }
208
208
 
209
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/selector.mjs
209
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/selector.mjs
210
210
  var _SELECTOR_REGEXP = new RegExp(
211
211
  `(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
212
212
  "g"
@@ -514,7 +514,7 @@ var SelectorContext = class {
514
514
  }
515
515
  };
516
516
 
517
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/core.mjs
517
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/core.mjs
518
518
  var ViewEncapsulation;
519
519
  (function(ViewEncapsulation2) {
520
520
  ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
@@ -576,7 +576,7 @@ function parseSelectorToR3Selector(selector) {
576
576
  return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];
577
577
  }
578
578
 
579
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
579
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
580
580
  var textEncoder;
581
581
  function computeDigest(message) {
582
582
  return sha1(serializeNodes(message.nodes).join("") + `[${message.meaning}]`);
@@ -816,7 +816,7 @@ function wordAt(bytes, index, endian) {
816
816
  return word;
817
817
  }
818
818
 
819
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
819
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
820
820
  var TypeModifier;
821
821
  (function(TypeModifier2) {
822
822
  TypeModifier2[TypeModifier2["None"] = 0] = "None";
@@ -1771,7 +1771,7 @@ function serializeTags(tags) {
1771
1771
  return out;
1772
1772
  }
1773
1773
 
1774
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1774
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1775
1775
  var CONSTANT_PREFIX = "_c";
1776
1776
  var UNKNOWN_VALUE_KEY = variable("<unknown>");
1777
1777
  var KEY_CONTEXT = {};
@@ -1874,7 +1874,7 @@ var ConstantPool = class {
1874
1874
  }))));
1875
1875
  }
1876
1876
  }
1877
- getSharedFunctionReference(fn2, prefix) {
1877
+ getSharedFunctionReference(fn2, prefix, useUniqueName = true) {
1878
1878
  var _a2;
1879
1879
  const isArrow = fn2 instanceof ArrowFunctionExpr;
1880
1880
  for (const current of this.statements) {
@@ -1885,7 +1885,7 @@ var ConstantPool = class {
1885
1885
  return variable(current.name);
1886
1886
  }
1887
1887
  }
1888
- const name = this.uniqueName(prefix);
1888
+ const name = useUniqueName ? this.uniqueName(prefix) : prefix;
1889
1889
  this.statements.push(fn2.toDeclStmt(name, StmtModifier.Final));
1890
1890
  return variable(name);
1891
1891
  }
@@ -1954,7 +1954,7 @@ function isLongStringLiteral(expr) {
1954
1954
  return expr instanceof LiteralExpr && typeof expr.value === "string" && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;
1955
1955
  }
1956
1956
 
1957
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1957
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1958
1958
  var CORE = "@angular/core";
1959
1959
  var _Identifiers = class {
1960
1960
  };
@@ -2586,8 +2586,14 @@ var Identifiers = _Identifiers;
2586
2586
  (() => {
2587
2587
  _Identifiers.validateIframeAttribute = { name: "\u0275\u0275validateIframeAttribute", moduleName: CORE };
2588
2588
  })();
2589
+ (() => {
2590
+ _Identifiers.InputSignalBrandWriteType = { name: "\u0275INPUT_SIGNAL_BRAND_WRITE_TYPE", moduleName: CORE };
2591
+ })();
2592
+ (() => {
2593
+ _Identifiers.UnwrapDirectiveSignalInputs = { name: "\u0275UnwrapDirectiveSignalInputs", moduleName: CORE };
2594
+ })();
2589
2595
 
2590
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/util.mjs
2596
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/util.mjs
2591
2597
  var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
2592
2598
  function dashCaseToCamelCase(input) {
2593
2599
  return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
@@ -2675,7 +2681,7 @@ function partitionArray(arr, conditionFn) {
2675
2681
  return [truthy, falsy];
2676
2682
  }
2677
2683
 
2678
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2684
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2679
2685
  var VERSION = 3;
2680
2686
  var JS_B64_PREFIX = "# sourceMappingURL=data:application/json;base64,";
2681
2687
  var SourceMapGenerator = class {
@@ -2804,7 +2810,7 @@ function toBase64Digit(value) {
2804
2810
  return B64_DIGITS[value];
2805
2811
  }
2806
2812
 
2807
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2813
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2808
2814
  var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
2809
2815
  var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
2810
2816
  var _INDENT_WITH = " ";
@@ -3289,7 +3295,7 @@ function _createIndent(count) {
3289
3295
  return res;
3290
3296
  }
3291
3297
 
3292
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/util.mjs
3298
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/util.mjs
3293
3299
  function typeWithParameters(type, numParams) {
3294
3300
  if (numParams === 0) {
3295
3301
  return expressionType(type);
@@ -3354,7 +3360,7 @@ function generateForwardRef(expr) {
3354
3360
  return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);
3355
3361
  }
3356
3362
 
3357
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3363
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3358
3364
  var R3FactoryDelegateType;
3359
3365
  (function(R3FactoryDelegateType2) {
3360
3366
  R3FactoryDelegateType2[R3FactoryDelegateType2["Class"] = 0] = "Class";
@@ -3499,20 +3505,24 @@ function getInjectFn(target) {
3499
3505
  }
3500
3506
  }
3501
3507
 
3502
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
3508
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
3503
3509
  var TagContentType;
3504
3510
  (function(TagContentType2) {
3505
3511
  TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
3506
3512
  TagContentType2[TagContentType2["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
3507
3513
  TagContentType2[TagContentType2["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
3508
3514
  })(TagContentType || (TagContentType = {}));
3509
- function splitNsName(elementName) {
3515
+ function splitNsName(elementName, fatal = true) {
3510
3516
  if (elementName[0] != ":") {
3511
3517
  return [null, elementName];
3512
3518
  }
3513
3519
  const colonIndex = elementName.indexOf(":", 1);
3514
3520
  if (colonIndex === -1) {
3515
- throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
3521
+ if (fatal) {
3522
+ throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
3523
+ } else {
3524
+ return [null, elementName];
3525
+ }
3516
3526
  }
3517
3527
  return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
3518
3528
  }
@@ -3532,7 +3542,7 @@ function mergeNsAndName(prefix, localName) {
3532
3542
  return prefix ? `:${prefix}:${localName}` : localName;
3533
3543
  }
3534
3544
 
3535
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3545
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3536
3546
  var Comment = class {
3537
3547
  constructor(value, sourceSpan) {
3538
3548
  this.value = value;
@@ -3913,7 +3923,7 @@ function visitAll(visitor, nodes) {
3913
3923
  return result;
3914
3924
  }
3915
3925
 
3916
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3926
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3917
3927
  var Message = class {
3918
3928
  constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) {
3919
3929
  this.nodes = nodes;
@@ -4019,28 +4029,6 @@ var BlockPlaceholder = class {
4019
4029
  return visitor.visitBlockPlaceholder(this, context);
4020
4030
  }
4021
4031
  };
4022
- var RecurseVisitor = class {
4023
- visitText(text2, context) {
4024
- }
4025
- visitContainer(container, context) {
4026
- container.children.forEach((child) => child.visit(this));
4027
- }
4028
- visitIcu(icu, context) {
4029
- Object.keys(icu.cases).forEach((k) => {
4030
- icu.cases[k].visit(this);
4031
- });
4032
- }
4033
- visitTagPlaceholder(ph, context) {
4034
- ph.children.forEach((child) => child.visit(this));
4035
- }
4036
- visitPlaceholder(ph, context) {
4037
- }
4038
- visitIcuPlaceholder(ph, context) {
4039
- }
4040
- visitBlockPlaceholder(ph, context) {
4041
- ph.children.forEach((child) => child.visit(this));
4042
- }
4043
- };
4044
4032
  function serializeMessage(messageNodes) {
4045
4033
  const visitor = new LocalizeMessageStringVisitor();
4046
4034
  const str = messageNodes.map((n) => n.visit(visitor)).join("");
@@ -4073,7 +4061,7 @@ var LocalizeMessageStringVisitor = class {
4073
4061
  }
4074
4062
  };
4075
4063
 
4076
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
4064
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
4077
4065
  var _Visitor = class {
4078
4066
  visitTag(tag) {
4079
4067
  const strAttrs = this._serializeAttributes(tag.attrs);
@@ -4101,12 +4089,12 @@ ${doctype.dtd}
4101
4089
  };
4102
4090
  var _visitor = new _Visitor();
4103
4091
 
4104
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4092
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4105
4093
  function toPublicName(internalName) {
4106
4094
  return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
4107
4095
  }
4108
4096
 
4109
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4097
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4110
4098
  var CLOSURE_TRANSLATION_VAR_PREFIX = "MSG_";
4111
4099
  var TRANSLATION_VAR_PREFIX = "i18n_";
4112
4100
  var I18N_ATTR = "i18n";
@@ -4208,7 +4196,7 @@ function declareI18nVariable(variable2) {
4208
4196
  return new DeclareVarStmt(variable2.name, void 0, INFERRED_TYPE, void 0, variable2.sourceSpan);
4209
4197
  }
4210
4198
 
4211
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4199
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4212
4200
  var UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;
4213
4201
  var TEMPORARY_NAME = "_t";
4214
4202
  var CONTEXT_NAME = "ctx";
@@ -4448,7 +4436,7 @@ function getInstructionStatements(instructions) {
4448
4436
  return statements;
4449
4437
  }
4450
4438
 
4451
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4439
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4452
4440
  function compileInjectable(meta, resolveForwardRefs) {
4453
4441
  let result = null;
4454
4442
  const factoryMeta = {
@@ -4533,7 +4521,7 @@ function createFactoryFunction(type) {
4533
4521
  return arrowFn([new FnParam("t", DYNAMIC_TYPE)], type.prop("\u0275fac").callFn([variable("t")]));
4534
4522
  }
4535
4523
 
4536
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/assertions.mjs
4524
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/assertions.mjs
4537
4525
  var UNUSABLE_INTERPOLATION_REGEXPS = [
4538
4526
  /^\s*$/,
4539
4527
  /[<>]/,
@@ -4555,7 +4543,7 @@ function assertInterpolationSymbols(identifier, value) {
4555
4543
  }
4556
4544
  }
4557
4545
 
4558
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/defaults.mjs
4546
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/defaults.mjs
4559
4547
  var InterpolationConfig = class {
4560
4548
  static fromArray(markers) {
4561
4549
  if (!markers) {
@@ -4572,7 +4560,7 @@ var InterpolationConfig = class {
4572
4560
  var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig("{{", "}}");
4573
4561
  var DEFAULT_CONTAINER_BLOCKS = /* @__PURE__ */ new Set(["switch"]);
4574
4562
 
4575
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/chars.mjs
4563
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/chars.mjs
4576
4564
  var $EOF = 0;
4577
4565
  var $BSPACE = 8;
4578
4566
  var $TAB = 9;
@@ -4654,7 +4642,7 @@ function isQuote(code) {
4654
4642
  return code === $SQ || code === $DQ || code === $BT;
4655
4643
  }
4656
4644
 
4657
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/parse_util.mjs
4645
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/parse_util.mjs
4658
4646
  var ParseLocation = class {
4659
4647
  constructor(file, offset, line, col) {
4660
4648
  this.file = file;
@@ -4801,7 +4789,7 @@ function sanitizeIdentifier(name) {
4801
4789
  return name.replace(/\W/g, "_");
4802
4790
  }
4803
4791
 
4804
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4792
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4805
4793
  var makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';
4806
4794
  var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4807
4795
  constructor() {
@@ -4894,7 +4882,7 @@ var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4894
4882
  }
4895
4883
  };
4896
4884
 
4897
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4885
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4898
4886
  var policy;
4899
4887
  function getPolicy() {
4900
4888
  if (policy === void 0) {
@@ -4932,7 +4920,7 @@ function newTrustedFunctionForJIT(...args) {
4932
4920
  return fn2.bind(_global);
4933
4921
  }
4934
4922
 
4935
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4923
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4936
4924
  var JitEvaluator = class {
4937
4925
  evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) {
4938
4926
  const converter = new JitEmitterVisitor(refResolver);
@@ -5023,7 +5011,7 @@ function isUseStrictStatement(statement) {
5023
5011
  return statement.isEquivalent(literal("use strict").toStmt());
5024
5012
  }
5025
5013
 
5026
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
5014
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
5027
5015
  function compileInjector(meta) {
5028
5016
  const definitionMap = new DefinitionMap();
5029
5017
  if (meta.providers !== null) {
@@ -5040,7 +5028,7 @@ function createInjectorType(meta) {
5040
5028
  return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
5041
5029
  }
5042
5030
 
5043
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
5031
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
5044
5032
  var R3JitReflector = class {
5045
5033
  constructor(context) {
5046
5034
  this.context = context;
@@ -5056,7 +5044,7 @@ var R3JitReflector = class {
5056
5044
  }
5057
5045
  };
5058
5046
 
5059
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
5047
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
5060
5048
  var R3SelectorScopeMode;
5061
5049
  (function(R3SelectorScopeMode2) {
5062
5050
  R3SelectorScopeMode2[R3SelectorScopeMode2["Inline"] = 0] = "Inline";
@@ -5197,7 +5185,7 @@ function tupleOfTypes(types) {
5197
5185
  return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;
5198
5186
  }
5199
5187
 
5200
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5188
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5201
5189
  function compilePipeFromMetadata(metadata) {
5202
5190
  const definitionMapValues = [];
5203
5191
  definitionMapValues.push({ key: "name", value: literal(metadata.pipeName), quoted: false });
@@ -5218,7 +5206,7 @@ function createPipeType(metadata) {
5218
5206
  ]));
5219
5207
  }
5220
5208
 
5221
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5209
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5222
5210
  var R3TemplateDependencyKind;
5223
5211
  (function(R3TemplateDependencyKind2) {
5224
5212
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
@@ -5226,7 +5214,7 @@ var R3TemplateDependencyKind;
5226
5214
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
5227
5215
  })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
5228
5216
 
5229
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5217
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5230
5218
  var ParserError = class {
5231
5219
  constructor(message, input, errLocation, ctxLocation) {
5232
5220
  this.input = input;
@@ -5892,7 +5880,7 @@ var BoundElementProperty = class {
5892
5880
  }
5893
5881
  };
5894
5882
 
5895
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5883
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5896
5884
  var _EventHandlerVars = class {
5897
5885
  };
5898
5886
  var EventHandlerVars = _EventHandlerVars;
@@ -6533,7 +6521,7 @@ var BuiltinFunctionCall = class extends Call {
6533
6521
  }
6534
6522
  };
6535
6523
 
6536
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6524
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6537
6525
  var _SECURITY_SCHEMA;
6538
6526
  function SECURITY_SCHEMA() {
6539
6527
  if (!_SECURITY_SCHEMA) {
@@ -6591,7 +6579,7 @@ function isIframeSecuritySensitiveAttr(attrName) {
6591
6579
  return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
6592
6580
  }
6593
6581
 
6594
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6582
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6595
6583
  var animationKeywords = /* @__PURE__ */ new Set([
6596
6584
  "inherit",
6597
6585
  "initial",
@@ -7062,7 +7050,7 @@ function repeatGroups(groups, multiples) {
7062
7050
  }
7063
7051
  }
7064
7052
 
7065
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
7053
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
7066
7054
  var OpKind;
7067
7055
  (function(OpKind2) {
7068
7056
  OpKind2[OpKind2["ListEnd"] = 0] = "ListEnd";
@@ -7108,8 +7096,9 @@ var OpKind;
7108
7096
  OpKind2[OpKind2["I18nApply"] = 40] = "I18nApply";
7109
7097
  OpKind2[OpKind2["IcuStart"] = 41] = "IcuStart";
7110
7098
  OpKind2[OpKind2["IcuEnd"] = 42] = "IcuEnd";
7111
- OpKind2[OpKind2["I18nContext"] = 43] = "I18nContext";
7112
- OpKind2[OpKind2["I18nAttributes"] = 44] = "I18nAttributes";
7099
+ OpKind2[OpKind2["IcuPlaceholder"] = 43] = "IcuPlaceholder";
7100
+ OpKind2[OpKind2["I18nContext"] = 44] = "I18nContext";
7101
+ OpKind2[OpKind2["I18nAttributes"] = 45] = "I18nAttributes";
7113
7102
  })(OpKind || (OpKind = {}));
7114
7103
  var ExpressionKind;
7115
7104
  (function(ExpressionKind2) {
@@ -7134,10 +7123,11 @@ var ExpressionKind;
7134
7123
  ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 18] = "AssignTemporaryExpr";
7135
7124
  ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 19] = "ReadTemporaryExpr";
7136
7125
  ExpressionKind2[ExpressionKind2["SanitizerExpr"] = 20] = "SanitizerExpr";
7137
- ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 21] = "SlotLiteralExpr";
7138
- ExpressionKind2[ExpressionKind2["ConditionalCase"] = 22] = "ConditionalCase";
7139
- ExpressionKind2[ExpressionKind2["DerivedRepeaterVar"] = 23] = "DerivedRepeaterVar";
7140
- ExpressionKind2[ExpressionKind2["ConstCollected"] = 24] = "ConstCollected";
7126
+ ExpressionKind2[ExpressionKind2["TrustedValueFnExpr"] = 21] = "TrustedValueFnExpr";
7127
+ ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 22] = "SlotLiteralExpr";
7128
+ ExpressionKind2[ExpressionKind2["ConditionalCase"] = 23] = "ConditionalCase";
7129
+ ExpressionKind2[ExpressionKind2["DerivedRepeaterVar"] = 24] = "DerivedRepeaterVar";
7130
+ ExpressionKind2[ExpressionKind2["ConstCollected"] = 25] = "ConstCollected";
7141
7131
  })(ExpressionKind || (ExpressionKind = {}));
7142
7132
  var VariableFlags;
7143
7133
  (function(VariableFlags2) {
@@ -7156,15 +7146,6 @@ var CompatibilityMode;
7156
7146
  CompatibilityMode2[CompatibilityMode2["Normal"] = 0] = "Normal";
7157
7147
  CompatibilityMode2[CompatibilityMode2["TemplateDefinitionBuilder"] = 1] = "TemplateDefinitionBuilder";
7158
7148
  })(CompatibilityMode || (CompatibilityMode = {}));
7159
- var SanitizerFn;
7160
- (function(SanitizerFn2) {
7161
- SanitizerFn2[SanitizerFn2["Html"] = 0] = "Html";
7162
- SanitizerFn2[SanitizerFn2["Script"] = 1] = "Script";
7163
- SanitizerFn2[SanitizerFn2["Style"] = 2] = "Style";
7164
- SanitizerFn2[SanitizerFn2["Url"] = 3] = "Url";
7165
- SanitizerFn2[SanitizerFn2["ResourceUrl"] = 4] = "ResourceUrl";
7166
- SanitizerFn2[SanitizerFn2["IframeAttribute"] = 5] = "IframeAttribute";
7167
- })(SanitizerFn || (SanitizerFn = {}));
7168
7149
  var DeferSecondaryKind;
7169
7150
  (function(DeferSecondaryKind2) {
7170
7151
  DeferSecondaryKind2[DeferSecondaryKind2["Loading"] = 0] = "Loading";
@@ -7235,7 +7216,7 @@ var TemplateKind;
7235
7216
  TemplateKind2[TemplateKind2["Block"] = 2] = "Block";
7236
7217
  })(TemplateKind || (TemplateKind = {}));
7237
7218
 
7238
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7219
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7239
7220
  var ConsumesSlot = Symbol("ConsumesSlot");
7240
7221
  var DependsOnSlotContext = Symbol("DependsOnSlotContext");
7241
7222
  var ConsumesVarsTrait = Symbol("ConsumesVars");
@@ -7267,7 +7248,7 @@ function hasUsesVarOffsetTrait(expr) {
7267
7248
  return expr[UsesVarOffset] === true;
7268
7249
  }
7269
7250
 
7270
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7251
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7271
7252
  function createStatementOp(statement) {
7272
7253
  return __spreadValues({
7273
7254
  kind: OpKind.Statement,
@@ -7289,7 +7270,7 @@ var NEW_OP = {
7289
7270
  next: null
7290
7271
  };
7291
7272
 
7292
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7273
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7293
7274
  function createInterpolateTextOp(xref, interpolation, sourceSpan) {
7294
7275
  return __spreadValues(__spreadValues(__spreadValues({
7295
7276
  kind: OpKind.InterpolateText,
@@ -7308,7 +7289,7 @@ var Interpolation2 = class {
7308
7289
  }
7309
7290
  }
7310
7291
  };
7311
- function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isStructuralTemplate, i18nContext, sourceSpan) {
7292
+ function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {
7312
7293
  return __spreadValues({
7313
7294
  kind: OpKind.Binding,
7314
7295
  bindingKind: kind,
@@ -7318,12 +7299,14 @@ function createBindingOp(target, kind, name, expression, unit, securityContext,
7318
7299
  unit,
7319
7300
  securityContext,
7320
7301
  isTextAttribute,
7321
- isStructuralTemplate,
7322
- i18nContext,
7302
+ isStructuralTemplateAttribute,
7303
+ templateKind,
7304
+ i18nContext: null,
7305
+ i18nMessage,
7323
7306
  sourceSpan
7324
7307
  }, NEW_OP);
7325
7308
  }
7326
- function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext, isStructuralTemplate, i18nContext, sourceSpan) {
7309
+ function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext, isStructuralTemplateAttribute, templateKind, i18nContext, i18nMessage, sourceSpan) {
7327
7310
  return __spreadValues(__spreadValues(__spreadValues({
7328
7311
  kind: OpKind.Property,
7329
7312
  target,
@@ -7332,8 +7315,10 @@ function createPropertyOp(target, name, expression, isAnimationTrigger, security
7332
7315
  isAnimationTrigger,
7333
7316
  securityContext,
7334
7317
  sanitizer: null,
7335
- isStructuralTemplate,
7318
+ isStructuralTemplateAttribute,
7319
+ templateKind,
7336
7320
  i18nContext,
7321
+ i18nMessage,
7337
7322
  sourceSpan
7338
7323
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7339
7324
  }
@@ -7372,7 +7357,7 @@ function createClassMapOp(xref, expression, sourceSpan) {
7372
7357
  sourceSpan
7373
7358
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7374
7359
  }
7375
- function createAttributeOp(target, name, expression, securityContext, isTextAttribute, isStructuralTemplate, i18nContext, sourceSpan) {
7360
+ function createAttributeOp(target, name, expression, securityContext, isTextAttribute, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {
7376
7361
  return __spreadValues(__spreadValues(__spreadValues({
7377
7362
  kind: OpKind.Attribute,
7378
7363
  target,
@@ -7381,8 +7366,10 @@ function createAttributeOp(target, name, expression, securityContext, isTextAttr
7381
7366
  securityContext,
7382
7367
  sanitizer: null,
7383
7368
  isTextAttribute,
7384
- isStructuralTemplate,
7385
- i18nContext,
7369
+ isStructuralTemplateAttribute,
7370
+ templateKind,
7371
+ i18nContext: null,
7372
+ i18nMessage,
7386
7373
  sourceSpan
7387
7374
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7388
7375
  }
@@ -7415,15 +7402,15 @@ function createRepeaterOp(repeaterCreate2, targetSlot, collection, sourceSpan) {
7415
7402
  }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
7416
7403
  }
7417
7404
  function createDeferWhenOp(target, expr, prefetch, sourceSpan) {
7418
- return __spreadValues(__spreadValues({
7405
+ return __spreadValues(__spreadValues(__spreadValues({
7419
7406
  kind: OpKind.DeferWhen,
7420
7407
  target,
7421
7408
  expr,
7422
7409
  prefetch,
7423
7410
  sourceSpan
7424
- }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
7411
+ }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS);
7425
7412
  }
7426
- function createI18nExpressionOp(context, target, i18nOwner, handle, expression, i18nPlaceholder, resolutionTime, usage, name, sourceSpan) {
7413
+ function createI18nExpressionOp(context, target, i18nOwner, handle, expression, icuPlaceholder, i18nPlaceholder, resolutionTime, usage, name, sourceSpan) {
7427
7414
  return __spreadValues(__spreadValues(__spreadValues({
7428
7415
  kind: OpKind.I18nExpression,
7429
7416
  context,
@@ -7431,6 +7418,7 @@ function createI18nExpressionOp(context, target, i18nOwner, handle, expression,
7431
7418
  i18nOwner,
7432
7419
  handle,
7433
7420
  expression,
7421
+ icuPlaceholder,
7434
7422
  i18nPlaceholder,
7435
7423
  resolutionTime,
7436
7424
  usage,
@@ -7447,7 +7435,7 @@ function createI18nApplyOp(owner, handle, sourceSpan) {
7447
7435
  }, NEW_OP);
7448
7436
  }
7449
7437
 
7450
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7438
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7451
7439
  var _a;
7452
7440
  var _b;
7453
7441
  var _c;
@@ -7978,26 +7966,6 @@ var ReadTemporaryExpr = class extends ExpressionBase {
7978
7966
  return r;
7979
7967
  }
7980
7968
  };
7981
- var SanitizerExpr = class extends ExpressionBase {
7982
- constructor(fn2) {
7983
- super();
7984
- this.fn = fn2;
7985
- this.kind = ExpressionKind.SanitizerExpr;
7986
- }
7987
- visitExpression(visitor, context) {
7988
- }
7989
- isEquivalent(e) {
7990
- return e instanceof SanitizerExpr && e.fn === this.fn;
7991
- }
7992
- isConstant() {
7993
- return true;
7994
- }
7995
- clone() {
7996
- return new SanitizerExpr(this.fn);
7997
- }
7998
- transformInternalExpressions() {
7999
- }
8000
- };
8001
7969
  var SlotLiteralExpr = class extends ExpressionBase {
8002
7970
  constructor(slot) {
8003
7971
  super();
@@ -8116,7 +8084,6 @@ function transformExpressionsInOp(op, transform2, flags) {
8116
8084
  case OpKind.ClassProp:
8117
8085
  case OpKind.ClassMap:
8118
8086
  case OpKind.Binding:
8119
- case OpKind.HostProperty:
8120
8087
  if (op.expression instanceof Interpolation2) {
8121
8088
  transformExpressionsInInterpolation(op.expression, transform2, flags);
8122
8089
  } else {
@@ -8124,6 +8091,7 @@ function transformExpressionsInOp(op, transform2, flags) {
8124
8091
  }
8125
8092
  break;
8126
8093
  case OpKind.Property:
8094
+ case OpKind.HostProperty:
8127
8095
  case OpKind.Attribute:
8128
8096
  if (op.expression instanceof Interpolation2) {
8129
8097
  transformExpressionsInInterpolation(op.expression, transform2, flags);
@@ -8165,6 +8133,7 @@ function transformExpressionsInOp(op, transform2, flags) {
8165
8133
  break;
8166
8134
  case OpKind.ExtractedAttribute:
8167
8135
  op.expression = op.expression && transformExpressionsInExpression(op.expression, transform2, flags);
8136
+ op.trustedValueFn = op.trustedValueFn && transformExpressionsInExpression(op.trustedValueFn, transform2, flags);
8168
8137
  break;
8169
8138
  case OpKind.RepeaterCreate:
8170
8139
  op.track = transformExpressionsInExpression(op.track, transform2, flags);
@@ -8182,6 +8151,9 @@ function transformExpressionsInOp(op, transform2, flags) {
8182
8151
  if (op.placeholderConfig !== null) {
8183
8152
  op.placeholderConfig = transformExpressionsInExpression(op.placeholderConfig, transform2, flags);
8184
8153
  }
8154
+ if (op.resolverFn !== null) {
8155
+ op.resolverFn = transformExpressionsInExpression(op.resolverFn, transform2, flags);
8156
+ }
8185
8157
  break;
8186
8158
  case OpKind.I18nMessage:
8187
8159
  for (const [placeholder, expr] of op.params) {
@@ -8218,6 +8190,7 @@ function transformExpressionsInOp(op, transform2, flags) {
8218
8190
  case OpKind.Template:
8219
8191
  case OpKind.Text:
8220
8192
  case OpKind.I18nAttributes:
8193
+ case OpKind.IcuPlaceholder:
8221
8194
  break;
8222
8195
  default:
8223
8196
  throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
@@ -8272,6 +8245,18 @@ function transformExpressionsInExpression(expr, transform2, flags) {
8272
8245
  }
8273
8246
  } else if (expr instanceof NotExpr) {
8274
8247
  expr.condition = transformExpressionsInExpression(expr.condition, transform2, flags);
8248
+ } else if (expr instanceof TaggedTemplateExpr) {
8249
+ expr.tag = transformExpressionsInExpression(expr.tag, transform2, flags);
8250
+ expr.template.expressions = expr.template.expressions.map((e) => transformExpressionsInExpression(e, transform2, flags));
8251
+ } else if (expr instanceof ArrowFunctionExpr) {
8252
+ if (Array.isArray(expr.body)) {
8253
+ for (let i = 0; i < expr.body.length; i++) {
8254
+ transformExpressionsInStatement(expr.body[i], transform2, flags);
8255
+ }
8256
+ } else {
8257
+ expr.body = transformExpressionsInExpression(expr.body, transform2, flags);
8258
+ }
8259
+ } else if (expr instanceof WrappedNodeExpr) {
8275
8260
  } else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr) {
8276
8261
  } else {
8277
8262
  throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
@@ -8303,7 +8288,7 @@ function isStringLiteral(expr) {
8303
8288
  return expr instanceof LiteralExpr && typeof expr.value === "string";
8304
8289
  }
8305
8290
 
8306
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8291
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8307
8292
  var _OpList = class {
8308
8293
  constructor() {
8309
8294
  this.debugListId = _OpList.nextListId++;
@@ -8494,14 +8479,14 @@ var OpList = _OpList;
8494
8479
  _OpList.nextListId = 0;
8495
8480
  })();
8496
8481
 
8497
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
8482
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
8498
8483
  var SlotHandle = class {
8499
8484
  constructor() {
8500
8485
  this.slot = null;
8501
8486
  }
8502
8487
  };
8503
8488
 
8504
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8489
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8505
8490
  var elementContainerOpKinds = /* @__PURE__ */ new Set([
8506
8491
  OpKind.Element,
8507
8492
  OpKind.ElementStart,
@@ -8513,7 +8498,7 @@ var elementContainerOpKinds = /* @__PURE__ */ new Set([
8513
8498
  function isElementOrContainerOp(op) {
8514
8499
  return elementContainerOpKinds.has(op.kind);
8515
8500
  }
8516
- function createElementStartOp(tag, xref, namespace, i18nPlaceholder, sourceSpan) {
8501
+ function createElementStartOp(tag, xref, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {
8517
8502
  return __spreadValues(__spreadValues({
8518
8503
  kind: OpKind.ElementStart,
8519
8504
  xref,
@@ -8524,10 +8509,11 @@ function createElementStartOp(tag, xref, namespace, i18nPlaceholder, sourceSpan)
8524
8509
  nonBindable: false,
8525
8510
  namespace,
8526
8511
  i18nPlaceholder,
8527
- sourceSpan
8512
+ startSourceSpan,
8513
+ wholeSourceSpan
8528
8514
  }, TRAIT_CONSUMES_SLOT), NEW_OP);
8529
8515
  }
8530
- function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, sourceSpan) {
8516
+ function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {
8531
8517
  return __spreadValues(__spreadValues({
8532
8518
  kind: OpKind.Template,
8533
8519
  xref,
@@ -8542,11 +8528,12 @@ function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace
8542
8528
  nonBindable: false,
8543
8529
  namespace,
8544
8530
  i18nPlaceholder,
8545
- sourceSpan
8531
+ startSourceSpan,
8532
+ wholeSourceSpan
8546
8533
  }, TRAIT_CONSUMES_SLOT), NEW_OP);
8547
8534
  }
8548
- function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, sourceSpan) {
8549
- return __spreadProps(__spreadValues(__spreadValues({
8535
+ function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, emptyTag, i18nPlaceholder, emptyI18nPlaceholder, startSourceSpan, wholeSourceSpan) {
8536
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
8550
8537
  kind: OpKind.RepeaterCreate,
8551
8538
  attributes: null,
8552
8539
  xref: primaryView,
@@ -8555,6 +8542,8 @@ function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, so
8555
8542
  track,
8556
8543
  trackByFn: null,
8557
8544
  tag,
8545
+ emptyTag,
8546
+ emptyAttributes: null,
8558
8547
  functionNameSuffix: "For",
8559
8548
  namespace: Namespace.HTML,
8560
8549
  nonBindable: false,
@@ -8563,8 +8552,11 @@ function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, so
8563
8552
  vars: null,
8564
8553
  varNames,
8565
8554
  usesComponentInstance: false,
8566
- sourceSpan
8567
- }, TRAIT_CONSUMES_SLOT), NEW_OP), {
8555
+ i18nPlaceholder,
8556
+ emptyI18nPlaceholder,
8557
+ startSourceSpan,
8558
+ wholeSourceSpan
8559
+ }, TRAIT_CONSUMES_SLOT), NEW_OP), TRAIT_CONSUMES_VARS), {
8568
8560
  numSlotsUsed: emptyView === null ? 2 : 3
8569
8561
  });
8570
8562
  }
@@ -8587,16 +8579,19 @@ function createEnableBindingsOp(xref) {
8587
8579
  xref
8588
8580
  }, NEW_OP);
8589
8581
  }
8590
- function createTextOp(xref, initialValue, sourceSpan) {
8582
+ function createTextOp(xref, initialValue, icuPlaceholder, sourceSpan) {
8591
8583
  return __spreadValues(__spreadValues({
8592
8584
  kind: OpKind.Text,
8593
8585
  xref,
8594
8586
  handle: new SlotHandle(),
8595
8587
  initialValue,
8588
+ icuPlaceholder,
8596
8589
  sourceSpan
8597
8590
  }, TRAIT_CONSUMES_SLOT), NEW_OP);
8598
8591
  }
8599
- function createListenerOp(target, targetSlot, name, tag, animationPhase, hostListener, sourceSpan) {
8592
+ function createListenerOp(target, targetSlot, name, tag, handlerOps, animationPhase, eventTarget, hostListener, sourceSpan) {
8593
+ const handlerList = new OpList();
8594
+ handlerList.push(handlerOps);
8600
8595
  return __spreadValues({
8601
8596
  kind: OpKind.Listener,
8602
8597
  target,
@@ -8604,11 +8599,12 @@ function createListenerOp(target, targetSlot, name, tag, animationPhase, hostLis
8604
8599
  tag,
8605
8600
  hostListener,
8606
8601
  name,
8607
- handlerOps: new OpList(),
8602
+ handlerOps: handlerList,
8608
8603
  handlerFnName: null,
8609
8604
  consumesDollarEvent: false,
8610
8605
  isAnimationListener: animationPhase !== null,
8611
8606
  animationPhase,
8607
+ eventTarget,
8612
8608
  sourceSpan
8613
8609
  }, NEW_OP);
8614
8610
  }
@@ -8632,7 +8628,7 @@ function createProjectionDefOp(def) {
8632
8628
  def
8633
8629
  }, NEW_OP);
8634
8630
  }
8635
- function createProjectionOp(xref, selector, i18nPlaceholder, attributes, sourceSpan) {
8631
+ function createProjectionOp(xref, selector, i18nPlaceholder, sourceSpan) {
8636
8632
  return __spreadValues(__spreadValues({
8637
8633
  kind: OpKind.Projection,
8638
8634
  xref,
@@ -8640,19 +8636,22 @@ function createProjectionOp(xref, selector, i18nPlaceholder, attributes, sourceS
8640
8636
  selector,
8641
8637
  i18nPlaceholder,
8642
8638
  projectionSlotIndex: 0,
8643
- attributes,
8639
+ attributes: null,
8644
8640
  localRefs: [],
8645
8641
  sourceSpan
8646
8642
  }, NEW_OP), TRAIT_CONSUMES_SLOT);
8647
8643
  }
8648
- function createExtractedAttributeOp(target, bindingKind, name, expression, i18nContext) {
8644
+ function createExtractedAttributeOp(target, bindingKind, name, expression, i18nContext, i18nMessage, securityContext) {
8649
8645
  return __spreadValues({
8650
8646
  kind: OpKind.ExtractedAttribute,
8651
8647
  target,
8652
8648
  bindingKind,
8653
8649
  name,
8654
8650
  expression,
8655
- i18nContext
8651
+ i18nContext,
8652
+ i18nMessage,
8653
+ securityContext,
8654
+ trustedValueFn: null
8656
8655
  }, NEW_OP);
8657
8656
  }
8658
8657
  function createDeferOp(xref, main, mainSlot, metadata, sourceSpan) {
@@ -8703,7 +8702,7 @@ function createI18nMessageOp(xref, i18nContext, i18nBlock, message, messagePlace
8703
8702
  subMessages: []
8704
8703
  }, NEW_OP);
8705
8704
  }
8706
- function createI18nStartOp(xref, message, root) {
8705
+ function createI18nStartOp(xref, message, root, sourceSpan) {
8707
8706
  return __spreadValues(__spreadValues({
8708
8707
  kind: OpKind.I18nStart,
8709
8708
  xref,
@@ -8712,13 +8711,15 @@ function createI18nStartOp(xref, message, root) {
8712
8711
  message,
8713
8712
  messageIndex: null,
8714
8713
  subTemplateIndex: null,
8715
- context: null
8714
+ context: null,
8715
+ sourceSpan
8716
8716
  }, NEW_OP), TRAIT_CONSUMES_SLOT);
8717
8717
  }
8718
- function createI18nEndOp(xref) {
8718
+ function createI18nEndOp(xref, sourceSpan) {
8719
8719
  return __spreadValues({
8720
8720
  kind: OpKind.I18nEnd,
8721
- xref
8721
+ xref,
8722
+ sourceSpan
8722
8723
  }, NEW_OP);
8723
8724
  }
8724
8725
  function createIcuStartOp(xref, message, messagePlaceholder, sourceSpan) {
@@ -8737,6 +8738,15 @@ function createIcuEndOp(xref) {
8737
8738
  xref
8738
8739
  }, NEW_OP);
8739
8740
  }
8741
+ function createIcuPlaceholderOp(xref, name, strings) {
8742
+ return __spreadValues({
8743
+ kind: OpKind.IcuPlaceholder,
8744
+ xref,
8745
+ name,
8746
+ strings,
8747
+ expressionPlaceholders: []
8748
+ }, NEW_OP);
8749
+ }
8740
8750
  function createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan) {
8741
8751
  if (i18nBlock === null && contextKind !== I18nContextKind.Attr) {
8742
8752
  throw new Error("AssertionError: i18nBlock must be provided for non-attribute contexts.");
@@ -8762,22 +8772,24 @@ function createI18nAttributesOp(xref, handle, target) {
8762
8772
  }, NEW_OP), TRAIT_CONSUMES_SLOT);
8763
8773
  }
8764
8774
 
8765
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8766
- function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, sourceSpan) {
8775
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8776
+ function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, securityContext, sourceSpan) {
8767
8777
  return __spreadValues(__spreadValues({
8768
8778
  kind: OpKind.HostProperty,
8769
8779
  name,
8770
8780
  expression,
8771
8781
  isAnimationTrigger,
8772
8782
  i18nContext,
8783
+ securityContext,
8784
+ sanitizer: null,
8773
8785
  sourceSpan
8774
8786
  }, TRAIT_CONSUMES_VARS), NEW_OP);
8775
8787
  }
8776
8788
 
8777
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8789
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8778
8790
  var CTX_REF = "CTX_REF_MARKER";
8779
8791
 
8780
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8792
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8781
8793
  var CompilationJobKind;
8782
8794
  (function(CompilationJobKind2) {
8783
8795
  CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
@@ -8884,7 +8896,7 @@ var HostBindingCompilationUnit = class extends CompilationUnit {
8884
8896
  }
8885
8897
  };
8886
8898
 
8887
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8899
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8888
8900
  function deleteAnyCasts(job) {
8889
8901
  for (const unit of job.units) {
8890
8902
  for (const op of unit.ops()) {
@@ -8902,7 +8914,7 @@ function removeAnys(e) {
8902
8914
  return e;
8903
8915
  }
8904
8916
 
8905
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8917
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8906
8918
  function applyI18nExpressions(job) {
8907
8919
  const i18nContexts = /* @__PURE__ */ new Map();
8908
8920
  for (const unit of job.units) {
@@ -8945,62 +8957,52 @@ function needsApplication(i18nContexts, op) {
8945
8957
  return false;
8946
8958
  }
8947
8959
 
8948
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8960
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8949
8961
  function assignI18nSlotDependencies(job) {
8950
- const i18nLastSlotConsumers = /* @__PURE__ */ new Map();
8951
- let lastSlotConsumer = null;
8952
- let currentI18nOp = null;
8953
8962
  for (const unit of job.units) {
8954
- for (const op of unit.create) {
8955
- if (hasConsumesSlotTrait(op)) {
8956
- lastSlotConsumer = op.xref;
8963
+ let updateOp = unit.update.head;
8964
+ let i18nExpressionsInProgress = [];
8965
+ let state = null;
8966
+ for (const createOp of unit.create) {
8967
+ if (createOp.kind === OpKind.I18nStart) {
8968
+ state = {
8969
+ blockXref: createOp.xref,
8970
+ lastSlotConsumer: createOp.xref
8971
+ };
8972
+ } else if (createOp.kind === OpKind.I18nEnd) {
8973
+ for (const op of i18nExpressionsInProgress) {
8974
+ op.target = state.lastSlotConsumer;
8975
+ OpList.insertBefore(op, updateOp);
8976
+ }
8977
+ i18nExpressionsInProgress.length = 0;
8978
+ state = null;
8957
8979
  }
8958
- switch (op.kind) {
8959
- case OpKind.I18nStart:
8960
- currentI18nOp = op;
8961
- break;
8962
- case OpKind.I18nEnd:
8963
- if (currentI18nOp === null) {
8964
- throw new Error("AssertionError: Expected an active I18n block while calculating last slot consumers");
8980
+ if (hasConsumesSlotTrait(createOp)) {
8981
+ if (state !== null) {
8982
+ state.lastSlotConsumer = createOp.xref;
8983
+ }
8984
+ while (true) {
8985
+ if (updateOp.next === null) {
8986
+ break;
8965
8987
  }
8966
- if (lastSlotConsumer === null) {
8967
- throw new Error("AssertionError: Expected a last slot consumer while calculating last slot consumers");
8988
+ if (state !== null && updateOp.kind === OpKind.I18nExpression && updateOp.usage === I18nExpressionFor.I18nText && updateOp.i18nOwner === state.blockXref) {
8989
+ const opToRemove = updateOp;
8990
+ updateOp = updateOp.next;
8991
+ OpList.remove(opToRemove);
8992
+ i18nExpressionsInProgress.push(opToRemove);
8993
+ continue;
8968
8994
  }
8969
- i18nLastSlotConsumers.set(currentI18nOp.xref, lastSlotConsumer);
8970
- currentI18nOp = null;
8971
- break;
8972
- }
8973
- }
8974
- let opsToMove = [];
8975
- let moveAfterTarget = null;
8976
- let previousTarget = null;
8977
- for (const op of unit.update) {
8978
- if (hasDependsOnSlotContextTrait(op)) {
8979
- if (moveAfterTarget !== null && previousTarget === moveAfterTarget && op.target !== previousTarget) {
8980
- OpList.insertBefore(opsToMove, op);
8981
- moveAfterTarget = null;
8982
- opsToMove = [];
8983
- }
8984
- previousTarget = op.target;
8985
- }
8986
- if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nText) {
8987
- OpList.remove(op);
8988
- opsToMove.push(op);
8989
- const target = i18nLastSlotConsumers.get(op.i18nOwner);
8990
- if (target === void 0) {
8991
- throw new Error("AssertionError: Expected to find a last slot consumer for an I18nExpressionOp");
8995
+ if (hasDependsOnSlotContextTrait(updateOp) && updateOp.target !== createOp.xref) {
8996
+ break;
8997
+ }
8998
+ updateOp = updateOp.next;
8992
8999
  }
8993
- op.target = target;
8994
- moveAfterTarget = op.target;
8995
9000
  }
8996
9001
  }
8997
- if (moveAfterTarget !== null) {
8998
- unit.update.push(opsToMove);
8999
- }
9000
9002
  }
9001
9003
  }
9002
9004
 
9003
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
9005
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
9004
9006
  function createOpXrefMap(unit) {
9005
9007
  const map = /* @__PURE__ */ new Map();
9006
9008
  for (const op of unit.create) {
@@ -9008,11 +9010,14 @@ function createOpXrefMap(unit) {
9008
9010
  continue;
9009
9011
  }
9010
9012
  map.set(op.xref, op);
9013
+ if (op.kind === OpKind.RepeaterCreate && op.emptyView !== null) {
9014
+ map.set(op.emptyView, op);
9015
+ }
9011
9016
  }
9012
9017
  return map;
9013
9018
  }
9014
9019
 
9015
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
9020
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
9016
9021
  function extractAttributes(job) {
9017
9022
  for (const unit of job.units) {
9018
9023
  const elements = createOpXrefMap(unit);
@@ -9024,26 +9029,56 @@ function extractAttributes(job) {
9024
9029
  case OpKind.Property:
9025
9030
  if (!op.isAnimationTrigger) {
9026
9031
  let bindingKind;
9027
- if (op.i18nContext !== null) {
9032
+ if (op.i18nMessage !== null && op.templateKind === null) {
9028
9033
  bindingKind = BindingKind.I18n;
9029
- } else if (op.isStructuralTemplate) {
9034
+ } else if (op.isStructuralTemplateAttribute) {
9030
9035
  bindingKind = BindingKind.Template;
9031
9036
  } else {
9032
9037
  bindingKind = BindingKind.Property;
9033
9038
  }
9034
- OpList.insertBefore(createExtractedAttributeOp(op.target, bindingKind, op.name, null, null), lookupElement(elements, op.target));
9039
+ OpList.insertBefore(
9040
+ createExtractedAttributeOp(
9041
+ op.target,
9042
+ bindingKind,
9043
+ op.name,
9044
+ null,
9045
+ null,
9046
+ null,
9047
+ op.securityContext
9048
+ ),
9049
+ lookupElement(elements, op.target)
9050
+ );
9035
9051
  }
9036
9052
  break;
9037
9053
  case OpKind.StyleProp:
9038
9054
  case OpKind.ClassProp:
9039
9055
  if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && op.expression instanceof EmptyExpr2) {
9040
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null, null), lookupElement(elements, op.target));
9056
+ OpList.insertBefore(createExtractedAttributeOp(
9057
+ op.target,
9058
+ BindingKind.Property,
9059
+ op.name,
9060
+ null,
9061
+ null,
9062
+ null,
9063
+ SecurityContext.STYLE
9064
+ ), lookupElement(elements, op.target));
9041
9065
  }
9042
9066
  break;
9043
9067
  case OpKind.Listener:
9044
9068
  if (!op.isAnimationListener) {
9045
- const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null, null);
9069
+ const extractedAttributeOp = createExtractedAttributeOp(
9070
+ op.target,
9071
+ BindingKind.Property,
9072
+ op.name,
9073
+ null,
9074
+ null,
9075
+ null,
9076
+ SecurityContext.NONE
9077
+ );
9046
9078
  if (job.kind === CompilationJobKind.Host) {
9079
+ if (job.compatibility) {
9080
+ break;
9081
+ }
9047
9082
  unit.create.push(extractedAttributeOp);
9048
9083
  } else {
9049
9084
  OpList.insertBefore(extractedAttributeOp, lookupElement(elements, op.target));
@@ -9065,18 +9100,12 @@ function extractAttributeOp(unit, op, elements) {
9065
9100
  if (op.expression instanceof Interpolation2) {
9066
9101
  return;
9067
9102
  }
9068
- let extractable = op.expression.isConstant();
9103
+ let extractable = op.isTextAttribute || op.expression.isConstant();
9069
9104
  if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
9070
- extractable = isStringLiteral(op.expression);
9071
- if (op.name === "style" || op.name === "class") {
9072
- extractable && (extractable = op.isTextAttribute);
9073
- }
9074
- if (unit.job.kind === CompilationJobKind.Host) {
9075
- extractable && (extractable = op.isTextAttribute);
9076
- }
9105
+ extractable && (extractable = op.isTextAttribute);
9077
9106
  }
9078
9107
  if (extractable) {
9079
- const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isStructuralTemplate ? BindingKind.Template : BindingKind.Attribute, op.name, op.expression, op.i18nContext);
9108
+ const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isStructuralTemplateAttribute ? BindingKind.Template : BindingKind.Attribute, op.name, op.expression, op.i18nContext, op.i18nMessage, op.securityContext);
9080
9109
  if (unit.job.kind === CompilationJobKind.Host) {
9081
9110
  unit.create.push(extractedAttributeOp);
9082
9111
  } else {
@@ -9087,7 +9116,7 @@ function extractAttributeOp(unit, op, elements) {
9087
9116
  }
9088
9117
  }
9089
9118
 
9090
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
9119
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
9091
9120
  function lookupElement2(elements, xref) {
9092
9121
  const el = elements.get(xref);
9093
9122
  if (el === void 0) {
@@ -9117,15 +9146,15 @@ function specializeBindings(job) {
9117
9146
  const target = lookupElement2(elements, op.target);
9118
9147
  target.nonBindable = true;
9119
9148
  } else {
9120
- OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.isStructuralTemplate, op.i18nContext, op.sourceSpan));
9149
+ OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.isStructuralTemplateAttribute, op.templateKind, op.i18nMessage, op.sourceSpan));
9121
9150
  }
9122
9151
  break;
9123
9152
  case BindingKind.Property:
9124
9153
  case BindingKind.Animation:
9125
9154
  if (job.kind === CompilationJobKind.Host) {
9126
- OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.i18nContext, op.sourceSpan));
9155
+ OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.i18nContext, op.securityContext, op.sourceSpan));
9127
9156
  } else {
9128
- OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isStructuralTemplate, op.i18nContext, op.sourceSpan));
9157
+ OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan));
9129
9158
  }
9130
9159
  break;
9131
9160
  case BindingKind.I18n:
@@ -9137,7 +9166,7 @@ function specializeBindings(job) {
9137
9166
  }
9138
9167
  }
9139
9168
 
9140
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
9169
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
9141
9170
  var CHAINABLE = /* @__PURE__ */ new Set([
9142
9171
  Identifiers.attribute,
9143
9172
  Identifiers.classProp,
@@ -9203,7 +9232,7 @@ function chainOperationsInList(opList) {
9203
9232
  }
9204
9233
  }
9205
9234
 
9206
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
9235
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
9207
9236
  function collapseSingletonInterpolations(job) {
9208
9237
  for (const unit of job.units) {
9209
9238
  for (const op of unit.update) {
@@ -9215,7 +9244,7 @@ function collapseSingletonInterpolations(job) {
9215
9244
  }
9216
9245
  }
9217
9246
 
9218
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
9247
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
9219
9248
  function generateConditionalExpressions(job) {
9220
9249
  for (const unit of job.units) {
9221
9250
  for (const op of unit.ops()) {
@@ -9252,7 +9281,7 @@ function generateConditionalExpressions(job) {
9252
9281
  }
9253
9282
  }
9254
9283
 
9255
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9284
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9256
9285
  var BINARY_OPERATORS = /* @__PURE__ */ new Map([
9257
9286
  ["&&", BinaryOperator.And],
9258
9287
  [">", BinaryOperator.Bigger],
@@ -9302,15 +9331,15 @@ function literalOrArrayLiteral(value) {
9302
9331
  return literal(value);
9303
9332
  }
9304
9333
 
9305
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9334
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9306
9335
  function collectElementConsts(job) {
9307
9336
  const allElementAttributes = /* @__PURE__ */ new Map();
9308
9337
  for (const unit of job.units) {
9309
9338
  for (const op of unit.create) {
9310
9339
  if (op.kind === OpKind.ExtractedAttribute) {
9311
- const attributes = allElementAttributes.get(op.target) || new ElementAttributes();
9340
+ const attributes = allElementAttributes.get(op.target) || new ElementAttributes(job.compatibility);
9312
9341
  allElementAttributes.set(op.target, attributes);
9313
- attributes.add(op.bindingKind, op.name, op.expression);
9342
+ attributes.add(op.bindingKind, op.name, op.expression, op.trustedValueFn);
9314
9343
  OpList.remove(op);
9315
9344
  }
9316
9345
  }
@@ -9318,14 +9347,19 @@ function collectElementConsts(job) {
9318
9347
  if (job instanceof ComponentCompilationJob) {
9319
9348
  for (const unit of job.units) {
9320
9349
  for (const op of unit.create) {
9321
- if (isElementOrContainerOp(op)) {
9350
+ if (op.kind == OpKind.Projection) {
9322
9351
  const attributes = allElementAttributes.get(op.xref);
9323
9352
  if (attributes !== void 0) {
9324
9353
  const attrArray = serializeAttributes(attributes);
9325
9354
  if (attrArray.entries.length > 0) {
9326
- op.attributes = job.addConst(attrArray);
9355
+ op.attributes = attrArray;
9327
9356
  }
9328
9357
  }
9358
+ } else if (isElementOrContainerOp(op)) {
9359
+ op.attributes = getConstIndex(job, allElementAttributes, op.xref);
9360
+ if (op.kind === OpKind.RepeaterCreate && op.emptyView !== null) {
9361
+ op.emptyAttributes = getConstIndex(job, allElementAttributes, op.emptyView);
9362
+ }
9329
9363
  }
9330
9364
  }
9331
9365
  }
@@ -9341,13 +9375,18 @@ function collectElementConsts(job) {
9341
9375
  }
9342
9376
  }
9343
9377
  }
9378
+ function getConstIndex(job, allElementAttributes, xref) {
9379
+ const attributes = allElementAttributes.get(xref);
9380
+ if (attributes !== void 0) {
9381
+ const attrArray = serializeAttributes(attributes);
9382
+ if (attrArray.entries.length > 0) {
9383
+ return job.addConst(attrArray);
9384
+ }
9385
+ }
9386
+ return null;
9387
+ }
9344
9388
  var FLYWEIGHT_ARRAY = Object.freeze([]);
9345
9389
  var ElementAttributes = class {
9346
- constructor() {
9347
- this.known = /* @__PURE__ */ new Set();
9348
- this.byKind = /* @__PURE__ */ new Map();
9349
- this.projectAs = null;
9350
- }
9351
9390
  get attributes() {
9352
9391
  var _a2;
9353
9392
  return (_a2 = this.byKind.get(BindingKind.Attribute)) != null ? _a2 : FLYWEIGHT_ARRAY;
@@ -9372,12 +9411,28 @@ var ElementAttributes = class {
9372
9411
  var _a2;
9373
9412
  return (_a2 = this.byKind.get(BindingKind.I18n)) != null ? _a2 : FLYWEIGHT_ARRAY;
9374
9413
  }
9375
- add(kind, name, value) {
9414
+ constructor(compatibility) {
9415
+ this.compatibility = compatibility;
9416
+ this.known = /* @__PURE__ */ new Map();
9417
+ this.byKind = /* @__PURE__ */ new Map();
9418
+ this.projectAs = null;
9419
+ }
9420
+ isKnown(kind, name, value) {
9421
+ var _a2;
9422
+ const nameToValue = (_a2 = this.known.get(kind)) != null ? _a2 : /* @__PURE__ */ new Set();
9423
+ this.known.set(kind, nameToValue);
9424
+ if (nameToValue.has(name)) {
9425
+ return true;
9426
+ }
9427
+ nameToValue.add(name);
9428
+ return false;
9429
+ }
9430
+ add(kind, name, value, trustedValueFn) {
9376
9431
  var _a2;
9377
- if (this.known.has(name)) {
9432
+ const allowDuplicates = this.compatibility === CompatibilityMode.TemplateDefinitionBuilder && (kind === BindingKind.Attribute || kind === BindingKind.ClassName || kind === BindingKind.StyleProperty);
9433
+ if (!allowDuplicates && this.isKnown(kind, name, value)) {
9378
9434
  return;
9379
9435
  }
9380
- this.known.add(name);
9381
9436
  if (name === "ngProjectAs") {
9382
9437
  if (value === null || !(value instanceof LiteralExpr) || value.value == null || typeof ((_a2 = value.value) == null ? void 0 : _a2.toString()) !== "string") {
9383
9438
  throw Error("ngProjectAs must have a string literal value");
@@ -9390,7 +9445,14 @@ var ElementAttributes = class {
9390
9445
  if (value === null) {
9391
9446
  throw Error("Attribute, i18n attribute, & style element attributes must have a value");
9392
9447
  }
9393
- array.push(value);
9448
+ if (trustedValueFn !== null) {
9449
+ if (!isStringLiteral(value)) {
9450
+ throw Error("AssertionError: extracted attribute value should be string literal");
9451
+ }
9452
+ array.push(taggedTemplate(trustedValueFn, new TemplateLiteral([new TemplateLiteralElement(value.value)], []), void 0, value.sourceSpan));
9453
+ } else {
9454
+ array.push(value);
9455
+ }
9394
9456
  }
9395
9457
  }
9396
9458
  arrayFor(kind) {
@@ -9401,7 +9463,7 @@ var ElementAttributes = class {
9401
9463
  }
9402
9464
  };
9403
9465
  function getAttributeNameLiterals(name) {
9404
- const [attributeNamespace, attributeName] = splitNsName(name);
9466
+ const [attributeNamespace, attributeName] = splitNsName(name, false);
9405
9467
  const nameLiteral = literal(attributeName);
9406
9468
  if (attributeNamespace) {
9407
9469
  return [
@@ -9436,7 +9498,7 @@ function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, proje
9436
9498
  return literalArr(attrArray);
9437
9499
  }
9438
9500
 
9439
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/convert_i18n_bindings.mjs
9501
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/convert_i18n_bindings.mjs
9440
9502
  function convertI18nBindings(job) {
9441
9503
  const i18nAttributesByElem = /* @__PURE__ */ new Map();
9442
9504
  for (const unit of job.units) {
@@ -9468,7 +9530,7 @@ function convertI18nBindings(job) {
9468
9530
  if (op.expression.i18nPlaceholders.length !== op.expression.expressions.length) {
9469
9531
  throw new Error(`AssertionError: An i18n attribute binding instruction requires the same number of expressions and placeholders, but found ${op.expression.i18nPlaceholders.length} placeholders and ${op.expression.expressions.length} expressions`);
9470
9532
  }
9471
- ops.push(createI18nExpressionOp(op.i18nContext, i18nAttributesForElem.target, i18nAttributesForElem.xref, i18nAttributesForElem.handle, expr, op.expression.i18nPlaceholders[i], I18nParamResolutionTime.Creation, I18nExpressionFor.I18nAttribute, op.name, op.sourceSpan));
9533
+ ops.push(createI18nExpressionOp(op.i18nContext, i18nAttributesForElem.target, i18nAttributesForElem.xref, i18nAttributesForElem.handle, expr, null, op.expression.i18nPlaceholders[i], I18nParamResolutionTime.Creation, I18nExpressionFor.I18nAttribute, op.name, op.sourceSpan));
9472
9534
  }
9473
9535
  OpList.replaceWithMany(op, ops);
9474
9536
  break;
@@ -9477,7 +9539,7 @@ function convertI18nBindings(job) {
9477
9539
  }
9478
9540
  }
9479
9541
 
9480
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
9542
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
9481
9543
  function createDeferDepsFns(job) {
9482
9544
  for (const unit of job.units) {
9483
9545
  for (const op of unit.create) {
@@ -9499,57 +9561,117 @@ function createDeferDepsFns(job) {
9499
9561
  if (op.handle.slot === null) {
9500
9562
  throw new Error("AssertionError: slot must be assigned bfore extracting defer deps functions");
9501
9563
  }
9502
- op.resolverFn = job.pool.getSharedFunctionReference(depsFnExpr, `${job.componentName}_Defer_${op.handle.slot}_DepsFn`);
9564
+ op.resolverFn = job.pool.getSharedFunctionReference(
9565
+ depsFnExpr,
9566
+ `${job.componentName}_Defer_${op.handle.slot}_DepsFn`,
9567
+ false
9568
+ );
9503
9569
  }
9504
9570
  }
9505
9571
  }
9506
9572
  }
9507
9573
 
9508
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
9574
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
9509
9575
  function createI18nContexts(job) {
9510
- const rootContexts = /* @__PURE__ */ new Map();
9511
- let currentI18nOp = null;
9512
- let xref;
9576
+ const attrContextByMessage = /* @__PURE__ */ new Map();
9577
+ for (const unit of job.units) {
9578
+ for (const op of unit.ops()) {
9579
+ switch (op.kind) {
9580
+ case OpKind.Binding:
9581
+ case OpKind.Property:
9582
+ case OpKind.Attribute:
9583
+ case OpKind.ExtractedAttribute:
9584
+ if (op.i18nMessage === null) {
9585
+ continue;
9586
+ }
9587
+ if (!attrContextByMessage.has(op.i18nMessage)) {
9588
+ const i18nContext = createI18nContextOp(I18nContextKind.Attr, job.allocateXrefId(), null, op.i18nMessage, null);
9589
+ unit.create.push(i18nContext);
9590
+ attrContextByMessage.set(op.i18nMessage, i18nContext.xref);
9591
+ }
9592
+ op.i18nContext = attrContextByMessage.get(op.i18nMessage);
9593
+ break;
9594
+ }
9595
+ }
9596
+ }
9597
+ const blockContextByI18nBlock = /* @__PURE__ */ new Map();
9513
9598
  for (const unit of job.units) {
9514
9599
  for (const op of unit.create) {
9515
9600
  switch (op.kind) {
9516
9601
  case OpKind.I18nStart:
9517
- currentI18nOp = op;
9518
9602
  if (op.xref === op.root) {
9519
- xref = job.allocateXrefId();
9520
- unit.create.push(createI18nContextOp(I18nContextKind.RootI18n, xref, op.xref, op.message, null));
9521
- op.context = xref;
9522
- rootContexts.set(op.xref, xref);
9603
+ const contextOp = createI18nContextOp(I18nContextKind.RootI18n, job.allocateXrefId(), op.xref, op.message, null);
9604
+ unit.create.push(contextOp);
9605
+ op.context = contextOp.xref;
9606
+ blockContextByI18nBlock.set(op.xref, contextOp);
9523
9607
  }
9524
9608
  break;
9609
+ }
9610
+ }
9611
+ }
9612
+ for (const unit of job.units) {
9613
+ for (const op of unit.create) {
9614
+ if (op.kind === OpKind.I18nStart && op.xref !== op.root) {
9615
+ const rootContext = blockContextByI18nBlock.get(op.root);
9616
+ if (rootContext === void 0) {
9617
+ throw Error("AssertionError: Root i18n block i18n context should have been created.");
9618
+ }
9619
+ op.context = rootContext.xref;
9620
+ blockContextByI18nBlock.set(op.xref, rootContext);
9621
+ }
9622
+ }
9623
+ }
9624
+ let currentI18nOp = null;
9625
+ for (const unit of job.units) {
9626
+ for (const op of unit.create) {
9627
+ switch (op.kind) {
9628
+ case OpKind.I18nStart:
9629
+ currentI18nOp = op;
9630
+ break;
9525
9631
  case OpKind.I18nEnd:
9526
9632
  currentI18nOp = null;
9527
9633
  break;
9528
9634
  case OpKind.IcuStart:
9529
9635
  if (currentI18nOp === null) {
9530
- throw Error("Unexpected ICU outside of an i18n block.");
9636
+ throw Error("AssertionError: Unexpected ICU outside of an i18n block.");
9531
9637
  }
9532
9638
  if (op.message.id !== currentI18nOp.message.id) {
9533
- xref = job.allocateXrefId();
9534
- unit.create.push(createI18nContextOp(I18nContextKind.Icu, xref, currentI18nOp.xref, op.message, null));
9535
- op.context = xref;
9639
+ const contextOp = createI18nContextOp(I18nContextKind.Icu, job.allocateXrefId(), currentI18nOp.xref, op.message, null);
9640
+ unit.create.push(contextOp);
9641
+ op.context = contextOp.xref;
9536
9642
  } else {
9537
9643
  op.context = currentI18nOp.context;
9644
+ blockContextByI18nBlock.get(currentI18nOp.xref).contextKind = I18nContextKind.Icu;
9538
9645
  }
9539
9646
  break;
9540
9647
  }
9541
9648
  }
9542
9649
  }
9650
+ }
9651
+
9652
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/deduplicate_text_bindings.mjs
9653
+ function deduplicateTextBindings(job) {
9654
+ const seen = /* @__PURE__ */ new Map();
9543
9655
  for (const unit of job.units) {
9544
- for (const op of unit.create) {
9545
- if (op.kind === OpKind.I18nStart && op.xref !== op.root) {
9546
- op.context = rootContexts.get(op.root);
9656
+ for (const op of unit.update.reversed()) {
9657
+ if (op.kind === OpKind.Binding && op.isTextAttribute) {
9658
+ const seenForElement = seen.get(op.target) || /* @__PURE__ */ new Set();
9659
+ if (seenForElement.has(op.name)) {
9660
+ if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
9661
+ if (op.name === "style" || op.name === "class") {
9662
+ OpList.remove(op);
9663
+ }
9664
+ } else {
9665
+ }
9666
+ }
9667
+ seenForElement.add(op.name);
9668
+ seen.set(op.target, seenForElement);
9547
9669
  }
9548
9670
  }
9549
9671
  }
9550
9672
  }
9551
9673
 
9552
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
9674
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
9553
9675
  function configureDeferInstructions(job) {
9554
9676
  for (const unit of job.units) {
9555
9677
  for (const op of unit.create) {
@@ -9566,7 +9688,7 @@ function configureDeferInstructions(job) {
9566
9688
  }
9567
9689
  }
9568
9690
 
9569
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
9691
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
9570
9692
  function resolveDeferTargetNames(job) {
9571
9693
  const scopes = /* @__PURE__ */ new Map();
9572
9694
  function getScopeForView2(view) {
@@ -9660,7 +9782,7 @@ var Scope = class {
9660
9782
  }
9661
9783
  };
9662
9784
 
9663
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9785
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9664
9786
  var REPLACEMENTS = /* @__PURE__ */ new Map([
9665
9787
  [OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
9666
9788
  [OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
@@ -9687,7 +9809,7 @@ function collapseEmptyInstructions(job) {
9687
9809
  }
9688
9810
  }
9689
9811
 
9690
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9812
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9691
9813
  function expandSafeReads(job) {
9692
9814
  for (const unit of job.units) {
9693
9815
  for (const op of unit.ops()) {
@@ -9823,7 +9945,7 @@ function ternaryTransform(e) {
9823
9945
  return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr);
9824
9946
  }
9825
9947
 
9826
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
9948
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
9827
9949
  var ESCAPE = "\uFFFD";
9828
9950
  var ELEMENT_MARKER = "#";
9829
9951
  var TEMPLATE_MARKER = "*";
@@ -9833,12 +9955,16 @@ var LIST_START_MARKER = "[";
9833
9955
  var LIST_END_MARKER = "]";
9834
9956
  var LIST_DELIMITER = "|";
9835
9957
  function extractI18nMessages(job) {
9836
- const i18nContexts = /* @__PURE__ */ new Map();
9958
+ const i18nMessagesByContext = /* @__PURE__ */ new Map();
9837
9959
  const i18nBlocks = /* @__PURE__ */ new Map();
9960
+ const i18nContexts = /* @__PURE__ */ new Map();
9838
9961
  for (const unit of job.units) {
9839
9962
  for (const op of unit.create) {
9840
9963
  switch (op.kind) {
9841
9964
  case OpKind.I18nContext:
9965
+ const i18nMessageOp = createI18nMessage(job, op);
9966
+ unit.create.push(i18nMessageOp);
9967
+ i18nMessagesByContext.set(op.xref, i18nMessageOp);
9842
9968
  i18nContexts.set(op.xref, op);
9843
9969
  break;
9844
9970
  case OpKind.I18nStart:
@@ -9847,49 +9973,40 @@ function extractI18nMessages(job) {
9847
9973
  }
9848
9974
  }
9849
9975
  }
9850
- for (const unit of job.units) {
9851
- for (const op of unit.create) {
9852
- if (op.kind !== OpKind.I18nContext || op.contextKind !== I18nContextKind.Attr) {
9853
- continue;
9854
- }
9855
- const i18nMessageOp = createI18nMessage(job, op);
9856
- unit.create.push(i18nMessageOp);
9857
- }
9858
- }
9859
- const i18nBlockMessages = /* @__PURE__ */ new Map();
9860
- for (const unit of job.units) {
9861
- for (const op of unit.create) {
9862
- if (op.kind === OpKind.I18nStart && op.xref === op.root) {
9863
- if (!op.context) {
9864
- throw Error("I18n start op should have its context set.");
9865
- }
9866
- const i18nMessageOp = createI18nMessage(job, i18nContexts.get(op.context));
9867
- i18nBlockMessages.set(op.xref, i18nMessageOp);
9868
- unit.create.push(i18nMessageOp);
9869
- }
9870
- }
9871
- }
9976
+ let currentIcu = null;
9872
9977
  for (const unit of job.units) {
9873
9978
  for (const op of unit.create) {
9874
9979
  switch (op.kind) {
9875
9980
  case OpKind.IcuStart:
9876
- if (!op.context) {
9877
- throw Error("ICU op should have its context set.");
9981
+ currentIcu = op;
9982
+ OpList.remove(op);
9983
+ const icuContext = i18nContexts.get(op.context);
9984
+ if (icuContext.contextKind !== I18nContextKind.Icu) {
9985
+ continue;
9878
9986
  }
9879
- const i18nContext = i18nContexts.get(op.context);
9880
- if (i18nContext.contextKind === I18nContextKind.Icu) {
9881
- if (i18nContext.i18nBlock === null) {
9882
- throw Error("ICU context should have its i18n block set.");
9883
- }
9884
- const subMessage = createI18nMessage(job, i18nContext, op.messagePlaceholder);
9885
- unit.create.push(subMessage);
9886
- const rootI18nId = i18nBlocks.get(i18nContext.i18nBlock).root;
9887
- const parentMessage = i18nBlockMessages.get(rootI18nId);
9888
- parentMessage == null ? void 0 : parentMessage.subMessages.push(subMessage.xref);
9987
+ const i18nBlock = i18nBlocks.get(icuContext.i18nBlock);
9988
+ if (i18nBlock.context === icuContext.xref) {
9989
+ continue;
9889
9990
  }
9890
- OpList.remove(op);
9991
+ const rootI18nBlock = i18nBlocks.get(i18nBlock.root);
9992
+ const rootMessage = i18nMessagesByContext.get(rootI18nBlock.context);
9993
+ if (rootMessage === void 0) {
9994
+ throw Error("AssertionError: ICU sub-message should belong to a root message.");
9995
+ }
9996
+ const subMessage = i18nMessagesByContext.get(icuContext.xref);
9997
+ subMessage.messagePlaceholder = op.messagePlaceholder;
9998
+ rootMessage.subMessages.push(subMessage.xref);
9891
9999
  break;
9892
10000
  case OpKind.IcuEnd:
10001
+ currentIcu = null;
10002
+ OpList.remove(op);
10003
+ break;
10004
+ case OpKind.IcuPlaceholder:
10005
+ if (currentIcu === null || currentIcu.context == null) {
10006
+ throw Error("AssertionError: Unexpected ICU placeholder outside of i18n context");
10007
+ }
10008
+ const msg = i18nMessagesByContext.get(currentIcu.context);
10009
+ msg.postprocessingParams.set(op.name, literal(formatIcuPlaceholder(op)));
9893
10010
  OpList.remove(op);
9894
10011
  break;
9895
10012
  }
@@ -9899,14 +10016,16 @@ function extractI18nMessages(job) {
9899
10016
  function createI18nMessage(job, context, messagePlaceholder) {
9900
10017
  let formattedParams = formatParams(context.params);
9901
10018
  const formattedPostprocessingParams = formatParams(context.postprocessingParams);
9902
- let needsPostprocessing = formattedPostprocessingParams.size > 0;
9903
- for (const values of context.params.values()) {
9904
- if (values.length > 1) {
9905
- needsPostprocessing = true;
9906
- }
9907
- }
10019
+ let needsPostprocessing = [...context.params.values()].some((v) => v.length > 1);
9908
10020
  return createI18nMessageOp(job.allocateXrefId(), context.xref, context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null, formattedParams, formattedPostprocessingParams, needsPostprocessing);
9909
10021
  }
10022
+ function formatIcuPlaceholder(op) {
10023
+ if (op.strings.length !== op.expressionPlaceholders.length + 1) {
10024
+ throw Error(`AsserionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`);
10025
+ }
10026
+ const values = op.expressionPlaceholders.map(formatValue);
10027
+ return op.strings.flatMap((str, i) => [str, values[i] || ""]).join("");
10028
+ }
9910
10029
  function formatParams(params) {
9911
10030
  const formattedParams = /* @__PURE__ */ new Map();
9912
10031
  for (const [placeholder, placeholderValues] of params) {
@@ -9962,7 +10081,7 @@ function formatValue(value) {
9962
10081
  return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
9963
10082
  }
9964
10083
 
9965
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
10084
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9966
10085
  function generateAdvance(job) {
9967
10086
  for (const unit of job.units) {
9968
10087
  const slotMap = /* @__PURE__ */ new Map();
@@ -9994,7 +10113,7 @@ function generateAdvance(job) {
9994
10113
  }
9995
10114
  }
9996
10115
 
9997
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
10116
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9998
10117
  function generateProjectionDefs(job) {
9999
10118
  const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
10000
10119
  const selectors = [];
@@ -10018,7 +10137,7 @@ function generateProjectionDefs(job) {
10018
10137
  }
10019
10138
  }
10020
10139
 
10021
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
10140
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
10022
10141
  function generateVariables(job) {
10023
10142
  recursivelyProcessView(job.root, null);
10024
10143
  }
@@ -10027,8 +10146,13 @@ function recursivelyProcessView(view, parentScope) {
10027
10146
  for (const op of view.create) {
10028
10147
  switch (op.kind) {
10029
10148
  case OpKind.Template:
10149
+ recursivelyProcessView(view.job.views.get(op.xref), scope);
10150
+ break;
10030
10151
  case OpKind.RepeaterCreate:
10031
10152
  recursivelyProcessView(view.job.views.get(op.xref), scope);
10153
+ if (op.emptyView) {
10154
+ recursivelyProcessView(view.job.views.get(op.emptyView), scope);
10155
+ }
10032
10156
  break;
10033
10157
  case OpKind.Listener:
10034
10158
  op.handlerOps.prepend(generateVariablesInScopeForView(view, scope));
@@ -10106,7 +10230,7 @@ function generateVariablesInScopeForView(view, scope) {
10106
10230
  return newOps;
10107
10231
  }
10108
10232
 
10109
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
10233
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
10110
10234
  function collectConstExpressions(job) {
10111
10235
  for (const unit of job.units) {
10112
10236
  for (const op of unit.ops()) {
@@ -10120,7 +10244,7 @@ function collectConstExpressions(job) {
10120
10244
  }
10121
10245
  }
10122
10246
 
10123
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
10247
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
10124
10248
  var STYLE_DOT = "style.";
10125
10249
  var CLASS_DOT = "class.";
10126
10250
  var STYLE_BANG = "style!";
@@ -10128,7 +10252,7 @@ var CLASS_BANG = "class!";
10128
10252
  var BANG_IMPORTANT = "!important";
10129
10253
  function parseHostStyleProperties(job) {
10130
10254
  for (const op of job.root.update) {
10131
- if (op.kind !== OpKind.Binding) {
10255
+ if (!(op.kind === OpKind.Binding && op.bindingKind === BindingKind.Property)) {
10132
10256
  continue;
10133
10257
  }
10134
10258
  if (op.name.endsWith(BANG_IMPORTANT)) {
@@ -10178,7 +10302,7 @@ function parseProperty(name) {
10178
10302
  return { property: property2, suffix };
10179
10303
  }
10180
10304
 
10181
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/map_util.mjs
10305
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/map_util.mjs
10182
10306
  function mapLiteral(obj, quoted = false) {
10183
10307
  return literalMap(Object.keys(obj).map((key) => ({
10184
10308
  key,
@@ -10187,7 +10311,7 @@ function mapLiteral(obj, quoted = false) {
10187
10311
  })));
10188
10312
  }
10189
10313
 
10190
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
10314
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
10191
10315
  var IcuSerializerVisitor = class {
10192
10316
  visitText(text2) {
10193
10317
  return text2.value;
@@ -10221,7 +10345,7 @@ function serializeIcuNode(icu) {
10221
10345
  return icu.visit(serializer);
10222
10346
  }
10223
10347
 
10224
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
10348
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
10225
10349
  var TokenType;
10226
10350
  (function(TokenType2) {
10227
10351
  TokenType2[TokenType2["Character"] = 0] = "Character";
@@ -10582,7 +10706,7 @@ function parseIntAutoRadix(text2) {
10582
10706
  return result;
10583
10707
  }
10584
10708
 
10585
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10709
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10586
10710
  var SplitInterpolation = class {
10587
10711
  constructor(strings, expressions, offsets) {
10588
10712
  this.strings = strings;
@@ -11476,7 +11600,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
11476
11600
  return offsetMap;
11477
11601
  }
11478
11602
 
11479
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
11603
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
11480
11604
  var NodeWithI18n = class {
11481
11605
  constructor(sourceSpan, i18n2) {
11482
11606
  this.sourceSpan = sourceSpan;
@@ -11628,11 +11752,11 @@ var RecursiveVisitor = class {
11628
11752
  }
11629
11753
  };
11630
11754
 
11631
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11755
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11632
11756
  var ElementSchemaRegistry = class {
11633
11757
  };
11634
11758
 
11635
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11759
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11636
11760
  var BOOLEAN = "boolean";
11637
11761
  var NUMBER = "number";
11638
11762
  var STRING = "string";
@@ -11985,7 +12109,7 @@ function _isPixelDimensionStyle(prop) {
11985
12109
  }
11986
12110
  }
11987
12111
 
11988
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
12112
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11989
12113
  var HtmlTagDefinition = class {
11990
12114
  constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
11991
12115
  this.closedByChildren = {};
@@ -12103,7 +12227,7 @@ function getHtmlTagDefinition(tagName) {
12103
12227
  return (_b2 = (_a2 = TAG_DEFINITIONS[tagName]) != null ? _a2 : TAG_DEFINITIONS[tagName.toLowerCase()]) != null ? _b2 : DEFAULT_TAG_DEFINITION;
12104
12228
  }
12105
12229
 
12106
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
12230
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
12107
12231
  var TAG_TO_PLACEHOLDER_NAMES = {
12108
12232
  "A": "LINK",
12109
12233
  "B": "BOLD_TEXT",
@@ -12225,7 +12349,7 @@ var PlaceholderRegistry = class {
12225
12349
  }
12226
12350
  };
12227
12351
 
12228
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
12352
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
12229
12353
  var _expParser = new Parser(new Lexer());
12230
12354
  function createI18nMessageFactory(interpolationConfig, containerBlocks) {
12231
12355
  const visitor = new _I18nVisitor(_expParser, interpolationConfig, containerBlocks);
@@ -12404,14 +12528,14 @@ function extractPlaceholderName(input) {
12404
12528
  return input.split(_CUSTOM_PH_EXP)[2];
12405
12529
  }
12406
12530
 
12407
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
12531
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
12408
12532
  var I18nError = class extends ParseError {
12409
12533
  constructor(span, msg) {
12410
12534
  super(span, msg);
12411
12535
  }
12412
12536
  };
12413
12537
 
12414
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
12538
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
12415
12539
  var NAMED_ENTITIES = {
12416
12540
  "AElig": "\xC6",
12417
12541
  "AMP": "&",
@@ -14542,7 +14666,7 @@ var NAMED_ENTITIES = {
14542
14666
  var NGSP_UNICODE = "\uE500";
14543
14667
  NAMED_ENTITIES["ngsp"] = NGSP_UNICODE;
14544
14668
 
14545
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
14669
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
14546
14670
  var TokenError = class extends ParseError {
14547
14671
  constructor(errorMsg, tokenType, span) {
14548
14672
  super(span, errorMsg);
@@ -15463,7 +15587,7 @@ var CursorError = class {
15463
15587
  }
15464
15588
  };
15465
15589
 
15466
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
15590
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
15467
15591
  var TreeError = class extends ParseError {
15468
15592
  static create(elementName, span, msg) {
15469
15593
  return new TreeError(elementName, span, msg);
@@ -15847,7 +15971,7 @@ function decodeEntity(match, entity) {
15847
15971
  return match;
15848
15972
  }
15849
15973
 
15850
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15974
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15851
15975
  var TRUSTED_TYPES_SINKS = /* @__PURE__ */ new Set([
15852
15976
  "iframe|srcdoc",
15853
15977
  "*|innerhtml",
@@ -15862,7 +15986,7 @@ function isTrustedTypesSink(tagName, propName) {
15862
15986
  return TRUSTED_TYPES_SINKS.has(tagName + "|" + propName) || TRUSTED_TYPES_SINKS.has("*|" + propName);
15863
15987
  }
15864
15988
 
15865
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15989
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15866
15990
  var setI18nRefs = (htmlNode, i18nNode) => {
15867
15991
  if (htmlNode instanceof NodeWithI18n) {
15868
15992
  if (i18nNode instanceof IcuPlaceholder && htmlNode.i18n instanceof Message) {
@@ -16019,7 +16143,7 @@ function i18nMetaToJSDoc(meta) {
16019
16143
  return jsDocComment(tags);
16020
16144
  }
16021
16145
 
16022
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
16146
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
16023
16147
  var GOOG_GET_MSG = "goog.getMsg";
16024
16148
  function createGoogleGetMsgStatements(variable2, message, closureVar, placeholderValues) {
16025
16149
  const messageString = serializeI18nMessageForGetMsg(message);
@@ -16070,7 +16194,7 @@ function serializeI18nMessageForGetMsg(message) {
16070
16194
  return message.nodes.map((node) => node.visit(serializerVisitor2, null)).join("");
16071
16195
  }
16072
16196
 
16073
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
16197
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
16074
16198
  function createLocalizeStatements(variable2, message, params) {
16075
16199
  const { messageParts, placeHolders } = serializeI18nMessageForLocalize(message);
16076
16200
  const sourceSpan = getSourceSpan(message);
@@ -16159,13 +16283,13 @@ function createEmptyMessagePart(location) {
16159
16283
  return new LiteralPiece("", new ParseSourceSpan(location, location));
16160
16284
  }
16161
16285
 
16162
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
16286
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
16163
16287
  var NG_I18N_CLOSURE_MODE = "ngI18nClosureMode";
16164
16288
  var TRANSLATION_VAR_PREFIX2 = "i18n_";
16165
16289
  var I18N_ICU_MAPPING_PREFIX2 = "I18N_EXP_";
16166
16290
  var ESCAPE2 = "\uFFFD";
16167
16291
  function collectI18nConsts(job) {
16168
- var _a2;
16292
+ var _a2, _b2;
16169
16293
  const fileBasedI18nSuffix = job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, "_").toUpperCase() + "_";
16170
16294
  const extractedAttributesByI18nContext = /* @__PURE__ */ new Map();
16171
16295
  const i18nAttributesByElement = /* @__PURE__ */ new Map();
@@ -16174,11 +16298,13 @@ function collectI18nConsts(job) {
16174
16298
  for (const unit of job.units) {
16175
16299
  for (const op of unit.ops()) {
16176
16300
  if (op.kind === OpKind.ExtractedAttribute && op.i18nContext !== null) {
16177
- extractedAttributesByI18nContext.set(op.i18nContext, op);
16301
+ const attributes = (_a2 = extractedAttributesByI18nContext.get(op.i18nContext)) != null ? _a2 : [];
16302
+ attributes.push(op);
16303
+ extractedAttributesByI18nContext.set(op.i18nContext, attributes);
16178
16304
  } else if (op.kind === OpKind.I18nAttributes) {
16179
16305
  i18nAttributesByElement.set(op.target, op);
16180
16306
  } else if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nAttribute) {
16181
- const expressions = (_a2 = i18nExpressionsByElement.get(op.target)) != null ? _a2 : [];
16307
+ const expressions = (_b2 = i18nExpressionsByElement.get(op.target)) != null ? _b2 : [];
16182
16308
  expressions.push(op);
16183
16309
  i18nExpressionsByElement.set(op.target, expressions);
16184
16310
  } else if (op.kind === OpKind.I18nMessage) {
@@ -16199,9 +16325,11 @@ function collectI18nConsts(job) {
16199
16325
  } else {
16200
16326
  job.constsInitializers.push(...statements);
16201
16327
  i18nValuesByContext.set(op.i18nContext, mainVar);
16202
- const attributeForMessage = extractedAttributesByI18nContext.get(op.i18nContext);
16203
- if (attributeForMessage !== void 0) {
16204
- attributeForMessage.expression = mainVar;
16328
+ const attributesForMessage = extractedAttributesByI18nContext.get(op.i18nContext);
16329
+ if (attributesForMessage !== void 0) {
16330
+ for (const attr of attributesForMessage) {
16331
+ attr.expression = mainVar.clone();
16332
+ }
16205
16333
  }
16206
16334
  }
16207
16335
  }
@@ -16266,7 +16394,7 @@ function collectMessage(job, fileBasedI18nSuffix, messages, messageOp) {
16266
16394
  const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX2));
16267
16395
  const closureVar = i18nGenerateClosureVar(job.pool, messageOp.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
16268
16396
  let transformFn = void 0;
16269
- if (messageOp.needsPostprocessing) {
16397
+ if (messageOp.needsPostprocessing || messageOp.postprocessingParams.size > 0) {
16270
16398
  const postprocessingParams = Object.fromEntries([...messageOp.postprocessingParams.entries()].sort());
16271
16399
  const formattedPostprocessingParams = formatI18nPlaceholderNamesInMap(postprocessingParams, false);
16272
16400
  const extraTransformFnParams = [];
@@ -16285,7 +16413,6 @@ function addSubMessageParams(messageOp, subMessagePlaceholders) {
16285
16413
  } else {
16286
16414
  messageOp.params.set(placeholder, literal(`${ESCAPE2}${I18N_ICU_MAPPING_PREFIX2}${placeholder}${ESCAPE2}`));
16287
16415
  messageOp.postprocessingParams.set(placeholder, literalArr(subMessages));
16288
- messageOp.needsPostprocessing = true;
16289
16416
  }
16290
16417
  }
16291
16418
  }
@@ -16317,14 +16444,15 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
16317
16444
  return variable(name);
16318
16445
  }
16319
16446
 
16320
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
16447
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
16321
16448
  function convertI18nText(job) {
16322
- var _a2;
16449
+ var _a2, _b2, _c2;
16323
16450
  for (const unit of job.units) {
16324
16451
  let currentI18n = null;
16325
16452
  let currentIcu = null;
16326
16453
  const textNodeI18nBlocks = /* @__PURE__ */ new Map();
16327
16454
  const textNodeIcus = /* @__PURE__ */ new Map();
16455
+ const icuPlaceholderByText = /* @__PURE__ */ new Map();
16328
16456
  for (const op of unit.create) {
16329
16457
  switch (op.kind) {
16330
16458
  case OpKind.I18nStart:
@@ -16349,7 +16477,13 @@ function convertI18nText(job) {
16349
16477
  if (currentI18n !== null) {
16350
16478
  textNodeI18nBlocks.set(op.xref, currentI18n);
16351
16479
  textNodeIcus.set(op.xref, currentIcu);
16352
- OpList.remove(op);
16480
+ if (op.icuPlaceholder !== null) {
16481
+ const icuPlaceholderOp = createIcuPlaceholderOp(job.allocateXrefId(), op.icuPlaceholder, [op.initialValue]);
16482
+ OpList.replace(op, icuPlaceholderOp);
16483
+ icuPlaceholderByText.set(op.xref, icuPlaceholderOp);
16484
+ } else {
16485
+ OpList.remove(op);
16486
+ }
16353
16487
  }
16354
16488
  break;
16355
16489
  }
@@ -16362,21 +16496,25 @@ function convertI18nText(job) {
16362
16496
  }
16363
16497
  const i18nOp = textNodeI18nBlocks.get(op.target);
16364
16498
  const icuOp = textNodeIcus.get(op.target);
16499
+ const icuPlaceholder = icuPlaceholderByText.get(op.target);
16365
16500
  const contextId = icuOp ? icuOp.context : i18nOp.context;
16366
16501
  const resolutionTime = icuOp ? I18nParamResolutionTime.Postproccessing : I18nParamResolutionTime.Creation;
16367
16502
  const ops = [];
16368
16503
  for (let i = 0; i < op.interpolation.expressions.length; i++) {
16369
16504
  const expr = op.interpolation.expressions[i];
16370
- ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.xref, i18nOp.handle, expr, op.interpolation.i18nPlaceholders[i], resolutionTime, I18nExpressionFor.I18nText, "", (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
16505
+ ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.xref, i18nOp.handle, expr, (_a2 = icuPlaceholder == null ? void 0 : icuPlaceholder.xref) != null ? _a2 : null, (_b2 = op.interpolation.i18nPlaceholders[i]) != null ? _b2 : null, resolutionTime, I18nExpressionFor.I18nText, "", (_c2 = expr.sourceSpan) != null ? _c2 : op.sourceSpan));
16371
16506
  }
16372
16507
  OpList.replaceWithMany(op, ops);
16508
+ if (icuPlaceholder !== void 0) {
16509
+ icuPlaceholder.strings = op.interpolation.strings;
16510
+ }
16373
16511
  break;
16374
16512
  }
16375
16513
  }
16376
16514
  }
16377
16515
  }
16378
16516
 
16379
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
16517
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
16380
16518
  function liftLocalRefs(job) {
16381
16519
  for (const unit of job.units) {
16382
16520
  for (const op of unit.create) {
@@ -16406,7 +16544,7 @@ function serializeLocalRefs(refs) {
16406
16544
  return literalArr(constRefs);
16407
16545
  }
16408
16546
 
16409
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
16547
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
16410
16548
  function emitNamespaceChanges(job) {
16411
16549
  for (const unit of job.units) {
16412
16550
  let activeNamespace = Namespace.HTML;
@@ -16422,7 +16560,7 @@ function emitNamespaceChanges(job) {
16422
16560
  }
16423
16561
  }
16424
16562
 
16425
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
16563
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
16426
16564
  function parse(value) {
16427
16565
  const styles = [];
16428
16566
  let i = 0;
@@ -16483,7 +16621,7 @@ function hyphenate2(value) {
16483
16621
  }).toLowerCase();
16484
16622
  }
16485
16623
 
16486
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
16624
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
16487
16625
  function nameFunctionsAndVariables(job) {
16488
16626
  addNamesToView(job.root, job.componentName, { index: 0 }, job.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
16489
16627
  }
@@ -16520,7 +16658,7 @@ function addNamesToView(unit, baseName, state, compatibility) {
16520
16658
  op.handlerFnName = sanitizeIdentifier(op.handlerFnName);
16521
16659
  break;
16522
16660
  case OpKind.Variable:
16523
- varNames.set(op.xref, getVariableName(op.variable, state));
16661
+ varNames.set(op.xref, getVariableName(unit, op.variable, state));
16524
16662
  break;
16525
16663
  case OpKind.RepeaterCreate:
16526
16664
  if (!(unit instanceof ViewCompilationUnit)) {
@@ -16571,14 +16709,19 @@ function addNamesToView(unit, baseName, state, compatibility) {
16571
16709
  });
16572
16710
  }
16573
16711
  }
16574
- function getVariableName(variable2, state) {
16712
+ function getVariableName(unit, variable2, state) {
16575
16713
  if (variable2.name === null) {
16576
16714
  switch (variable2.kind) {
16577
16715
  case SemanticVariableKind.Context:
16578
16716
  variable2.name = `ctx_r${state.index++}`;
16579
16717
  break;
16580
16718
  case SemanticVariableKind.Identifier:
16581
- variable2.name = `${variable2.identifier}_r${++state.index}`;
16719
+ if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
16720
+ const compatPrefix = variable2.identifier === "ctx" ? "i" : "";
16721
+ variable2.name = `${variable2.identifier}_${compatPrefix}r${++state.index}`;
16722
+ } else {
16723
+ variable2.name = `${variable2.identifier}_i${state.index++}`;
16724
+ }
16582
16725
  break;
16583
16726
  default:
16584
16727
  variable2.name = `_r${++state.index}`;
@@ -16598,7 +16741,7 @@ function stripImportant(name) {
16598
16741
  return name;
16599
16742
  }
16600
16743
 
16601
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
16744
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
16602
16745
  function mergeNextContextExpressions(job) {
16603
16746
  for (const unit of job.units) {
16604
16747
  for (const op of unit.create) {
@@ -16644,7 +16787,7 @@ function mergeNextContextsInOps(ops) {
16644
16787
  }
16645
16788
  }
16646
16789
 
16647
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
16790
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
16648
16791
  var CONTAINER_TAG = "ng-container";
16649
16792
  function generateNgContainerOps(job) {
16650
16793
  for (const unit of job.units) {
@@ -16661,7 +16804,7 @@ function generateNgContainerOps(job) {
16661
16804
  }
16662
16805
  }
16663
16806
 
16664
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
16807
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
16665
16808
  function lookupElement3(elements, xref) {
16666
16809
  const el = elements.get(xref);
16667
16810
  if (el === void 0) {
@@ -16691,7 +16834,7 @@ function disableBindings(job) {
16691
16834
  }
16692
16835
  }
16693
16836
 
16694
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16837
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16695
16838
  function generateNullishCoalesceExpressions(job) {
16696
16839
  for (const unit of job.units) {
16697
16840
  for (const op of unit.ops()) {
@@ -16707,7 +16850,7 @@ function generateNullishCoalesceExpressions(job) {
16707
16850
  }
16708
16851
  }
16709
16852
 
16710
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16853
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16711
16854
  function kindTest(kind) {
16712
16855
  return (op) => op.kind === kind;
16713
16856
  }
@@ -16721,17 +16864,24 @@ var CREATE_ORDERING = [
16721
16864
  { test: (op) => op.kind === OpKind.Listener && !(op.hostListener && op.isAnimationListener) }
16722
16865
  ];
16723
16866
  var UPDATE_ORDERING = [
16724
- { test: kindWithInterpolationTest(OpKind.HostProperty, true) },
16725
- { test: kindWithInterpolationTest(OpKind.HostProperty, false) },
16726
16867
  { test: kindTest(OpKind.StyleMap), transform: keepLast },
16727
16868
  { test: kindTest(OpKind.ClassMap), transform: keepLast },
16728
16869
  { test: kindTest(OpKind.StyleProp) },
16729
16870
  { test: kindTest(OpKind.ClassProp) },
16730
- { test: kindWithInterpolationTest(OpKind.Property, true) },
16731
16871
  { test: kindWithInterpolationTest(OpKind.Attribute, true) },
16872
+ { test: kindWithInterpolationTest(OpKind.Property, true) },
16732
16873
  { test: kindWithInterpolationTest(OpKind.Property, false) },
16733
16874
  { test: kindWithInterpolationTest(OpKind.Attribute, false) }
16734
16875
  ];
16876
+ var UPDATE_HOST_ORDERING = [
16877
+ { test: kindWithInterpolationTest(OpKind.HostProperty, true) },
16878
+ { test: kindWithInterpolationTest(OpKind.HostProperty, false) },
16879
+ { test: kindTest(OpKind.Attribute) },
16880
+ { test: kindTest(OpKind.StyleMap), transform: keepLast },
16881
+ { test: kindTest(OpKind.ClassMap), transform: keepLast },
16882
+ { test: kindTest(OpKind.StyleProp) },
16883
+ { test: kindTest(OpKind.ClassProp) }
16884
+ ];
16735
16885
  var handledOpKinds = /* @__PURE__ */ new Set([
16736
16886
  OpKind.Listener,
16737
16887
  OpKind.StyleMap,
@@ -16745,7 +16895,8 @@ var handledOpKinds = /* @__PURE__ */ new Set([
16745
16895
  function orderOps(job) {
16746
16896
  for (const unit of job.units) {
16747
16897
  orderWithin(unit.create, CREATE_ORDERING);
16748
- orderWithin(unit.update, UPDATE_ORDERING);
16898
+ const ordering = unit.job.kind === CompilationJobKind.Host ? UPDATE_HOST_ORDERING : UPDATE_ORDERING;
16899
+ orderWithin(unit.update, ordering);
16749
16900
  }
16750
16901
  }
16751
16902
  function orderWithin(opList, ordering) {
@@ -16781,21 +16932,33 @@ function keepLast(ops) {
16781
16932
  return ops.slice(ops.length - 1);
16782
16933
  }
16783
16934
 
16784
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16935
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16785
16936
  function parseExtractedStyles(job) {
16937
+ const elements = /* @__PURE__ */ new Map();
16938
+ for (const unit of job.units) {
16939
+ for (const op of unit.create) {
16940
+ if (isElementOrContainerOp(op)) {
16941
+ elements.set(op.xref, op);
16942
+ }
16943
+ }
16944
+ }
16786
16945
  for (const unit of job.units) {
16787
16946
  for (const op of unit.create) {
16788
16947
  if (op.kind === OpKind.ExtractedAttribute && op.bindingKind === BindingKind.Attribute && isStringLiteral(op.expression)) {
16948
+ const target = elements.get(op.target);
16949
+ if (target !== void 0 && target.kind === OpKind.Template && target.templateKind === TemplateKind.Structural) {
16950
+ continue;
16951
+ }
16789
16952
  if (op.name === "style") {
16790
16953
  const parsedStyles = parse(op.expression.value);
16791
16954
  for (let i = 0; i < parsedStyles.length - 1; i += 2) {
16792
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1]), null), op);
16955
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1]), null, null, SecurityContext.STYLE), op);
16793
16956
  }
16794
16957
  OpList.remove(op);
16795
16958
  } else if (op.name === "class") {
16796
16959
  const parsedClasses = op.expression.value.trim().split(/\s+/g);
16797
16960
  for (const parsedClass of parsedClasses) {
16798
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null, null), op);
16961
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null, null, null, SecurityContext.NONE), op);
16799
16962
  }
16800
16963
  OpList.remove(op);
16801
16964
  }
@@ -16804,7 +16967,7 @@ function parseExtractedStyles(job) {
16804
16967
  }
16805
16968
  }
16806
16969
 
16807
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16970
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16808
16971
  function removeContentSelectors(job) {
16809
16972
  for (const unit of job.units) {
16810
16973
  const elements = createOpXrefMap(unit);
@@ -16816,13 +16979,6 @@ function removeContentSelectors(job) {
16816
16979
  OpList.remove(op);
16817
16980
  }
16818
16981
  break;
16819
- case OpKind.Projection:
16820
- for (let i = op.attributes.length - 2; i >= 0; i -= 2) {
16821
- if (isSelectAttribute(op.attributes[i])) {
16822
- op.attributes.splice(i, 2);
16823
- }
16824
- }
16825
- break;
16826
16982
  }
16827
16983
  }
16828
16984
  }
@@ -16838,7 +16994,7 @@ function lookupInXrefMap(map, xref) {
16838
16994
  return el;
16839
16995
  }
16840
16996
 
16841
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16997
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16842
16998
  function createPipes(job) {
16843
16999
  for (const unit of job.units) {
16844
17000
  processPipeBindingsInView(unit);
@@ -16886,7 +17042,7 @@ function addPipeToCreationBlock(unit, afterTargetXref, binding) {
16886
17042
  throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);
16887
17043
  }
16888
17044
 
16889
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
17045
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16890
17046
  function createVariadicPipes(job) {
16891
17047
  for (const unit of job.units) {
16892
17048
  for (const op of unit.update) {
@@ -16903,7 +17059,7 @@ function createVariadicPipes(job) {
16903
17059
  }
16904
17060
  }
16905
17061
 
16906
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
17062
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16907
17063
  function propagateI18nBlocks(job) {
16908
17064
  propagateI18nBlocksToTemplates(job.root, 0);
16909
17065
  }
@@ -16922,29 +17078,42 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
16922
17078
  i18nBlock = null;
16923
17079
  break;
16924
17080
  case OpKind.Template:
16925
- const templateView = unit.job.views.get(op.xref);
16926
- if (op.i18nPlaceholder !== void 0) {
16927
- if (i18nBlock === null) {
16928
- throw Error("Expected template with i18n placeholder to be in an i18n block.");
16929
- }
16930
- subTemplateIndex++;
16931
- wrapTemplateWithI18n(templateView, i18nBlock);
17081
+ subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.xref), i18nBlock, op.i18nPlaceholder, subTemplateIndex);
17082
+ break;
17083
+ case OpKind.RepeaterCreate:
17084
+ const forView = unit.job.views.get(op.xref);
17085
+ subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.xref), i18nBlock, op.i18nPlaceholder, subTemplateIndex);
17086
+ if (op.emptyView !== null) {
17087
+ subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.emptyView), i18nBlock, op.emptyI18nPlaceholder, subTemplateIndex);
16932
17088
  }
16933
- subTemplateIndex = propagateI18nBlocksToTemplates(templateView, subTemplateIndex);
17089
+ break;
16934
17090
  }
16935
17091
  }
16936
17092
  return subTemplateIndex;
16937
17093
  }
17094
+ function propagateI18nBlocksForView(view, i18nBlock, i18nPlaceholder, subTemplateIndex) {
17095
+ if (i18nPlaceholder !== void 0) {
17096
+ if (i18nBlock === null) {
17097
+ throw Error("Expected template with i18n placeholder to be in an i18n block.");
17098
+ }
17099
+ subTemplateIndex++;
17100
+ wrapTemplateWithI18n(view, i18nBlock);
17101
+ }
17102
+ return propagateI18nBlocksToTemplates(view, subTemplateIndex);
17103
+ }
16938
17104
  function wrapTemplateWithI18n(unit, parentI18n) {
16939
17105
  var _a2;
16940
17106
  if (((_a2 = unit.create.head.next) == null ? void 0 : _a2.kind) !== OpKind.I18nStart) {
16941
17107
  const id = unit.job.allocateXrefId();
16942
- OpList.insertAfter(createI18nStartOp(id, parentI18n.message, parentI18n.root), unit.create.head);
16943
- OpList.insertBefore(createI18nEndOp(id), unit.create.tail);
17108
+ OpList.insertAfter(
17109
+ createI18nStartOp(id, parentI18n.message, parentI18n.root, null),
17110
+ unit.create.head
17111
+ );
17112
+ OpList.insertBefore(createI18nEndOp(id, null), unit.create.tail);
16944
17113
  }
16945
17114
  }
16946
17115
 
16947
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
17116
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16948
17117
  function extractPureFunctions(job) {
16949
17118
  for (const view of job.units) {
16950
17119
  for (const op of view.ops()) {
@@ -16986,7 +17155,7 @@ var PureFunctionConstant = class extends GenericKeyFn {
16986
17155
  }
16987
17156
  };
16988
17157
 
16989
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
17158
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16990
17159
  function generatePureLiteralStructures(job) {
16991
17160
  for (const unit of job.units) {
16992
17161
  for (const op of unit.update) {
@@ -17033,7 +17202,7 @@ function transformLiteralMap(expr) {
17033
17202
  return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
17034
17203
  }
17035
17204
 
17036
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
17205
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
17037
17206
  function element(slot, tag, constIndex, localRefIndex, sourceSpan) {
17038
17207
  return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan);
17039
17208
  }
@@ -17091,17 +17260,13 @@ function disableBindings2() {
17091
17260
  function enableBindings() {
17092
17261
  return call(Identifiers.enableBindings, [], null);
17093
17262
  }
17094
- function listener(name, handlerFn, sourceSpan) {
17095
- return call(Identifiers.listener, [
17096
- literal(name),
17097
- handlerFn
17098
- ], sourceSpan);
17099
- }
17100
- function syntheticHostListener(name, handlerFn, sourceSpan) {
17101
- return call(Identifiers.syntheticHostListener, [
17102
- literal(name),
17103
- handlerFn
17104
- ], sourceSpan);
17263
+ function listener(name, handlerFn, eventTargetResolver, syntheticHost, sourceSpan) {
17264
+ const args = [literal(name), handlerFn];
17265
+ if (eventTargetResolver !== null) {
17266
+ args.push(literal(false));
17267
+ args.push(importExpr(eventTargetResolver));
17268
+ }
17269
+ return call(syntheticHost ? Identifiers.syntheticHostListener : Identifiers.listener, args, sourceSpan);
17105
17270
  }
17106
17271
  function pipe(slot, name) {
17107
17272
  return call(Identifiers.pipe, [
@@ -17199,22 +17364,22 @@ function projectionDef(def) {
17199
17364
  }
17200
17365
  function projection(slot, projectionSlotIndex, attributes, sourceSpan) {
17201
17366
  const args = [literal(slot)];
17202
- if (projectionSlotIndex !== 0 || attributes.length > 0) {
17367
+ if (projectionSlotIndex !== 0 || attributes !== null) {
17203
17368
  args.push(literal(projectionSlotIndex));
17204
- if (attributes.length > 0) {
17205
- args.push(literalArr(attributes.map((attr) => literal(attr))));
17369
+ if (attributes !== null) {
17370
+ args.push(attributes);
17206
17371
  }
17207
17372
  }
17208
17373
  return call(Identifiers.projection, args, sourceSpan);
17209
17374
  }
17210
- function i18nStart(slot, constIndex, subTemplateIndex) {
17375
+ function i18nStart(slot, constIndex, subTemplateIndex, sourceSpan) {
17211
17376
  const args = [literal(slot), literal(constIndex)];
17212
17377
  if (subTemplateIndex !== null) {
17213
17378
  args.push(literal(subTemplateIndex));
17214
17379
  }
17215
- return call(Identifiers.i18nStart, args, null);
17380
+ return call(Identifiers.i18nStart, args, sourceSpan);
17216
17381
  }
17217
- function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByFn, trackByUsesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, sourceSpan) {
17382
+ function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByFn, trackByUsesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, emptyTag, emptyConstIndex, sourceSpan) {
17218
17383
  const args = [
17219
17384
  literal(slot),
17220
17385
  variable(viewFnName),
@@ -17228,6 +17393,12 @@ function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByF
17228
17393
  args.push(literal(trackByUsesComponentInstance));
17229
17394
  if (emptyViewFnName !== null) {
17230
17395
  args.push(variable(emptyViewFnName), literal(emptyDecls), literal(emptyVars));
17396
+ if (emptyTag !== null || emptyConstIndex !== null) {
17397
+ args.push(literal(emptyTag));
17398
+ }
17399
+ if (emptyConstIndex !== null) {
17400
+ args.push(literal(emptyConstIndex));
17401
+ }
17231
17402
  }
17232
17403
  }
17233
17404
  return call(Identifiers.repeaterCreate, args, sourceSpan);
@@ -17238,15 +17409,15 @@ function repeater(collection, sourceSpan) {
17238
17409
  function deferWhen(prefetch, expr, sourceSpan) {
17239
17410
  return call(prefetch ? Identifiers.deferPrefetchWhen : Identifiers.deferWhen, [expr], sourceSpan);
17240
17411
  }
17241
- function i18n(slot, constIndex, subTemplateIndex) {
17412
+ function i18n(slot, constIndex, subTemplateIndex, sourceSpan) {
17242
17413
  const args = [literal(slot), literal(constIndex)];
17243
17414
  if (subTemplateIndex) {
17244
17415
  args.push(literal(subTemplateIndex));
17245
17416
  }
17246
- return call(Identifiers.i18n, args, null);
17417
+ return call(Identifiers.i18n, args, sourceSpan);
17247
17418
  }
17248
- function i18nEnd() {
17249
- return call(Identifiers.i18nEnd, [], null);
17419
+ function i18nEnd(endSourceSpan) {
17420
+ return call(Identifiers.i18nEnd, [], endSourceSpan);
17250
17421
  }
17251
17422
  function i18nAttributes(slot, i18nAttributesConfig) {
17252
17423
  const args = [literal(slot), literal(i18nAttributesConfig)];
@@ -17360,8 +17531,12 @@ function classMapInterpolate(strings, expressions, sourceSpan) {
17360
17531
  const interpolationArgs = collateInterpolationArgs(strings, expressions);
17361
17532
  return callVariadicInstruction(CLASS_MAP_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
17362
17533
  }
17363
- function hostProperty(name, expression, sourceSpan) {
17364
- return call(Identifiers.hostProperty, [literal(name), expression], sourceSpan);
17534
+ function hostProperty(name, expression, sanitizer, sourceSpan) {
17535
+ const args = [literal(name), expression];
17536
+ if (sanitizer !== null) {
17537
+ args.push(sanitizer);
17538
+ }
17539
+ return call(Identifiers.hostProperty, args, sourceSpan);
17365
17540
  }
17366
17541
  function syntheticHostProperty(name, expression, sourceSpan) {
17367
17542
  return call(Identifiers.syntheticHostProperty, [literal(name), expression], sourceSpan);
@@ -17548,14 +17723,11 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
17548
17723
  return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
17549
17724
  }
17550
17725
 
17551
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
17552
- var sanitizerIdentifierMap = /* @__PURE__ */ new Map([
17553
- [SanitizerFn.Html, Identifiers.sanitizeHtml],
17554
- [SanitizerFn.IframeAttribute, Identifiers.validateIframeAttribute],
17555
- [SanitizerFn.ResourceUrl, Identifiers.sanitizeResourceUrl],
17556
- [SanitizerFn.Script, Identifiers.sanitizeScript],
17557
- [SanitizerFn.Style, Identifiers.sanitizeStyle],
17558
- [SanitizerFn.Url, Identifiers.sanitizeUrl]
17726
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
17727
+ var GLOBAL_TARGET_RESOLVERS = /* @__PURE__ */ new Map([
17728
+ ["window", Identifiers.resolveWindow],
17729
+ ["document", Identifiers.resolveDocument],
17730
+ ["body", Identifiers.resolveBody]
17559
17731
  ]);
17560
17732
  function reify(job) {
17561
17733
  for (const unit of job.units) {
@@ -17572,31 +17744,31 @@ function reifyCreateOperations(unit, ops) {
17572
17744
  OpList.replace(op, text(op.handle.slot, op.initialValue, op.sourceSpan));
17573
17745
  break;
17574
17746
  case OpKind.ElementStart:
17575
- OpList.replace(op, elementStart(op.handle.slot, op.tag, op.attributes, op.localRefs, op.sourceSpan));
17747
+ OpList.replace(op, elementStart(op.handle.slot, op.tag, op.attributes, op.localRefs, op.startSourceSpan));
17576
17748
  break;
17577
17749
  case OpKind.Element:
17578
- OpList.replace(op, element(op.handle.slot, op.tag, op.attributes, op.localRefs, op.sourceSpan));
17750
+ OpList.replace(op, element(op.handle.slot, op.tag, op.attributes, op.localRefs, op.wholeSourceSpan));
17579
17751
  break;
17580
17752
  case OpKind.ElementEnd:
17581
17753
  OpList.replace(op, elementEnd(op.sourceSpan));
17582
17754
  break;
17583
17755
  case OpKind.ContainerStart:
17584
- OpList.replace(op, elementContainerStart(op.handle.slot, op.attributes, op.localRefs, op.sourceSpan));
17756
+ OpList.replace(op, elementContainerStart(op.handle.slot, op.attributes, op.localRefs, op.startSourceSpan));
17585
17757
  break;
17586
17758
  case OpKind.Container:
17587
- OpList.replace(op, elementContainer(op.handle.slot, op.attributes, op.localRefs, op.sourceSpan));
17759
+ OpList.replace(op, elementContainer(op.handle.slot, op.attributes, op.localRefs, op.wholeSourceSpan));
17588
17760
  break;
17589
17761
  case OpKind.ContainerEnd:
17590
17762
  OpList.replace(op, elementContainerEnd());
17591
17763
  break;
17592
17764
  case OpKind.I18nStart:
17593
- OpList.replace(op, i18nStart(op.handle.slot, op.messageIndex, op.subTemplateIndex));
17765
+ OpList.replace(op, i18nStart(op.handle.slot, op.messageIndex, op.subTemplateIndex, op.sourceSpan));
17594
17766
  break;
17595
17767
  case OpKind.I18nEnd:
17596
- OpList.replace(op, i18nEnd());
17768
+ OpList.replace(op, i18nEnd(op.sourceSpan));
17597
17769
  break;
17598
17770
  case OpKind.I18n:
17599
- OpList.replace(op, i18n(op.handle.slot, op.messageIndex, op.subTemplateIndex));
17771
+ OpList.replace(op, i18n(op.handle.slot, op.messageIndex, op.subTemplateIndex, op.sourceSpan));
17600
17772
  break;
17601
17773
  case OpKind.I18nAttributes:
17602
17774
  if (op.i18nAttributesConfig === null) {
@@ -17612,7 +17784,7 @@ function reifyCreateOperations(unit, ops) {
17612
17784
  throw new Error(`AssertionError: local refs array should have been extracted into a constant`);
17613
17785
  }
17614
17786
  const childView = unit.job.views.get(op.xref);
17615
- OpList.replace(op, template(op.handle.slot, variable(childView.fnName), childView.decls, childView.vars, op.tag, op.attributes, op.localRefs, op.sourceSpan));
17787
+ OpList.replace(op, template(op.handle.slot, variable(childView.fnName), childView.decls, childView.vars, op.tag, op.attributes, op.localRefs, op.startSourceSpan));
17616
17788
  break;
17617
17789
  case OpKind.DisableBindings:
17618
17790
  OpList.replace(op, disableBindings2());
@@ -17625,8 +17797,11 @@ function reifyCreateOperations(unit, ops) {
17625
17797
  break;
17626
17798
  case OpKind.Listener:
17627
17799
  const listenerFn = reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, op.consumesDollarEvent);
17628
- const reified = op.hostListener && op.isAnimationListener ? syntheticHostListener(op.name, listenerFn, op.sourceSpan) : listener(op.name, listenerFn, op.sourceSpan);
17629
- OpList.replace(op, reified);
17800
+ const eventTargetResolver = op.eventTarget ? GLOBAL_TARGET_RESOLVERS.get(op.eventTarget) : null;
17801
+ if (eventTargetResolver === void 0) {
17802
+ throw new Error(`Unexpected global target '${op.eventTarget}' defined for '${op.name}' event. Supported list of global targets: window,document,body.`);
17803
+ }
17804
+ OpList.replace(op, listener(op.name, listenerFn, eventTargetResolver, op.hostListener && op.isAnimationListener, op.sourceSpan));
17630
17805
  break;
17631
17806
  case OpKind.Variable:
17632
17807
  if (op.variable.name === null) {
@@ -17711,7 +17886,7 @@ function reifyCreateOperations(unit, ops) {
17711
17886
  emptyDecls = emptyView.decls;
17712
17887
  emptyVars = emptyView.vars;
17713
17888
  }
17714
- OpList.replace(op, repeaterCreate(op.handle.slot, repeaterView.fnName, op.decls, op.vars, op.tag, op.attributes, op.trackByFn, op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.sourceSpan));
17889
+ OpList.replace(op, repeaterCreate(op.handle.slot, repeaterView.fnName, op.decls, op.vars, op.tag, op.attributes, op.trackByFn, op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.emptyTag, op.emptyAttributes, op.wholeSourceSpan));
17715
17890
  break;
17716
17891
  case OpKind.Statement:
17717
17892
  break;
@@ -17781,7 +17956,7 @@ function reifyUpdateOperations(_unit, ops) {
17781
17956
  if (op.isAnimationTrigger) {
17782
17957
  OpList.replace(op, syntheticHostProperty(op.name, op.expression, op.sourceSpan));
17783
17958
  } else {
17784
- OpList.replace(op, hostProperty(op.name, op.expression, op.sourceSpan));
17959
+ OpList.replace(op, hostProperty(op.name, op.expression, op.sanitizer, op.sourceSpan));
17785
17960
  }
17786
17961
  }
17787
17962
  break;
@@ -17859,8 +18034,6 @@ function reifyIrExpression(expr) {
17859
18034
  return pipeBind(expr.targetSlot.slot, expr.varOffset, expr.args);
17860
18035
  case ExpressionKind.PipeBindingVariadic:
17861
18036
  return pipeBindV(expr.targetSlot.slot, expr.varOffset, expr.args);
17862
- case ExpressionKind.SanitizerExpr:
17863
- return importExpr(sanitizerIdentifierMap.get(expr.fn));
17864
18037
  case ExpressionKind.SlotLiteralExpr:
17865
18038
  return literal(expr.slot.slot);
17866
18039
  default:
@@ -17883,7 +18056,7 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
17883
18056
  return fn(params, handlerStmts, void 0, void 0, name);
17884
18057
  }
17885
18058
 
17886
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
18059
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17887
18060
  function removeEmptyBindings(job) {
17888
18061
  for (const unit of job.units) {
17889
18062
  for (const op of unit.update) {
@@ -17904,7 +18077,7 @@ function removeEmptyBindings(job) {
17904
18077
  }
17905
18078
  }
17906
18079
 
17907
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
18080
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
17908
18081
  function removeI18nContexts(job) {
17909
18082
  for (const unit of job.units) {
17910
18083
  for (const op of unit.create) {
@@ -17920,7 +18093,7 @@ function removeI18nContexts(job) {
17920
18093
  }
17921
18094
  }
17922
18095
 
17923
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_unused_i18n_attrs.mjs
18096
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_unused_i18n_attrs.mjs
17924
18097
  function removeUnusedI18nAttributesOps(job) {
17925
18098
  for (const unit of job.units) {
17926
18099
  const ownersWithI18nExpressions = /* @__PURE__ */ new Set();
@@ -17942,7 +18115,7 @@ function removeUnusedI18nAttributesOps(job) {
17942
18115
  }
17943
18116
  }
17944
18117
 
17945
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
18118
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
17946
18119
  function generateRepeaterDerivedVars(job) {
17947
18120
  const repeaters = /* @__PURE__ */ new Map();
17948
18121
  for (const unit of job.units) {
@@ -17974,7 +18147,7 @@ function generateRepeaterDerivedVars(job) {
17974
18147
  }
17975
18148
  }
17976
18149
 
17977
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
18150
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17978
18151
  function resolveContexts(job) {
17979
18152
  for (const unit of job.units) {
17980
18153
  processLexicalScope(unit, unit.create);
@@ -18015,7 +18188,7 @@ function processLexicalScope(view, ops) {
18015
18188
  }
18016
18189
  }
18017
18190
 
18018
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
18191
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
18019
18192
  function resolveDollarEvent(job) {
18020
18193
  for (const unit of job.units) {
18021
18194
  transformDollarEvent(unit, unit.create);
@@ -18036,7 +18209,7 @@ function transformDollarEvent(unit, ops) {
18036
18209
  }
18037
18210
  }
18038
18211
 
18039
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
18212
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
18040
18213
  function resolveI18nElementPlaceholders(job) {
18041
18214
  const i18nContexts = /* @__PURE__ */ new Map();
18042
18215
  const elements = /* @__PURE__ */ new Map();
@@ -18101,18 +18274,52 @@ function resolvePlaceholdersForView(job, unit, i18nContexts, elements, pendingSt
18101
18274
  }
18102
18275
  break;
18103
18276
  case OpKind.Template:
18277
+ const view = job.views.get(op.xref);
18104
18278
  if (op.i18nPlaceholder === void 0) {
18105
- resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
18279
+ resolvePlaceholdersForView(job, view, i18nContexts, elements);
18106
18280
  } else {
18107
18281
  if (currentOps === null) {
18108
18282
  throw Error("i18n tag placeholder should only occur inside an i18n block");
18109
18283
  }
18110
18284
  if (op.templateKind === TemplateKind.Structural) {
18111
- resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements, op);
18285
+ resolvePlaceholdersForView(job, view, i18nContexts, elements, op);
18112
18286
  } else {
18113
- recordTemplateStart(job, op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18114
- resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
18115
- recordTemplateClose(job, op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18287
+ recordTemplateStart(job, view, op.handle.slot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18288
+ resolvePlaceholdersForView(job, view, i18nContexts, elements);
18289
+ recordTemplateClose(job, view, op.handle.slot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18290
+ pendingStructuralDirective = void 0;
18291
+ }
18292
+ }
18293
+ break;
18294
+ case OpKind.RepeaterCreate:
18295
+ if (pendingStructuralDirective !== void 0) {
18296
+ throw Error("AssertionError: Unexpected structural directive associated with @for block");
18297
+ }
18298
+ const forSlot = op.handle.slot + 1;
18299
+ const forView = job.views.get(op.xref);
18300
+ if (op.i18nPlaceholder === void 0) {
18301
+ resolvePlaceholdersForView(job, forView, i18nContexts, elements);
18302
+ } else {
18303
+ if (currentOps === null) {
18304
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
18305
+ }
18306
+ recordTemplateStart(job, forView, forSlot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18307
+ resolvePlaceholdersForView(job, forView, i18nContexts, elements);
18308
+ recordTemplateClose(job, forView, forSlot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18309
+ pendingStructuralDirective = void 0;
18310
+ }
18311
+ if (op.emptyView !== null) {
18312
+ const emptySlot = op.handle.slot + 2;
18313
+ const emptyView = job.views.get(op.emptyView);
18314
+ if (op.emptyI18nPlaceholder === void 0) {
18315
+ resolvePlaceholdersForView(job, emptyView, i18nContexts, elements);
18316
+ } else {
18317
+ if (currentOps === null) {
18318
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
18319
+ }
18320
+ recordTemplateStart(job, emptyView, emptySlot, op.emptyI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18321
+ resolvePlaceholdersForView(job, emptyView, i18nContexts, elements);
18322
+ recordTemplateClose(job, emptyView, emptySlot, op.emptyI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18116
18323
  pendingStructuralDirective = void 0;
18117
18324
  }
18118
18325
  }
@@ -18145,8 +18352,8 @@ function recordElementClose(op, i18nContext, i18nBlock, structuralDirective) {
18145
18352
  addParam(i18nContext.params, closeName, value, i18nBlock.subTemplateIndex, flags);
18146
18353
  }
18147
18354
  }
18148
- function recordTemplateStart(job, op, i18nContext, i18nBlock, structuralDirective) {
18149
- let { startName, closeName } = op.i18nPlaceholder;
18355
+ function recordTemplateStart(job, view, slot, i18nPlaceholder, i18nContext, i18nBlock, structuralDirective) {
18356
+ let { startName, closeName } = i18nPlaceholder;
18150
18357
  let flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.OpenTag;
18151
18358
  if (!closeName) {
18152
18359
  flags |= I18nParamValueFlags.CloseTag;
@@ -18154,20 +18361,20 @@ function recordTemplateStart(job, op, i18nContext, i18nBlock, structuralDirectiv
18154
18361
  if (structuralDirective !== void 0) {
18155
18362
  addParam(i18nContext.params, startName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
18156
18363
  }
18157
- addParam(i18nContext.params, startName, op.handle.slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, op), flags);
18364
+ addParam(i18nContext.params, startName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
18158
18365
  }
18159
- function recordTemplateClose(job, op, i18nContext, i18nBlock, structuralDirective) {
18160
- const { startName, closeName } = op.i18nPlaceholder;
18366
+ function recordTemplateClose(job, view, slot, i18nPlaceholder, i18nContext, i18nBlock, structuralDirective) {
18367
+ const { startName, closeName } = i18nPlaceholder;
18161
18368
  const flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag;
18162
18369
  if (closeName) {
18163
- addParam(i18nContext.params, closeName, op.handle.slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, op), flags);
18370
+ addParam(i18nContext.params, closeName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
18164
18371
  if (structuralDirective !== void 0) {
18165
18372
  addParam(i18nContext.params, closeName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
18166
18373
  }
18167
18374
  }
18168
18375
  }
18169
- function getSubTemplateIndexForTemplateTag(job, i18nOp, op) {
18170
- for (const childOp of job.views.get(op.xref).create) {
18376
+ function getSubTemplateIndexForTemplateTag(job, i18nOp, view) {
18377
+ for (const childOp of view.create) {
18171
18378
  if (childOp.kind === OpKind.I18nStart) {
18172
18379
  return childOp.subTemplateIndex;
18173
18380
  }
@@ -18181,11 +18388,12 @@ function addParam(params, placeholder, value, subTemplateIndex, flags) {
18181
18388
  params.set(placeholder, values);
18182
18389
  }
18183
18390
 
18184
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
18391
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
18185
18392
  function resolveI18nExpressionPlaceholders(job) {
18186
18393
  var _a2;
18187
18394
  const subTemplateIndicies = /* @__PURE__ */ new Map();
18188
18395
  const i18nContexts = /* @__PURE__ */ new Map();
18396
+ const icuPlaceholders = /* @__PURE__ */ new Map();
18189
18397
  for (const unit of job.units) {
18190
18398
  for (const op of unit.create) {
18191
18399
  switch (op.kind) {
@@ -18195,6 +18403,9 @@ function resolveI18nExpressionPlaceholders(job) {
18195
18403
  case OpKind.I18nContext:
18196
18404
  i18nContexts.set(op.xref, op);
18197
18405
  break;
18406
+ case OpKind.IcuPlaceholder:
18407
+ icuPlaceholders.set(op.xref, op);
18408
+ break;
18198
18409
  }
18199
18410
  }
18200
18411
  }
@@ -18203,68 +18414,34 @@ function resolveI18nExpressionPlaceholders(job) {
18203
18414
  for (const unit of job.units) {
18204
18415
  for (const op of unit.update) {
18205
18416
  if (op.kind === OpKind.I18nExpression) {
18206
- const i18nContext = i18nContexts.get(op.context);
18207
18417
  const index = expressionIndices.get(referenceIndex(op)) || 0;
18208
18418
  const subTemplateIndex = (_a2 = subTemplateIndicies.get(op.i18nOwner)) != null ? _a2 : null;
18209
- const params = op.resolutionTime === I18nParamResolutionTime.Creation ? i18nContext.params : i18nContext.postprocessingParams;
18210
- const values = params.get(op.i18nPlaceholder) || [];
18211
- values.push({
18419
+ const value = {
18212
18420
  value: index,
18213
18421
  subTemplateIndex,
18214
18422
  flags: I18nParamValueFlags.ExpressionIndex
18215
- });
18216
- params.set(op.i18nPlaceholder, values);
18423
+ };
18424
+ updatePlaceholder(op, value, i18nContexts, icuPlaceholders);
18217
18425
  expressionIndices.set(referenceIndex(op), index + 1);
18218
18426
  }
18219
18427
  }
18220
18428
  }
18221
18429
  }
18222
-
18223
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
18224
- function resolveI18nIcuPlaceholders(job) {
18225
- for (const unit of job.units) {
18226
- for (const op of unit.create) {
18227
- if (op.kind === OpKind.I18nContext && op.contextKind === I18nContextKind.Icu) {
18228
- for (const node of op.message.nodes) {
18229
- node.visit(new ResolveIcuPlaceholdersVisitor(op.postprocessingParams));
18230
- }
18231
- }
18232
- }
18233
- }
18234
- }
18235
- var ResolveIcuPlaceholdersVisitor = class extends RecurseVisitor {
18236
- constructor(params) {
18237
- super();
18238
- this.params = params;
18239
- }
18240
- visitContainerPlaceholder(placeholder) {
18241
- var _a2, _b2;
18242
- if (placeholder.startName && placeholder.startSourceSpan && !this.params.has(placeholder.startName)) {
18243
- this.params.set(placeholder.startName, [{
18244
- value: (_a2 = placeholder.startSourceSpan) == null ? void 0 : _a2.toString(),
18245
- subTemplateIndex: null,
18246
- flags: I18nParamValueFlags.None
18247
- }]);
18248
- }
18249
- if (placeholder.closeName && placeholder.endSourceSpan && !this.params.has(placeholder.closeName)) {
18250
- this.params.set(placeholder.closeName, [{
18251
- value: (_b2 = placeholder.endSourceSpan) == null ? void 0 : _b2.toString(),
18252
- subTemplateIndex: null,
18253
- flags: I18nParamValueFlags.None
18254
- }]);
18255
- }
18256
- }
18257
- visitTagPlaceholder(placeholder) {
18258
- super.visitTagPlaceholder(placeholder);
18259
- this.visitContainerPlaceholder(placeholder);
18430
+ function updatePlaceholder(op, value, i18nContexts, icuPlaceholders) {
18431
+ if (op.i18nPlaceholder !== null) {
18432
+ const i18nContext = i18nContexts.get(op.context);
18433
+ const params = op.resolutionTime === I18nParamResolutionTime.Creation ? i18nContext.params : i18nContext.postprocessingParams;
18434
+ const values = params.get(op.i18nPlaceholder) || [];
18435
+ values.push(value);
18436
+ params.set(op.i18nPlaceholder, values);
18260
18437
  }
18261
- visitBlockPlaceholder(placeholder) {
18262
- super.visitBlockPlaceholder(placeholder);
18263
- this.visitContainerPlaceholder(placeholder);
18438
+ if (op.icuPlaceholder !== null) {
18439
+ const icuPlaceholderOp = icuPlaceholders.get(op.icuPlaceholder);
18440
+ icuPlaceholderOp == null ? void 0 : icuPlaceholderOp.expressionPlaceholders.push(value);
18264
18441
  }
18265
- };
18442
+ }
18266
18443
 
18267
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
18444
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
18268
18445
  function resolveNames(job) {
18269
18446
  for (const unit of job.units) {
18270
18447
  processLexicalScope2(unit, unit.create, null);
@@ -18328,31 +18505,55 @@ function processLexicalScope2(unit, ops, savedView) {
18328
18505
  }
18329
18506
  }
18330
18507
 
18331
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
18332
- var sanitizers = /* @__PURE__ */ new Map([
18333
- [SecurityContext.HTML, SanitizerFn.Html],
18334
- [SecurityContext.SCRIPT, SanitizerFn.Script],
18335
- [SecurityContext.STYLE, SanitizerFn.Style],
18336
- [SecurityContext.URL, SanitizerFn.Url],
18337
- [SecurityContext.RESOURCE_URL, SanitizerFn.ResourceUrl]
18508
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
18509
+ var sanitizerFns = /* @__PURE__ */ new Map([
18510
+ [SecurityContext.HTML, Identifiers.sanitizeHtml],
18511
+ [SecurityContext.RESOURCE_URL, Identifiers.sanitizeResourceUrl],
18512
+ [SecurityContext.SCRIPT, Identifiers.sanitizeScript],
18513
+ [SecurityContext.STYLE, Identifiers.sanitizeStyle],
18514
+ [SecurityContext.URL, Identifiers.sanitizeUrl]
18515
+ ]);
18516
+ var trustedValueFns = /* @__PURE__ */ new Map([
18517
+ [SecurityContext.HTML, Identifiers.trustConstantHtml],
18518
+ [SecurityContext.RESOURCE_URL, Identifiers.trustConstantResourceUrl]
18338
18519
  ]);
18339
18520
  function resolveSanitizers(job) {
18521
+ var _a2, _b2;
18340
18522
  for (const unit of job.units) {
18341
18523
  const elements = createOpXrefMap(unit);
18342
- let sanitizerFn;
18524
+ if (job.kind !== CompilationJobKind.Host) {
18525
+ for (const op of unit.create) {
18526
+ if (op.kind === OpKind.ExtractedAttribute) {
18527
+ const trustedValueFn = (_a2 = trustedValueFns.get(getOnlySecurityContext(op.securityContext))) != null ? _a2 : null;
18528
+ op.trustedValueFn = trustedValueFn !== null ? importExpr(trustedValueFn) : null;
18529
+ }
18530
+ }
18531
+ }
18343
18532
  for (const op of unit.update) {
18344
18533
  switch (op.kind) {
18345
18534
  case OpKind.Property:
18346
18535
  case OpKind.Attribute:
18347
- sanitizerFn = sanitizers.get(op.securityContext) || null;
18348
- op.sanitizer = sanitizerFn ? new SanitizerExpr(sanitizerFn) : null;
18536
+ case OpKind.HostProperty:
18537
+ let sanitizerFn = null;
18538
+ if (Array.isArray(op.securityContext) && op.securityContext.length === 2 && op.securityContext.indexOf(SecurityContext.URL) > -1 && op.securityContext.indexOf(SecurityContext.RESOURCE_URL) > -1) {
18539
+ sanitizerFn = Identifiers.sanitizeUrlOrResourceUrl;
18540
+ } else {
18541
+ sanitizerFn = (_b2 = sanitizerFns.get(getOnlySecurityContext(op.securityContext))) != null ? _b2 : null;
18542
+ }
18543
+ op.sanitizer = sanitizerFn !== null ? importExpr(sanitizerFn) : null;
18349
18544
  if (op.sanitizer === null) {
18350
- const ownerOp = elements.get(op.target);
18351
- if (ownerOp === void 0 || !isElementOrContainerOp(ownerOp)) {
18352
- throw Error("Property should have an element-like owner");
18545
+ let isIframe = false;
18546
+ if (job.kind === CompilationJobKind.Host || op.kind === OpKind.HostProperty) {
18547
+ isIframe = true;
18548
+ } else {
18549
+ const ownerOp = elements.get(op.target);
18550
+ if (ownerOp === void 0 || !isElementOrContainerOp(ownerOp)) {
18551
+ throw Error("Property should have an element-like owner");
18552
+ }
18553
+ isIframe = isIframeElement(ownerOp);
18353
18554
  }
18354
- if (isIframeElement(ownerOp) && isIframeSecuritySensitiveAttr(op.name)) {
18355
- op.sanitizer = new SanitizerExpr(SanitizerFn.IframeAttribute);
18555
+ if (isIframe && isIframeSecuritySensitiveAttr(op.name)) {
18556
+ op.sanitizer = importExpr(Identifiers.validateIframeAttribute);
18356
18557
  }
18357
18558
  }
18358
18559
  break;
@@ -18364,8 +18565,17 @@ function isIframeElement(op) {
18364
18565
  var _a2;
18365
18566
  return op.kind === OpKind.ElementStart && ((_a2 = op.tag) == null ? void 0 : _a2.toLowerCase()) === "iframe";
18366
18567
  }
18568
+ function getOnlySecurityContext(securityContext) {
18569
+ if (Array.isArray(securityContext)) {
18570
+ if (securityContext.length > 1) {
18571
+ throw Error(`AssertionError: Ambiguous security context`);
18572
+ }
18573
+ return securityContext[0] || SecurityContext.NONE;
18574
+ }
18575
+ return securityContext;
18576
+ }
18367
18577
 
18368
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
18578
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
18369
18579
  function saveAndRestoreView(job) {
18370
18580
  for (const unit of job.units) {
18371
18581
  unit.create.prepend([
@@ -18410,7 +18620,7 @@ function addSaveRestoreViewOperationToListener(unit, op) {
18410
18620
  }
18411
18621
  }
18412
18622
 
18413
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
18623
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
18414
18624
  function allocateSlots(job) {
18415
18625
  const slotMap = /* @__PURE__ */ new Map();
18416
18626
  for (const unit of job.units) {
@@ -18435,7 +18645,7 @@ function allocateSlots(job) {
18435
18645
  }
18436
18646
  }
18437
18647
 
18438
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
18648
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
18439
18649
  function specializeStyleBindings(job) {
18440
18650
  for (const unit of job.units) {
18441
18651
  for (const op of unit.update) {
@@ -18465,7 +18675,7 @@ function specializeStyleBindings(job) {
18465
18675
  }
18466
18676
  }
18467
18677
 
18468
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
18678
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
18469
18679
  function generateTemporaryVariables(job) {
18470
18680
  for (const unit of job.units) {
18471
18681
  unit.create.prepend(generateTemporaries(unit.create));
@@ -18523,7 +18733,7 @@ function assignName(names, expr) {
18523
18733
  expr.name = name;
18524
18734
  }
18525
18735
 
18526
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18736
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18527
18737
  function generateTrackFns(job) {
18528
18738
  for (const unit of job.units) {
18529
18739
  for (const op of unit.create) {
@@ -18535,6 +18745,9 @@ function generateTrackFns(job) {
18535
18745
  }
18536
18746
  let usesComponentContext = false;
18537
18747
  op.track = transformExpressionsInExpression(op.track, (expr) => {
18748
+ if (expr instanceof PipeBindingExpr || expr instanceof PipeBindingVariadicExpr) {
18749
+ throw new Error(`Illegal State: Pipes are not allowed in this context`);
18750
+ }
18538
18751
  if (expr instanceof TrackContextExpr) {
18539
18752
  usesComponentContext = true;
18540
18753
  return variable("this");
@@ -18553,7 +18766,7 @@ function generateTrackFns(job) {
18553
18766
  }
18554
18767
  }
18555
18768
 
18556
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18769
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18557
18770
  function optimizeTrackFns(job) {
18558
18771
  for (const unit of job.units) {
18559
18772
  for (const op of unit.create) {
@@ -18600,7 +18813,7 @@ function isTrackByFunctionCall(rootView, expr) {
18600
18813
  return true;
18601
18814
  }
18602
18815
 
18603
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18816
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18604
18817
  function generateTrackVariables(job) {
18605
18818
  for (const unit of job.units) {
18606
18819
  for (const op of unit.create) {
@@ -18621,7 +18834,7 @@ function generateTrackVariables(job) {
18621
18834
  }
18622
18835
  }
18623
18836
 
18624
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
18837
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
18625
18838
  function countVariables(job) {
18626
18839
  for (const unit of job.units) {
18627
18840
  let varCount = 0;
@@ -18699,7 +18912,10 @@ function varsUsedByOp(op) {
18699
18912
  return op.interpolation.expressions.length;
18700
18913
  case OpKind.I18nExpression:
18701
18914
  case OpKind.Conditional:
18915
+ case OpKind.DeferWhen:
18702
18916
  return 1;
18917
+ case OpKind.RepeaterCreate:
18918
+ return op.emptyView ? 1 : 0;
18703
18919
  default:
18704
18920
  throw new Error(`Unhandled op: ${OpKind[op.kind]}`);
18705
18921
  }
@@ -18726,7 +18942,7 @@ function isSingletonInterpolation(expr) {
18726
18942
  return true;
18727
18943
  }
18728
18944
 
18729
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
18945
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
18730
18946
  function optimizeVariables(job) {
18731
18947
  for (const unit of job.units) {
18732
18948
  inlineAlwaysInlineVariables(unit.create);
@@ -18976,7 +19192,7 @@ function allowConservativeInlining(decl, target) {
18976
19192
  }
18977
19193
  }
18978
19194
 
18979
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
19195
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18980
19196
  function wrapI18nIcus(job) {
18981
19197
  for (const unit of job.units) {
18982
19198
  let currentI18nOp = null;
@@ -18992,12 +19208,12 @@ function wrapI18nIcus(job) {
18992
19208
  case OpKind.IcuStart:
18993
19209
  if (currentI18nOp === null) {
18994
19210
  addedI18nId = job.allocateXrefId();
18995
- OpList.insertBefore(createI18nStartOp(addedI18nId, op.message), op);
19211
+ OpList.insertBefore(createI18nStartOp(addedI18nId, op.message, void 0, null), op);
18996
19212
  }
18997
19213
  break;
18998
19214
  case OpKind.IcuEnd:
18999
19215
  if (addedI18nId !== null) {
19000
- OpList.insertAfter(createI18nEndOp(addedI18nId), op);
19216
+ OpList.insertAfter(createI18nEndOp(addedI18nId, null), op);
19001
19217
  addedI18nId = null;
19002
19218
  }
19003
19219
  break;
@@ -19006,17 +19222,18 @@ function wrapI18nIcus(job) {
19006
19222
  }
19007
19223
  }
19008
19224
 
19009
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
19225
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
19010
19226
  var phases = [
19011
19227
  { kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
19012
19228
  { kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
19013
19229
  { kind: CompilationJobKind.Tmpl, fn: emitNamespaceChanges },
19014
19230
  { kind: CompilationJobKind.Tmpl, fn: propagateI18nBlocks },
19015
19231
  { kind: CompilationJobKind.Tmpl, fn: wrapI18nIcus },
19016
- { kind: CompilationJobKind.Tmpl, fn: createI18nContexts },
19232
+ { kind: CompilationJobKind.Both, fn: deduplicateTextBindings },
19017
19233
  { kind: CompilationJobKind.Both, fn: specializeStyleBindings },
19018
19234
  { kind: CompilationJobKind.Both, fn: specializeBindings },
19019
19235
  { kind: CompilationJobKind.Both, fn: extractAttributes },
19236
+ { kind: CompilationJobKind.Tmpl, fn: createI18nContexts },
19020
19237
  { kind: CompilationJobKind.Both, fn: parseExtractedStyles },
19021
19238
  { kind: CompilationJobKind.Tmpl, fn: removeEmptyBindings },
19022
19239
  { kind: CompilationJobKind.Both, fn: collapseSingletonInterpolations },
@@ -19034,7 +19251,7 @@ var phases = [
19034
19251
  { kind: CompilationJobKind.Tmpl, fn: generateProjectionDefs },
19035
19252
  { kind: CompilationJobKind.Tmpl, fn: generateVariables },
19036
19253
  { kind: CompilationJobKind.Tmpl, fn: saveAndRestoreView },
19037
- { kind: CompilationJobKind.Tmpl, fn: deleteAnyCasts },
19254
+ { kind: CompilationJobKind.Both, fn: deleteAnyCasts },
19038
19255
  { kind: CompilationJobKind.Both, fn: resolveDollarEvent },
19039
19256
  { kind: CompilationJobKind.Tmpl, fn: generateRepeaterDerivedVars },
19040
19257
  { kind: CompilationJobKind.Tmpl, fn: generateTrackVariables },
@@ -19042,7 +19259,7 @@ var phases = [
19042
19259
  { kind: CompilationJobKind.Tmpl, fn: resolveDeferTargetNames },
19043
19260
  { kind: CompilationJobKind.Tmpl, fn: optimizeTrackFns },
19044
19261
  { kind: CompilationJobKind.Both, fn: resolveContexts },
19045
- { kind: CompilationJobKind.Tmpl, fn: resolveSanitizers },
19262
+ { kind: CompilationJobKind.Both, fn: resolveSanitizers },
19046
19263
  { kind: CompilationJobKind.Tmpl, fn: liftLocalRefs },
19047
19264
  { kind: CompilationJobKind.Both, fn: generateNullishCoalesceExpressions },
19048
19265
  { kind: CompilationJobKind.Both, fn: expandSafeReads },
@@ -19051,7 +19268,6 @@ var phases = [
19051
19268
  { kind: CompilationJobKind.Tmpl, fn: createDeferDepsFns },
19052
19269
  { kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
19053
19270
  { kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
19054
- { kind: CompilationJobKind.Tmpl, fn: resolveI18nIcuPlaceholders },
19055
19271
  { kind: CompilationJobKind.Tmpl, fn: extractI18nMessages },
19056
19272
  { kind: CompilationJobKind.Tmpl, fn: generateTrackFns },
19057
19273
  { kind: CompilationJobKind.Tmpl, fn: collectI18nConsts },
@@ -19172,8 +19388,10 @@ function emitHostBindingFunction(job) {
19172
19388
  );
19173
19389
  }
19174
19390
 
19175
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
19391
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
19176
19392
  var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
19393
+ var domSchema = new DomElementSchemaRegistry();
19394
+ var NG_TEMPLATE_TAG_NAME = "ng-template";
19177
19395
  function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta) {
19178
19396
  const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta);
19179
19397
  ingestNodes(job.root, template2);
@@ -19183,17 +19401,27 @@ function ingestHostBinding(input, bindingParser, constantPool) {
19183
19401
  var _a2, _b2, _c2;
19184
19402
  const job = new HostBindingCompilationJob(input.componentName, constantPool, compatibilityMode);
19185
19403
  for (const property2 of (_a2 = input.properties) != null ? _a2 : []) {
19186
- ingestHostProperty(job, property2, false);
19404
+ let bindingKind = BindingKind.Property;
19405
+ if (property2.name.startsWith("attr.")) {
19406
+ property2.name = property2.name.substring("attr.".length);
19407
+ bindingKind = BindingKind.Attribute;
19408
+ }
19409
+ if (property2.isAnimation) {
19410
+ bindingKind = BindingKind.Animation;
19411
+ }
19412
+ const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, property2.name, bindingKind === BindingKind.Attribute).filter((context) => context !== SecurityContext.NONE);
19413
+ ingestHostProperty(job, property2, bindingKind, securityContexts);
19187
19414
  }
19188
19415
  for (const [name, expr] of (_b2 = Object.entries(input.attributes)) != null ? _b2 : []) {
19189
- ingestHostAttribute(job, name, expr);
19416
+ const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, name, true).filter((context) => context !== SecurityContext.NONE);
19417
+ ingestHostAttribute(job, name, expr, securityContexts);
19190
19418
  }
19191
19419
  for (const event of (_c2 = input.events) != null ? _c2 : []) {
19192
19420
  ingestHostEvent(job, event);
19193
19421
  }
19194
19422
  return job;
19195
19423
  }
19196
- function ingestHostProperty(job, property2, isTextAttribute) {
19424
+ function ingestHostProperty(job, property2, bindingKind, securityContexts) {
19197
19425
  let expression;
19198
19426
  const ast = property2.expression.ast;
19199
19427
  if (ast instanceof Interpolation) {
@@ -19201,34 +19429,27 @@ function ingestHostProperty(job, property2, isTextAttribute) {
19201
19429
  } else {
19202
19430
  expression = convertAst(ast, job, property2.sourceSpan);
19203
19431
  }
19204
- let bindingKind = BindingKind.Property;
19205
- if (property2.name.startsWith("attr.")) {
19206
- property2.name = property2.name.substring("attr.".length);
19207
- bindingKind = BindingKind.Attribute;
19208
- }
19209
- if (property2.isAnimation) {
19210
- bindingKind = BindingKind.Animation;
19211
- }
19212
- job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, SecurityContext.NONE, isTextAttribute, false, null, property2.sourceSpan));
19432
+ job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, securityContexts, false, false, null, null, property2.sourceSpan));
19213
19433
  }
19214
- function ingestHostAttribute(job, name, value) {
19434
+ function ingestHostAttribute(job, name, value, securityContexts) {
19215
19435
  const attrBinding = createBindingOp(
19216
19436
  job.root.xref,
19217
19437
  BindingKind.Attribute,
19218
19438
  name,
19219
19439
  value,
19220
19440
  null,
19221
- SecurityContext.NONE,
19441
+ securityContexts,
19222
19442
  true,
19223
19443
  false,
19224
19444
  null,
19225
- null
19445
+ null,
19446
+ value.sourceSpan
19226
19447
  );
19227
19448
  job.root.update.push(attrBinding);
19228
19449
  }
19229
19450
  function ingestHostEvent(job, event) {
19230
- const eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, event.targetOrPhase, true, event.sourceSpan);
19231
- eventBinding.handlerOps.push(createStatementOp(new ReturnStatement(convertAst(event.handler.ast, job, event.sourceSpan), event.handlerSpan)));
19451
+ const [phase, target] = event.type === 0 ? [null, event.targetOrPhase] : [event.targetOrPhase, null];
19452
+ const eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, makeListenerHandlerOps(job.root, event.handler, event.handlerSpan), phase, target, true, event.sourceSpan);
19232
19453
  job.root.create.push(eventBinding);
19233
19454
  }
19234
19455
  function ingestNodes(unit, template2) {
@@ -19240,9 +19461,9 @@ function ingestNodes(unit, template2) {
19240
19461
  } else if (node instanceof Content) {
19241
19462
  ingestContent(unit, node);
19242
19463
  } else if (node instanceof Text) {
19243
- ingestText(unit, node);
19464
+ ingestText(unit, node, null);
19244
19465
  } else if (node instanceof BoundText) {
19245
- ingestBoundText(unit, node);
19466
+ ingestBoundText(unit, node, null);
19246
19467
  } else if (node instanceof IfBlock) {
19247
19468
  ingestIfBlock(unit, node);
19248
19469
  } else if (node instanceof SwitchBlock) {
@@ -19259,26 +19480,30 @@ function ingestNodes(unit, template2) {
19259
19480
  }
19260
19481
  }
19261
19482
  function ingestElement(unit, element2) {
19262
- var _a2;
19483
+ var _a2, _b2;
19263
19484
  if (element2.i18n !== void 0 && !(element2.i18n instanceof Message || element2.i18n instanceof TagPlaceholder)) {
19264
19485
  throw Error(`Unhandled i18n metadata type for element: ${element2.i18n.constructor.name}`);
19265
19486
  }
19266
19487
  const id = unit.job.allocateXrefId();
19267
19488
  const [namespaceKey, elementName] = splitNsName(element2.name);
19268
- const startOp = createElementStartOp(elementName, id, namespaceForKey(namespaceKey), element2.i18n instanceof TagPlaceholder ? element2.i18n : void 0, element2.startSourceSpan);
19489
+ const startOp = createElementStartOp(elementName, id, namespaceForKey(namespaceKey), element2.i18n instanceof TagPlaceholder ? element2.i18n : void 0, element2.startSourceSpan, element2.sourceSpan);
19269
19490
  unit.create.push(startOp);
19270
- ingestBindings(unit, startOp, element2);
19491
+ ingestElementBindings(unit, startOp, element2);
19271
19492
  ingestReferences(startOp, element2);
19493
+ let i18nBlockId = null;
19494
+ if (element2.i18n instanceof Message) {
19495
+ i18nBlockId = unit.job.allocateXrefId();
19496
+ unit.create.push(createI18nStartOp(i18nBlockId, element2.i18n, void 0, element2.startSourceSpan));
19497
+ }
19272
19498
  ingestNodes(unit, element2.children);
19273
19499
  const endOp = createElementEndOp(id, (_a2 = element2.endSourceSpan) != null ? _a2 : element2.startSourceSpan);
19274
19500
  unit.create.push(endOp);
19275
- if (element2.i18n instanceof Message) {
19276
- const i18nBlockId = unit.job.allocateXrefId();
19277
- OpList.insertAfter(createI18nStartOp(i18nBlockId, element2.i18n), startOp);
19278
- OpList.insertBefore(createI18nEndOp(i18nBlockId), endOp);
19501
+ if (i18nBlockId !== null) {
19502
+ OpList.insertBefore(createI18nEndOp(i18nBlockId, (_b2 = element2.endSourceSpan) != null ? _b2 : element2.startSourceSpan), endOp);
19279
19503
  }
19280
19504
  }
19281
19505
  function ingestTemplate(unit, tmpl) {
19506
+ var _a2;
19282
19507
  if (tmpl.i18n !== void 0 && !(tmpl.i18n instanceof Message || tmpl.i18n instanceof TagPlaceholder)) {
19283
19508
  throw Error(`Unhandled i18n metadata type for template: ${tmpl.i18n.constructor.name}`);
19284
19509
  }
@@ -19292,9 +19517,9 @@ function ingestTemplate(unit, tmpl) {
19292
19517
  const namespace = namespaceForKey(namespacePrefix);
19293
19518
  const functionNameSuffix = tagNameWithoutNamespace === null ? "" : prefixWithNamespace(tagNameWithoutNamespace, namespace);
19294
19519
  const templateKind = isPlainTemplate(tmpl) ? TemplateKind.NgTemplate : TemplateKind.Structural;
19295
- const templateOp = createTemplateOp(childView.xref, templateKind, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan);
19520
+ const templateOp = createTemplateOp(childView.xref, templateKind, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan, tmpl.sourceSpan);
19296
19521
  unit.create.push(templateOp);
19297
- ingestBindings(unit, templateOp, tmpl);
19522
+ ingestTemplateBindings(unit, templateOp, tmpl, templateKind);
19298
19523
  ingestReferences(templateOp, tmpl);
19299
19524
  ingestNodes(childView, tmpl.children);
19300
19525
  for (const { name, value } of tmpl.variables) {
@@ -19302,25 +19527,25 @@ function ingestTemplate(unit, tmpl) {
19302
19527
  }
19303
19528
  if (templateKind === TemplateKind.NgTemplate && tmpl.i18n instanceof Message) {
19304
19529
  const id = unit.job.allocateXrefId();
19305
- OpList.insertAfter(createI18nStartOp(id, tmpl.i18n), childView.create.head);
19306
- OpList.insertBefore(createI18nEndOp(id), childView.create.tail);
19530
+ OpList.insertAfter(createI18nStartOp(id, tmpl.i18n, void 0, tmpl.startSourceSpan), childView.create.head);
19531
+ OpList.insertBefore(createI18nEndOp(id, (_a2 = tmpl.endSourceSpan) != null ? _a2 : tmpl.startSourceSpan), childView.create.tail);
19307
19532
  }
19308
19533
  }
19309
19534
  function ingestContent(unit, content) {
19310
19535
  if (content.i18n !== void 0 && !(content.i18n instanceof TagPlaceholder)) {
19311
19536
  throw Error(`Unhandled i18n metadata type for element: ${content.i18n.constructor.name}`);
19312
19537
  }
19313
- const attrs = content.attributes.flatMap((a) => [a.name, a.value]);
19314
- const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.i18n, attrs, content.sourceSpan);
19538
+ const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.i18n, content.sourceSpan);
19315
19539
  for (const attr of content.attributes) {
19316
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue, attr.i18n);
19540
+ const securityContext = domSchema.securityContext(content.name, attr.name, true);
19541
+ unit.update.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
19317
19542
  }
19318
19543
  unit.create.push(op);
19319
19544
  }
19320
- function ingestText(unit, text2) {
19321
- unit.create.push(createTextOp(unit.job.allocateXrefId(), text2.value, text2.sourceSpan));
19545
+ function ingestText(unit, text2, icuPlaceholder) {
19546
+ unit.create.push(createTextOp(unit.job.allocateXrefId(), text2.value, icuPlaceholder, text2.sourceSpan));
19322
19547
  }
19323
- function ingestBoundText(unit, text2, i18nPlaceholders) {
19548
+ function ingestBoundText(unit, text2, icuPlaceholder) {
19324
19549
  var _a2;
19325
19550
  let value = text2.value;
19326
19551
  if (value instanceof ASTWithSource) {
@@ -19332,14 +19557,12 @@ function ingestBoundText(unit, text2, i18nPlaceholders) {
19332
19557
  if (text2.i18n !== void 0 && !(text2.i18n instanceof Container)) {
19333
19558
  throw Error(`Unhandled i18n metadata type for text interpolation: ${(_a2 = text2.i18n) == null ? void 0 : _a2.constructor.name}`);
19334
19559
  }
19335
- if (i18nPlaceholders === void 0) {
19336
- i18nPlaceholders = text2.i18n instanceof Container ? text2.i18n.children.filter((node) => node instanceof Placeholder).map((placeholder) => placeholder.name) : [];
19337
- }
19560
+ const i18nPlaceholders = text2.i18n instanceof Container ? text2.i18n.children.filter((node) => node instanceof Placeholder).map((placeholder) => placeholder.name) : [];
19338
19561
  if (i18nPlaceholders.length > 0 && i18nPlaceholders.length !== value.expressions.length) {
19339
19562
  throw Error(`Unexpected number of i18n placeholders (${value.expressions.length}) for BoundText with ${value.expressions.length} expressions`);
19340
19563
  }
19341
19564
  const textXref = unit.job.allocateXrefId();
19342
- unit.create.push(createTextOp(textXref, "", text2.sourceSpan));
19565
+ unit.create.push(createTextOp(textXref, "", icuPlaceholder, text2.sourceSpan));
19343
19566
  const baseSourceSpan = unit.job.compatibility ? null : text2.sourceSpan;
19344
19567
  unit.update.push(createInterpolateTextOp(textXref, new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan)), i18nPlaceholders), text2.sourceSpan));
19345
19568
  }
@@ -19365,7 +19588,7 @@ function ingestIfBlock(unit, ifBlock) {
19365
19588
  }
19366
19589
  ifCaseI18nMeta = ifCase.i18n;
19367
19590
  }
19368
- const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, "Conditional", Namespace.HTML, ifCaseI18nMeta, ifCase.sourceSpan);
19591
+ const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, "Conditional", Namespace.HTML, ifCaseI18nMeta, ifCase.startSourceSpan, ifCase.sourceSpan);
19369
19592
  unit.create.push(templateOp);
19370
19593
  if (firstXref === null) {
19371
19594
  firstXref = cView.xref;
@@ -19393,7 +19616,7 @@ function ingestSwitchBlock(unit, switchBlock) {
19393
19616
  }
19394
19617
  switchCaseI18nMeta = switchCase.i18n;
19395
19618
  }
19396
- const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, null, "Case", Namespace.HTML, switchCaseI18nMeta, switchCase.sourceSpan);
19619
+ const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, null, "Case", Namespace.HTML, switchCaseI18nMeta, switchCase.startSourceSpan, switchCase.sourceSpan);
19397
19620
  unit.create.push(templateOp);
19398
19621
  if (firstXref === null) {
19399
19622
  firstXref = cView.xref;
@@ -19407,35 +19630,38 @@ function ingestSwitchBlock(unit, switchBlock) {
19407
19630
  const conditional2 = createConditionalOp(firstXref, firstSlotHandle, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan);
19408
19631
  unit.update.push(conditional2);
19409
19632
  }
19410
- function ingestDeferView(unit, suffix, children, sourceSpan) {
19633
+ function ingestDeferView(unit, suffix, i18nMeta, children, sourceSpan) {
19634
+ if (i18nMeta !== void 0 && !(i18nMeta instanceof BlockPlaceholder)) {
19635
+ throw Error("Unhandled i18n metadata type for defer block");
19636
+ }
19411
19637
  if (children === void 0) {
19412
19638
  return null;
19413
19639
  }
19414
19640
  const secondaryView = unit.job.allocateView(unit.xref);
19415
19641
  ingestNodes(secondaryView, children);
19416
- const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML, void 0, sourceSpan);
19642
+ const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML, i18nMeta, sourceSpan, sourceSpan);
19417
19643
  unit.create.push(templateOp);
19418
19644
  return templateOp;
19419
19645
  }
19420
19646
  function ingestDeferBlock(unit, deferBlock) {
19421
- var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
19647
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
19422
19648
  const blockMeta = unit.job.deferBlocksMeta.get(deferBlock);
19423
19649
  if (blockMeta === void 0) {
19424
19650
  throw new Error(`AssertionError: unable to find metadata for deferred block`);
19425
19651
  }
19426
- const main = ingestDeferView(unit, "", deferBlock.children, deferBlock.sourceSpan);
19427
- const loading = ingestDeferView(unit, "Loading", (_a2 = deferBlock.loading) == null ? void 0 : _a2.children, (_b2 = deferBlock.loading) == null ? void 0 : _b2.sourceSpan);
19428
- const placeholder = ingestDeferView(unit, "Placeholder", (_c2 = deferBlock.placeholder) == null ? void 0 : _c2.children, (_d2 = deferBlock.placeholder) == null ? void 0 : _d2.sourceSpan);
19429
- const error2 = ingestDeferView(unit, "Error", (_e2 = deferBlock.error) == null ? void 0 : _e2.children, (_f2 = deferBlock.error) == null ? void 0 : _f2.sourceSpan);
19652
+ const main = ingestDeferView(unit, "", deferBlock.i18n, deferBlock.children, deferBlock.sourceSpan);
19653
+ const loading = ingestDeferView(unit, "Loading", (_a2 = deferBlock.loading) == null ? void 0 : _a2.i18n, (_b2 = deferBlock.loading) == null ? void 0 : _b2.children, (_c2 = deferBlock.loading) == null ? void 0 : _c2.sourceSpan);
19654
+ const placeholder = ingestDeferView(unit, "Placeholder", (_d2 = deferBlock.placeholder) == null ? void 0 : _d2.i18n, (_e2 = deferBlock.placeholder) == null ? void 0 : _e2.children, (_f2 = deferBlock.placeholder) == null ? void 0 : _f2.sourceSpan);
19655
+ const error2 = ingestDeferView(unit, "Error", (_g = deferBlock.error) == null ? void 0 : _g.i18n, (_h = deferBlock.error) == null ? void 0 : _h.children, (_i = deferBlock.error) == null ? void 0 : _i.sourceSpan);
19430
19656
  const deferXref = unit.job.allocateXrefId();
19431
19657
  const deferOp = createDeferOp(deferXref, main.xref, main.handle, blockMeta, deferBlock.sourceSpan);
19432
- deferOp.placeholderView = (_g = placeholder == null ? void 0 : placeholder.xref) != null ? _g : null;
19433
- deferOp.placeholderSlot = (_h = placeholder == null ? void 0 : placeholder.handle) != null ? _h : null;
19434
- deferOp.loadingSlot = (_i = loading == null ? void 0 : loading.handle) != null ? _i : null;
19435
- deferOp.errorSlot = (_j = error2 == null ? void 0 : error2.handle) != null ? _j : null;
19436
- deferOp.placeholderMinimumTime = (_l = (_k = deferBlock.placeholder) == null ? void 0 : _k.minimumTime) != null ? _l : null;
19437
- deferOp.loadingMinimumTime = (_n = (_m = deferBlock.loading) == null ? void 0 : _m.minimumTime) != null ? _n : null;
19438
- deferOp.loadingAfterTime = (_p = (_o = deferBlock.loading) == null ? void 0 : _o.afterTime) != null ? _p : null;
19658
+ deferOp.placeholderView = (_j = placeholder == null ? void 0 : placeholder.xref) != null ? _j : null;
19659
+ deferOp.placeholderSlot = (_k = placeholder == null ? void 0 : placeholder.handle) != null ? _k : null;
19660
+ deferOp.loadingSlot = (_l = loading == null ? void 0 : loading.handle) != null ? _l : null;
19661
+ deferOp.errorSlot = (_m = error2 == null ? void 0 : error2.handle) != null ? _m : null;
19662
+ deferOp.placeholderMinimumTime = (_o = (_n = deferBlock.placeholder) == null ? void 0 : _n.minimumTime) != null ? _o : null;
19663
+ deferOp.loadingMinimumTime = (_q = (_p = deferBlock.loading) == null ? void 0 : _p.minimumTime) != null ? _q : null;
19664
+ deferOp.loadingAfterTime = (_s = (_r = deferBlock.loading) == null ? void 0 : _r.afterTime) != null ? _s : null;
19439
19665
  unit.create.push(deferOp);
19440
19666
  let prefetch = false;
19441
19667
  let deferOnOps = [];
@@ -19487,6 +19713,9 @@ function ingestDeferBlock(unit, deferBlock) {
19487
19713
  deferOnOps.push(deferOnOp);
19488
19714
  }
19489
19715
  if (triggers.when !== void 0) {
19716
+ if (triggers.when.value instanceof Interpolation) {
19717
+ throw new Error(`Unexpected interpolation in defer block when trigger`);
19718
+ }
19490
19719
  const deferOnOp = createDeferWhenOp(deferXref, convertAst(triggers.when.value, unit.job, triggers.when.sourceSpan), prefetch, triggers.when.sourceSpan);
19491
19720
  deferWhenOps.push(deferOnOp);
19492
19721
  }
@@ -19506,9 +19735,9 @@ function ingestIcu(unit, icu) {
19506
19735
  unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
19507
19736
  for (const [placeholder, text2] of Object.entries(__spreadValues(__spreadValues({}, icu.vars), icu.placeholders))) {
19508
19737
  if (text2 instanceof BoundText) {
19509
- ingestBoundText(unit, text2, [placeholder]);
19738
+ ingestBoundText(unit, text2, placeholder);
19510
19739
  } else {
19511
- ingestText(unit, text2);
19740
+ ingestText(unit, text2, placeholder);
19512
19741
  }
19513
19742
  }
19514
19743
  unit.create.push(createIcuEndOp(xref));
@@ -19517,7 +19746,7 @@ function ingestIcu(unit, icu) {
19517
19746
  }
19518
19747
  }
19519
19748
  function ingestForBlock(unit, forBlock) {
19520
- var _a2;
19749
+ var _a2, _b2, _c2;
19521
19750
  const repeaterView = unit.job.allocateView(unit.xref);
19522
19751
  const createRepeaterAlias = (ident, repeaterVar) => {
19523
19752
  repeaterView.aliases.add({
@@ -19538,9 +19767,11 @@ function ingestForBlock(unit, forBlock) {
19538
19767
  const track = convertAst(forBlock.trackBy, unit.job, sourceSpan);
19539
19768
  ingestNodes(repeaterView, forBlock.children);
19540
19769
  let emptyView = null;
19770
+ let emptyTagName = null;
19541
19771
  if (forBlock.empty !== null) {
19542
19772
  emptyView = unit.job.allocateView(unit.xref);
19543
19773
  ingestNodes(emptyView, forBlock.empty.children);
19774
+ emptyTagName = ingestControlFlowInsertionPoint(unit, emptyView.xref, forBlock.empty);
19544
19775
  }
19545
19776
  const varNames = {
19546
19777
  $index: forBlock.contextVariables.$index.name,
@@ -19551,8 +19782,16 @@ function ingestForBlock(unit, forBlock) {
19551
19782
  $odd: forBlock.contextVariables.$odd.name,
19552
19783
  $implicit: forBlock.item.name
19553
19784
  };
19785
+ if (forBlock.i18n !== void 0 && !(forBlock.i18n instanceof BlockPlaceholder)) {
19786
+ throw Error("AssertionError: Unhandled i18n metadata type or @for");
19787
+ }
19788
+ if (((_a2 = forBlock.empty) == null ? void 0 : _a2.i18n) !== void 0 && !(forBlock.empty.i18n instanceof BlockPlaceholder)) {
19789
+ throw Error("AssertionError: Unhandled i18n metadata type or @empty");
19790
+ }
19791
+ const i18nPlaceholder = forBlock.i18n;
19792
+ const emptyI18nPlaceholder = (_b2 = forBlock.empty) == null ? void 0 : _b2.i18n;
19554
19793
  const tagName = ingestControlFlowInsertionPoint(unit, repeaterView.xref, forBlock);
19555
- const repeaterCreate2 = createRepeaterCreateOp(repeaterView.xref, (_a2 = emptyView == null ? void 0 : emptyView.xref) != null ? _a2 : null, tagName, track, varNames, forBlock.sourceSpan);
19794
+ const repeaterCreate2 = createRepeaterCreateOp(repeaterView.xref, (_c2 = emptyView == null ? void 0 : emptyView.xref) != null ? _c2 : null, tagName, track, varNames, emptyTagName, i18nPlaceholder, emptyI18nPlaceholder, forBlock.startSourceSpan, forBlock.sourceSpan);
19556
19795
  unit.create.push(repeaterCreate2);
19557
19796
  const expression = convertAst(forBlock.expression, unit.job, convertSourceSpan(forBlock.expression.span, forBlock.sourceSpan));
19558
19797
  const repeater2 = createRepeaterOp(repeaterCreate2.xref, repeaterCreate2.handle, expression, forBlock.sourceSpan);
@@ -19562,7 +19801,10 @@ function convertAst(ast, job, baseSourceSpan) {
19562
19801
  if (ast instanceof ASTWithSource) {
19563
19802
  return convertAst(ast.ast, job, baseSourceSpan);
19564
19803
  } else if (ast instanceof PropertyRead) {
19565
- if (ast.receiver instanceof ImplicitReceiver && !(ast.receiver instanceof ThisReceiver)) {
19804
+ const isThisReceiver = ast.receiver instanceof ThisReceiver;
19805
+ const isImplicitReceiver = ast.receiver instanceof ImplicitReceiver && !(ast.receiver instanceof ThisReceiver);
19806
+ const isSpecialNode = ast.name === "$any" || ast.name === "$event";
19807
+ if (isImplicitReceiver || isThisReceiver && !isSpecialNode) {
19566
19808
  return new LexicalReadExpr(ast.name);
19567
19809
  } else {
19568
19810
  return new ReadPropExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name, null, convertSourceSpan(ast.span, baseSourceSpan));
@@ -19640,120 +19882,128 @@ function convertAst(ast, job, baseSourceSpan) {
19640
19882
  throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan == null ? void 0 : baseSourceSpan.start.file.url}"`);
19641
19883
  }
19642
19884
  }
19885
+ function convertAstWithInterpolation(job, value, i18nMeta, sourceSpan) {
19886
+ var _a2, _b2;
19887
+ let expression;
19888
+ if (value instanceof Interpolation) {
19889
+ expression = new Interpolation2(value.strings, value.expressions.map((e) => convertAst(e, job, sourceSpan != null ? sourceSpan : null)), Object.keys((_b2 = (_a2 = asMessage(i18nMeta)) == null ? void 0 : _a2.placeholders) != null ? _b2 : {}));
19890
+ } else if (value instanceof AST) {
19891
+ expression = convertAst(value, job, sourceSpan != null ? sourceSpan : null);
19892
+ } else {
19893
+ expression = literal(value);
19894
+ }
19895
+ return expression;
19896
+ }
19897
+ var BINDING_KINDS = /* @__PURE__ */ new Map([
19898
+ [0, BindingKind.Property],
19899
+ [1, BindingKind.Attribute],
19900
+ [2, BindingKind.ClassName],
19901
+ [3, BindingKind.StyleProperty],
19902
+ [4, BindingKind.Animation]
19903
+ ]);
19643
19904
  function isPlainTemplate(tmpl) {
19644
19905
  var _a2;
19645
- return splitNsName((_a2 = tmpl.tagName) != null ? _a2 : "")[1] === "ng-template";
19646
- }
19647
- function ingestBindings(unit, op, element2) {
19648
- let flags = BindingFlags.None;
19649
- let hasI18nAttributes = false;
19650
- if (element2 instanceof Template) {
19651
- flags |= BindingFlags.OnNgTemplateElement;
19652
- if (element2 instanceof Template && isPlainTemplate(element2)) {
19653
- flags |= BindingFlags.BindingTargetsTemplate;
19654
- }
19655
- const templateAttrFlags = flags | BindingFlags.BindingTargetsTemplate | BindingFlags.IsStructuralTemplateAttribute;
19656
- for (const attr of element2.templateAttrs) {
19657
- if (attr instanceof TextAttribute) {
19658
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, templateAttrFlags | BindingFlags.TextValue, attr.i18n);
19659
- hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19660
- } else {
19661
- ingestBinding(unit, op.xref, attr.name, attr.value, attr.type, attr.unit, attr.securityContext, attr.sourceSpan, templateAttrFlags, attr.i18n);
19662
- hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19663
- }
19664
- }
19906
+ return splitNsName((_a2 = tmpl.tagName) != null ? _a2 : "")[1] === NG_TEMPLATE_TAG_NAME;
19907
+ }
19908
+ function asMessage(i18nMeta) {
19909
+ if (i18nMeta == null) {
19910
+ return null;
19911
+ }
19912
+ if (!(i18nMeta instanceof Message)) {
19913
+ throw Error(`Expected i18n meta to be a Message, but got: ${i18nMeta.constructor.name}`);
19665
19914
  }
19915
+ return i18nMeta;
19916
+ }
19917
+ function ingestElementBindings(unit, op, element2) {
19918
+ var _a2;
19919
+ let bindings = new Array();
19666
19920
  for (const attr of element2.attributes) {
19667
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, flags | BindingFlags.TextValue, attr.i18n);
19668
- hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19921
+ const securityContext = domSchema.securityContext(element2.name, attr.name, true);
19922
+ bindings.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, convertAstWithInterpolation(unit.job, attr.value, attr.i18n), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
19669
19923
  }
19670
19924
  for (const input of element2.inputs) {
19671
- ingestBinding(unit, op.xref, input.name, input.value, input.type, input.unit, input.securityContext, input.sourceSpan, flags, input.i18n);
19672
- hasI18nAttributes || (hasI18nAttributes = input.i18n !== void 0);
19925
+ bindings.push(createBindingOp(op.xref, BINDING_KINDS.get(input.type), input.name, convertAstWithInterpolation(unit.job, astOf(input.value), input.i18n), input.unit, input.securityContext, false, false, null, (_a2 = asMessage(input.i18n)) != null ? _a2 : null, input.sourceSpan));
19673
19926
  }
19927
+ unit.create.push(bindings.filter((b) => (b == null ? void 0 : b.kind) === OpKind.ExtractedAttribute));
19928
+ unit.update.push(bindings.filter((b) => (b == null ? void 0 : b.kind) === OpKind.Binding));
19674
19929
  for (const output of element2.outputs) {
19675
- let listenerOp;
19676
- if (output.type === 1) {
19677
- if (output.phase === null) {
19678
- throw Error("Animation listener should have a phase");
19679
- }
19930
+ if (output.type === 1 && output.phase === null) {
19931
+ throw Error("Animation listener should have a phase");
19680
19932
  }
19681
- if (element2 instanceof Template && !isPlainTemplate(element2)) {
19682
- unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null, null));
19683
- continue;
19684
- }
19685
- listenerOp = createListenerOp(op.xref, op.handle, output.name, op.tag, output.phase, false, output.sourceSpan);
19686
- let handlerExprs;
19687
- let handler = output.handler;
19688
- if (handler instanceof ASTWithSource) {
19689
- handler = handler.ast;
19690
- }
19691
- if (handler instanceof Chain) {
19692
- handlerExprs = handler.expressions;
19933
+ unit.create.push(createListenerOp(op.xref, op.handle, output.name, op.tag, makeListenerHandlerOps(unit, output.handler, output.handlerSpan), output.phase, output.target, false, output.sourceSpan));
19934
+ }
19935
+ if (bindings.some((b) => b == null ? void 0 : b.i18nMessage) !== null) {
19936
+ unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref));
19937
+ }
19938
+ }
19939
+ function ingestTemplateBindings(unit, op, template2, templateKind) {
19940
+ let bindings = new Array();
19941
+ for (const attr of template2.templateAttrs) {
19942
+ if (attr instanceof TextAttribute) {
19943
+ const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
19944
+ bindings.push(createTemplateBinding(unit, op.xref, 1, attr.name, attr.value, null, securityContext, true, templateKind, asMessage(attr.i18n), attr.sourceSpan));
19693
19945
  } else {
19694
- handlerExprs = [handler];
19946
+ bindings.push(createTemplateBinding(unit, op.xref, attr.type, attr.name, astOf(attr.value), attr.unit, attr.securityContext, true, templateKind, asMessage(attr.i18n), attr.sourceSpan));
19695
19947
  }
19696
- if (handlerExprs.length === 0) {
19697
- throw new Error("Expected listener to have non-empty expression list.");
19948
+ }
19949
+ for (const attr of template2.attributes) {
19950
+ const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
19951
+ bindings.push(createTemplateBinding(unit, op.xref, 1, attr.name, attr.value, null, securityContext, false, templateKind, asMessage(attr.i18n), attr.sourceSpan));
19952
+ }
19953
+ for (const input of template2.inputs) {
19954
+ bindings.push(createTemplateBinding(unit, op.xref, input.type, input.name, astOf(input.value), input.unit, input.securityContext, false, templateKind, asMessage(input.i18n), input.sourceSpan));
19955
+ }
19956
+ unit.create.push(bindings.filter((b) => (b == null ? void 0 : b.kind) === OpKind.ExtractedAttribute));
19957
+ unit.update.push(bindings.filter((b) => (b == null ? void 0 : b.kind) === OpKind.Binding));
19958
+ for (const output of template2.outputs) {
19959
+ if (output.type === 1 && output.phase === null) {
19960
+ throw Error("Animation listener should have a phase");
19961
+ }
19962
+ if (templateKind === TemplateKind.NgTemplate) {
19963
+ unit.create.push(createListenerOp(op.xref, op.handle, output.name, op.tag, makeListenerHandlerOps(unit, output.handler, output.handlerSpan), output.phase, output.target, false, output.sourceSpan));
19698
19964
  }
19699
- const expressions = handlerExprs.map((expr) => convertAst(expr, unit.job, output.handlerSpan));
19700
- const returnExpr = expressions.pop();
19701
- for (const expr of expressions) {
19702
- const stmtOp = createStatementOp(new ExpressionStatement(expr, expr.sourceSpan));
19703
- listenerOp.handlerOps.push(stmtOp);
19965
+ if (templateKind === TemplateKind.Structural && output.type !== 1) {
19966
+ const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, output.name, false);
19967
+ unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null, null, null, securityContext));
19704
19968
  }
19705
- listenerOp.handlerOps.push(createStatementOp(new ReturnStatement(returnExpr, returnExpr.sourceSpan)));
19706
- unit.create.push(listenerOp);
19707
19969
  }
19708
- if (hasI18nAttributes) {
19970
+ if (bindings.some((b) => b == null ? void 0 : b.i18nMessage) !== null) {
19709
19971
  unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref));
19710
19972
  }
19711
19973
  }
19712
- var BINDING_KINDS = /* @__PURE__ */ new Map([
19713
- [0, BindingKind.Property],
19714
- [1, BindingKind.Attribute],
19715
- [2, BindingKind.ClassName],
19716
- [3, BindingKind.StyleProperty],
19717
- [4, BindingKind.Animation]
19718
- ]);
19719
- var BindingFlags;
19720
- (function(BindingFlags2) {
19721
- BindingFlags2[BindingFlags2["None"] = 0] = "None";
19722
- BindingFlags2[BindingFlags2["TextValue"] = 1] = "TextValue";
19723
- BindingFlags2[BindingFlags2["BindingTargetsTemplate"] = 2] = "BindingTargetsTemplate";
19724
- BindingFlags2[BindingFlags2["IsStructuralTemplateAttribute"] = 4] = "IsStructuralTemplateAttribute";
19725
- BindingFlags2[BindingFlags2["OnNgTemplateElement"] = 8] = "OnNgTemplateElement";
19726
- })(BindingFlags || (BindingFlags = {}));
19727
- function ingestBinding(view, xref, name, value, type, unit, securityContext, sourceSpan, flags, i18nMeta) {
19728
- if (value instanceof ASTWithSource) {
19729
- value = value.ast;
19730
- }
19731
- let i18nContext = null;
19732
- if (i18nMeta !== void 0) {
19733
- if (!(i18nMeta instanceof Message)) {
19734
- throw Error(`Unhandled i18n metadata type for binding: ${i18nMeta.constructor.name}`);
19974
+ function createTemplateBinding(view, xref, type, name, value, unit, securityContext, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {
19975
+ const isTextBinding = typeof value === "string";
19976
+ if (templateKind === TemplateKind.Structural) {
19977
+ if (!isStructuralTemplateAttribute && (type === 0 || type === 2 || type === 3)) {
19978
+ return createExtractedAttributeOp(xref, BindingKind.Property, name, null, null, i18nMessage, securityContext);
19979
+ }
19980
+ if (!isTextBinding && (type === 1 || type === 4)) {
19981
+ return null;
19735
19982
  }
19736
- i18nContext = view.job.allocateXrefId();
19737
- view.create.push(createI18nContextOp(I18nContextKind.Attr, i18nContext, null, i18nMeta, null));
19738
- }
19739
- if (flags & BindingFlags.OnNgTemplateElement && !(flags & BindingFlags.BindingTargetsTemplate) && type === 0) {
19740
- view.create.push(createExtractedAttributeOp(xref, BindingKind.Property, name, null, i18nContext));
19741
- return;
19742
19983
  }
19743
- let expression;
19744
- if (value instanceof Interpolation) {
19745
- let i18nPlaceholders = [];
19746
- if (i18nMeta !== void 0) {
19747
- i18nPlaceholders = Object.keys(i18nMeta.placeholders);
19984
+ let bindingType = BINDING_KINDS.get(type);
19985
+ if (templateKind === TemplateKind.NgTemplate) {
19986
+ if (type === 2 || type === 3 || type === 1 && !isTextBinding) {
19987
+ bindingType = BindingKind.Property;
19748
19988
  }
19749
- expression = new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, view.job, null)), i18nPlaceholders);
19750
- } else if (value instanceof AST) {
19751
- expression = convertAst(value, view.job, null);
19752
- } else {
19753
- expression = value;
19754
19989
  }
19755
- const kind = BINDING_KINDS.get(type);
19756
- view.update.push(createBindingOp(xref, kind, name, expression, unit, securityContext, !!(flags & BindingFlags.TextValue), !!(flags & BindingFlags.IsStructuralTemplateAttribute), i18nContext, sourceSpan));
19990
+ return createBindingOp(xref, bindingType, name, convertAstWithInterpolation(view.job, value, i18nMessage), unit, securityContext, isTextBinding, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan);
19991
+ }
19992
+ function makeListenerHandlerOps(unit, handler, handlerSpan) {
19993
+ handler = astOf(handler);
19994
+ const handlerOps = new Array();
19995
+ let handlerExprs = handler instanceof Chain ? handler.expressions : [handler];
19996
+ if (handlerExprs.length === 0) {
19997
+ throw new Error("Expected listener to have non-empty expression list.");
19998
+ }
19999
+ const expressions = handlerExprs.map((expr) => convertAst(expr, unit.job, handlerSpan));
20000
+ const returnExpr = expressions.pop();
20001
+ handlerOps.push(...expressions.map((e) => createStatementOp(new ExpressionStatement(e, e.sourceSpan))));
20002
+ handlerOps.push(createStatementOp(new ReturnStatement(returnExpr, returnExpr.sourceSpan)));
20003
+ return handlerOps;
20004
+ }
20005
+ function astOf(ast) {
20006
+ return ast instanceof ASTWithSource ? ast.ast : ast;
19757
20007
  }
19758
20008
  function ingestReferences(op, element2) {
19759
20009
  assertIsArray(op.localRefs);
@@ -19793,18 +20043,19 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
19793
20043
  }
19794
20044
  if (root !== null) {
19795
20045
  for (const attr of root.attributes) {
19796
- ingestBinding(unit, xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue, attr.i18n);
20046
+ const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
20047
+ unit.update.push(createBindingOp(xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
19797
20048
  }
19798
20049
  const tagName = root instanceof Element ? root.name : root.tagName;
19799
- return tagName === "ng-template" ? null : tagName;
20050
+ return tagName === NG_TEMPLATE_TAG_NAME ? null : tagName;
19800
20051
  }
19801
20052
  return null;
19802
20053
  }
19803
20054
 
19804
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
20055
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
19805
20056
  var USE_TEMPLATE_PIPELINE = false;
19806
20057
 
19807
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
20058
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
19808
20059
  var IMPORTANT_FLAG = "!important";
19809
20060
  var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
19810
20061
  var StylingBuilder = class {
@@ -20137,7 +20388,7 @@ function isEmptyExpression(ast) {
20137
20388
  return ast instanceof EmptyExpr;
20138
20389
  }
20139
20390
 
20140
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
20391
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
20141
20392
  var HtmlParser = class extends Parser2 {
20142
20393
  constructor() {
20143
20394
  super(getHtmlTagDefinition);
@@ -20147,7 +20398,7 @@ var HtmlParser = class extends Parser2 {
20147
20398
  }
20148
20399
  };
20149
20400
 
20150
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
20401
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
20151
20402
  var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
20152
20403
  var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
20153
20404
  var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
@@ -20213,7 +20464,7 @@ function visitAllWithSiblings(visitor, nodes) {
20213
20464
  return result;
20214
20465
  }
20215
20466
 
20216
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
20467
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
20217
20468
  var PROPERTY_PARTS_SEPARATOR = ".";
20218
20469
  var ATTRIBUTE_PREFIX = "attr";
20219
20470
  var CLASS_PREFIX = "class";
@@ -20533,7 +20784,7 @@ function moveParseSourceSpan(sourceSpan, absoluteSpan) {
20533
20784
  return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
20534
20785
  }
20535
20786
 
20536
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
20787
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
20537
20788
  function isStyleUrlResolvable(url) {
20538
20789
  if (url == null || url.length === 0 || url[0] == "/")
20539
20790
  return false;
@@ -20542,7 +20793,7 @@ function isStyleUrlResolvable(url) {
20542
20793
  }
20543
20794
  var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
20544
20795
 
20545
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
20796
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
20546
20797
  var NG_CONTENT_SELECT_ATTR = "select";
20547
20798
  var LINK_ELEMENT = "link";
20548
20799
  var LINK_STYLE_REL_ATTR = "rel";
@@ -20612,7 +20863,7 @@ function normalizeNgContentSelect(selectAttr) {
20612
20863
  return selectAttr;
20613
20864
  }
20614
20865
 
20615
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
20866
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
20616
20867
  var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/;
20617
20868
  var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
20618
20869
  var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
@@ -20903,7 +21154,7 @@ function stripOptionalParentheses(param, errors) {
20903
21154
  return expression.slice(start, end);
20904
21155
  }
20905
21156
 
20906
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
21157
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
20907
21158
  var TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/;
20908
21159
  var SEPARATOR_PATTERN = /^\s$/;
20909
21160
  var COMMA_DELIMITED_SYNTAX = /* @__PURE__ */ new Map([
@@ -21167,7 +21418,7 @@ function parseDeferredTime(value) {
21167
21418
  return parseFloat(time) * (units === "s" ? 1e3 : 1);
21168
21419
  }
21169
21420
 
21170
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
21421
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
21171
21422
  var PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
21172
21423
  var PREFETCH_ON_PATTERN = /^prefetch\s+on\s/;
21173
21424
  var MINIMUM_PARAMETER_PATTERN = /^minimum\s/;
@@ -21302,7 +21553,7 @@ function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
21302
21553
  return { triggers, prefetchTriggers };
21303
21554
  }
21304
21555
 
21305
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
21556
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
21306
21557
  var BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;
21307
21558
  var KW_BIND_IDX = 1;
21308
21559
  var KW_LET_IDX = 2;
@@ -21733,7 +21984,7 @@ function textContents(node) {
21733
21984
  }
21734
21985
  }
21735
21986
 
21736
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
21987
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
21737
21988
  var TagType;
21738
21989
  (function(TagType2) {
21739
21990
  TagType2[TagType2["ELEMENT"] = 0] = "ELEMENT";
@@ -21878,21 +22129,21 @@ function serializePlaceholderValue(value) {
21878
22129
  }
21879
22130
  }
21880
22131
 
21881
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
22132
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
21882
22133
  var NG_CONTENT_SELECT_ATTR2 = "select";
21883
22134
  var NG_PROJECT_AS_ATTR_NAME = "ngProjectAs";
21884
22135
  var EVENT_BINDING_SCOPE_GLOBALS = /* @__PURE__ */ new Set(["$event"]);
21885
- var NG_TEMPLATE_TAG_NAME = "ng-template";
21886
- var GLOBAL_TARGET_RESOLVERS = /* @__PURE__ */ new Map([["window", Identifiers.resolveWindow], ["document", Identifiers.resolveDocument], ["body", Identifiers.resolveBody]]);
22136
+ var NG_TEMPLATE_TAG_NAME2 = "ng-template";
22137
+ var GLOBAL_TARGET_RESOLVERS2 = /* @__PURE__ */ new Map([["window", Identifiers.resolveWindow], ["document", Identifiers.resolveDocument], ["body", Identifiers.resolveBody]]);
21887
22138
  var LEADING_TRIVIA_CHARS = [" ", "\n", "\r", " "];
21888
22139
  function renderFlagCheckIfStmt(flags, statements) {
21889
22140
  return ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal(flags), null, false), statements);
21890
22141
  }
21891
22142
  function prepareEventListenerParameters(eventAst, handlerName = null, scope = null) {
21892
22143
  const { type, name, target, phase, handler } = eventAst;
21893
- if (target && !GLOBAL_TARGET_RESOLVERS.has(target)) {
22144
+ if (target && !GLOBAL_TARGET_RESOLVERS2.has(target)) {
21894
22145
  throw new Error(`Unexpected global target '${target}' defined for '${name}' event.
21895
- Supported list of global targets: ${Array.from(GLOBAL_TARGET_RESOLVERS.keys())}.`);
22146
+ Supported list of global targets: ${Array.from(GLOBAL_TARGET_RESOLVERS2.keys())}.`);
21896
22147
  }
21897
22148
  const eventArgumentName = "$event";
21898
22149
  const implicitReceiverAccesses = /* @__PURE__ */ new Set();
@@ -21925,7 +22176,7 @@ function prepareEventListenerParameters(eventAst, handlerName = null, scope = nu
21925
22176
  if (target) {
21926
22177
  params.push(
21927
22178
  literal(false),
21928
- importExpr(GLOBAL_TARGET_RESOLVERS.get(target))
22179
+ importExpr(GLOBAL_TARGET_RESOLVERS2.get(target))
21929
22180
  );
21930
22181
  }
21931
22182
  return params;
@@ -22471,10 +22722,10 @@ var TemplateDefinitionBuilder = class {
22471
22722
  var _a2;
22472
22723
  const tagNameWithoutNamespace = template2.tagName ? splitNsName(template2.tagName)[1] : template2.tagName;
22473
22724
  const contextNameSuffix = template2.tagName ? "_" + sanitizeIdentifier(template2.tagName) : "";
22474
- const attrsExprs = this.getAttributeExpressions(NG_TEMPLATE_TAG_NAME, template2.attributes, template2.inputs, template2.outputs, void 0, template2.templateAttrs);
22725
+ const attrsExprs = this.getAttributeExpressions(NG_TEMPLATE_TAG_NAME2, template2.attributes, template2.inputs, template2.outputs, void 0, template2.templateAttrs);
22475
22726
  const templateIndex = this.createEmbeddedTemplateFn(tagNameWithoutNamespace, template2.children, contextNameSuffix, template2.sourceSpan, template2.variables, attrsExprs, template2.references, template2.i18n);
22476
22727
  this.templatePropertyBindings(templateIndex, template2.templateAttrs);
22477
- if (tagNameWithoutNamespace === NG_TEMPLATE_TAG_NAME) {
22728
+ if (tagNameWithoutNamespace === NG_TEMPLATE_TAG_NAME2) {
22478
22729
  const [i18nInputs, inputs] = partitionArray(template2.inputs, hasI18nMeta);
22479
22730
  if (i18nInputs.length > 0) {
22480
22731
  this.i18nAttributesInstruction(templateIndex, i18nInputs, (_a2 = template2.startSourceSpan) != null ? _a2 : template2.sourceSpan);
@@ -22715,8 +22966,8 @@ var TemplateDefinitionBuilder = class {
22715
22966
  }
22716
22967
  if (root !== null) {
22717
22968
  const name = root instanceof Element ? root.name : root.tagName;
22718
- tagName = name === NG_TEMPLATE_TAG_NAME ? null : name;
22719
- attrsExprs = this.getAttributeExpressions(NG_TEMPLATE_TAG_NAME, root.attributes, root.inputs, []);
22969
+ tagName = name === NG_TEMPLATE_TAG_NAME2 ? null : name;
22970
+ attrsExprs = this.getAttributeExpressions(NG_TEMPLATE_TAG_NAME2, root.attributes, root.inputs, []);
22720
22971
  }
22721
22972
  return { tagName, attrsExprs };
22722
22973
  }
@@ -22732,7 +22983,12 @@ var TemplateDefinitionBuilder = class {
22732
22983
  });
22733
22984
  const { expression: trackByExpression, usesComponentInstance: trackByUsesComponentInstance } = this.createTrackByFunction(block);
22734
22985
  let emptyData = null;
22986
+ let emptyTagName = null;
22987
+ let emptyAttrsExprs;
22735
22988
  if (block.empty !== null) {
22989
+ const emptyInferred = this.inferProjectionDataFromInsertionPoint(block.empty);
22990
+ emptyTagName = emptyInferred.tagName;
22991
+ emptyAttrsExprs = emptyInferred.attrsExprs;
22736
22992
  emptyData = this.prepareEmbeddedTemplateFn(block.empty.children, "_ForEmpty", void 0, block.empty.i18n);
22737
22993
  this.allocateBindingSlots(null);
22738
22994
  }
@@ -22748,11 +23004,11 @@ var TemplateDefinitionBuilder = class {
22748
23004
  trackByExpression
22749
23005
  ];
22750
23006
  if (emptyData !== null) {
22751
- params.push(literal(trackByUsesComponentInstance), variable(emptyData.name), literal(emptyData.getConstCount()), literal(emptyData.getVarCount()));
23007
+ params.push(literal(trackByUsesComponentInstance), variable(emptyData.name), literal(emptyData.getConstCount()), literal(emptyData.getVarCount()), literal(emptyTagName), this.addAttrsToConsts(emptyAttrsExprs || null));
22752
23008
  } else if (trackByUsesComponentInstance) {
22753
23009
  params.push(literal(trackByUsesComponentInstance));
22754
23010
  }
22755
- return params;
23011
+ return trimTrailingNulls(params);
22756
23012
  });
22757
23013
  const value = block.expression.visit(this._valueConverter);
22758
23014
  this.updateInstructionWithAdvance(blockIndex, block.sourceSpan, Identifiers.repeater, () => [this.convertPropertyBinding(value)]);
@@ -23315,12 +23571,15 @@ var BindingScope = class {
23315
23571
  }
23316
23572
  };
23317
23573
  var TrackByBindingScope = class extends BindingScope {
23318
- constructor(parentScope, globalAliases) {
23574
+ constructor(parentScope, globalOverrides) {
23319
23575
  super(parentScope.bindingLevel + 1, parentScope);
23320
- this.globalAliases = globalAliases;
23576
+ this.globalOverrides = globalOverrides;
23321
23577
  this.componentAccessCount = 0;
23322
23578
  }
23323
23579
  get(name) {
23580
+ if (this.globalOverrides.hasOwnProperty(name)) {
23581
+ return variable(this.globalOverrides[name]);
23582
+ }
23324
23583
  let current = this.parent;
23325
23584
  while (current) {
23326
23585
  if (current.hasLocal(name)) {
@@ -23328,9 +23587,6 @@ var TrackByBindingScope = class extends BindingScope {
23328
23587
  }
23329
23588
  current = current.parent;
23330
23589
  }
23331
- if (this.globalAliases[name]) {
23332
- return variable(this.globalAliases[name]);
23333
- }
23334
23590
  this.componentAccessCount++;
23335
23591
  return variable("this").prop(name);
23336
23592
  }
@@ -23555,7 +23811,7 @@ function createClosureModeGuard2() {
23555
23811
  return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
23556
23812
  }
23557
23813
 
23558
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23814
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23559
23815
  var ATTR_REGEX = /attr\.([^\]]+)/;
23560
23816
  var COMPONENT_VARIABLE = "%COMP%";
23561
23817
  var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
@@ -23825,14 +24081,14 @@ function createBaseDirectiveTypeParams(meta) {
23825
24081
  function getInputsTypeExpression(meta) {
23826
24082
  return literalMap(Object.keys(meta.inputs).map((key) => {
23827
24083
  const value = meta.inputs[key];
23828
- return {
23829
- key,
23830
- value: literalMap([
23831
- { key: "alias", value: literal(value.bindingPropertyName), quoted: true },
23832
- { key: "required", value: literal(value.required), quoted: true }
23833
- ]),
23834
- quoted: true
23835
- };
24084
+ const values = [
24085
+ { key: "alias", value: literal(value.bindingPropertyName), quoted: true },
24086
+ { key: "required", value: literal(value.required), quoted: true }
24087
+ ];
24088
+ if (value.isSignal) {
24089
+ values.push({ key: "isSignal", value: literal(value.isSignal), quoted: true });
24090
+ }
24091
+ return { key, value: literalMap(values), quoted: true };
23836
24092
  }));
23837
24093
  }
23838
24094
  function createDirectiveType(meta) {
@@ -23876,6 +24132,7 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23876
24132
  }
23877
24133
  const hostJob = ingestHostBinding({
23878
24134
  componentName: name,
24135
+ componentSelector: selector,
23879
24136
  properties: bindings,
23880
24137
  events: eventBindings,
23881
24138
  attributes: hostBindingsMetadata.attributes
@@ -24169,7 +24426,7 @@ function createHostDirectivesMappingArray(mapping) {
24169
24426
  return elements.length > 0 ? literalArr(elements) : null;
24170
24427
  }
24171
24428
 
24172
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
24429
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
24173
24430
  var R3TargetBinder = class {
24174
24431
  constructor(directiveMatcher) {
24175
24432
  this.directiveMatcher = directiveMatcher;
@@ -24774,11 +25031,11 @@ function extractScopedNodeEntities(rootScope) {
24774
25031
  return templateEntities;
24775
25032
  }
24776
25033
 
24777
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/resource_loader.mjs
25034
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/resource_loader.mjs
24778
25035
  var ResourceLoader = class {
24779
25036
  };
24780
25037
 
24781
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
25038
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
24782
25039
  var CompilerFacadeImpl = class {
24783
25040
  constructor(jitEvaluator = new JitEvaluator()) {
24784
25041
  this.jitEvaluator = jitEvaluator;
@@ -24994,6 +25251,7 @@ function convertDirectiveFacadeToMetadata(facade) {
24994
25251
  bindingPropertyName: ann.alias || field,
24995
25252
  classPropertyName: field,
24996
25253
  required: ann.required || false,
25254
+ isSignal: false,
24997
25255
  transformFunction: ann.transform != null ? new WrappedNodeExpr(ann.transform) : null
24998
25256
  };
24999
25257
  } else if (isOutput(ann)) {
@@ -25024,7 +25282,7 @@ function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
25024
25282
  type: wrapReference(declaration.type),
25025
25283
  typeSourceSpan,
25026
25284
  selector: (_a2 = declaration.selector) != null ? _a2 : null,
25027
- inputs: declaration.inputs ? inputsMappingToInputMetadata(declaration.inputs) : {},
25285
+ inputs: declaration.inputs ? inputsPartialMetadataToInputMetadata(declaration.inputs) : {},
25028
25286
  outputs: (_b2 = declaration.outputs) != null ? _b2 : {},
25029
25287
  host: convertHostDeclarationToMetadata(declaration.host),
25030
25288
  queries: ((_c2 = declaration.queries) != null ? _c2 : []).map(convertQueryDeclarationToMetadata),
@@ -25252,27 +25510,41 @@ function isInput(value) {
25252
25510
  function isOutput(value) {
25253
25511
  return value.ngMetadataName === "Output";
25254
25512
  }
25255
- function inputsMappingToInputMetadata(inputs) {
25256
- return Object.keys(inputs).reduce((result, key) => {
25257
- const value = inputs[key];
25258
- if (typeof value === "string") {
25259
- result[key] = {
25260
- bindingPropertyName: value,
25261
- classPropertyName: value,
25262
- transformFunction: null,
25263
- required: false
25264
- };
25513
+ function inputsPartialMetadataToInputMetadata(inputs) {
25514
+ return Object.keys(inputs).reduce((result, minifiedClassName) => {
25515
+ const value = inputs[minifiedClassName];
25516
+ if (typeof value === "string" || Array.isArray(value)) {
25517
+ result[minifiedClassName] = parseLegacyInputPartialOutput(value);
25265
25518
  } else {
25266
- result[key] = {
25267
- bindingPropertyName: value[0],
25268
- classPropertyName: value[1],
25269
- transformFunction: value[2] ? new WrappedNodeExpr(value[2]) : null,
25270
- required: false
25519
+ result[minifiedClassName] = {
25520
+ bindingPropertyName: value.publicName,
25521
+ classPropertyName: minifiedClassName,
25522
+ transformFunction: value.transformFunction !== null ? new WrappedNodeExpr(value.transformFunction) : null,
25523
+ required: value.isRequired,
25524
+ isSignal: value.isSignal
25271
25525
  };
25272
25526
  }
25273
25527
  return result;
25274
25528
  }, {});
25275
25529
  }
25530
+ function parseLegacyInputPartialOutput(value) {
25531
+ if (typeof value === "string") {
25532
+ return {
25533
+ bindingPropertyName: value,
25534
+ classPropertyName: value,
25535
+ transformFunction: null,
25536
+ required: false,
25537
+ isSignal: false
25538
+ };
25539
+ }
25540
+ return {
25541
+ bindingPropertyName: value[0],
25542
+ classPropertyName: value[1],
25543
+ transformFunction: value[2] ? new WrappedNodeExpr(value[2]) : null,
25544
+ required: false,
25545
+ isSignal: false
25546
+ };
25547
+ }
25276
25548
  function parseInputsArray(values) {
25277
25549
  return values.reduce((results, value) => {
25278
25550
  if (typeof value === "string") {
@@ -25281,6 +25553,7 @@ function parseInputsArray(values) {
25281
25553
  bindingPropertyName,
25282
25554
  classPropertyName,
25283
25555
  required: false,
25556
+ isSignal: false,
25284
25557
  transformFunction: null
25285
25558
  };
25286
25559
  } else {
@@ -25288,6 +25561,7 @@ function parseInputsArray(values) {
25288
25561
  bindingPropertyName: value.alias || value.name,
25289
25562
  classPropertyName: value.name,
25290
25563
  required: value.required || false,
25564
+ isSignal: false,
25291
25565
  transformFunction: value.transform != null ? new WrappedNodeExpr(value.transform) : null
25292
25566
  };
25293
25567
  }
@@ -25330,17 +25604,17 @@ function publishFacade(global) {
25330
25604
  ng.\u0275compilerFacade = new CompilerFacadeImpl();
25331
25605
  }
25332
25606
 
25333
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/version.mjs
25334
- var VERSION2 = new Version("17.1.0-next.3");
25607
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
25608
+ var VERSION2 = new Version("17.1.0-next.5");
25335
25609
 
25336
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
25610
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
25337
25611
  var _VisitorMode;
25338
25612
  (function(_VisitorMode2) {
25339
25613
  _VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
25340
25614
  _VisitorMode2[_VisitorMode2["Merge"] = 1] = "Merge";
25341
25615
  })(_VisitorMode || (_VisitorMode = {}));
25342
25616
 
25343
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
25617
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
25344
25618
  var XmlTagDefinition = class {
25345
25619
  constructor() {
25346
25620
  this.closedByParent = false;
@@ -25362,7 +25636,7 @@ var XmlTagDefinition = class {
25362
25636
  };
25363
25637
  var _TAG_DEFINITION = new XmlTagDefinition();
25364
25638
 
25365
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
25639
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
25366
25640
  var FactoryTarget2;
25367
25641
  (function(FactoryTarget3) {
25368
25642
  FactoryTarget3[FactoryTarget3["Directive"] = 0] = "Directive";
@@ -25372,10 +25646,10 @@ var FactoryTarget2;
25372
25646
  FactoryTarget3[FactoryTarget3["NgModule"] = 4] = "NgModule";
25373
25647
  })(FactoryTarget2 || (FactoryTarget2 = {}));
25374
25648
 
25375
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler.mjs
25649
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/compiler.mjs
25376
25650
  publishFacade(_global);
25377
25651
 
25378
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/util.mjs
25652
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/util.mjs
25379
25653
  var import_path2 = require("path");
25380
25654
  var import_typescript3 = __toESM(require("typescript"), 1);
25381
25655
  var REPLACEMENTS2 = {
@@ -25483,7 +25757,7 @@ function forEachClass(sourceFile, callback) {
25483
25757
  });
25484
25758
  }
25485
25759
 
25486
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/index.mjs
25760
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/index.mjs
25487
25761
  function block_template_entities_default() {
25488
25762
  return (tree) => __async(this, null, function* () {
25489
25763
  const { buildPaths, testPaths } = yield getProjectTsConfigPaths(tree);