@angular/core 17.0.5 → 17.0.6

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.
@@ -63,7 +63,7 @@ var __async = (__this, __arguments, generator) => {
63
63
  });
64
64
  };
65
65
 
66
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
66
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
67
67
  var control_flow_migration_exports = {};
68
68
  __export(control_flow_migration_exports, {
69
69
  default: () => control_flow_migration_default
@@ -72,22 +72,22 @@ module.exports = __toCommonJS(control_flow_migration_exports);
72
72
  var import_schematics = require("@angular-devkit/schematics");
73
73
  var import_path3 = require("path");
74
74
 
75
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
75
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
76
76
  var import_typescript2 = __toESM(require("typescript"), 1);
77
77
 
78
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
78
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
79
79
  var import_typescript = __toESM(require("typescript"), 1);
80
80
 
81
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
81
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
82
82
  function normalizePath(path2) {
83
83
  return path2.replace(/\\/g, "/");
84
84
  }
85
85
 
86
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
86
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
87
87
  var import_path = require("path");
88
88
  var import_typescript4 = __toESM(require("typescript"), 1);
89
89
 
90
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
90
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
91
91
  var path = __toESM(require("path"), 1);
92
92
  var import_typescript3 = __toESM(require("typescript"), 1);
93
93
  function parseTsconfigFile(tsconfigPath, basePath) {
@@ -104,7 +104,7 @@ function parseTsconfigFile(tsconfigPath, basePath) {
104
104
  return import_typescript3.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
105
105
  }
106
106
 
107
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
107
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
108
108
  function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
109
109
  const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
110
110
  return import_typescript4.default.createProgram(rootNames, options, host);
@@ -137,7 +137,7 @@ function canMigrateFile(basePath, sourceFile, program) {
137
137
  return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
138
138
  }
139
139
 
140
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/selector.mjs
140
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/selector.mjs
141
141
  var _SELECTOR_REGEXP = new RegExp(
142
142
  `(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
143
143
  "g"
@@ -445,7 +445,7 @@ var SelectorContext = class {
445
445
  }
446
446
  };
447
447
 
448
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/core.mjs
448
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/core.mjs
449
449
  var ViewEncapsulation;
450
450
  (function(ViewEncapsulation2) {
451
451
  ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
@@ -507,7 +507,7 @@ function parseSelectorToR3Selector(selector) {
507
507
  return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];
508
508
  }
509
509
 
510
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
510
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
511
511
  var textEncoder;
512
512
  function computeDigest(message) {
513
513
  return sha1(serializeNodes(message.nodes).join("") + `[${message.meaning}]`);
@@ -747,7 +747,7 @@ function wordAt(bytes, index, endian) {
747
747
  return word;
748
748
  }
749
749
 
750
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
750
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
751
751
  var TypeModifier;
752
752
  (function(TypeModifier2) {
753
753
  TypeModifier2[TypeModifier2["None"] = 0] = "None";
@@ -1702,7 +1702,7 @@ function serializeTags(tags) {
1702
1702
  return out;
1703
1703
  }
1704
1704
 
1705
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1705
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1706
1706
  var CONSTANT_PREFIX = "_c";
1707
1707
  var UNKNOWN_VALUE_KEY = variable("<unknown>");
1708
1708
  var KEY_CONTEXT = {};
@@ -1885,7 +1885,7 @@ function isLongStringLiteral(expr) {
1885
1885
  return expr instanceof LiteralExpr && typeof expr.value === "string" && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;
1886
1886
  }
1887
1887
 
1888
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1888
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1889
1889
  var CORE = "@angular/core";
1890
1890
  var _Identifiers = class {
1891
1891
  };
@@ -2518,7 +2518,7 @@ var Identifiers = _Identifiers;
2518
2518
  _Identifiers.validateIframeAttribute = { name: "\u0275\u0275validateIframeAttribute", moduleName: CORE };
2519
2519
  })();
2520
2520
 
2521
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/util.mjs
2521
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/util.mjs
2522
2522
  var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
2523
2523
  function dashCaseToCamelCase(input) {
2524
2524
  return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
@@ -2606,7 +2606,7 @@ function partitionArray(arr, conditionFn) {
2606
2606
  return [truthy, falsy];
2607
2607
  }
2608
2608
 
2609
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2609
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2610
2610
  var VERSION = 3;
2611
2611
  var JS_B64_PREFIX = "# sourceMappingURL=data:application/json;base64,";
2612
2612
  var SourceMapGenerator = class {
@@ -2735,7 +2735,7 @@ function toBase64Digit(value) {
2735
2735
  return B64_DIGITS[value];
2736
2736
  }
2737
2737
 
2738
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2738
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2739
2739
  var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
2740
2740
  var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
2741
2741
  var _INDENT_WITH = " ";
@@ -3220,7 +3220,7 @@ function _createIndent(count) {
3220
3220
  return res;
3221
3221
  }
3222
3222
 
3223
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/util.mjs
3223
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/util.mjs
3224
3224
  function typeWithParameters(type, numParams) {
3225
3225
  if (numParams === 0) {
3226
3226
  return expressionType(type);
@@ -3285,7 +3285,7 @@ function generateForwardRef(expr) {
3285
3285
  return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);
3286
3286
  }
3287
3287
 
3288
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3288
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3289
3289
  var R3FactoryDelegateType;
3290
3290
  (function(R3FactoryDelegateType2) {
3291
3291
  R3FactoryDelegateType2[R3FactoryDelegateType2["Class"] = 0] = "Class";
@@ -3430,7 +3430,40 @@ function getInjectFn(target) {
3430
3430
  }
3431
3431
  }
3432
3432
 
3433
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3433
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
3434
+ var TagContentType;
3435
+ (function(TagContentType2) {
3436
+ TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
3437
+ TagContentType2[TagContentType2["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
3438
+ TagContentType2[TagContentType2["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
3439
+ })(TagContentType || (TagContentType = {}));
3440
+ function splitNsName(elementName) {
3441
+ if (elementName[0] != ":") {
3442
+ return [null, elementName];
3443
+ }
3444
+ const colonIndex = elementName.indexOf(":", 1);
3445
+ if (colonIndex === -1) {
3446
+ throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
3447
+ }
3448
+ return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
3449
+ }
3450
+ function isNgContainer(tagName) {
3451
+ return splitNsName(tagName)[1] === "ng-container";
3452
+ }
3453
+ function isNgContent(tagName) {
3454
+ return splitNsName(tagName)[1] === "ng-content";
3455
+ }
3456
+ function isNgTemplate(tagName) {
3457
+ return splitNsName(tagName)[1] === "ng-template";
3458
+ }
3459
+ function getNsPrefix(fullName) {
3460
+ return fullName === null ? null : splitNsName(fullName)[0];
3461
+ }
3462
+ function mergeNsAndName(prefix, localName) {
3463
+ return prefix ? `:${prefix}:${localName}` : localName;
3464
+ }
3465
+
3466
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3434
3467
  var Comment = class {
3435
3468
  constructor(value, sourceSpan) {
3436
3469
  this.value = value;
@@ -3811,7 +3844,7 @@ function visitAll(visitor, nodes) {
3811
3844
  return result;
3812
3845
  }
3813
3846
 
3814
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3847
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3815
3848
  var Message = class {
3816
3849
  constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) {
3817
3850
  this.nodes = nodes;
@@ -3971,7 +4004,7 @@ var LocalizeMessageStringVisitor = class {
3971
4004
  }
3972
4005
  };
3973
4006
 
3974
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
4007
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
3975
4008
  var _Visitor = class {
3976
4009
  visitTag(tag) {
3977
4010
  const strAttrs = this._serializeAttributes(tag.attrs);
@@ -3999,12 +4032,12 @@ ${doctype.dtd}
3999
4032
  };
4000
4033
  var _visitor = new _Visitor();
4001
4034
 
4002
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4035
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4003
4036
  function toPublicName(internalName) {
4004
4037
  return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
4005
4038
  }
4006
4039
 
4007
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4040
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4008
4041
  var CLOSURE_TRANSLATION_VAR_PREFIX = "MSG_";
4009
4042
  var TRANSLATION_VAR_PREFIX = "i18n_";
4010
4043
  var I18N_ATTR = "i18n";
@@ -4106,7 +4139,7 @@ function declareI18nVariable(variable2) {
4106
4139
  return new DeclareVarStmt(variable2.name, void 0, INFERRED_TYPE, void 0, variable2.sourceSpan);
4107
4140
  }
4108
4141
 
4109
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4142
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4110
4143
  var UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;
4111
4144
  var TEMPORARY_NAME = "_t";
4112
4145
  var CONTEXT_NAME = "ctx";
@@ -4273,6 +4306,23 @@ var DefinitionMap = class {
4273
4306
  return literalMap(this.values);
4274
4307
  }
4275
4308
  };
4309
+ function createCssSelectorFromNode(node) {
4310
+ const elementName = node instanceof Element ? node.name : "ng-template";
4311
+ const attributes = getAttrsForDirectiveMatching(node);
4312
+ const cssSelector = new CssSelector();
4313
+ const elementNameNoNs = splitNsName(elementName)[1];
4314
+ cssSelector.setElement(elementNameNoNs);
4315
+ Object.getOwnPropertyNames(attributes).forEach((name) => {
4316
+ const nameNoNs = splitNsName(name)[1];
4317
+ const value = attributes[name];
4318
+ cssSelector.addAttribute(nameNoNs, value);
4319
+ if (name.toLowerCase() === "class") {
4320
+ const classes = value.trim().split(/\s+/);
4321
+ classes.forEach((className) => cssSelector.addClassName(className));
4322
+ }
4323
+ });
4324
+ return cssSelector;
4325
+ }
4276
4326
  function getAttrsForDirectiveMatching(elOrTpl) {
4277
4327
  const attributesMap = {};
4278
4328
  if (elOrTpl instanceof Template && elOrTpl.tagName !== "ng-template") {
@@ -4329,7 +4379,7 @@ function getInstructionStatements(instructions) {
4329
4379
  return statements;
4330
4380
  }
4331
4381
 
4332
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4382
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4333
4383
  function compileInjectable(meta, resolveForwardRefs) {
4334
4384
  let result = null;
4335
4385
  const factoryMeta = {
@@ -4414,7 +4464,7 @@ function createFactoryFunction(type) {
4414
4464
  return arrowFn([new FnParam("t", DYNAMIC_TYPE)], type.prop("\u0275fac").callFn([variable("t")]));
4415
4465
  }
4416
4466
 
4417
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/assertions.mjs
4467
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/assertions.mjs
4418
4468
  var UNUSABLE_INTERPOLATION_REGEXPS = [
4419
4469
  /^\s*$/,
4420
4470
  /[<>]/,
@@ -4436,7 +4486,7 @@ function assertInterpolationSymbols(identifier, value) {
4436
4486
  }
4437
4487
  }
4438
4488
 
4439
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/defaults.mjs
4489
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/defaults.mjs
4440
4490
  var InterpolationConfig = class {
4441
4491
  static fromArray(markers) {
4442
4492
  if (!markers) {
@@ -4453,7 +4503,7 @@ var InterpolationConfig = class {
4453
4503
  var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig("{{", "}}");
4454
4504
  var DEFAULT_CONTAINER_BLOCKS = /* @__PURE__ */ new Set(["switch"]);
4455
4505
 
4456
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/chars.mjs
4506
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/chars.mjs
4457
4507
  var $EOF = 0;
4458
4508
  var $BSPACE = 8;
4459
4509
  var $TAB = 9;
@@ -4535,7 +4585,7 @@ function isQuote(code) {
4535
4585
  return code === $SQ || code === $DQ || code === $BT;
4536
4586
  }
4537
4587
 
4538
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/parse_util.mjs
4588
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/parse_util.mjs
4539
4589
  var ParseLocation = class {
4540
4590
  constructor(file, offset, line, col) {
4541
4591
  this.file = file;
@@ -4682,7 +4732,7 @@ function sanitizeIdentifier(name) {
4682
4732
  return name.replace(/\W/g, "_");
4683
4733
  }
4684
4734
 
4685
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4735
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4686
4736
  var makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';
4687
4737
  var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4688
4738
  constructor() {
@@ -4775,7 +4825,7 @@ var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4775
4825
  }
4776
4826
  };
4777
4827
 
4778
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4828
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4779
4829
  var policy;
4780
4830
  function getPolicy() {
4781
4831
  if (policy === void 0) {
@@ -4813,7 +4863,7 @@ function newTrustedFunctionForJIT(...args) {
4813
4863
  return fn2.bind(_global);
4814
4864
  }
4815
4865
 
4816
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4866
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4817
4867
  var JitEvaluator = class {
4818
4868
  evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) {
4819
4869
  const converter = new JitEmitterVisitor(refResolver);
@@ -4904,7 +4954,7 @@ function isUseStrictStatement(statement) {
4904
4954
  return statement.isEquivalent(literal("use strict").toStmt());
4905
4955
  }
4906
4956
 
4907
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4957
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4908
4958
  function compileInjector(meta) {
4909
4959
  const definitionMap = new DefinitionMap();
4910
4960
  if (meta.providers !== null) {
@@ -4921,7 +4971,7 @@ function createInjectorType(meta) {
4921
4971
  return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
4922
4972
  }
4923
4973
 
4924
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4974
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4925
4975
  var R3JitReflector = class {
4926
4976
  constructor(context) {
4927
4977
  this.context = context;
@@ -4937,7 +4987,7 @@ var R3JitReflector = class {
4937
4987
  }
4938
4988
  };
4939
4989
 
4940
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4990
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4941
4991
  var R3SelectorScopeMode;
4942
4992
  (function(R3SelectorScopeMode2) {
4943
4993
  R3SelectorScopeMode2[R3SelectorScopeMode2["Inline"] = 0] = "Inline";
@@ -5078,7 +5128,7 @@ function tupleOfTypes(types) {
5078
5128
  return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;
5079
5129
  }
5080
5130
 
5081
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5131
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5082
5132
  function compilePipeFromMetadata(metadata) {
5083
5133
  const definitionMapValues = [];
5084
5134
  definitionMapValues.push({ key: "name", value: literal(metadata.pipeName), quoted: false });
@@ -5099,7 +5149,7 @@ function createPipeType(metadata) {
5099
5149
  ]));
5100
5150
  }
5101
5151
 
5102
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5152
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5103
5153
  var R3TemplateDependencyKind;
5104
5154
  (function(R3TemplateDependencyKind2) {
5105
5155
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
@@ -5107,7 +5157,7 @@ var R3TemplateDependencyKind;
5107
5157
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
5108
5158
  })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
5109
5159
 
5110
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5160
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5111
5161
  var ParserError = class {
5112
5162
  constructor(message, input, errLocation, ctxLocation) {
5113
5163
  this.input = input;
@@ -5773,7 +5823,7 @@ var BoundElementProperty = class {
5773
5823
  }
5774
5824
  };
5775
5825
 
5776
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5826
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5777
5827
  var _EventHandlerVars = class {
5778
5828
  };
5779
5829
  var EventHandlerVars = _EventHandlerVars;
@@ -6414,7 +6464,7 @@ var BuiltinFunctionCall = class extends Call {
6414
6464
  }
6415
6465
  };
6416
6466
 
6417
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6467
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6418
6468
  var _SECURITY_SCHEMA;
6419
6469
  function SECURITY_SCHEMA() {
6420
6470
  if (!_SECURITY_SCHEMA) {
@@ -6472,7 +6522,7 @@ function isIframeSecuritySensitiveAttr(attrName) {
6472
6522
  return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
6473
6523
  }
6474
6524
 
6475
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6525
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6476
6526
  var animationKeywords = /* @__PURE__ */ new Set([
6477
6527
  "inherit",
6478
6528
  "initial",
@@ -6943,7 +6993,7 @@ function repeatGroups(groups, multiples) {
6943
6993
  }
6944
6994
  }
6945
6995
 
6946
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6996
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6947
6997
  var OpKind;
6948
6998
  (function(OpKind2) {
6949
6999
  OpKind2[OpKind2["ListEnd"] = 0] = "ListEnd";
@@ -6990,6 +7040,7 @@ var OpKind;
6990
7040
  OpKind2[OpKind2["IcuStart"] = 41] = "IcuStart";
6991
7041
  OpKind2[OpKind2["IcuEnd"] = 42] = "IcuEnd";
6992
7042
  OpKind2[OpKind2["I18nContext"] = 43] = "I18nContext";
7043
+ OpKind2[OpKind2["I18nAttributes"] = 44] = "I18nAttributes";
6993
7044
  })(OpKind || (OpKind = {}));
6994
7045
  var ExpressionKind;
6995
7046
  (function(ExpressionKind2) {
@@ -7066,6 +7117,11 @@ var I18nParamResolutionTime;
7066
7117
  I18nParamResolutionTime2[I18nParamResolutionTime2["Creation"] = 0] = "Creation";
7067
7118
  I18nParamResolutionTime2[I18nParamResolutionTime2["Postproccessing"] = 1] = "Postproccessing";
7068
7119
  })(I18nParamResolutionTime || (I18nParamResolutionTime = {}));
7120
+ var I18nExpressionFor;
7121
+ (function(I18nExpressionFor2) {
7122
+ I18nExpressionFor2[I18nExpressionFor2["I18nText"] = 0] = "I18nText";
7123
+ I18nExpressionFor2[I18nExpressionFor2["I18nAttribute"] = 1] = "I18nAttribute";
7124
+ })(I18nExpressionFor || (I18nExpressionFor = {}));
7069
7125
  var I18nParamValueFlags;
7070
7126
  (function(I18nParamValueFlags2) {
7071
7127
  I18nParamValueFlags2[I18nParamValueFlags2["None"] = 0] = "None";
@@ -7101,9 +7157,16 @@ var I18nContextKind;
7101
7157
  (function(I18nContextKind2) {
7102
7158
  I18nContextKind2[I18nContextKind2["RootI18n"] = 0] = "RootI18n";
7103
7159
  I18nContextKind2[I18nContextKind2["Icu"] = 1] = "Icu";
7160
+ I18nContextKind2[I18nContextKind2["Attr"] = 2] = "Attr";
7104
7161
  })(I18nContextKind || (I18nContextKind = {}));
7162
+ var TemplateKind;
7163
+ (function(TemplateKind2) {
7164
+ TemplateKind2[TemplateKind2["NgTemplate"] = 0] = "NgTemplate";
7165
+ TemplateKind2[TemplateKind2["Structural"] = 1] = "Structural";
7166
+ TemplateKind2[TemplateKind2["Block"] = 2] = "Block";
7167
+ })(TemplateKind || (TemplateKind = {}));
7105
7168
 
7106
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7169
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7107
7170
  var ConsumesSlot = Symbol("ConsumesSlot");
7108
7171
  var DependsOnSlotContext = Symbol("DependsOnSlotContext");
7109
7172
  var ConsumesVarsTrait = Symbol("ConsumesVars");
@@ -7135,7 +7198,7 @@ function hasUsesVarOffsetTrait(expr) {
7135
7198
  return expr[UsesVarOffset] === true;
7136
7199
  }
7137
7200
 
7138
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7201
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7139
7202
  function createStatementOp(statement) {
7140
7203
  return __spreadValues({
7141
7204
  kind: OpKind.Statement,
@@ -7157,23 +7220,26 @@ var NEW_OP = {
7157
7220
  next: null
7158
7221
  };
7159
7222
 
7160
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7161
- function createInterpolateTextOp(xref, interpolation, i18nPlaceholders, sourceSpan) {
7223
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7224
+ function createInterpolateTextOp(xref, interpolation, sourceSpan) {
7162
7225
  return __spreadValues(__spreadValues(__spreadValues({
7163
7226
  kind: OpKind.InterpolateText,
7164
7227
  target: xref,
7165
7228
  interpolation,
7166
- i18nPlaceholders,
7167
7229
  sourceSpan
7168
7230
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7169
7231
  }
7170
7232
  var Interpolation2 = class {
7171
- constructor(strings, expressions) {
7233
+ constructor(strings, expressions, i18nPlaceholders) {
7172
7234
  this.strings = strings;
7173
7235
  this.expressions = expressions;
7236
+ this.i18nPlaceholders = i18nPlaceholders;
7237
+ if (i18nPlaceholders.length !== 0 && i18nPlaceholders.length !== expressions.length) {
7238
+ throw new Error(`Expected ${expressions.length} placeholders to match interpolation expression count, but got ${i18nPlaceholders.length}`);
7239
+ }
7174
7240
  }
7175
7241
  };
7176
- function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isTemplate, sourceSpan) {
7242
+ function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isStructuralTemplate, i18nContext, sourceSpan) {
7177
7243
  return __spreadValues({
7178
7244
  kind: OpKind.Binding,
7179
7245
  bindingKind: kind,
@@ -7183,11 +7249,12 @@ function createBindingOp(target, kind, name, expression, unit, securityContext,
7183
7249
  unit,
7184
7250
  securityContext,
7185
7251
  isTextAttribute,
7186
- isTemplate,
7252
+ isStructuralTemplate,
7253
+ i18nContext,
7187
7254
  sourceSpan
7188
7255
  }, NEW_OP);
7189
7256
  }
7190
- function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext, isTemplate, sourceSpan) {
7257
+ function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext, isStructuralTemplate, i18nContext, sourceSpan) {
7191
7258
  return __spreadValues(__spreadValues(__spreadValues({
7192
7259
  kind: OpKind.Property,
7193
7260
  target,
@@ -7196,7 +7263,8 @@ function createPropertyOp(target, name, expression, isAnimationTrigger, security
7196
7263
  isAnimationTrigger,
7197
7264
  securityContext,
7198
7265
  sanitizer: null,
7199
- isTemplate,
7266
+ isStructuralTemplate,
7267
+ i18nContext,
7200
7268
  sourceSpan
7201
7269
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7202
7270
  }
@@ -7235,7 +7303,7 @@ function createClassMapOp(xref, expression, sourceSpan) {
7235
7303
  sourceSpan
7236
7304
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7237
7305
  }
7238
- function createAttributeOp(target, name, expression, securityContext, isTextAttribute, isTemplate, sourceSpan) {
7306
+ function createAttributeOp(target, name, expression, securityContext, isTextAttribute, isStructuralTemplate, i18nContext, sourceSpan) {
7239
7307
  return __spreadValues(__spreadValues(__spreadValues({
7240
7308
  kind: OpKind.Attribute,
7241
7309
  target,
@@ -7244,7 +7312,8 @@ function createAttributeOp(target, name, expression, securityContext, isTextAttr
7244
7312
  securityContext,
7245
7313
  sanitizer: null,
7246
7314
  isTextAttribute,
7247
- isTemplate,
7315
+ isStructuralTemplate,
7316
+ i18nContext,
7248
7317
  sourceSpan
7249
7318
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7250
7319
  }
@@ -7285,28 +7354,31 @@ function createDeferWhenOp(target, expr, prefetch, sourceSpan) {
7285
7354
  sourceSpan
7286
7355
  }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
7287
7356
  }
7288
- function createI18nExpressionOp(context, target, handle, expression, i18nPlaceholder, resolutionTime, sourceSpan) {
7357
+ function createI18nExpressionOp(context, target, i18nOwner, handle, expression, i18nPlaceholder, resolutionTime, usage, name, sourceSpan) {
7289
7358
  return __spreadValues(__spreadValues(__spreadValues({
7290
7359
  kind: OpKind.I18nExpression,
7291
7360
  context,
7292
7361
  target,
7362
+ i18nOwner,
7293
7363
  handle,
7294
7364
  expression,
7295
7365
  i18nPlaceholder,
7296
7366
  resolutionTime,
7367
+ usage,
7368
+ name,
7297
7369
  sourceSpan
7298
7370
  }, NEW_OP), TRAIT_CONSUMES_VARS), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
7299
7371
  }
7300
- function createI18nApplyOp(target, handle, sourceSpan) {
7372
+ function createI18nApplyOp(owner, handle, sourceSpan) {
7301
7373
  return __spreadValues({
7302
7374
  kind: OpKind.I18nApply,
7303
- target,
7375
+ owner,
7304
7376
  handle,
7305
7377
  sourceSpan
7306
7378
  }, NEW_OP);
7307
7379
  }
7308
7380
 
7309
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7381
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7310
7382
  var _a;
7311
7383
  var _b;
7312
7384
  var _c;
@@ -8076,6 +8148,7 @@ function transformExpressionsInOp(op, transform2, flags) {
8076
8148
  case OpKind.ProjectionDef:
8077
8149
  case OpKind.Template:
8078
8150
  case OpKind.Text:
8151
+ case OpKind.I18nAttributes:
8079
8152
  break;
8080
8153
  default:
8081
8154
  throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
@@ -8087,6 +8160,8 @@ function transformExpressionsInExpression(expr, transform2, flags) {
8087
8160
  } else if (expr instanceof BinaryOperatorExpr) {
8088
8161
  expr.lhs = transformExpressionsInExpression(expr.lhs, transform2, flags);
8089
8162
  expr.rhs = transformExpressionsInExpression(expr.rhs, transform2, flags);
8163
+ } else if (expr instanceof UnaryOperatorExpr) {
8164
+ expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
8090
8165
  } else if (expr instanceof ReadPropExpr) {
8091
8166
  expr.receiver = transformExpressionsInExpression(expr.receiver, transform2, flags);
8092
8167
  } else if (expr instanceof ReadKeyExpr) {
@@ -8126,6 +8201,8 @@ function transformExpressionsInExpression(expr, transform2, flags) {
8126
8201
  for (let i = 0; i < expr.expressions.length; i++) {
8127
8202
  expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform2, flags);
8128
8203
  }
8204
+ } else if (expr instanceof NotExpr) {
8205
+ expr.condition = transformExpressionsInExpression(expr.condition, transform2, flags);
8129
8206
  } else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr) {
8130
8207
  } else {
8131
8208
  throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
@@ -8157,7 +8234,7 @@ function isStringLiteral(expr) {
8157
8234
  return expr instanceof LiteralExpr && typeof expr.value === "string";
8158
8235
  }
8159
8236
 
8160
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8237
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8161
8238
  var _OpList = class {
8162
8239
  constructor() {
8163
8240
  this.debugListId = _OpList.nextListId++;
@@ -8348,14 +8425,14 @@ var OpList = _OpList;
8348
8425
  _OpList.nextListId = 0;
8349
8426
  })();
8350
8427
 
8351
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
8428
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
8352
8429
  var SlotHandle = class {
8353
8430
  constructor() {
8354
8431
  this.slot = null;
8355
8432
  }
8356
8433
  };
8357
8434
 
8358
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8435
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8359
8436
  var elementContainerOpKinds = /* @__PURE__ */ new Set([
8360
8437
  OpKind.Element,
8361
8438
  OpKind.ElementStart,
@@ -8381,10 +8458,11 @@ function createElementStartOp(tag, xref, namespace, i18nPlaceholder, sourceSpan)
8381
8458
  sourceSpan
8382
8459
  }, TRAIT_CONSUMES_SLOT), NEW_OP);
8383
8460
  }
8384
- function createTemplateOp(xref, tag, functionNameSuffix, namespace, i18nPlaceholder, sourceSpan) {
8461
+ function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, sourceSpan) {
8385
8462
  return __spreadValues(__spreadValues({
8386
8463
  kind: OpKind.Template,
8387
8464
  xref,
8465
+ templateKind,
8388
8466
  attributes: null,
8389
8467
  tag,
8390
8468
  handle: new SlotHandle(),
@@ -8485,25 +8563,27 @@ function createProjectionDefOp(def) {
8485
8563
  def
8486
8564
  }, NEW_OP);
8487
8565
  }
8488
- function createProjectionOp(xref, selector, sourceSpan) {
8566
+ function createProjectionOp(xref, selector, i18nPlaceholder, attributes, sourceSpan) {
8489
8567
  return __spreadValues(__spreadValues({
8490
8568
  kind: OpKind.Projection,
8491
8569
  xref,
8492
8570
  handle: new SlotHandle(),
8493
8571
  selector,
8572
+ i18nPlaceholder,
8494
8573
  projectionSlotIndex: 0,
8495
- attributes: [],
8574
+ attributes,
8496
8575
  localRefs: [],
8497
8576
  sourceSpan
8498
8577
  }, NEW_OP), TRAIT_CONSUMES_SLOT);
8499
8578
  }
8500
- function createExtractedAttributeOp(target, bindingKind, name, expression) {
8579
+ function createExtractedAttributeOp(target, bindingKind, name, expression, i18nContext) {
8501
8580
  return __spreadValues({
8502
8581
  kind: OpKind.ExtractedAttribute,
8503
8582
  target,
8504
8583
  bindingKind,
8505
8584
  name,
8506
- expression
8585
+ expression,
8586
+ i18nContext
8507
8587
  }, NEW_OP);
8508
8588
  }
8509
8589
  function createDeferOp(xref, main, mainSlot, metadata, sourceSpan) {
@@ -8540,10 +8620,11 @@ function createDeferOnOp(defer2, trigger, prefetch, sourceSpan) {
8540
8620
  sourceSpan
8541
8621
  }, NEW_OP);
8542
8622
  }
8543
- function createI18nMessageOp(xref, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {
8623
+ function createI18nMessageOp(xref, i18nContext, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {
8544
8624
  return __spreadValues({
8545
8625
  kind: OpKind.I18nMessage,
8546
8626
  xref,
8627
+ i18nContext,
8547
8628
  i18nBlock,
8548
8629
  message,
8549
8630
  messagePlaceholder,
@@ -8588,6 +8669,9 @@ function createIcuEndOp(xref) {
8588
8669
  }, NEW_OP);
8589
8670
  }
8590
8671
  function createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan) {
8672
+ if (i18nBlock === null && contextKind !== I18nContextKind.Attr) {
8673
+ throw new Error("AssertionError: i18nBlock must be provided for non-attribute contexts.");
8674
+ }
8591
8675
  return __spreadValues({
8592
8676
  kind: OpKind.I18nContext,
8593
8677
  contextKind,
@@ -8599,22 +8683,32 @@ function createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan)
8599
8683
  postprocessingParams: /* @__PURE__ */ new Map()
8600
8684
  }, NEW_OP);
8601
8685
  }
8686
+ function createI18nAttributesOp(xref, handle, target) {
8687
+ return __spreadValues(__spreadValues({
8688
+ kind: OpKind.I18nAttributes,
8689
+ xref,
8690
+ handle,
8691
+ target,
8692
+ i18nAttributesConfig: null
8693
+ }, NEW_OP), TRAIT_CONSUMES_SLOT);
8694
+ }
8602
8695
 
8603
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8604
- function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan) {
8696
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8697
+ function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, sourceSpan) {
8605
8698
  return __spreadValues(__spreadValues({
8606
8699
  kind: OpKind.HostProperty,
8607
8700
  name,
8608
8701
  expression,
8609
8702
  isAnimationTrigger,
8703
+ i18nContext,
8610
8704
  sourceSpan
8611
8705
  }, TRAIT_CONSUMES_VARS), NEW_OP);
8612
8706
  }
8613
8707
 
8614
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8708
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8615
8709
  var CTX_REF = "CTX_REF_MARKER";
8616
8710
 
8617
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8711
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8618
8712
  var CompilationJobKind;
8619
8713
  (function(CompilationJobKind2) {
8620
8714
  CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
@@ -8721,7 +8815,7 @@ var HostBindingCompilationUnit = class extends CompilationUnit {
8721
8815
  }
8722
8816
  };
8723
8817
 
8724
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8818
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8725
8819
  function deleteAnyCasts(job) {
8726
8820
  for (const unit of job.units) {
8727
8821
  for (const op of unit.ops()) {
@@ -8739,7 +8833,7 @@ function removeAnys(e) {
8739
8833
  return e;
8740
8834
  }
8741
8835
 
8742
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8836
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8743
8837
  function applyI18nExpressions(job) {
8744
8838
  const i18nContexts = /* @__PURE__ */ new Map();
8745
8839
  for (const unit of job.units) {
@@ -8752,7 +8846,7 @@ function applyI18nExpressions(job) {
8752
8846
  for (const unit of job.units) {
8753
8847
  for (const op of unit.update) {
8754
8848
  if (op.kind === OpKind.I18nExpression && needsApplication(i18nContexts, op)) {
8755
- OpList.insertAfter(createI18nApplyOp(op.target, op.handle, null), op);
8849
+ OpList.insertAfter(createI18nApplyOp(op.i18nOwner, op.handle, null), op);
8756
8850
  }
8757
8851
  }
8758
8852
  }
@@ -8764,13 +8858,25 @@ function needsApplication(i18nContexts, op) {
8764
8858
  }
8765
8859
  const context = i18nContexts.get(op.context);
8766
8860
  const nextContext2 = i18nContexts.get(op.next.context);
8767
- if (context.i18nBlock !== nextContext2.i18nBlock) {
8861
+ if (context === void 0) {
8862
+ throw new Error("AssertionError: expected an I18nContextOp to exist for the I18nExpressionOp's context");
8863
+ }
8864
+ if (nextContext2 === void 0) {
8865
+ throw new Error("AssertionError: expected an I18nContextOp to exist for the next I18nExpressionOp's context");
8866
+ }
8867
+ if (context.i18nBlock !== null) {
8868
+ if (context.i18nBlock !== nextContext2.i18nBlock) {
8869
+ return true;
8870
+ }
8871
+ return false;
8872
+ }
8873
+ if (op.i18nOwner !== op.next.i18nOwner) {
8768
8874
  return true;
8769
8875
  }
8770
8876
  return false;
8771
8877
  }
8772
8878
 
8773
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8879
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8774
8880
  function assignI18nSlotDependencies(job) {
8775
8881
  const i18nLastSlotConsumers = /* @__PURE__ */ new Map();
8776
8882
  let lastSlotConsumer = null;
@@ -8785,20 +8891,47 @@ function assignI18nSlotDependencies(job) {
8785
8891
  currentI18nOp = op;
8786
8892
  break;
8787
8893
  case OpKind.I18nEnd:
8894
+ if (currentI18nOp === null) {
8895
+ throw new Error("AssertionError: Expected an active I18n block while calculating last slot consumers");
8896
+ }
8897
+ if (lastSlotConsumer === null) {
8898
+ throw new Error("AssertionError: Expected a last slot consumer while calculating last slot consumers");
8899
+ }
8788
8900
  i18nLastSlotConsumers.set(currentI18nOp.xref, lastSlotConsumer);
8789
8901
  currentI18nOp = null;
8790
8902
  break;
8791
8903
  }
8792
8904
  }
8905
+ let opsToMove = [];
8906
+ let moveAfterTarget = null;
8907
+ let previousTarget = null;
8793
8908
  for (const op of unit.update) {
8794
- if (op.kind === OpKind.I18nExpression) {
8795
- op.target = i18nLastSlotConsumers.get(op.target);
8909
+ if (hasDependsOnSlotContextTrait(op)) {
8910
+ if (moveAfterTarget !== null && previousTarget === moveAfterTarget && op.target !== previousTarget) {
8911
+ OpList.insertBefore(opsToMove, op);
8912
+ moveAfterTarget = null;
8913
+ opsToMove = [];
8914
+ }
8915
+ previousTarget = op.target;
8916
+ }
8917
+ if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nText) {
8918
+ OpList.remove(op);
8919
+ opsToMove.push(op);
8920
+ const target = i18nLastSlotConsumers.get(op.i18nOwner);
8921
+ if (target === void 0) {
8922
+ throw new Error("AssertionError: Expected to find a last slot consumer for an I18nExpressionOp");
8923
+ }
8924
+ op.target = target;
8925
+ moveAfterTarget = op.target;
8796
8926
  }
8797
8927
  }
8928
+ if (moveAfterTarget !== null) {
8929
+ unit.update.push(opsToMove);
8930
+ }
8798
8931
  }
8799
8932
  }
8800
8933
 
8801
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8934
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8802
8935
  function createOpXrefMap(unit) {
8803
8936
  const map = /* @__PURE__ */ new Map();
8804
8937
  for (const op of unit.create) {
@@ -8810,7 +8943,7 @@ function createOpXrefMap(unit) {
8810
8943
  return map;
8811
8944
  }
8812
8945
 
8813
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8946
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8814
8947
  function extractAttributes(job) {
8815
8948
  for (const unit of job.units) {
8816
8949
  const elements = createOpXrefMap(unit);
@@ -8821,18 +8954,26 @@ function extractAttributes(job) {
8821
8954
  break;
8822
8955
  case OpKind.Property:
8823
8956
  if (!op.isAnimationTrigger) {
8824
- OpList.insertBefore(createExtractedAttributeOp(op.target, op.isTemplate ? BindingKind.Template : BindingKind.Property, op.name, null), lookupElement(elements, op.target));
8957
+ let bindingKind;
8958
+ if (op.i18nContext !== null) {
8959
+ bindingKind = BindingKind.I18n;
8960
+ } else if (op.isStructuralTemplate) {
8961
+ bindingKind = BindingKind.Template;
8962
+ } else {
8963
+ bindingKind = BindingKind.Property;
8964
+ }
8965
+ OpList.insertBefore(createExtractedAttributeOp(op.target, bindingKind, op.name, null, null), lookupElement(elements, op.target));
8825
8966
  }
8826
8967
  break;
8827
8968
  case OpKind.StyleProp:
8828
8969
  case OpKind.ClassProp:
8829
8970
  if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && op.expression instanceof EmptyExpr2) {
8830
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null), lookupElement(elements, op.target));
8971
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null, null), lookupElement(elements, op.target));
8831
8972
  }
8832
8973
  break;
8833
8974
  case OpKind.Listener:
8834
8975
  if (!op.isAnimationListener) {
8835
- const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null);
8976
+ const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null, null);
8836
8977
  if (job.kind === CompilationJobKind.Host) {
8837
8978
  unit.create.push(extractedAttributeOp);
8838
8979
  } else {
@@ -8866,7 +9007,7 @@ function extractAttributeOp(unit, op, elements) {
8866
9007
  }
8867
9008
  }
8868
9009
  if (extractable) {
8869
- const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isTemplate ? BindingKind.Template : BindingKind.Attribute, op.name, op.expression);
9010
+ const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isStructuralTemplate ? BindingKind.Template : BindingKind.Attribute, op.name, op.expression, op.i18nContext);
8870
9011
  if (unit.job.kind === CompilationJobKind.Host) {
8871
9012
  unit.create.push(extractedAttributeOp);
8872
9013
  } else {
@@ -8877,7 +9018,7 @@ function extractAttributeOp(unit, op, elements) {
8877
9018
  }
8878
9019
  }
8879
9020
 
8880
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
9021
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
8881
9022
  function lookupElement2(elements, xref) {
8882
9023
  const el = elements.get(xref);
8883
9024
  if (el === void 0) {
@@ -8907,15 +9048,15 @@ function specializeBindings(job) {
8907
9048
  const target = lookupElement2(elements, op.target);
8908
9049
  target.nonBindable = true;
8909
9050
  } else {
8910
- OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.isTemplate, op.sourceSpan));
9051
+ OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.isStructuralTemplate, op.i18nContext, op.sourceSpan));
8911
9052
  }
8912
9053
  break;
8913
9054
  case BindingKind.Property:
8914
9055
  case BindingKind.Animation:
8915
9056
  if (job.kind === CompilationJobKind.Host) {
8916
- OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.sourceSpan));
9057
+ OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.i18nContext, op.sourceSpan));
8917
9058
  } else {
8918
- OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isTemplate, op.sourceSpan));
9059
+ OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isStructuralTemplate, op.i18nContext, op.sourceSpan));
8919
9060
  }
8920
9061
  break;
8921
9062
  case BindingKind.I18n:
@@ -8927,7 +9068,7 @@ function specializeBindings(job) {
8927
9068
  }
8928
9069
  }
8929
9070
 
8930
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
9071
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
8931
9072
  var CHAINABLE = /* @__PURE__ */ new Set([
8932
9073
  Identifiers.attribute,
8933
9074
  Identifiers.classProp,
@@ -8993,7 +9134,7 @@ function chainOperationsInList(opList) {
8993
9134
  }
8994
9135
  }
8995
9136
 
8996
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
9137
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
8997
9138
  function collapseSingletonInterpolations(job) {
8998
9139
  for (const unit of job.units) {
8999
9140
  for (const op of unit.update) {
@@ -9005,7 +9146,7 @@ function collapseSingletonInterpolations(job) {
9005
9146
  }
9006
9147
  }
9007
9148
 
9008
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
9149
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
9009
9150
  function generateConditionalExpressions(job) {
9010
9151
  for (const unit of job.units) {
9011
9152
  for (const op of unit.ops()) {
@@ -9042,40 +9183,7 @@ function generateConditionalExpressions(job) {
9042
9183
  }
9043
9184
  }
9044
9185
 
9045
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
9046
- var TagContentType;
9047
- (function(TagContentType2) {
9048
- TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
9049
- TagContentType2[TagContentType2["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
9050
- TagContentType2[TagContentType2["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
9051
- })(TagContentType || (TagContentType = {}));
9052
- function splitNsName(elementName) {
9053
- if (elementName[0] != ":") {
9054
- return [null, elementName];
9055
- }
9056
- const colonIndex = elementName.indexOf(":", 1);
9057
- if (colonIndex === -1) {
9058
- throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
9059
- }
9060
- return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
9061
- }
9062
- function isNgContainer(tagName) {
9063
- return splitNsName(tagName)[1] === "ng-container";
9064
- }
9065
- function isNgContent(tagName) {
9066
- return splitNsName(tagName)[1] === "ng-content";
9067
- }
9068
- function isNgTemplate(tagName) {
9069
- return splitNsName(tagName)[1] === "ng-template";
9070
- }
9071
- function getNsPrefix(fullName) {
9072
- return fullName === null ? null : splitNsName(fullName)[0];
9073
- }
9074
- function mergeNsAndName(prefix, localName) {
9075
- return prefix ? `:${prefix}:${localName}` : localName;
9076
- }
9077
-
9078
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9186
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9079
9187
  var BINARY_OPERATORS = /* @__PURE__ */ new Map([
9080
9188
  ["&&", BinaryOperator.And],
9081
9189
  [">", BinaryOperator.Bigger],
@@ -9125,7 +9233,7 @@ function literalOrArrayLiteral(value) {
9125
9233
  return literal(value);
9126
9234
  }
9127
9235
 
9128
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9236
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9129
9237
  function collectElementConsts(job) {
9130
9238
  const allElementAttributes = /* @__PURE__ */ new Map();
9131
9239
  for (const unit of job.units) {
@@ -9211,7 +9319,7 @@ var ElementAttributes = class {
9211
9319
  array.push(...getAttributeNameLiterals(name));
9212
9320
  if (kind === BindingKind.Attribute || kind === BindingKind.StyleProperty) {
9213
9321
  if (value === null) {
9214
- throw Error("Attribute & style element attributes must have a value");
9322
+ throw Error("Attribute, i18n attribute, & style element attributes must have a value");
9215
9323
  }
9216
9324
  array.push(value);
9217
9325
  }
@@ -9259,7 +9367,48 @@ function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, proje
9259
9367
  return literalArr(attrArray);
9260
9368
  }
9261
9369
 
9262
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
9370
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/convert_i18n_bindings.mjs
9371
+ function convertI18nBindings(job) {
9372
+ const i18nAttributesByElem = /* @__PURE__ */ new Map();
9373
+ for (const unit of job.units) {
9374
+ for (const op of unit.create) {
9375
+ if (op.kind === OpKind.I18nAttributes) {
9376
+ i18nAttributesByElem.set(op.target, op);
9377
+ }
9378
+ }
9379
+ for (const op of unit.update) {
9380
+ switch (op.kind) {
9381
+ case OpKind.Property:
9382
+ case OpKind.Attribute:
9383
+ if (op.i18nContext === null) {
9384
+ continue;
9385
+ }
9386
+ if (!(op.expression instanceof Interpolation2)) {
9387
+ continue;
9388
+ }
9389
+ const i18nAttributesForElem = i18nAttributesByElem.get(op.target);
9390
+ if (i18nAttributesForElem === void 0) {
9391
+ throw new Error("AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction");
9392
+ }
9393
+ if (i18nAttributesForElem.target !== op.target) {
9394
+ throw new Error("AssertionError: Expected i18nAttributes target element to match binding target element");
9395
+ }
9396
+ const ops = [];
9397
+ for (let i = 0; i < op.expression.expressions.length; i++) {
9398
+ const expr = op.expression.expressions[i];
9399
+ if (op.expression.i18nPlaceholders.length !== op.expression.expressions.length) {
9400
+ 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`);
9401
+ }
9402
+ ops.push(createI18nExpressionOp(op.i18nContext, i18nAttributesForElem.target, i18nAttributesForElem.xref, i18nAttributesForElem.handle, expr, op.expression.i18nPlaceholders[i], I18nParamResolutionTime.Creation, I18nExpressionFor.I18nAttribute, op.name, op.sourceSpan));
9403
+ }
9404
+ OpList.replaceWithMany(op, ops);
9405
+ break;
9406
+ }
9407
+ }
9408
+ }
9409
+ }
9410
+
9411
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
9263
9412
  function createDeferDepsFns(job) {
9264
9413
  for (const unit of job.units) {
9265
9414
  for (const op of unit.create) {
@@ -9287,7 +9436,7 @@ function createDeferDepsFns(job) {
9287
9436
  }
9288
9437
  }
9289
9438
 
9290
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
9439
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
9291
9440
  function createI18nContexts(job) {
9292
9441
  const rootContexts = /* @__PURE__ */ new Map();
9293
9442
  let currentI18nOp = null;
@@ -9331,7 +9480,7 @@ function createI18nContexts(job) {
9331
9480
  }
9332
9481
  }
9333
9482
 
9334
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
9483
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
9335
9484
  function configureDeferInstructions(job) {
9336
9485
  for (const unit of job.units) {
9337
9486
  for (const op of unit.create) {
@@ -9348,7 +9497,7 @@ function configureDeferInstructions(job) {
9348
9497
  }
9349
9498
  }
9350
9499
 
9351
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
9500
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
9352
9501
  function resolveDeferTargetNames(job) {
9353
9502
  const scopes = /* @__PURE__ */ new Map();
9354
9503
  function getScopeForView2(view) {
@@ -9442,7 +9591,7 @@ var Scope = class {
9442
9591
  }
9443
9592
  };
9444
9593
 
9445
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9594
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9446
9595
  var REPLACEMENTS = /* @__PURE__ */ new Map([
9447
9596
  [OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
9448
9597
  [OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
@@ -9469,7 +9618,7 @@ function collapseEmptyInstructions(job) {
9469
9618
  }
9470
9619
  }
9471
9620
 
9472
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9621
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9473
9622
  function expandSafeReads(job) {
9474
9623
  for (const unit of job.units) {
9475
9624
  for (const op of unit.ops()) {
@@ -9605,7 +9754,7 @@ function ternaryTransform(e) {
9605
9754
  return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr);
9606
9755
  }
9607
9756
 
9608
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
9757
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
9609
9758
  var ESCAPE = "\uFFFD";
9610
9759
  var ELEMENT_MARKER = "#";
9611
9760
  var TEMPLATE_MARKER = "*";
@@ -9629,6 +9778,15 @@ function extractI18nMessages(job) {
9629
9778
  }
9630
9779
  }
9631
9780
  }
9781
+ for (const unit of job.units) {
9782
+ for (const op of unit.create) {
9783
+ if (op.kind !== OpKind.I18nContext || op.contextKind !== I18nContextKind.Attr) {
9784
+ continue;
9785
+ }
9786
+ const i18nMessageOp = createI18nMessage(job, op);
9787
+ unit.create.push(i18nMessageOp);
9788
+ }
9789
+ }
9632
9790
  const i18nBlockMessages = /* @__PURE__ */ new Map();
9633
9791
  for (const unit of job.units) {
9634
9792
  for (const op of unit.create) {
@@ -9651,6 +9809,9 @@ function extractI18nMessages(job) {
9651
9809
  }
9652
9810
  const i18nContext = i18nContexts.get(op.context);
9653
9811
  if (i18nContext.contextKind === I18nContextKind.Icu) {
9812
+ if (i18nContext.i18nBlock === null) {
9813
+ throw Error("ICU context should have its i18n block set.");
9814
+ }
9654
9815
  const subMessage = createI18nMessage(job, i18nContext, op.messagePlaceholder);
9655
9816
  unit.create.push(subMessage);
9656
9817
  const rootI18nId = i18nBlocks.get(i18nContext.i18nBlock).root;
@@ -9667,69 +9828,54 @@ function extractI18nMessages(job) {
9667
9828
  }
9668
9829
  }
9669
9830
  function createI18nMessage(job, context, messagePlaceholder) {
9670
- let [formattedParams, needsPostprocessing] = formatParams(context.params);
9671
- const [formattedPostprocessingParams] = formatParams(context.postprocessingParams);
9672
- needsPostprocessing || (needsPostprocessing = formattedPostprocessingParams.size > 0);
9673
- return createI18nMessageOp(job.allocateXrefId(), context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null, formattedParams, formattedPostprocessingParams, needsPostprocessing);
9831
+ let formattedParams = formatParams(context.params);
9832
+ const formattedPostprocessingParams = formatParams(context.postprocessingParams);
9833
+ let needsPostprocessing = formattedPostprocessingParams.size > 0;
9834
+ for (const values of context.params.values()) {
9835
+ if (values.length > 1) {
9836
+ needsPostprocessing = true;
9837
+ }
9838
+ }
9839
+ return createI18nMessageOp(job.allocateXrefId(), context.xref, context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null, formattedParams, formattedPostprocessingParams, needsPostprocessing);
9674
9840
  }
9675
9841
  function formatParams(params) {
9676
9842
  const formattedParams = /* @__PURE__ */ new Map();
9677
- let needsPostprocessing = false;
9678
9843
  for (const [placeholder, placeholderValues] of params) {
9679
- const [serializedValues, paramNeedsPostprocessing] = formatParamValues(placeholderValues);
9680
- needsPostprocessing || (needsPostprocessing = paramNeedsPostprocessing);
9844
+ const serializedValues = formatParamValues(placeholderValues);
9681
9845
  if (serializedValues !== null) {
9682
9846
  formattedParams.set(placeholder, literal(serializedValues));
9683
9847
  }
9684
9848
  }
9685
- return [formattedParams, needsPostprocessing];
9849
+ return formattedParams;
9686
9850
  }
9687
9851
  function formatParamValues(values) {
9688
9852
  if (values.length === 0) {
9689
- return [null, false];
9853
+ return null;
9690
9854
  }
9691
- collapseElementTemplatePairs(values);
9692
9855
  const serializedValues = values.map((value) => formatValue(value));
9693
- return serializedValues.length === 1 ? [serializedValues[0], false] : [`${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`, true];
9856
+ return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;
9694
9857
  }
9695
- function collapseElementTemplatePairs(values) {
9696
- var _a2;
9697
- const valueIndiciesBySubTemplateIndex = /* @__PURE__ */ new Map();
9698
- for (let i = 0; i < values.length; i++) {
9699
- const value = values[i];
9700
- if (value.subTemplateIndex !== null && value.flags & (I18nParamValueFlags.ElementTag | I18nParamValueFlags.TemplateTag)) {
9701
- const valueIndicies = (_a2 = valueIndiciesBySubTemplateIndex.get(value.subTemplateIndex)) != null ? _a2 : [];
9702
- valueIndicies.push(i);
9703
- valueIndiciesBySubTemplateIndex.set(value.subTemplateIndex, valueIndicies);
9704
- }
9705
- }
9706
- for (const [subTemplateIndex, valueIndicies] of valueIndiciesBySubTemplateIndex) {
9707
- if (valueIndicies.length > 1) {
9708
- const elementIndex = valueIndicies.find((index) => values[index].flags & I18nParamValueFlags.ElementTag);
9709
- const templateIndex = valueIndicies.find((index) => values[index].flags & I18nParamValueFlags.TemplateTag);
9710
- if (elementIndex !== void 0 && templateIndex !== void 0) {
9711
- const elementValue = values[elementIndex];
9712
- const templateValue = values[templateIndex];
9713
- let compundValue;
9714
- if (elementValue.flags & I18nParamValueFlags.OpenTag && elementValue.flags & I18nParamValueFlags.CloseTag) {
9715
- compundValue = `${formatValue(templateValue)}${formatValue(elementValue)}${formatValue(templateValue)}`;
9716
- } else if (elementValue.flags & I18nParamValueFlags.OpenTag) {
9717
- compundValue = `${formatValue(templateValue)}${formatValue(elementValue)}`;
9718
- } else {
9719
- compundValue = `${formatValue(elementValue)}${formatValue(templateValue)}`;
9720
- }
9721
- values.splice(elementIndex, 1, { value: compundValue, subTemplateIndex, flags: I18nParamValueFlags.None });
9722
- values.splice(templateIndex, 1, null);
9723
- }
9858
+ function formatValue(value) {
9859
+ if (value.flags & I18nParamValueFlags.ElementTag && value.flags & I18nParamValueFlags.TemplateTag) {
9860
+ if (typeof value.value !== "object") {
9861
+ throw Error("AssertionError: Expected i18n param value to have an element and template slot");
9724
9862
  }
9725
- }
9726
- for (let i = values.length - 1; i >= 0; i--) {
9727
- if (values[i] === null) {
9728
- values.splice(i, 1);
9863
+ const elementValue = formatValue(__spreadProps(__spreadValues({}, value), {
9864
+ value: value.value.element,
9865
+ flags: value.flags & ~I18nParamValueFlags.TemplateTag
9866
+ }));
9867
+ const templateValue = formatValue(__spreadProps(__spreadValues({}, value), {
9868
+ value: value.value.template,
9869
+ flags: value.flags & ~I18nParamValueFlags.ElementTag
9870
+ }));
9871
+ if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
9872
+ return `${templateValue}${elementValue}${templateValue}`;
9729
9873
  }
9874
+ return value.flags & I18nParamValueFlags.CloseTag ? `${elementValue}${templateValue}` : `${templateValue}${elementValue}`;
9875
+ }
9876
+ if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
9877
+ return `${formatValue(__spreadProps(__spreadValues({}, value), { flags: value.flags & ~I18nParamValueFlags.CloseTag }))}${formatValue(__spreadProps(__spreadValues({}, value), { flags: value.flags & ~I18nParamValueFlags.OpenTag }))}`;
9730
9878
  }
9731
- }
9732
- function formatValue(value) {
9733
9879
  if (value.flags === I18nParamValueFlags.None) {
9734
9880
  return `${value.value}`;
9735
9881
  }
@@ -9744,13 +9890,10 @@ function formatValue(value) {
9744
9890
  closeMarker = value.flags & I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : "";
9745
9891
  }
9746
9892
  const context = value.subTemplateIndex === null ? "" : `${CONTEXT_MARKER}${value.subTemplateIndex}`;
9747
- if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
9748
- return `${ESCAPE}${tagMarker}${value.value}${context}${ESCAPE}${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
9749
- }
9750
9893
  return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
9751
9894
  }
9752
9895
 
9753
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9896
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9754
9897
  function generateAdvance(job) {
9755
9898
  for (const unit of job.units) {
9756
9899
  const slotMap = /* @__PURE__ */ new Map();
@@ -9767,7 +9910,7 @@ function generateAdvance(job) {
9767
9910
  if (!hasDependsOnSlotContextTrait(op)) {
9768
9911
  continue;
9769
9912
  } else if (!slotMap.has(op.target)) {
9770
- throw new Error(`AssertionError: reference to unknown slot for var ${op.target}`);
9913
+ throw new Error(`AssertionError: reference to unknown slot for target ${op.target}`);
9771
9914
  }
9772
9915
  const slot = slotMap.get(op.target);
9773
9916
  if (slotContext !== slot) {
@@ -9782,7 +9925,7 @@ function generateAdvance(job) {
9782
9925
  }
9783
9926
  }
9784
9927
 
9785
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9928
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9786
9929
  function generateProjectionDefs(job) {
9787
9930
  const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
9788
9931
  const selectors = [];
@@ -9806,7 +9949,7 @@ function generateProjectionDefs(job) {
9806
9949
  }
9807
9950
  }
9808
9951
 
9809
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9952
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9810
9953
  function generateVariables(job) {
9811
9954
  recursivelyProcessView(job.root, null);
9812
9955
  }
@@ -9894,7 +10037,7 @@ function generateVariablesInScopeForView(view, scope) {
9894
10037
  return newOps;
9895
10038
  }
9896
10039
 
9897
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
10040
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
9898
10041
  function collectConstExpressions(job) {
9899
10042
  for (const unit of job.units) {
9900
10043
  for (const op of unit.ops()) {
@@ -9908,7 +10051,7 @@ function collectConstExpressions(job) {
9908
10051
  }
9909
10052
  }
9910
10053
 
9911
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
10054
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
9912
10055
  var STYLE_DOT = "style.";
9913
10056
  var CLASS_DOT = "class.";
9914
10057
  var STYLE_BANG = "style!";
@@ -9966,7 +10109,7 @@ function parseProperty(name) {
9966
10109
  return { property: property2, suffix };
9967
10110
  }
9968
10111
 
9969
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/map_util.mjs
10112
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/map_util.mjs
9970
10113
  function mapLiteral(obj, quoted = false) {
9971
10114
  return literalMap(Object.keys(obj).map((key) => ({
9972
10115
  key,
@@ -9975,7 +10118,7 @@ function mapLiteral(obj, quoted = false) {
9975
10118
  })));
9976
10119
  }
9977
10120
 
9978
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
10121
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
9979
10122
  var IcuSerializerVisitor = class {
9980
10123
  visitText(text2) {
9981
10124
  return text2.value;
@@ -10009,7 +10152,7 @@ function serializeIcuNode(icu) {
10009
10152
  return icu.visit(serializer);
10010
10153
  }
10011
10154
 
10012
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
10155
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
10013
10156
  var TokenType;
10014
10157
  (function(TokenType2) {
10015
10158
  TokenType2[TokenType2["Character"] = 0] = "Character";
@@ -10370,7 +10513,7 @@ function parseIntAutoRadix(text2) {
10370
10513
  return result;
10371
10514
  }
10372
10515
 
10373
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10516
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10374
10517
  var SplitInterpolation = class {
10375
10518
  constructor(strings, expressions, offsets) {
10376
10519
  this.strings = strings;
@@ -11264,7 +11407,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
11264
11407
  return offsetMap;
11265
11408
  }
11266
11409
 
11267
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
11410
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
11268
11411
  var NodeWithI18n = class {
11269
11412
  constructor(sourceSpan, i18n2) {
11270
11413
  this.sourceSpan = sourceSpan;
@@ -11416,11 +11559,11 @@ var RecursiveVisitor = class {
11416
11559
  }
11417
11560
  };
11418
11561
 
11419
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11562
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11420
11563
  var ElementSchemaRegistry = class {
11421
11564
  };
11422
11565
 
11423
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11566
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11424
11567
  var BOOLEAN = "boolean";
11425
11568
  var NUMBER = "number";
11426
11569
  var STRING = "string";
@@ -11773,7 +11916,7 @@ function _isPixelDimensionStyle(prop) {
11773
11916
  }
11774
11917
  }
11775
11918
 
11776
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11919
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11777
11920
  var HtmlTagDefinition = class {
11778
11921
  constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
11779
11922
  this.closedByChildren = {};
@@ -11891,7 +12034,7 @@ function getHtmlTagDefinition(tagName) {
11891
12034
  return (_b2 = (_a2 = TAG_DEFINITIONS[tagName]) != null ? _a2 : TAG_DEFINITIONS[tagName.toLowerCase()]) != null ? _b2 : DEFAULT_TAG_DEFINITION;
11892
12035
  }
11893
12036
 
11894
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
12037
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
11895
12038
  var TAG_TO_PLACEHOLDER_NAMES = {
11896
12039
  "A": "LINK",
11897
12040
  "B": "BOLD_TEXT",
@@ -12013,7 +12156,7 @@ var PlaceholderRegistry = class {
12013
12156
  }
12014
12157
  };
12015
12158
 
12016
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
12159
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
12017
12160
  var _expParser = new Parser(new Lexer());
12018
12161
  function createI18nMessageFactory(interpolationConfig, containerBlocks) {
12019
12162
  const visitor = new _I18nVisitor(_expParser, interpolationConfig, containerBlocks);
@@ -12192,14 +12335,14 @@ function extractPlaceholderName(input) {
12192
12335
  return input.split(_CUSTOM_PH_EXP)[2];
12193
12336
  }
12194
12337
 
12195
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
12338
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
12196
12339
  var I18nError = class extends ParseError {
12197
12340
  constructor(span, msg) {
12198
12341
  super(span, msg);
12199
12342
  }
12200
12343
  };
12201
12344
 
12202
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
12345
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
12203
12346
  var NAMED_ENTITIES = {
12204
12347
  "AElig": "\xC6",
12205
12348
  "AMP": "&",
@@ -14330,7 +14473,7 @@ var NAMED_ENTITIES = {
14330
14473
  var NGSP_UNICODE = "\uE500";
14331
14474
  NAMED_ENTITIES["ngsp"] = NGSP_UNICODE;
14332
14475
 
14333
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
14476
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
14334
14477
  var TokenError = class extends ParseError {
14335
14478
  constructor(errorMsg, tokenType, span) {
14336
14479
  super(span, errorMsg);
@@ -15251,7 +15394,7 @@ var CursorError = class {
15251
15394
  }
15252
15395
  };
15253
15396
 
15254
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
15397
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
15255
15398
  var TreeError = class extends ParseError {
15256
15399
  static create(elementName, span, msg) {
15257
15400
  return new TreeError(elementName, span, msg);
@@ -15635,7 +15778,7 @@ function decodeEntity(match, entity) {
15635
15778
  return match;
15636
15779
  }
15637
15780
 
15638
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15781
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15639
15782
  var TRUSTED_TYPES_SINKS = /* @__PURE__ */ new Set([
15640
15783
  "iframe|srcdoc",
15641
15784
  "*|innerhtml",
@@ -15650,7 +15793,7 @@ function isTrustedTypesSink(tagName, propName) {
15650
15793
  return TRUSTED_TYPES_SINKS.has(tagName + "|" + propName) || TRUSTED_TYPES_SINKS.has("*|" + propName);
15651
15794
  }
15652
15795
 
15653
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15796
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15654
15797
  var setI18nRefs = (htmlNode, i18nNode) => {
15655
15798
  if (htmlNode instanceof NodeWithI18n) {
15656
15799
  if (i18nNode instanceof IcuPlaceholder && htmlNode.i18n instanceof Message) {
@@ -15807,7 +15950,7 @@ function i18nMetaToJSDoc(meta) {
15807
15950
  return jsDocComment(tags);
15808
15951
  }
15809
15952
 
15810
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15953
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15811
15954
  var GOOG_GET_MSG = "goog.getMsg";
15812
15955
  function createGoogleGetMsgStatements(variable2, message, closureVar, placeholderValues) {
15813
15956
  const messageString = serializeI18nMessageForGetMsg(message);
@@ -15858,7 +16001,7 @@ function serializeI18nMessageForGetMsg(message) {
15858
16001
  return message.nodes.map((node) => node.visit(serializerVisitor2, null)).join("");
15859
16002
  }
15860
16003
 
15861
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
16004
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
15862
16005
  function createLocalizeStatements(variable2, message, params) {
15863
16006
  const { messageParts, placeHolders } = serializeI18nMessageForLocalize(message);
15864
16007
  const sourceSpan = getSourceSpan(message);
@@ -15947,59 +16090,136 @@ function createEmptyMessagePart(location) {
15947
16090
  return new LiteralPiece("", new ParseSourceSpan(location, location));
15948
16091
  }
15949
16092
 
15950
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
16093
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
15951
16094
  var NG_I18N_CLOSURE_MODE = "ngI18nClosureMode";
15952
16095
  var TRANSLATION_VAR_PREFIX2 = "i18n_";
16096
+ var I18N_ICU_MAPPING_PREFIX2 = "I18N_EXP_";
16097
+ var ESCAPE2 = "\uFFFD";
15953
16098
  function collectI18nConsts(job) {
16099
+ var _a2;
15954
16100
  const fileBasedI18nSuffix = job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, "_").toUpperCase() + "_";
15955
- const messageConstIndices = /* @__PURE__ */ new Map();
16101
+ const extractedAttributesByI18nContext = /* @__PURE__ */ new Map();
16102
+ const i18nAttributesByElement = /* @__PURE__ */ new Map();
16103
+ const i18nExpressionsByElement = /* @__PURE__ */ new Map();
15956
16104
  const messages = /* @__PURE__ */ new Map();
16105
+ for (const unit of job.units) {
16106
+ for (const op of unit.ops()) {
16107
+ if (op.kind === OpKind.ExtractedAttribute && op.i18nContext !== null) {
16108
+ extractedAttributesByI18nContext.set(op.i18nContext, op);
16109
+ } else if (op.kind === OpKind.I18nAttributes) {
16110
+ i18nAttributesByElement.set(op.target, op);
16111
+ } else if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nAttribute) {
16112
+ const expressions = (_a2 = i18nExpressionsByElement.get(op.target)) != null ? _a2 : [];
16113
+ expressions.push(op);
16114
+ i18nExpressionsByElement.set(op.target, expressions);
16115
+ } else if (op.kind === OpKind.I18nMessage) {
16116
+ messages.set(op.xref, op);
16117
+ }
16118
+ }
16119
+ }
16120
+ const i18nValuesByContext = /* @__PURE__ */ new Map();
16121
+ const messageConstIndices = /* @__PURE__ */ new Map();
15957
16122
  for (const unit of job.units) {
15958
16123
  for (const op of unit.create) {
15959
16124
  if (op.kind === OpKind.I18nMessage) {
15960
- messages.set(op.xref, op);
16125
+ if (op.messagePlaceholder === null) {
16126
+ const { mainVar, statements } = collectMessage(job, fileBasedI18nSuffix, messages, op);
16127
+ if (op.i18nBlock !== null) {
16128
+ const i18nConst = job.addConst(mainVar, statements);
16129
+ messageConstIndices.set(op.i18nBlock, i18nConst);
16130
+ } else {
16131
+ job.constsInitializers.push(...statements);
16132
+ i18nValuesByContext.set(op.i18nContext, mainVar);
16133
+ const attributeForMessage = extractedAttributesByI18nContext.get(op.i18nContext);
16134
+ if (attributeForMessage !== void 0) {
16135
+ attributeForMessage.expression = mainVar;
16136
+ }
16137
+ }
16138
+ }
15961
16139
  OpList.remove(op);
15962
16140
  }
15963
16141
  }
15964
16142
  }
15965
- for (const op of messages.values()) {
15966
- if (op.kind === OpKind.I18nMessage && op.messagePlaceholder === null) {
15967
- const { mainVar, statements } = collectMessage(job, fileBasedI18nSuffix, messages, op);
15968
- messageConstIndices.set(op.i18nBlock, job.addConst(mainVar, statements));
16143
+ for (const unit of job.units) {
16144
+ for (const elem of unit.create) {
16145
+ if (isElementOrContainerOp(elem)) {
16146
+ const i18nAttributes2 = i18nAttributesByElement.get(elem.xref);
16147
+ if (i18nAttributes2 === void 0) {
16148
+ continue;
16149
+ }
16150
+ let i18nExpressions = i18nExpressionsByElement.get(elem.xref);
16151
+ if (i18nExpressions === void 0) {
16152
+ throw new Error("AssertionError: Could not find any i18n expressions associated with an I18nAttributes instruction");
16153
+ }
16154
+ const seenPropertyNames = /* @__PURE__ */ new Set();
16155
+ i18nExpressions = i18nExpressions.filter((i18nExpr) => {
16156
+ const seen = seenPropertyNames.has(i18nExpr.name);
16157
+ seenPropertyNames.add(i18nExpr.name);
16158
+ return !seen;
16159
+ });
16160
+ const i18nAttributeConfig = i18nExpressions.flatMap((i18nExpr) => {
16161
+ const i18nExprValue = i18nValuesByContext.get(i18nExpr.context);
16162
+ if (i18nExprValue === void 0) {
16163
+ throw new Error("AssertionError: Could not find i18n expression's value");
16164
+ }
16165
+ return [literal(i18nExpr.name), i18nExprValue];
16166
+ });
16167
+ i18nAttributes2.i18nAttributesConfig = job.addConst(new LiteralArrayExpr(i18nAttributeConfig));
16168
+ }
15969
16169
  }
15970
16170
  }
15971
16171
  for (const unit of job.units) {
15972
16172
  for (const op of unit.create) {
15973
16173
  if (op.kind === OpKind.I18nStart) {
15974
- op.messageIndex = messageConstIndices.get(op.root);
16174
+ const msgIndex = messageConstIndices.get(op.root);
16175
+ if (msgIndex === void 0) {
16176
+ throw new Error("AssertionError: Could not find corresponding i18n block index for an i18n message op; was an i18n message incorrectly assumed to correspond to an attribute?");
16177
+ }
16178
+ op.messageIndex = msgIndex;
15975
16179
  }
15976
16180
  }
15977
16181
  }
15978
16182
  }
15979
16183
  function collectMessage(job, fileBasedI18nSuffix, messages, messageOp) {
16184
+ var _a2;
15980
16185
  const statements = [];
16186
+ const subMessagePlaceholders = /* @__PURE__ */ new Map();
15981
16187
  for (const subMessageId of messageOp.subMessages) {
15982
16188
  const subMessage = messages.get(subMessageId);
15983
16189
  const { mainVar: subMessageVar, statements: subMessageStatements } = collectMessage(job, fileBasedI18nSuffix, messages, subMessage);
15984
16190
  statements.push(...subMessageStatements);
15985
- messageOp.params.set(subMessage.messagePlaceholder, subMessageVar);
16191
+ const subMessages = (_a2 = subMessagePlaceholders.get(subMessage.messagePlaceholder)) != null ? _a2 : [];
16192
+ subMessages.push(subMessageVar);
16193
+ subMessagePlaceholders.set(subMessage.messagePlaceholder, subMessages);
15986
16194
  }
16195
+ addSubMessageParams(messageOp, subMessagePlaceholders);
15987
16196
  messageOp.params = new Map([...messageOp.params.entries()].sort());
15988
- assertAllParamsResolved(messageOp);
15989
16197
  const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX2));
15990
16198
  const closureVar = i18nGenerateClosureVar(job.pool, messageOp.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
15991
16199
  let transformFn = void 0;
15992
16200
  if (messageOp.needsPostprocessing) {
15993
- messageOp.postprocessingParams = new Map([...messageOp.postprocessingParams.entries()].sort());
16201
+ const postprocessingParams = Object.fromEntries([...messageOp.postprocessingParams.entries()].sort());
16202
+ const formattedPostprocessingParams = formatI18nPlaceholderNamesInMap(postprocessingParams, false);
15994
16203
  const extraTransformFnParams = [];
15995
16204
  if (messageOp.postprocessingParams.size > 0) {
15996
- extraTransformFnParams.push(literalMap([...messageOp.postprocessingParams].map(([key, value]) => ({ key, value, quoted: true }))));
16205
+ extraTransformFnParams.push(mapLiteral(formattedPostprocessingParams, true));
15997
16206
  }
15998
16207
  transformFn = (expr) => importExpr(Identifiers.i18nPostprocess).callFn([expr, ...extraTransformFnParams]);
15999
16208
  }
16000
16209
  statements.push(...getTranslationDeclStmts(messageOp.message, mainVar, closureVar, messageOp.params, transformFn));
16001
16210
  return { mainVar, statements };
16002
16211
  }
16212
+ function addSubMessageParams(messageOp, subMessagePlaceholders) {
16213
+ for (const [placeholder, subMessages] of subMessagePlaceholders) {
16214
+ if (subMessages.length === 1) {
16215
+ messageOp.params.set(placeholder, subMessages[0]);
16216
+ } else {
16217
+ messageOp.params.set(placeholder, literal(`${ESCAPE2}${I18N_ICU_MAPPING_PREFIX2}${placeholder}${ESCAPE2}`));
16218
+ messageOp.postprocessingParams.set(placeholder, literalArr(subMessages));
16219
+ messageOp.needsPostprocessing = true;
16220
+ }
16221
+ }
16222
+ }
16003
16223
  function getTranslationDeclStmts(message, variable2, closureVar, params, transformFn) {
16004
16224
  const paramsObject = Object.fromEntries(params);
16005
16225
  const statements = [
@@ -16027,23 +16247,9 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
16027
16247
  }
16028
16248
  return variable(name);
16029
16249
  }
16030
- function assertAllParamsResolved(op) {
16031
- for (let placeholder in op.message.placeholders) {
16032
- placeholder = placeholder.trimEnd();
16033
- if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
16034
- throw Error(`Failed to resolve i18n placeholder: ${placeholder}`);
16035
- }
16036
- }
16037
- for (let placeholder in op.message.placeholderToMessage) {
16038
- placeholder = placeholder.trimEnd();
16039
- if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
16040
- throw Error(`Failed to resolve i18n message placeholder: ${placeholder}`);
16041
- }
16042
- }
16043
- }
16044
16250
 
16045
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
16046
- function extractI18nText(job) {
16251
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
16252
+ function convertI18nText(job) {
16047
16253
  var _a2;
16048
16254
  for (const unit of job.units) {
16049
16255
  let currentI18n = null;
@@ -16092,7 +16298,7 @@ function extractI18nText(job) {
16092
16298
  const ops = [];
16093
16299
  for (let i = 0; i < op.interpolation.expressions.length; i++) {
16094
16300
  const expr = op.interpolation.expressions[i];
16095
- ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.handle, expr, op.i18nPlaceholders[i], resolutionTime, (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
16301
+ 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));
16096
16302
  }
16097
16303
  OpList.replaceWithMany(op, ops);
16098
16304
  break;
@@ -16101,7 +16307,7 @@ function extractI18nText(job) {
16101
16307
  }
16102
16308
  }
16103
16309
 
16104
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
16310
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
16105
16311
  function liftLocalRefs(job) {
16106
16312
  for (const unit of job.units) {
16107
16313
  for (const op of unit.create) {
@@ -16131,7 +16337,7 @@ function serializeLocalRefs(refs) {
16131
16337
  return literalArr(constRefs);
16132
16338
  }
16133
16339
 
16134
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
16340
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
16135
16341
  function emitNamespaceChanges(job) {
16136
16342
  for (const unit of job.units) {
16137
16343
  let activeNamespace = Namespace.HTML;
@@ -16147,7 +16353,7 @@ function emitNamespaceChanges(job) {
16147
16353
  }
16148
16354
  }
16149
16355
 
16150
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
16356
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
16151
16357
  function parse(value) {
16152
16358
  const styles = [];
16153
16359
  let i = 0;
@@ -16208,7 +16414,7 @@ function hyphenate2(value) {
16208
16414
  }).toLowerCase();
16209
16415
  }
16210
16416
 
16211
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
16417
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
16212
16418
  function nameFunctionsAndVariables(job) {
16213
16419
  addNamesToView(job.root, job.componentName, { index: 0 }, job.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
16214
16420
  }
@@ -16323,7 +16529,7 @@ function stripImportant(name) {
16323
16529
  return name;
16324
16530
  }
16325
16531
 
16326
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
16532
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
16327
16533
  function mergeNextContextExpressions(job) {
16328
16534
  for (const unit of job.units) {
16329
16535
  for (const op of unit.create) {
@@ -16369,7 +16575,7 @@ function mergeNextContextsInOps(ops) {
16369
16575
  }
16370
16576
  }
16371
16577
 
16372
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
16578
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
16373
16579
  var CONTAINER_TAG = "ng-container";
16374
16580
  function generateNgContainerOps(job) {
16375
16581
  for (const unit of job.units) {
@@ -16386,7 +16592,7 @@ function generateNgContainerOps(job) {
16386
16592
  }
16387
16593
  }
16388
16594
 
16389
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
16595
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
16390
16596
  function lookupElement3(elements, xref) {
16391
16597
  const el = elements.get(xref);
16392
16598
  if (el === void 0) {
@@ -16416,7 +16622,7 @@ function disableBindings(job) {
16416
16622
  }
16417
16623
  }
16418
16624
 
16419
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16625
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16420
16626
  function generateNullishCoalesceExpressions(job) {
16421
16627
  for (const unit of job.units) {
16422
16628
  for (const op of unit.ops()) {
@@ -16432,7 +16638,7 @@ function generateNullishCoalesceExpressions(job) {
16432
16638
  }
16433
16639
  }
16434
16640
 
16435
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16641
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16436
16642
  function kindTest(kind) {
16437
16643
  return (op) => op.kind === kind;
16438
16644
  }
@@ -16506,7 +16712,7 @@ function keepLast(ops) {
16506
16712
  return ops.slice(ops.length - 1);
16507
16713
  }
16508
16714
 
16509
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16715
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16510
16716
  function parseExtractedStyles(job) {
16511
16717
  for (const unit of job.units) {
16512
16718
  for (const op of unit.create) {
@@ -16514,13 +16720,13 @@ function parseExtractedStyles(job) {
16514
16720
  if (op.name === "style") {
16515
16721
  const parsedStyles = parse(op.expression.value);
16516
16722
  for (let i = 0; i < parsedStyles.length - 1; i += 2) {
16517
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1])), op);
16723
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1]), null), op);
16518
16724
  }
16519
16725
  OpList.remove(op);
16520
16726
  } else if (op.name === "class") {
16521
16727
  const parsedClasses = op.expression.value.trim().split(/\s+/g);
16522
16728
  for (const parsedClass of parsedClasses) {
16523
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null), op);
16729
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null, null), op);
16524
16730
  }
16525
16731
  OpList.remove(op);
16526
16732
  }
@@ -16529,22 +16735,32 @@ function parseExtractedStyles(job) {
16529
16735
  }
16530
16736
  }
16531
16737
 
16532
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16738
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16533
16739
  function removeContentSelectors(job) {
16534
16740
  for (const unit of job.units) {
16535
16741
  const elements = createOpXrefMap(unit);
16536
- for (const op of unit.update) {
16742
+ for (const op of unit.ops()) {
16537
16743
  switch (op.kind) {
16538
16744
  case OpKind.Binding:
16539
16745
  const target = lookupInXrefMap(elements, op.target);
16540
- if (op.name.toLowerCase() === "select" && target.kind === OpKind.Projection) {
16746
+ if (isSelectAttribute(op.name) && target.kind === OpKind.Projection) {
16541
16747
  OpList.remove(op);
16542
16748
  }
16543
16749
  break;
16750
+ case OpKind.Projection:
16751
+ for (let i = op.attributes.length - 2; i >= 0; i -= 2) {
16752
+ if (isSelectAttribute(op.attributes[i])) {
16753
+ op.attributes.splice(i, 2);
16754
+ }
16755
+ }
16756
+ break;
16544
16757
  }
16545
16758
  }
16546
16759
  }
16547
16760
  }
16761
+ function isSelectAttribute(name) {
16762
+ return name.toLowerCase() === "select";
16763
+ }
16548
16764
  function lookupInXrefMap(map, xref) {
16549
16765
  const el = map.get(xref);
16550
16766
  if (el === void 0) {
@@ -16553,7 +16769,7 @@ function lookupInXrefMap(map, xref) {
16553
16769
  return el;
16554
16770
  }
16555
16771
 
16556
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16772
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16557
16773
  function createPipes(job) {
16558
16774
  for (const unit of job.units) {
16559
16775
  processPipeBindingsInView(unit);
@@ -16601,7 +16817,7 @@ function addPipeToCreationBlock(unit, afterTargetXref, binding) {
16601
16817
  throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);
16602
16818
  }
16603
16819
 
16604
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16820
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16605
16821
  function createVariadicPipes(job) {
16606
16822
  for (const unit of job.units) {
16607
16823
  for (const op of unit.update) {
@@ -16618,7 +16834,7 @@ function createVariadicPipes(job) {
16618
16834
  }
16619
16835
  }
16620
16836
 
16621
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16837
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16622
16838
  function propagateI18nBlocks(job) {
16623
16839
  propagateI18nBlocksToTemplates(job.root, 0);
16624
16840
  }
@@ -16631,6 +16847,9 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
16631
16847
  i18nBlock = op;
16632
16848
  break;
16633
16849
  case OpKind.I18nEnd:
16850
+ if (i18nBlock.subTemplateIndex === null) {
16851
+ subTemplateIndex = 0;
16852
+ }
16634
16853
  i18nBlock = null;
16635
16854
  break;
16636
16855
  case OpKind.Template:
@@ -16656,7 +16875,7 @@ function wrapTemplateWithI18n(unit, parentI18n) {
16656
16875
  }
16657
16876
  }
16658
16877
 
16659
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16878
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16660
16879
  function extractPureFunctions(job) {
16661
16880
  for (const view of job.units) {
16662
16881
  for (const op of view.ops()) {
@@ -16698,7 +16917,7 @@ var PureFunctionConstant = class extends GenericKeyFn {
16698
16917
  }
16699
16918
  };
16700
16919
 
16701
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16920
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16702
16921
  function generatePureLiteralStructures(job) {
16703
16922
  for (const unit of job.units) {
16704
16923
  for (const op of unit.update) {
@@ -16745,7 +16964,7 @@ function transformLiteralMap(expr) {
16745
16964
  return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
16746
16965
  }
16747
16966
 
16748
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16967
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16749
16968
  function element(slot, tag, constIndex, localRefIndex, sourceSpan) {
16750
16969
  return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan);
16751
16970
  }
@@ -16960,6 +17179,10 @@ function i18n(slot, constIndex, subTemplateIndex) {
16960
17179
  function i18nEnd() {
16961
17180
  return call(Identifiers.i18nEnd, [], null);
16962
17181
  }
17182
+ function i18nAttributes(slot, i18nAttributesConfig) {
17183
+ const args = [literal(slot), literal(i18nAttributesConfig)];
17184
+ return call(Identifiers.i18nAttributes, args, null);
17185
+ }
16963
17186
  function property(name, expression, sanitizer, sourceSpan) {
16964
17187
  const args = [literal(name), expression];
16965
17188
  if (sanitizer !== null) {
@@ -17256,7 +17479,7 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
17256
17479
  return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
17257
17480
  }
17258
17481
 
17259
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
17482
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
17260
17483
  var sanitizerIdentifierMap = /* @__PURE__ */ new Map([
17261
17484
  [SanitizerFn.Html, Identifiers.sanitizeHtml],
17262
17485
  [SanitizerFn.IframeAttribute, Identifiers.validateIframeAttribute],
@@ -17306,6 +17529,12 @@ function reifyCreateOperations(unit, ops) {
17306
17529
  case OpKind.I18n:
17307
17530
  OpList.replace(op, i18n(op.handle.slot, op.messageIndex, op.subTemplateIndex));
17308
17531
  break;
17532
+ case OpKind.I18nAttributes:
17533
+ if (op.i18nAttributesConfig === null) {
17534
+ throw new Error(`AssertionError: i18nAttributesConfig was not set`);
17535
+ }
17536
+ OpList.replace(op, i18nAttributes(op.handle.slot, op.i18nAttributesConfig));
17537
+ break;
17309
17538
  case OpKind.Template:
17310
17539
  if (!(unit instanceof ViewCompilationUnit)) {
17311
17540
  throw new Error(`AssertionError: must be compiling a component`);
@@ -17585,7 +17814,7 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
17585
17814
  return fn(params, handlerStmts, void 0, void 0, name);
17586
17815
  }
17587
17816
 
17588
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17817
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17589
17818
  function removeEmptyBindings(job) {
17590
17819
  for (const unit of job.units) {
17591
17820
  for (const op of unit.update) {
@@ -17606,7 +17835,7 @@ function removeEmptyBindings(job) {
17606
17835
  }
17607
17836
  }
17608
17837
 
17609
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
17838
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
17610
17839
  function removeI18nContexts(job) {
17611
17840
  for (const unit of job.units) {
17612
17841
  for (const op of unit.create) {
@@ -17622,7 +17851,29 @@ function removeI18nContexts(job) {
17622
17851
  }
17623
17852
  }
17624
17853
 
17625
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
17854
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_unused_i18n_attrs.mjs
17855
+ function removeUnusedI18nAttributesOps(job) {
17856
+ for (const unit of job.units) {
17857
+ const ownersWithI18nExpressions = /* @__PURE__ */ new Set();
17858
+ for (const op of unit.update) {
17859
+ switch (op.kind) {
17860
+ case OpKind.I18nExpression:
17861
+ ownersWithI18nExpressions.add(op.i18nOwner);
17862
+ }
17863
+ }
17864
+ for (const op of unit.create) {
17865
+ switch (op.kind) {
17866
+ case OpKind.I18nAttributes:
17867
+ if (ownersWithI18nExpressions.has(op.xref)) {
17868
+ continue;
17869
+ }
17870
+ OpList.remove(op);
17871
+ }
17872
+ }
17873
+ }
17874
+ }
17875
+
17876
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
17626
17877
  function generateRepeaterDerivedVars(job) {
17627
17878
  const repeaters = /* @__PURE__ */ new Map();
17628
17879
  for (const unit of job.units) {
@@ -17654,7 +17905,7 @@ function generateRepeaterDerivedVars(job) {
17654
17905
  }
17655
17906
  }
17656
17907
 
17657
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17908
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17658
17909
  function resolveContexts(job) {
17659
17910
  for (const unit of job.units) {
17660
17911
  processLexicalScope(unit, unit.create);
@@ -17695,7 +17946,7 @@ function processLexicalScope(view, ops) {
17695
17946
  }
17696
17947
  }
17697
17948
 
17698
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17949
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17699
17950
  function resolveDollarEvent(job) {
17700
17951
  for (const unit of job.units) {
17701
17952
  transformDollarEvent(unit, unit.create);
@@ -17716,7 +17967,7 @@ function transformDollarEvent(unit, ops) {
17716
17967
  }
17717
17968
  }
17718
17969
 
17719
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
17970
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
17720
17971
  function resolveI18nElementPlaceholders(job) {
17721
17972
  const i18nContexts = /* @__PURE__ */ new Map();
17722
17973
  const elements = /* @__PURE__ */ new Map();
@@ -17734,8 +17985,9 @@ function resolveI18nElementPlaceholders(job) {
17734
17985
  }
17735
17986
  resolvePlaceholdersForView(job, job.root, i18nContexts, elements);
17736
17987
  }
17737
- function resolvePlaceholdersForView(job, unit, i18nContexts, elements) {
17988
+ function resolvePlaceholdersForView(job, unit, i18nContexts, elements, pendingStructuralDirective) {
17738
17989
  let currentOps = null;
17990
+ let pendingStructuralDirectiveCloses = /* @__PURE__ */ new Map();
17739
17991
  for (const op of unit.create) {
17740
17992
  switch (op.kind) {
17741
17993
  case OpKind.I18nStart:
@@ -17752,50 +18004,99 @@ function resolvePlaceholdersForView(job, unit, i18nContexts, elements) {
17752
18004
  if (currentOps === null) {
17753
18005
  throw Error("i18n tag placeholder should only occur inside an i18n block");
17754
18006
  }
17755
- const { startName, closeName } = op.i18nPlaceholder;
17756
- let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
17757
- if (closeName === "") {
17758
- flags |= I18nParamValueFlags.CloseTag;
18007
+ recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18008
+ if (pendingStructuralDirective && op.i18nPlaceholder.closeName) {
18009
+ pendingStructuralDirectiveCloses.set(op.xref, pendingStructuralDirective);
17759
18010
  }
17760
- addParam(currentOps.i18nContext.params, startName, op.handle.slot, currentOps.i18nBlock.subTemplateIndex, flags);
18011
+ pendingStructuralDirective = void 0;
17761
18012
  }
17762
18013
  break;
17763
18014
  case OpKind.ElementEnd:
17764
18015
  const startOp = elements.get(op.xref);
17765
18016
  if (startOp && startOp.i18nPlaceholder !== void 0) {
17766
18017
  if (currentOps === null) {
17767
- throw Error("i18n tag placeholder should only occur inside an i18n block");
17768
- }
17769
- const { closeName } = startOp.i18nPlaceholder;
17770
- if (closeName !== "") {
17771
- addParam(currentOps.i18nContext.params, closeName, startOp.handle.slot, currentOps.i18nBlock.subTemplateIndex, I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag);
18018
+ throw Error("AssertionError: i18n tag placeholder should only occur inside an i18n block");
17772
18019
  }
18020
+ recordElementClose(startOp, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirectiveCloses.get(op.xref));
18021
+ pendingStructuralDirectiveCloses.delete(op.xref);
17773
18022
  }
17774
18023
  break;
17775
- case OpKind.Template:
18024
+ case OpKind.Projection:
17776
18025
  if (op.i18nPlaceholder !== void 0) {
17777
18026
  if (currentOps === null) {
17778
18027
  throw Error("i18n tag placeholder should only occur inside an i18n block");
17779
18028
  }
17780
- let startFlags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.OpenTag;
17781
- const subTemplateIndex = getSubTemplateIndexForTemplateTag(job, currentOps.i18nBlock, op);
17782
- const { startName, closeName } = op.i18nPlaceholder;
17783
- const isSelfClosing = closeName === "";
17784
- if (isSelfClosing) {
17785
- startFlags |= I18nParamValueFlags.CloseTag;
17786
- }
17787
- addParam(currentOps.i18nContext.params, startName, op.handle.slot, subTemplateIndex, startFlags);
18029
+ recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18030
+ recordElementClose(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18031
+ pendingStructuralDirective = void 0;
18032
+ }
18033
+ break;
18034
+ case OpKind.Template:
18035
+ if (op.i18nPlaceholder === void 0) {
17788
18036
  resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
17789
- if (!isSelfClosing) {
17790
- addParam(currentOps.i18nContext.params, closeName, op.handle.slot, subTemplateIndex, I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag);
17791
- }
17792
18037
  } else {
17793
- resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
18038
+ if (currentOps === null) {
18039
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
18040
+ }
18041
+ if (op.templateKind === TemplateKind.Structural) {
18042
+ resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements, op);
18043
+ } else {
18044
+ recordTemplateStart(job, op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18045
+ resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
18046
+ recordTemplateClose(job, op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18047
+ pendingStructuralDirective = void 0;
18048
+ }
17794
18049
  }
17795
18050
  break;
17796
18051
  }
17797
18052
  }
17798
18053
  }
18054
+ function recordElementStart(op, i18nContext, i18nBlock, structuralDirective) {
18055
+ const { startName, closeName } = op.i18nPlaceholder;
18056
+ let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
18057
+ let value = op.handle.slot;
18058
+ if (structuralDirective !== void 0) {
18059
+ flags |= I18nParamValueFlags.TemplateTag;
18060
+ value = { element: value, template: structuralDirective.handle.slot };
18061
+ }
18062
+ if (!closeName) {
18063
+ flags |= I18nParamValueFlags.CloseTag;
18064
+ }
18065
+ addParam(i18nContext.params, startName, value, i18nBlock.subTemplateIndex, flags);
18066
+ }
18067
+ function recordElementClose(op, i18nContext, i18nBlock, structuralDirective) {
18068
+ const { closeName } = op.i18nPlaceholder;
18069
+ if (closeName) {
18070
+ let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag;
18071
+ let value = op.handle.slot;
18072
+ if (structuralDirective !== void 0) {
18073
+ flags |= I18nParamValueFlags.TemplateTag;
18074
+ value = { element: value, template: structuralDirective.handle.slot };
18075
+ }
18076
+ addParam(i18nContext.params, closeName, value, i18nBlock.subTemplateIndex, flags);
18077
+ }
18078
+ }
18079
+ function recordTemplateStart(job, op, i18nContext, i18nBlock, structuralDirective) {
18080
+ let { startName, closeName } = op.i18nPlaceholder;
18081
+ let flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.OpenTag;
18082
+ if (!closeName) {
18083
+ flags |= I18nParamValueFlags.CloseTag;
18084
+ }
18085
+ if (structuralDirective !== void 0) {
18086
+ addParam(i18nContext.params, startName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
18087
+ }
18088
+ addParam(i18nContext.params, startName, op.handle.slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, op), flags);
18089
+ }
18090
+ function recordTemplateClose(job, op, i18nContext, i18nBlock, structuralDirective) {
18091
+ const { startName, closeName } = op.i18nPlaceholder;
18092
+ const flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag;
18093
+ if (closeName) {
18094
+ addParam(i18nContext.params, closeName, op.handle.slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, op), flags);
18095
+ if (structuralDirective !== void 0) {
18096
+ addParam(i18nContext.params, closeName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
18097
+ }
18098
+ }
18099
+ }
17799
18100
  function getSubTemplateIndexForTemplateTag(job, i18nOp, op) {
17800
18101
  for (const childOp of job.views.get(op.xref).create) {
17801
18102
  if (childOp.kind === OpKind.I18nStart) {
@@ -17811,8 +18112,9 @@ function addParam(params, placeholder, value, subTemplateIndex, flags) {
17811
18112
  params.set(placeholder, values);
17812
18113
  }
17813
18114
 
17814
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
18115
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
17815
18116
  function resolveI18nExpressionPlaceholders(job) {
18117
+ var _a2;
17816
18118
  const subTemplateIndicies = /* @__PURE__ */ new Map();
17817
18119
  const i18nContexts = /* @__PURE__ */ new Map();
17818
18120
  for (const unit of job.units) {
@@ -17828,12 +18130,13 @@ function resolveI18nExpressionPlaceholders(job) {
17828
18130
  }
17829
18131
  }
17830
18132
  const expressionIndices = /* @__PURE__ */ new Map();
18133
+ const referenceIndex = (op) => op.usage === I18nExpressionFor.I18nText ? op.i18nOwner : op.context;
17831
18134
  for (const unit of job.units) {
17832
18135
  for (const op of unit.update) {
17833
18136
  if (op.kind === OpKind.I18nExpression) {
17834
18137
  const i18nContext = i18nContexts.get(op.context);
17835
- const index = expressionIndices.get(op.target) || 0;
17836
- const subTemplateIndex = subTemplateIndicies.get(op.target);
18138
+ const index = expressionIndices.get(referenceIndex(op)) || 0;
18139
+ const subTemplateIndex = (_a2 = subTemplateIndicies.get(op.i18nOwner)) != null ? _a2 : null;
17837
18140
  const params = op.resolutionTime === I18nParamResolutionTime.Creation ? i18nContext.params : i18nContext.postprocessingParams;
17838
18141
  const values = params.get(op.i18nPlaceholder) || [];
17839
18142
  values.push({
@@ -17842,13 +18145,13 @@ function resolveI18nExpressionPlaceholders(job) {
17842
18145
  flags: I18nParamValueFlags.ExpressionIndex
17843
18146
  });
17844
18147
  params.set(op.i18nPlaceholder, values);
17845
- expressionIndices.set(op.target, index + 1);
18148
+ expressionIndices.set(referenceIndex(op), index + 1);
17846
18149
  }
17847
18150
  }
17848
18151
  }
17849
18152
  }
17850
18153
 
17851
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
18154
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
17852
18155
  function resolveI18nIcuPlaceholders(job) {
17853
18156
  for (const unit of job.units) {
17854
18157
  for (const op of unit.create) {
@@ -17892,7 +18195,7 @@ var ResolveIcuPlaceholdersVisitor = class extends RecurseVisitor {
17892
18195
  }
17893
18196
  };
17894
18197
 
17895
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
18198
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
17896
18199
  function resolveNames(job) {
17897
18200
  for (const unit of job.units) {
17898
18201
  processLexicalScope2(unit, unit.create, null);
@@ -17956,7 +18259,7 @@ function processLexicalScope2(unit, ops, savedView) {
17956
18259
  }
17957
18260
  }
17958
18261
 
17959
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
18262
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
17960
18263
  var sanitizers = /* @__PURE__ */ new Map([
17961
18264
  [SecurityContext.HTML, SanitizerFn.Html],
17962
18265
  [SecurityContext.SCRIPT, SanitizerFn.Script],
@@ -17993,7 +18296,7 @@ function isIframeElement(op) {
17993
18296
  return op.kind === OpKind.ElementStart && ((_a2 = op.tag) == null ? void 0 : _a2.toLowerCase()) === "iframe";
17994
18297
  }
17995
18298
 
17996
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
18299
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
17997
18300
  function saveAndRestoreView(job) {
17998
18301
  for (const unit of job.units) {
17999
18302
  unit.create.prepend([
@@ -18038,7 +18341,7 @@ function addSaveRestoreViewOperationToListener(unit, op) {
18038
18341
  }
18039
18342
  }
18040
18343
 
18041
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
18344
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
18042
18345
  function allocateSlots(job) {
18043
18346
  const slotMap = /* @__PURE__ */ new Map();
18044
18347
  for (const unit of job.units) {
@@ -18063,7 +18366,7 @@ function allocateSlots(job) {
18063
18366
  }
18064
18367
  }
18065
18368
 
18066
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
18369
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
18067
18370
  function specializeStyleBindings(job) {
18068
18371
  for (const unit of job.units) {
18069
18372
  for (const op of unit.update) {
@@ -18093,7 +18396,7 @@ function specializeStyleBindings(job) {
18093
18396
  }
18094
18397
  }
18095
18398
 
18096
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
18399
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
18097
18400
  function generateTemporaryVariables(job) {
18098
18401
  for (const unit of job.units) {
18099
18402
  unit.create.prepend(generateTemporaries(unit.create));
@@ -18151,7 +18454,7 @@ function assignName(names, expr) {
18151
18454
  expr.name = name;
18152
18455
  }
18153
18456
 
18154
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18457
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18155
18458
  function generateTrackFns(job) {
18156
18459
  for (const unit of job.units) {
18157
18460
  for (const op of unit.create) {
@@ -18181,7 +18484,7 @@ function generateTrackFns(job) {
18181
18484
  }
18182
18485
  }
18183
18486
 
18184
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18487
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18185
18488
  function optimizeTrackFns(job) {
18186
18489
  for (const unit of job.units) {
18187
18490
  for (const op of unit.create) {
@@ -18228,7 +18531,7 @@ function isTrackByFunctionCall(rootView, expr) {
18228
18531
  return true;
18229
18532
  }
18230
18533
 
18231
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18534
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18232
18535
  function generateTrackVariables(job) {
18233
18536
  for (const unit of job.units) {
18234
18537
  for (const op of unit.create) {
@@ -18249,7 +18552,7 @@ function generateTrackVariables(job) {
18249
18552
  }
18250
18553
  }
18251
18554
 
18252
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
18555
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
18253
18556
  function countVariables(job) {
18254
18557
  for (const unit of job.units) {
18255
18558
  let varCount = 0;
@@ -18354,7 +18657,7 @@ function isSingletonInterpolation(expr) {
18354
18657
  return true;
18355
18658
  }
18356
18659
 
18357
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
18660
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
18358
18661
  function optimizeVariables(job) {
18359
18662
  for (const unit of job.units) {
18360
18663
  inlineAlwaysInlineVariables(unit.create);
@@ -18604,7 +18907,7 @@ function allowConservativeInlining(decl, target) {
18604
18907
  }
18605
18908
  }
18606
18909
 
18607
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18910
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18608
18911
  function wrapI18nIcus(job) {
18609
18912
  for (const unit of job.units) {
18610
18913
  let currentI18nOp = null;
@@ -18634,16 +18937,16 @@ function wrapI18nIcus(job) {
18634
18937
  }
18635
18938
  }
18636
18939
 
18637
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
18940
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
18638
18941
  var phases = [
18639
18942
  { kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
18640
18943
  { kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
18641
18944
  { kind: CompilationJobKind.Tmpl, fn: emitNamespaceChanges },
18642
- { kind: CompilationJobKind.Both, fn: specializeStyleBindings },
18643
- { kind: CompilationJobKind.Both, fn: specializeBindings },
18644
18945
  { kind: CompilationJobKind.Tmpl, fn: propagateI18nBlocks },
18645
18946
  { kind: CompilationJobKind.Tmpl, fn: wrapI18nIcus },
18646
18947
  { kind: CompilationJobKind.Tmpl, fn: createI18nContexts },
18948
+ { kind: CompilationJobKind.Both, fn: specializeStyleBindings },
18949
+ { kind: CompilationJobKind.Both, fn: specializeBindings },
18647
18950
  { kind: CompilationJobKind.Both, fn: extractAttributes },
18648
18951
  { kind: CompilationJobKind.Both, fn: parseExtractedStyles },
18649
18952
  { kind: CompilationJobKind.Tmpl, fn: removeEmptyBindings },
@@ -18652,7 +18955,10 @@ var phases = [
18652
18955
  { kind: CompilationJobKind.Tmpl, fn: generateConditionalExpressions },
18653
18956
  { kind: CompilationJobKind.Tmpl, fn: createPipes },
18654
18957
  { kind: CompilationJobKind.Tmpl, fn: configureDeferInstructions },
18655
- { kind: CompilationJobKind.Tmpl, fn: extractI18nText },
18958
+ { kind: CompilationJobKind.Tmpl, fn: convertI18nText },
18959
+ { kind: CompilationJobKind.Tmpl, fn: convertI18nBindings },
18960
+ { kind: CompilationJobKind.Tmpl, fn: removeUnusedI18nAttributesOps },
18961
+ { kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
18656
18962
  { kind: CompilationJobKind.Tmpl, fn: applyI18nExpressions },
18657
18963
  { kind: CompilationJobKind.Tmpl, fn: createVariadicPipes },
18658
18964
  { kind: CompilationJobKind.Both, fn: generatePureLiteralStructures },
@@ -18682,7 +18988,6 @@ var phases = [
18682
18988
  { kind: CompilationJobKind.Tmpl, fn: collectI18nConsts },
18683
18989
  { kind: CompilationJobKind.Tmpl, fn: collectConstExpressions },
18684
18990
  { kind: CompilationJobKind.Both, fn: collectElementConsts },
18685
- { kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
18686
18991
  { kind: CompilationJobKind.Tmpl, fn: removeI18nContexts },
18687
18992
  { kind: CompilationJobKind.Both, fn: countVariables },
18688
18993
  { kind: CompilationJobKind.Tmpl, fn: generateAdvance },
@@ -18798,7 +19103,7 @@ function emitHostBindingFunction(job) {
18798
19103
  );
18799
19104
  }
18800
19105
 
18801
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
19106
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
18802
19107
  var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
18803
19108
  function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta) {
18804
19109
  const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta);
@@ -18823,7 +19128,7 @@ function ingestHostProperty(job, property2, isTextAttribute) {
18823
19128
  let expression;
18824
19129
  const ast = property2.expression.ast;
18825
19130
  if (ast instanceof Interpolation) {
18826
- expression = new Interpolation2(ast.strings, ast.expressions.map((expr) => convertAst(expr, job, property2.sourceSpan)));
19131
+ expression = new Interpolation2(ast.strings, ast.expressions.map((expr) => convertAst(expr, job, property2.sourceSpan)), []);
18827
19132
  } else {
18828
19133
  expression = convertAst(ast, job, property2.sourceSpan);
18829
19134
  }
@@ -18835,7 +19140,7 @@ function ingestHostProperty(job, property2, isTextAttribute) {
18835
19140
  if (property2.isAnimation) {
18836
19141
  bindingKind = BindingKind.Animation;
18837
19142
  }
18838
- job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, SecurityContext.NONE, isTextAttribute, false, property2.sourceSpan));
19143
+ job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, SecurityContext.NONE, isTextAttribute, false, null, property2.sourceSpan));
18839
19144
  }
18840
19145
  function ingestHostAttribute(job, name, value) {
18841
19146
  const attrBinding = createBindingOp(
@@ -18847,6 +19152,7 @@ function ingestHostAttribute(job, name, value) {
18847
19152
  SecurityContext.NONE,
18848
19153
  true,
18849
19154
  false,
19155
+ null,
18850
19156
  null
18851
19157
  );
18852
19158
  job.root.update.push(attrBinding);
@@ -18916,24 +19222,29 @@ function ingestTemplate(unit, tmpl) {
18916
19222
  const i18nPlaceholder = tmpl.i18n instanceof TagPlaceholder ? tmpl.i18n : void 0;
18917
19223
  const namespace = namespaceForKey(namespacePrefix);
18918
19224
  const functionNameSuffix = tagNameWithoutNamespace === null ? "" : prefixWithNamespace(tagNameWithoutNamespace, namespace);
18919
- const tplOp = createTemplateOp(childView.xref, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan);
18920
- unit.create.push(tplOp);
18921
- ingestBindings(unit, tplOp, tmpl);
18922
- ingestReferences(tplOp, tmpl);
19225
+ const templateKind = isPlainTemplate(tmpl) ? TemplateKind.NgTemplate : TemplateKind.Structural;
19226
+ const templateOp = createTemplateOp(childView.xref, templateKind, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan);
19227
+ unit.create.push(templateOp);
19228
+ ingestBindings(unit, templateOp, tmpl);
19229
+ ingestReferences(templateOp, tmpl);
18923
19230
  ingestNodes(childView, tmpl.children);
18924
19231
  for (const { name, value } of tmpl.variables) {
18925
19232
  childView.contextVariables.set(name, value !== "" ? value : "$implicit");
18926
19233
  }
18927
- if (isPlainTemplate(tmpl) && tmpl.i18n instanceof Message) {
19234
+ if (templateKind === TemplateKind.NgTemplate && tmpl.i18n instanceof Message) {
18928
19235
  const id = unit.job.allocateXrefId();
18929
19236
  OpList.insertAfter(createI18nStartOp(id, tmpl.i18n), childView.create.head);
18930
19237
  OpList.insertBefore(createI18nEndOp(id), childView.create.tail);
18931
19238
  }
18932
19239
  }
18933
19240
  function ingestContent(unit, content) {
18934
- const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.sourceSpan);
19241
+ if (content.i18n !== void 0 && !(content.i18n instanceof TagPlaceholder)) {
19242
+ throw Error(`Unhandled i18n metadata type for element: ${content.i18n.constructor.name}`);
19243
+ }
19244
+ const attrs = content.attributes.flatMap((a) => [a.name, a.value]);
19245
+ const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.i18n, attrs, content.sourceSpan);
18935
19246
  for (const attr of content.attributes) {
18936
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
19247
+ ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue, attr.i18n);
18937
19248
  }
18938
19249
  unit.create.push(op);
18939
19250
  }
@@ -18961,9 +19272,10 @@ function ingestBoundText(unit, text2, i18nPlaceholders) {
18961
19272
  const textXref = unit.job.allocateXrefId();
18962
19273
  unit.create.push(createTextOp(textXref, "", text2.sourceSpan));
18963
19274
  const baseSourceSpan = unit.job.compatibility ? null : text2.sourceSpan;
18964
- unit.update.push(createInterpolateTextOp(textXref, new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan))), i18nPlaceholders, text2.sourceSpan));
19275
+ unit.update.push(createInterpolateTextOp(textXref, new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan)), i18nPlaceholders), text2.sourceSpan));
18965
19276
  }
18966
19277
  function ingestIfBlock(unit, ifBlock) {
19278
+ var _a2;
18967
19279
  let firstXref = null;
18968
19280
  let firstSlotHandle = null;
18969
19281
  let conditions = [];
@@ -18977,14 +19289,21 @@ function ingestIfBlock(unit, ifBlock) {
18977
19289
  if (ifCase.expressionAlias !== null) {
18978
19290
  cView.contextVariables.set(ifCase.expressionAlias.name, CTX_REF);
18979
19291
  }
18980
- const tmplOp = createTemplateOp(cView.xref, tagName, "Conditional", Namespace.HTML, void 0, ifCase.sourceSpan);
18981
- unit.create.push(tmplOp);
19292
+ let ifCaseI18nMeta = void 0;
19293
+ if (ifCase.i18n !== void 0) {
19294
+ if (!(ifCase.i18n instanceof BlockPlaceholder)) {
19295
+ throw Error(`Unhandled i18n metadata type for if block: ${(_a2 = ifCase.i18n) == null ? void 0 : _a2.constructor.name}`);
19296
+ }
19297
+ ifCaseI18nMeta = ifCase.i18n;
19298
+ }
19299
+ const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, "Conditional", Namespace.HTML, ifCaseI18nMeta, ifCase.sourceSpan);
19300
+ unit.create.push(templateOp);
18982
19301
  if (firstXref === null) {
18983
19302
  firstXref = cView.xref;
18984
- firstSlotHandle = tmplOp.handle;
19303
+ firstSlotHandle = templateOp.handle;
18985
19304
  }
18986
19305
  const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null;
18987
- const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, tmplOp.xref, tmplOp.handle, ifCase.expressionAlias);
19306
+ const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle, ifCase.expressionAlias);
18988
19307
  conditions.push(conditionalCaseExpr);
18989
19308
  ingestNodes(cView, ifCase.children);
18990
19309
  }
@@ -18992,19 +19311,27 @@ function ingestIfBlock(unit, ifBlock) {
18992
19311
  unit.update.push(conditional2);
18993
19312
  }
18994
19313
  function ingestSwitchBlock(unit, switchBlock) {
19314
+ var _a2;
18995
19315
  let firstXref = null;
18996
19316
  let firstSlotHandle = null;
18997
19317
  let conditions = [];
18998
19318
  for (const switchCase of switchBlock.cases) {
18999
19319
  const cView = unit.job.allocateView(unit.xref);
19000
- const tmplOp = createTemplateOp(cView.xref, null, "Case", Namespace.HTML, void 0, switchCase.sourceSpan);
19001
- unit.create.push(tmplOp);
19320
+ let switchCaseI18nMeta = void 0;
19321
+ if (switchCase.i18n !== void 0) {
19322
+ if (!(switchCase.i18n instanceof BlockPlaceholder)) {
19323
+ throw Error(`Unhandled i18n metadata type for switch block: ${(_a2 = switchCase.i18n) == null ? void 0 : _a2.constructor.name}`);
19324
+ }
19325
+ switchCaseI18nMeta = switchCase.i18n;
19326
+ }
19327
+ const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, null, "Case", Namespace.HTML, switchCaseI18nMeta, switchCase.sourceSpan);
19328
+ unit.create.push(templateOp);
19002
19329
  if (firstXref === null) {
19003
19330
  firstXref = cView.xref;
19004
- firstSlotHandle = tmplOp.handle;
19331
+ firstSlotHandle = templateOp.handle;
19005
19332
  }
19006
19333
  const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null;
19007
- const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, tmplOp.xref, tmplOp.handle);
19334
+ const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle);
19008
19335
  conditions.push(conditionalCaseExpr);
19009
19336
  ingestNodes(cView, switchCase.children);
19010
19337
  }
@@ -19017,7 +19344,7 @@ function ingestDeferView(unit, suffix, children, sourceSpan) {
19017
19344
  }
19018
19345
  const secondaryView = unit.job.allocateView(unit.xref);
19019
19346
  ingestNodes(secondaryView, children);
19020
- const templateOp = createTemplateOp(secondaryView.xref, null, `Defer${suffix}`, Namespace.HTML, void 0, sourceSpan);
19347
+ const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML, void 0, sourceSpan);
19021
19348
  unit.create.push(templateOp);
19022
19349
  return templateOp;
19023
19350
  }
@@ -19103,17 +19430,12 @@ function ingestDeferBlock(unit, deferBlock) {
19103
19430
  unit.update.push(deferWhenOps);
19104
19431
  }
19105
19432
  function ingestIcu(unit, icu) {
19106
- var _a2, _b2;
19433
+ var _a2;
19107
19434
  if (icu.i18n instanceof Message && isSingleI18nIcu(icu.i18n)) {
19108
19435
  const xref = unit.job.allocateXrefId();
19109
19436
  const icuNode = icu.i18n.nodes[0];
19110
19437
  unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
19111
- const expressionPlaceholder = (_a2 = icuNode.expressionPlaceholder) == null ? void 0 : _a2.trimEnd();
19112
- if (expressionPlaceholder === void 0 || icu.vars[expressionPlaceholder] === void 0) {
19113
- throw Error("ICU should have a text binding");
19114
- }
19115
- ingestBoundText(unit, icu.vars[expressionPlaceholder], [expressionPlaceholder]);
19116
- for (const [placeholder, text2] of Object.entries(icu.placeholders)) {
19438
+ for (const [placeholder, text2] of Object.entries(__spreadValues(__spreadValues({}, icu.vars), icu.placeholders))) {
19117
19439
  if (text2 instanceof BoundText) {
19118
19440
  ingestBoundText(unit, text2, [placeholder]);
19119
19441
  } else {
@@ -19122,7 +19444,7 @@ function ingestIcu(unit, icu) {
19122
19444
  }
19123
19445
  unit.create.push(createIcuEndOp(xref));
19124
19446
  } else {
19125
- throw Error(`Unhandled i18n metadata type for ICU: ${(_b2 = icu.i18n) == null ? void 0 : _b2.constructor.name}`);
19447
+ throw Error(`Unhandled i18n metadata type for ICU: ${(_a2 = icu.i18n) == null ? void 0 : _a2.constructor.name}`);
19126
19448
  }
19127
19449
  }
19128
19450
  function ingestForBlock(unit, forBlock) {
@@ -19197,6 +19519,15 @@ function convertAst(ast, job, baseSourceSpan) {
19197
19519
  }
19198
19520
  } else if (ast instanceof LiteralPrimitive) {
19199
19521
  return literal(ast.value, void 0, convertSourceSpan(ast.span, baseSourceSpan));
19522
+ } else if (ast instanceof Unary) {
19523
+ switch (ast.operator) {
19524
+ case "+":
19525
+ return new UnaryOperatorExpr(UnaryOperator.Plus, convertAst(ast.expr, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
19526
+ case "-":
19527
+ return new UnaryOperatorExpr(UnaryOperator.Minus, convertAst(ast.expr, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
19528
+ default:
19529
+ throw new Error(`AssertionError: unknown unary operator ${ast.operator}`);
19530
+ }
19200
19531
  } else if (ast instanceof Binary) {
19201
19532
  const operator = BINARY_OPERATORS.get(ast.operation);
19202
19533
  if (operator === void 0) {
@@ -19234,6 +19565,8 @@ function convertAst(ast, job, baseSourceSpan) {
19234
19565
  return new SafeInvokeFunctionExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.args.map((a) => convertAst(a, job, baseSourceSpan)));
19235
19566
  } else if (ast instanceof EmptyExpr) {
19236
19567
  return new EmptyExpr2(convertSourceSpan(ast.span, baseSourceSpan));
19568
+ } else if (ast instanceof PrefixNot) {
19569
+ return not(convertAst(ast.expression, job, baseSourceSpan), convertSourceSpan(ast.span, baseSourceSpan));
19237
19570
  } else {
19238
19571
  throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan == null ? void 0 : baseSourceSpan.start.file.url}"`);
19239
19572
  }
@@ -19244,6 +19577,7 @@ function isPlainTemplate(tmpl) {
19244
19577
  }
19245
19578
  function ingestBindings(unit, op, element2) {
19246
19579
  let flags = BindingFlags.None;
19580
+ let hasI18nAttributes = false;
19247
19581
  if (element2 instanceof Template) {
19248
19582
  flags |= BindingFlags.OnNgTemplateElement;
19249
19583
  if (element2 instanceof Template && isPlainTemplate(element2)) {
@@ -19252,17 +19586,21 @@ function ingestBindings(unit, op, element2) {
19252
19586
  const templateAttrFlags = flags | BindingFlags.BindingTargetsTemplate | BindingFlags.IsStructuralTemplateAttribute;
19253
19587
  for (const attr of element2.templateAttrs) {
19254
19588
  if (attr instanceof TextAttribute) {
19255
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, templateAttrFlags | BindingFlags.TextValue);
19589
+ ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, templateAttrFlags | BindingFlags.TextValue, attr.i18n);
19590
+ hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19256
19591
  } else {
19257
- ingestBinding(unit, op.xref, attr.name, attr.value, attr.type, attr.unit, attr.securityContext, attr.sourceSpan, templateAttrFlags);
19592
+ ingestBinding(unit, op.xref, attr.name, attr.value, attr.type, attr.unit, attr.securityContext, attr.sourceSpan, templateAttrFlags, attr.i18n);
19593
+ hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19258
19594
  }
19259
19595
  }
19260
19596
  }
19261
19597
  for (const attr of element2.attributes) {
19262
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, flags | BindingFlags.TextValue);
19598
+ ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, flags | BindingFlags.TextValue, attr.i18n);
19599
+ hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19263
19600
  }
19264
19601
  for (const input of element2.inputs) {
19265
- ingestBinding(unit, op.xref, input.name, input.value, input.type, input.unit, input.securityContext, input.sourceSpan, flags);
19602
+ ingestBinding(unit, op.xref, input.name, input.value, input.type, input.unit, input.securityContext, input.sourceSpan, flags, input.i18n);
19603
+ hasI18nAttributes || (hasI18nAttributes = input.i18n !== void 0);
19266
19604
  }
19267
19605
  for (const output of element2.outputs) {
19268
19606
  let listenerOp;
@@ -19272,7 +19610,7 @@ function ingestBindings(unit, op, element2) {
19272
19610
  }
19273
19611
  }
19274
19612
  if (element2 instanceof Template && !isPlainTemplate(element2)) {
19275
- unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null));
19613
+ unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null, null));
19276
19614
  continue;
19277
19615
  }
19278
19616
  listenerOp = createListenerOp(op.xref, op.handle, output.name, op.tag, output.phase, false, output.sourceSpan);
@@ -19298,6 +19636,9 @@ function ingestBindings(unit, op, element2) {
19298
19636
  listenerOp.handlerOps.push(createStatementOp(new ReturnStatement(returnExpr, returnExpr.sourceSpan)));
19299
19637
  unit.create.push(listenerOp);
19300
19638
  }
19639
+ if (hasI18nAttributes) {
19640
+ unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref));
19641
+ }
19301
19642
  }
19302
19643
  var BINDING_KINDS = /* @__PURE__ */ new Map([
19303
19644
  [0, BindingKind.Property],
@@ -19314,24 +19655,36 @@ var BindingFlags;
19314
19655
  BindingFlags2[BindingFlags2["IsStructuralTemplateAttribute"] = 4] = "IsStructuralTemplateAttribute";
19315
19656
  BindingFlags2[BindingFlags2["OnNgTemplateElement"] = 8] = "OnNgTemplateElement";
19316
19657
  })(BindingFlags || (BindingFlags = {}));
19317
- function ingestBinding(view, xref, name, value, type, unit, securityContext, sourceSpan, flags) {
19658
+ function ingestBinding(view, xref, name, value, type, unit, securityContext, sourceSpan, flags, i18nMeta) {
19318
19659
  if (value instanceof ASTWithSource) {
19319
19660
  value = value.ast;
19320
19661
  }
19662
+ let i18nContext = null;
19663
+ if (i18nMeta !== void 0) {
19664
+ if (!(i18nMeta instanceof Message)) {
19665
+ throw Error(`Unhandled i18n metadata type for binding: ${i18nMeta.constructor.name}`);
19666
+ }
19667
+ i18nContext = view.job.allocateXrefId();
19668
+ view.create.push(createI18nContextOp(I18nContextKind.Attr, i18nContext, null, i18nMeta, null));
19669
+ }
19321
19670
  if (flags & BindingFlags.OnNgTemplateElement && !(flags & BindingFlags.BindingTargetsTemplate) && type === 0) {
19322
- view.create.push(createExtractedAttributeOp(xref, BindingKind.Property, name, null));
19671
+ view.create.push(createExtractedAttributeOp(xref, BindingKind.Property, name, null, i18nContext));
19323
19672
  return;
19324
19673
  }
19325
19674
  let expression;
19326
19675
  if (value instanceof Interpolation) {
19327
- expression = new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, view.job, null)));
19676
+ let i18nPlaceholders = [];
19677
+ if (i18nMeta !== void 0) {
19678
+ i18nPlaceholders = Object.keys(i18nMeta.placeholders);
19679
+ }
19680
+ expression = new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, view.job, null)), i18nPlaceholders);
19328
19681
  } else if (value instanceof AST) {
19329
19682
  expression = convertAst(value, view.job, null);
19330
19683
  } else {
19331
19684
  expression = value;
19332
19685
  }
19333
19686
  const kind = BINDING_KINDS.get(type);
19334
- view.update.push(createBindingOp(xref, kind, name, expression, unit, securityContext, !!(flags & BindingFlags.TextValue), !!(flags & BindingFlags.IsStructuralTemplateAttribute), sourceSpan));
19687
+ view.update.push(createBindingOp(xref, kind, name, expression, unit, securityContext, !!(flags & BindingFlags.TextValue), !!(flags & BindingFlags.IsStructuralTemplateAttribute), i18nContext, sourceSpan));
19335
19688
  }
19336
19689
  function ingestReferences(op, element2) {
19337
19690
  assertIsArray(op.localRefs);
@@ -19371,7 +19724,7 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
19371
19724
  }
19372
19725
  if (root !== null) {
19373
19726
  for (const attr of root.attributes) {
19374
- ingestBinding(unit, xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
19727
+ ingestBinding(unit, xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue, attr.i18n);
19375
19728
  }
19376
19729
  const tagName = root instanceof Element ? root.name : root.tagName;
19377
19730
  return tagName === "ng-template" ? null : tagName;
@@ -19379,10 +19732,10 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
19379
19732
  return null;
19380
19733
  }
19381
19734
 
19382
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
19735
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
19383
19736
  var USE_TEMPLATE_PIPELINE = false;
19384
19737
 
19385
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
19738
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
19386
19739
  var IMPORTANT_FLAG = "!important";
19387
19740
  var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
19388
19741
  var StylingBuilder = class {
@@ -19715,7 +20068,7 @@ function isEmptyExpression(ast) {
19715
20068
  return ast instanceof EmptyExpr;
19716
20069
  }
19717
20070
 
19718
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
20071
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
19719
20072
  var HtmlParser = class extends Parser2 {
19720
20073
  constructor() {
19721
20074
  super(getHtmlTagDefinition);
@@ -19725,7 +20078,7 @@ var HtmlParser = class extends Parser2 {
19725
20078
  }
19726
20079
  };
19727
20080
 
19728
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
20081
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
19729
20082
  var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
19730
20083
  var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
19731
20084
  var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
@@ -19791,7 +20144,7 @@ function visitAllWithSiblings(visitor, nodes) {
19791
20144
  return result;
19792
20145
  }
19793
20146
 
19794
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
20147
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
19795
20148
  var PROPERTY_PARTS_SEPARATOR = ".";
19796
20149
  var ATTRIBUTE_PREFIX = "attr";
19797
20150
  var CLASS_PREFIX = "class";
@@ -20111,7 +20464,7 @@ function moveParseSourceSpan(sourceSpan, absoluteSpan) {
20111
20464
  return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
20112
20465
  }
20113
20466
 
20114
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
20467
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
20115
20468
  function isStyleUrlResolvable(url) {
20116
20469
  if (url == null || url.length === 0 || url[0] == "/")
20117
20470
  return false;
@@ -20120,7 +20473,7 @@ function isStyleUrlResolvable(url) {
20120
20473
  }
20121
20474
  var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
20122
20475
 
20123
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
20476
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
20124
20477
  var NG_CONTENT_SELECT_ATTR = "select";
20125
20478
  var LINK_ELEMENT = "link";
20126
20479
  var LINK_STYLE_REL_ATTR = "rel";
@@ -20190,7 +20543,7 @@ function normalizeNgContentSelect(selectAttr) {
20190
20543
  return selectAttr;
20191
20544
  }
20192
20545
 
20193
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
20546
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
20194
20547
  var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/;
20195
20548
  var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
20196
20549
  var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
@@ -20481,7 +20834,7 @@ function stripOptionalParentheses(param, errors) {
20481
20834
  return expression.slice(start, end);
20482
20835
  }
20483
20836
 
20484
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
20837
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
20485
20838
  var TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/;
20486
20839
  var SEPARATOR_PATTERN = /^\s$/;
20487
20840
  var COMMA_DELIMITED_SYNTAX = /* @__PURE__ */ new Map([
@@ -20745,7 +21098,7 @@ function parseDeferredTime(value) {
20745
21098
  return parseFloat(time) * (units === "s" ? 1e3 : 1);
20746
21099
  }
20747
21100
 
20748
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
21101
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
20749
21102
  var PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
20750
21103
  var PREFETCH_ON_PATTERN = /^prefetch\s+on\s/;
20751
21104
  var MINIMUM_PARAMETER_PATTERN = /^minimum\s/;
@@ -20880,7 +21233,7 @@ function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
20880
21233
  return { triggers, prefetchTriggers };
20881
21234
  }
20882
21235
 
20883
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
21236
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
20884
21237
  var BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;
20885
21238
  var KW_BIND_IDX = 1;
20886
21239
  var KW_LET_IDX = 2;
@@ -21311,7 +21664,7 @@ function textContents(node) {
21311
21664
  }
21312
21665
  }
21313
21666
 
21314
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
21667
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
21315
21668
  var TagType;
21316
21669
  (function(TagType2) {
21317
21670
  TagType2[TagType2["ELEMENT"] = 0] = "ELEMENT";
@@ -21456,7 +21809,7 @@ function serializePlaceholderValue(value) {
21456
21809
  }
21457
21810
  }
21458
21811
 
21459
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
21812
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
21460
21813
  var NG_CONTENT_SELECT_ATTR2 = "select";
21461
21814
  var NG_PROJECT_AS_ATTR_NAME = "ngProjectAs";
21462
21815
  var EVENT_BINDING_SCOPE_GLOBALS = /* @__PURE__ */ new Set(["$event"]);
@@ -22916,21 +23269,6 @@ var TrackByBindingScope = class extends BindingScope {
22916
23269
  return this.componentAccessCount;
22917
23270
  }
22918
23271
  };
22919
- function createCssSelector(elementName, attributes) {
22920
- const cssSelector = new CssSelector();
22921
- const elementNameNoNs = splitNsName(elementName)[1];
22922
- cssSelector.setElement(elementNameNoNs);
22923
- Object.getOwnPropertyNames(attributes).forEach((name) => {
22924
- const nameNoNs = splitNsName(name)[1];
22925
- const value = attributes[name];
22926
- cssSelector.addAttribute(nameNoNs, value);
22927
- if (name.toLowerCase() === "class") {
22928
- const classes = value.trim().split(/\s+/);
22929
- classes.forEach((className) => cssSelector.addClassName(className));
22930
- }
22931
- });
22932
- return cssSelector;
22933
- }
22934
23272
  function getNgProjectAsLiteral(attribute2) {
22935
23273
  const parsedR3Selector = parseSelectorToR3Selector(attribute2.value)[0];
22936
23274
  return [literal(5), asLiteral(parsedR3Selector)];
@@ -23148,7 +23486,7 @@ function createClosureModeGuard2() {
23148
23486
  return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
23149
23487
  }
23150
23488
 
23151
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23489
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23152
23490
  var ATTR_REGEX = /attr\.([^\]]+)/;
23153
23491
  var COMPONENT_VARIABLE = "%COMP%";
23154
23492
  var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
@@ -23481,6 +23819,8 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23481
23819
  }
23482
23820
  return emitHostBindingFunction(hostJob);
23483
23821
  }
23822
+ let bindingId = 0;
23823
+ const getNextBindingId = () => `${bindingId++}`;
23484
23824
  const bindingContext = variable(CONTEXT_NAME);
23485
23825
  const styleBuilder = new StylingBuilder(bindingContext);
23486
23826
  const { styleAttr, classAttr } = hostBindingsMetadata.specialAttributes;
@@ -23530,7 +23870,7 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23530
23870
  const syntheticHostBindings = [];
23531
23871
  for (const binding of allOtherBindings) {
23532
23872
  const value = binding.expression.visit(getValueConverter());
23533
- const bindingExpr = bindingFn(bindingContext, value);
23873
+ const bindingExpr = bindingFn(bindingContext, value, getNextBindingId);
23534
23874
  const { bindingName, instruction, isAttribute } = getBindingNameAndInstruction(binding);
23535
23875
  const securityContexts = bindingParser.calcPossibleSecurityContexts(selector, bindingName, isAttribute).filter((context) => context !== SecurityContext.NONE);
23536
23876
  let sanitizerFn = null;
@@ -23575,9 +23915,11 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23575
23915
  styleBuilder.buildUpdateLevelInstructions(getValueConverter()).forEach((instruction) => {
23576
23916
  for (const call2 of instruction.calls) {
23577
23917
  totalHostVarsCount += Math.max(call2.allocateBindingSlots - MIN_STYLING_BINDING_SLOTS_REQUIRED, 0);
23918
+ const { params, stmts } = convertStylingCall(call2, bindingContext, bindingFn, getNextBindingId);
23919
+ updateVariables.push(...stmts);
23578
23920
  updateInstructions.push({
23579
23921
  reference: instruction.reference,
23580
- paramsOrFn: convertStylingCall(call2, bindingContext, bindingFn),
23922
+ paramsOrFn: params,
23581
23923
  span: null
23582
23924
  });
23583
23925
  }
@@ -23599,11 +23941,19 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23599
23941
  }
23600
23942
  return null;
23601
23943
  }
23602
- function bindingFn(implicit, value) {
23603
- return convertPropertyBinding(null, implicit, value, "b");
23944
+ function bindingFn(implicit, value, getNextBindingIdFn) {
23945
+ return convertPropertyBinding(null, implicit, value, getNextBindingIdFn());
23604
23946
  }
23605
- function convertStylingCall(call2, bindingContext, bindingFn2) {
23606
- return call2.params((value) => bindingFn2(bindingContext, value).currValExpr);
23947
+ function convertStylingCall(call2, bindingContext, bindingFn2, getNextBindingIdFn) {
23948
+ const stmts = [];
23949
+ const params = call2.params((value) => {
23950
+ const result = bindingFn2(bindingContext, value, getNextBindingIdFn);
23951
+ if (Array.isArray(result.stmts) && result.stmts.length > 0) {
23952
+ stmts.push(...result.stmts);
23953
+ }
23954
+ return result.currValExpr;
23955
+ });
23956
+ return { params, stmts };
23607
23957
  }
23608
23958
  function getBindingNameAndInstruction(binding) {
23609
23959
  let bindingName = binding.name;
@@ -23750,7 +24100,7 @@ function createHostDirectivesMappingArray(mapping) {
23750
24100
  return elements.length > 0 ? literalArr(elements) : null;
23751
24101
  }
23752
24102
 
23753
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
24103
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
23754
24104
  var R3TargetBinder = class {
23755
24105
  constructor(directiveMatcher) {
23756
24106
  this.directiveMatcher = directiveMatcher;
@@ -23918,13 +24268,13 @@ var DirectiveBinder = class {
23918
24268
  template2.forEach((node) => node.visit(this));
23919
24269
  }
23920
24270
  visitElement(element2) {
23921
- this.visitElementOrTemplate(element2.name, element2);
24271
+ this.visitElementOrTemplate(element2);
23922
24272
  }
23923
24273
  visitTemplate(template2) {
23924
- this.visitElementOrTemplate("ng-template", template2);
24274
+ this.visitElementOrTemplate(template2);
23925
24275
  }
23926
- visitElementOrTemplate(elementName, node) {
23927
- const cssSelector = createCssSelector(elementName, getAttrsForDirectiveMatching(node));
24276
+ visitElementOrTemplate(node) {
24277
+ const cssSelector = createCssSelectorFromNode(node);
23928
24278
  const directives = [];
23929
24279
  this.matcher.match(cssSelector, (_selector, results) => directives.push(...results));
23930
24280
  if (directives.length > 0) {
@@ -24355,11 +24705,11 @@ function extractScopedNodeEntities(rootScope) {
24355
24705
  return templateEntities;
24356
24706
  }
24357
24707
 
24358
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/resource_loader.mjs
24708
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/resource_loader.mjs
24359
24709
  var ResourceLoader = class {
24360
24710
  };
24361
24711
 
24362
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
24712
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
24363
24713
  var CompilerFacadeImpl = class {
24364
24714
  constructor(jitEvaluator = new JitEvaluator()) {
24365
24715
  this.jitEvaluator = jitEvaluator;
@@ -24911,17 +25261,17 @@ function publishFacade(global) {
24911
25261
  ng.\u0275compilerFacade = new CompilerFacadeImpl();
24912
25262
  }
24913
25263
 
24914
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
24915
- var VERSION2 = new Version("17.0.5");
25264
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/version.mjs
25265
+ var VERSION2 = new Version("17.0.6");
24916
25266
 
24917
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
25267
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
24918
25268
  var _VisitorMode;
24919
25269
  (function(_VisitorMode2) {
24920
25270
  _VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
24921
25271
  _VisitorMode2[_VisitorMode2["Merge"] = 1] = "Merge";
24922
25272
  })(_VisitorMode || (_VisitorMode = {}));
24923
25273
 
24924
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
25274
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
24925
25275
  var XmlTagDefinition = class {
24926
25276
  constructor() {
24927
25277
  this.closedByParent = false;
@@ -24943,7 +25293,7 @@ var XmlTagDefinition = class {
24943
25293
  };
24944
25294
  var _TAG_DEFINITION = new XmlTagDefinition();
24945
25295
 
24946
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
25296
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
24947
25297
  var FactoryTarget2;
24948
25298
  (function(FactoryTarget3) {
24949
25299
  FactoryTarget3[FactoryTarget3["Directive"] = 0] = "Directive";
@@ -24953,10 +25303,10 @@ var FactoryTarget2;
24953
25303
  FactoryTarget3[FactoryTarget3["NgModule"] = 4] = "NgModule";
24954
25304
  })(FactoryTarget2 || (FactoryTarget2 = {}));
24955
25305
 
24956
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/compiler.mjs
25306
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler.mjs
24957
25307
  publishFacade(_global);
24958
25308
 
24959
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
25309
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
24960
25310
  var ngtemplate = "ng-template";
24961
25311
  var boundngifelse = "[ngIfElse]";
24962
25312
  var boundngifthenelse = "[ngIfThenElse]";
@@ -25003,12 +25353,13 @@ var commonModulePipes = [
25003
25353
  "titlecase"
25004
25354
  ].map((name) => pipeMatchRegExpFor(name));
25005
25355
  var ElementToMigrate = class {
25006
- constructor(el, attr, elseAttr = void 0, thenAttr = void 0, forAttrs = void 0) {
25356
+ constructor(el, attr, elseAttr = void 0, thenAttr = void 0, forAttrs = void 0, aliasAttrs = void 0) {
25007
25357
  __publicField(this, "el");
25008
25358
  __publicField(this, "attr");
25009
25359
  __publicField(this, "elseAttr");
25010
25360
  __publicField(this, "thenAttr");
25011
25361
  __publicField(this, "forAttrs");
25362
+ __publicField(this, "aliasAttrs");
25012
25363
  __publicField(this, "nestCount", 0);
25013
25364
  __publicField(this, "hasLineBreaks", false);
25014
25365
  this.el = el;
@@ -25016,6 +25367,7 @@ var ElementToMigrate = class {
25016
25367
  this.elseAttr = elseAttr;
25017
25368
  this.thenAttr = thenAttr;
25018
25369
  this.forAttrs = forAttrs;
25370
+ this.aliasAttrs = aliasAttrs;
25019
25371
  }
25020
25372
  getCondition() {
25021
25373
  const chunks = this.attr.value.split(";");
@@ -25033,7 +25385,11 @@ var ElementToMigrate = class {
25033
25385
  getTemplateName(targetStr, secondStr) {
25034
25386
  const targetLocation = this.attr.value.indexOf(targetStr);
25035
25387
  const secondTargetLocation = secondStr ? this.attr.value.indexOf(secondStr) : void 0;
25036
- return this.attr.value.slice(targetLocation + targetStr.length, secondTargetLocation).replace(":", "").trim().split(";")[0].trim();
25388
+ let templateName = this.attr.value.slice(targetLocation + targetStr.length, secondTargetLocation);
25389
+ if (templateName.startsWith(":")) {
25390
+ templateName = templateName.slice(1).trim();
25391
+ }
25392
+ return templateName.split(";")[0].trim();
25037
25393
  }
25038
25394
  getValueEnd(offset) {
25039
25395
  return (this.attr.valueSpan ? this.attr.valueSpan.end.offset + 1 : this.attr.keySpan.end.offset) - offset;
@@ -25169,15 +25525,14 @@ var ElementCollector = class extends RecursiveVisitor {
25169
25525
  const elseAttr = el.attrs.find((x) => x.name === boundngifelse);
25170
25526
  const thenAttr = el.attrs.find((x) => x.name === boundngifthenelse || x.name === boundngifthen);
25171
25527
  const forAttrs = attr.name === nakedngfor ? this.getForAttrs(el) : void 0;
25172
- this.elements.push(new ElementToMigrate(el, attr, elseAttr, thenAttr, forAttrs));
25528
+ const aliasAttrs = this.getAliasAttrs(el);
25529
+ this.elements.push(new ElementToMigrate(el, attr, elseAttr, thenAttr, forAttrs, aliasAttrs));
25173
25530
  }
25174
25531
  }
25175
25532
  }
25176
25533
  super.visitElement(el, null);
25177
25534
  }
25178
25535
  getForAttrs(el) {
25179
- const aliases = /* @__PURE__ */ new Map();
25180
- let item = "";
25181
25536
  let trackBy = "";
25182
25537
  let forOf = "";
25183
25538
  for (const attr of el.attrs) {
@@ -25187,6 +25542,13 @@ var ElementCollector = class extends RecursiveVisitor {
25187
25542
  if (attr.name === "[ngForOf]") {
25188
25543
  forOf = attr.value;
25189
25544
  }
25545
+ }
25546
+ return { forOf, trackBy };
25547
+ }
25548
+ getAliasAttrs(el) {
25549
+ const aliases = /* @__PURE__ */ new Map();
25550
+ let item = "";
25551
+ for (const attr of el.attrs) {
25190
25552
  if (attr.name.startsWith("let-")) {
25191
25553
  if (attr.value === "") {
25192
25554
  item = attr.name.replace("let-", "");
@@ -25195,7 +25557,7 @@ var ElementCollector = class extends RecursiveVisitor {
25195
25557
  }
25196
25558
  }
25197
25559
  }
25198
- return { forOf, trackBy, item, aliases };
25560
+ return { item, aliases };
25199
25561
  }
25200
25562
  };
25201
25563
  var TemplateCollector = class extends RecursiveVisitor {
@@ -25227,7 +25589,7 @@ var TemplateCollector = class extends RecursiveVisitor {
25227
25589
  }
25228
25590
  };
25229
25591
 
25230
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
25592
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
25231
25593
  var import_path2 = require("path");
25232
25594
  var import_typescript5 = __toESM(require("typescript"), 1);
25233
25595
  var importRemovals = [
@@ -25279,9 +25641,7 @@ function updateImportClause(clause, removeCommonModule) {
25279
25641
  return clause;
25280
25642
  }
25281
25643
  function updateClassImports(propAssignment, removeCommonModule) {
25282
- const printer = import_typescript5.default.createPrinter({
25283
- removeComments: true
25284
- });
25644
+ const printer = import_typescript5.default.createPrinter();
25285
25645
  const importList = propAssignment.initializer;
25286
25646
  const removals = removeCommonModule ? importWithCommonRemovals : importRemovals;
25287
25647
  const elements = importList.elements.filter((el) => !removals.includes(el.getText()));
@@ -25411,7 +25771,7 @@ function getTemplates(template2) {
25411
25771
  visitAll2(visitor, parsed.rootNodes);
25412
25772
  for (let [key, tmpl] of visitor.templates) {
25413
25773
  const escapeKey = escapeRegExp(key.slice(1));
25414
- const regex = new RegExp(`[^a-zA-Z0-9-<']${escapeKey}\\W`, "gm");
25774
+ const regex = new RegExp(`[^a-zA-Z0-9-<(']${escapeKey}\\W`, "gm");
25415
25775
  const matches = template2.match(regex);
25416
25776
  tmpl.count = (_a2 = matches == null ? void 0 : matches.length) != null ? _a2 : 0;
25417
25777
  tmpl.generateContents(template2);
@@ -25420,6 +25780,13 @@ function getTemplates(template2) {
25420
25780
  }
25421
25781
  return /* @__PURE__ */ new Map();
25422
25782
  }
25783
+ function updateTemplates(template2, templates) {
25784
+ const updatedTemplates = getTemplates(template2);
25785
+ for (let [key, tmpl] of updatedTemplates) {
25786
+ templates.set(key, tmpl);
25787
+ }
25788
+ return templates;
25789
+ }
25423
25790
  function wrapIntoI18nContainer(i18nAttr, content) {
25424
25791
  const { start, middle, end } = generatei18nContainer(i18nAttr, content);
25425
25792
  return `${start}${middle}${end}`;
@@ -25432,8 +25799,8 @@ function processNgTemplates(template2) {
25432
25799
  try {
25433
25800
  const templates = getTemplates(template2);
25434
25801
  for (const [name, t] of templates) {
25435
- const replaceRegex = new RegExp(`${name}\\|`, "g");
25436
- const forRegex = new RegExp(`${name}\\#`, "g");
25802
+ const replaceRegex = new RegExp(`\u03B8${name.slice(1)}\\\u03B4`, "g");
25803
+ const forRegex = new RegExp(`\u03B8${name.slice(1)}\\\u03C6`, "g");
25437
25804
  const forMatches = [...template2.matchAll(forRegex)];
25438
25805
  const matches = [...forMatches, ...template2.matchAll(replaceRegex)];
25439
25806
  let safeToRemove = true;
@@ -25456,13 +25823,26 @@ function processNgTemplates(template2) {
25456
25823
  if (t.count === matches.length + 1 && safeToRemove) {
25457
25824
  template2 = template2.replace(t.contents, "");
25458
25825
  }
25826
+ updateTemplates(template2, templates);
25459
25827
  }
25460
25828
  }
25829
+ template2 = replaceRemainingPlaceholders(template2);
25461
25830
  return { migrated: template2, err: void 0 };
25462
25831
  } catch (err) {
25463
25832
  return { migrated: template2, err };
25464
25833
  }
25465
25834
  }
25835
+ function replaceRemainingPlaceholders(template2) {
25836
+ const replaceRegex = new RegExp(`\u03B8.*\u03B4`, "g");
25837
+ const placeholders = [...template2.matchAll(replaceRegex)];
25838
+ let migrated = template2;
25839
+ for (let ph of placeholders) {
25840
+ const placeholder = ph[0];
25841
+ const name = placeholder.slice(1, placeholder.length - 1);
25842
+ migrated = template2.replace(placeholder, `<ng-template [ngTemplateOutlet]="${name}"></ng-template>`);
25843
+ }
25844
+ return migrated;
25845
+ }
25466
25846
  function canRemoveCommonModule(template2) {
25467
25847
  const parsed = parseTemplate2(template2);
25468
25848
  let removeCommonModule = false;
@@ -25495,10 +25875,29 @@ function getOriginals(etm, tmpl, offset) {
25495
25875
  return { start, end: "", childLength: 0 };
25496
25876
  }
25497
25877
  function isI18nTemplate(etm, i18nAttr) {
25498
- return etm.el.name === "ng-template" && i18nAttr !== void 0 && (etm.el.attrs.length === 2 || etm.el.attrs.length === 3 && etm.elseAttr !== void 0);
25878
+ let attrCount = countAttributes(etm);
25879
+ const safeToRemove = etm.el.attrs.length === attrCount + (i18nAttr !== void 0 ? 1 : 0);
25880
+ return etm.el.name === "ng-template" && i18nAttr !== void 0 && safeToRemove;
25499
25881
  }
25500
25882
  function isRemovableContainer(etm) {
25501
- return (etm.el.name === "ng-container" || etm.el.name === "ng-template") && (etm.el.attrs.length === 1 || etm.forAttrs !== void 0 || etm.el.attrs.length === 2 && etm.elseAttr !== void 0 || etm.el.attrs.length === 3 && etm.elseAttr !== void 0 && etm.thenAttr !== void 0);
25883
+ let attrCount = countAttributes(etm);
25884
+ const safeToRemove = etm.el.attrs.length === attrCount;
25885
+ return (etm.el.name === "ng-container" || etm.el.name === "ng-template") && safeToRemove;
25886
+ }
25887
+ function countAttributes(etm) {
25888
+ var _a2, _b2, _c2, _d2, _e2;
25889
+ let attrCount = 1;
25890
+ if (etm.elseAttr !== void 0) {
25891
+ attrCount++;
25892
+ }
25893
+ if (etm.thenAttr !== void 0) {
25894
+ attrCount++;
25895
+ }
25896
+ attrCount += (_b2 = (_a2 = etm.aliasAttrs) == null ? void 0 : _a2.aliases.size) != null ? _b2 : 0;
25897
+ attrCount += ((_c2 = etm.aliasAttrs) == null ? void 0 : _c2.item) ? 1 : 0;
25898
+ attrCount += ((_d2 = etm.forAttrs) == null ? void 0 : _d2.trackBy) ? 1 : 0;
25899
+ attrCount += ((_e2 = etm.forAttrs) == null ? void 0 : _e2.forOf) ? 1 : 0;
25900
+ return attrCount;
25502
25901
  }
25503
25902
  function getMainBlock(etm, tmpl, offset) {
25504
25903
  const i18nAttr = etm.el.attrs.find((x) => x.name === "i18n");
@@ -25517,11 +25916,12 @@ function getMainBlock(etm, tmpl, offset) {
25517
25916
  const valEnd = etm.getValueEnd(offset);
25518
25917
  const { childStart, childEnd } = etm.hasChildren() ? etm.getChildSpan(offset) : { childStart: valEnd, childEnd: valEnd };
25519
25918
  let start = tmpl.slice(etm.start(offset), attrStart) + tmpl.slice(valEnd, childStart);
25919
+ const middle = tmpl.slice(childStart, childEnd);
25920
+ let end = tmpl.slice(childEnd, etm.end(offset));
25520
25921
  if (etm.shouldRemoveElseAttr()) {
25521
25922
  start = start.replace(etm.getElseAttrStr(), "");
25923
+ end = end.replace(etm.getElseAttrStr(), "");
25522
25924
  }
25523
- const middle = tmpl.slice(childStart, childEnd);
25524
- const end = tmpl.slice(childEnd, etm.end(offset));
25525
25925
  return { start, middle, end };
25526
25926
  }
25527
25927
  var selfClosingList = "input|br|img|base|wbr|area|col|embed|hr|link|meta|param|source|track";
@@ -25584,7 +25984,7 @@ function forEachClass(sourceFile, callback) {
25584
25984
  });
25585
25985
  }
25586
25986
 
25587
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/cases.mjs
25987
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/cases.mjs
25588
25988
  var boundcase = "[ngSwitchCase]";
25589
25989
  var switchcase = "*ngSwitchCase";
25590
25990
  var nakedcase = "ngSwitchCase";
@@ -25662,7 +26062,7 @@ function migrateNgSwitchDefault(etm, tmpl, offset) {
25662
26062
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25663
26063
  }
25664
26064
 
25665
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/fors.mjs
26065
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/fors.mjs
25666
26066
  var ngfor = "*ngFor";
25667
26067
  var nakedngfor2 = "ngFor";
25668
26068
  var fors = [
@@ -25736,7 +26136,7 @@ function migrateStandardNgFor(etm, tmpl, offset) {
25736
26136
  trackBy = `${trackByFn}($index, ${loopVar})`;
25737
26137
  }
25738
26138
  if (part.startsWith("template:")) {
25739
- tmplPlaceholder = `#${part.split(":")[1].trim()}#`;
26139
+ tmplPlaceholder = `\u03B8${part.split(":")[1].trim()}\u03C6`;
25740
26140
  }
25741
26141
  if (part.match(aliasWithEqualRegexp)) {
25742
26142
  const aliasParts = part.split("=");
@@ -25776,9 +26176,10 @@ function migrateStandardNgFor(etm, tmpl, offset) {
25776
26176
  }
25777
26177
  function migrateBoundNgFor(etm, tmpl, offset) {
25778
26178
  const forAttrs = etm.forAttrs;
25779
- const aliasMap = forAttrs.aliases;
26179
+ const aliasAttrs = etm.aliasAttrs;
26180
+ const aliasMap = aliasAttrs.aliases;
25780
26181
  const originals = getOriginals(etm, tmpl, offset);
25781
- const condition = `${forAttrs.item} of ${forAttrs.forOf}`;
26182
+ const condition = `${aliasAttrs.item} of ${forAttrs.forOf}`;
25782
26183
  const aliases = [];
25783
26184
  let aliasedIndex = "$index";
25784
26185
  for (const [key, val] of aliasMap) {
@@ -25788,9 +26189,9 @@ function migrateBoundNgFor(etm, tmpl, offset) {
25788
26189
  }
25789
26190
  }
25790
26191
  const aliasStr = aliases.length > 0 ? `;${aliases.join(";")}` : "";
25791
- let trackBy = forAttrs.item;
26192
+ let trackBy = aliasAttrs.item;
25792
26193
  if (forAttrs.trackBy !== "") {
25793
- trackBy = `${forAttrs.trackBy.trim()}(${aliasedIndex}, ${forAttrs.item})`;
26194
+ trackBy = `${forAttrs.trackBy.trim()}(${aliasedIndex}, ${aliasAttrs.item})`;
25794
26195
  }
25795
26196
  const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25796
26197
  const startBlock = `@for (${condition}; track ${trackBy}${aliasStr}) {
@@ -25835,7 +26236,7 @@ function getNgForParts(expression) {
25835
26236
  return parts;
25836
26237
  }
25837
26238
 
25838
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/ifs.mjs
26239
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/ifs.mjs
25839
26240
  var ngif = "*ngIf";
25840
26241
  var boundngif = "[ngIf]";
25841
26242
  var nakedngif = "ngIf";
@@ -25874,20 +26275,32 @@ function migrateIf(template2) {
25874
26275
  return { migrated: result, errors, changed };
25875
26276
  }
25876
26277
  function migrateNgIf(etm, tmpl, offset) {
25877
- const matchThen = etm.attr.value.match(/;?\s*then/gm);
25878
- const matchElse = etm.attr.value.match(/;?\s*else/gm);
26278
+ const matchThen = etm.attr.value.match(/[^\w\d];?\s*then/gm);
26279
+ const matchElse = etm.attr.value.match(/[^\w\d];?\s*else/gm);
25879
26280
  if (etm.thenAttr !== void 0 || etm.elseAttr !== void 0) {
25880
26281
  return buildBoundIfElseBlock(etm, tmpl, offset);
25881
- } else if (matchThen && matchThen.length > 0) {
26282
+ } else if (matchThen && matchThen.length > 0 && matchElse && matchElse.length > 0) {
25882
26283
  return buildStandardIfThenElseBlock(etm, tmpl, matchThen[0], matchElse[0], offset);
26284
+ } else if (matchThen && matchThen.length > 0) {
26285
+ return buildStandardIfThenBlock(etm, tmpl, matchThen[0], offset);
25883
26286
  } else if (matchElse && matchElse.length > 0) {
25884
26287
  return buildStandardIfElseBlock(etm, tmpl, matchElse[0], offset);
25885
26288
  }
25886
26289
  return buildIfBlock(etm, tmpl, offset);
25887
26290
  }
25888
26291
  function buildIfBlock(etm, tmpl, offset) {
26292
+ const aliasAttrs = etm.aliasAttrs;
26293
+ const aliases = [...aliasAttrs.aliases.keys()];
26294
+ if (aliasAttrs.item) {
26295
+ aliases.push(aliasAttrs.item);
26296
+ }
25889
26297
  const lbString = etm.hasLineBreaks ? "\n" : "";
25890
- const condition = etm.attr.value.replace(" as ", "; as ").replace(/;\s*let/g, "; as");
26298
+ let condition = etm.attr.value.replace(" as ", "; as ").replace(/;\s*let/g, "; as");
26299
+ if (aliases.length > 1 || aliases.length === 1 && condition.indexOf("; as") > -1) {
26300
+ throw new Error("Found more than one alias on your ngIf. Remove one of them and re-run the migration.");
26301
+ } else if (aliases.length === 1) {
26302
+ condition += `; as ${aliases[0]}`;
26303
+ }
25891
26304
  const originals = getOriginals(etm, tmpl, offset);
25892
26305
  const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25893
26306
  const startBlock = `@if (${condition}) {${lbString}${start}`;
@@ -25900,14 +26313,24 @@ function buildIfBlock(etm, tmpl, offset) {
25900
26313
  }
25901
26314
  function buildStandardIfElseBlock(etm, tmpl, elseString, offset) {
25902
26315
  const condition = etm.getCondition().replace(" as ", "; as ").replace(/;\s*let/g, "; as");
25903
- const elsePlaceholder = `#${etm.getTemplateName(elseString)}|`;
26316
+ const elsePlaceholder = `\u03B8${etm.getTemplateName(elseString)}\u03B4`;
25904
26317
  return buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset);
25905
26318
  }
25906
26319
  function buildBoundIfElseBlock(etm, tmpl, offset) {
25907
- const condition = etm.attr.value.replace(" as ", "; as ");
25908
- const elsePlaceholder = `#${etm.elseAttr.value}|`;
26320
+ const aliasAttrs = etm.aliasAttrs;
26321
+ const aliases = [...aliasAttrs.aliases.keys()];
26322
+ if (aliasAttrs.item) {
26323
+ aliases.push(aliasAttrs.item);
26324
+ }
26325
+ let condition = etm.attr.value.replace(" as ", "; as ");
26326
+ if (aliases.length > 1 || aliases.length === 1 && condition.indexOf("; as") > -1) {
26327
+ throw new Error("Found more than one alias on your ngIf. Remove one of them and re-run the migration.");
26328
+ } else if (aliases.length === 1) {
26329
+ condition += `; as ${aliases[0]}`;
26330
+ }
26331
+ const elsePlaceholder = `\u03B8${etm.elseAttr.value}\u03B4`;
25909
26332
  if (etm.thenAttr !== void 0) {
25910
- const thenPlaceholder = `#${etm.thenAttr.value}|`;
26333
+ const thenPlaceholder = `\u03B8${etm.thenAttr.value}\u03B4`;
25911
26334
  return buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset);
25912
26335
  }
25913
26336
  return buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset);
@@ -25929,10 +26352,15 @@ function buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset) {
25929
26352
  }
25930
26353
  function buildStandardIfThenElseBlock(etm, tmpl, thenString, elseString, offset) {
25931
26354
  const condition = etm.getCondition().replace(" as ", "; as ").replace(/;\s*let/g, "; as");
25932
- const thenPlaceholder = `#${etm.getTemplateName(thenString, elseString)}|`;
25933
- const elsePlaceholder = `#${etm.getTemplateName(elseString)}|`;
26355
+ const thenPlaceholder = `\u03B8${etm.getTemplateName(thenString, elseString)}\u03B4`;
26356
+ const elsePlaceholder = `\u03B8${etm.getTemplateName(elseString)}\u03B4`;
25934
26357
  return buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset);
25935
26358
  }
26359
+ function buildStandardIfThenBlock(etm, tmpl, thenString, offset) {
26360
+ const condition = etm.getCondition().replace(" as ", "; as ").replace(/;\s*let/g, "; as");
26361
+ const thenPlaceholder = `\u03B8${etm.getTemplateName(thenString)}\u03B4`;
26362
+ return buildIfThenBlock(etm, tmpl, condition, thenPlaceholder, offset);
26363
+ }
25936
26364
  function buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset) {
25937
26365
  const lbString = etm.hasLineBreaks ? "\n" : "";
25938
26366
  const originals = getOriginals(etm, tmpl, offset);
@@ -25947,8 +26375,21 @@ function buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceho
25947
26375
  const post = originals.end.length - postBlock.length;
25948
26376
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25949
26377
  }
26378
+ function buildIfThenBlock(etm, tmpl, condition, thenPlaceholder, offset) {
26379
+ const lbString = etm.hasLineBreaks ? "\n" : "";
26380
+ const originals = getOriginals(etm, tmpl, offset);
26381
+ const startBlock = `@if (${condition}) {${lbString}`;
26382
+ const postBlock = thenPlaceholder + `${lbString}}`;
26383
+ const ifThenBlock = startBlock + postBlock;
26384
+ const tmplStart = tmpl.slice(0, etm.start(offset));
26385
+ const tmplEnd = tmpl.slice(etm.end(offset));
26386
+ const updatedTmpl = tmplStart + ifThenBlock + tmplEnd;
26387
+ const pre = originals.start.length + originals.childLength - startBlock.length;
26388
+ const post = originals.end.length - postBlock.length;
26389
+ return { tmpl: updatedTmpl, offsets: { pre, post } };
26390
+ }
25950
26391
 
25951
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/switches.mjs
26392
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/switches.mjs
25952
26393
  var ngswitch = "[ngSwitch]";
25953
26394
  var switches = [
25954
26395
  ngswitch
@@ -25998,7 +26439,7 @@ function migrateNgSwitch(etm, tmpl, offset) {
25998
26439
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25999
26440
  }
26000
26441
 
26001
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/migration.mjs
26442
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/migration.mjs
26002
26443
  function migrateTemplate(template2, templateType, node, file, format = true, analyzedFiles) {
26003
26444
  let errors = [];
26004
26445
  let migrated = template2;
@@ -26033,7 +26474,7 @@ function migrateTemplate(template2, templateType, node, file, format = true, ana
26033
26474
  return { migrated, errors };
26034
26475
  }
26035
26476
 
26036
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
26477
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
26037
26478
  function control_flow_migration_default(options) {
26038
26479
  return (tree, context) => __async(this, null, function* () {
26039
26480
  const basePath = process.cwd();