@angular/core 17.1.2 → 17.2.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/esm2022/primitives/signals/index.mjs +2 -2
  2. package/esm2022/src/application/application_tokens.mjs +2 -1
  3. package/esm2022/src/authoring/input.mjs +1 -1
  4. package/esm2022/src/authoring/input_signal.mjs +4 -1
  5. package/esm2022/src/authoring/input_type_checking.mjs +1 -1
  6. package/esm2022/src/authoring/queries.mjs +114 -0
  7. package/esm2022/src/authoring.mjs +1 -1
  8. package/esm2022/src/compiler/compiler_facade_interface.mjs +1 -1
  9. package/esm2022/src/core_render3_private_export.mjs +2 -2
  10. package/esm2022/src/linker/query_list.mjs +7 -1
  11. package/esm2022/src/metadata/di.mjs +7 -7
  12. package/esm2022/src/render3/component_ref.mjs +1 -1
  13. package/esm2022/src/render3/index.mjs +2 -2
  14. package/esm2022/src/render3/instructions/all.mjs +2 -1
  15. package/esm2022/src/render3/instructions/queries.mjs +6 -25
  16. package/esm2022/src/render3/instructions/queries_signals.mjs +55 -0
  17. package/esm2022/src/render3/instructions/write_to_directive_input.mjs +1 -1
  18. package/esm2022/src/render3/jit/directive.mjs +2 -1
  19. package/esm2022/src/render3/jit/environment.mjs +4 -1
  20. package/esm2022/src/render3/query.mjs +46 -7
  21. package/esm2022/src/render3/query_reactive.mjs +110 -0
  22. package/esm2022/src/render3/reactivity/computed.mjs +4 -1
  23. package/esm2022/src/render3/reactivity/signal.mjs +4 -1
  24. package/esm2022/src/version.mjs +1 -1
  25. package/esm2022/testing/src/logger.mjs +3 -3
  26. package/fesm2022/core.mjs +217 -36
  27. package/fesm2022/core.mjs.map +1 -1
  28. package/fesm2022/primitives/signals.mjs +2 -2
  29. package/fesm2022/rxjs-interop.mjs +1 -1
  30. package/fesm2022/testing.mjs +1 -1
  31. package/index.d.ts +90 -14
  32. package/package.json +1 -1
  33. package/primitives/signals/index.d.ts +3 -1
  34. package/rxjs-interop/index.d.ts +1 -1
  35. package/schematics/migrations/block-template-entities/bundle.js +615 -549
  36. package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
  37. package/schematics/ng-generate/control-flow-migration/bundle.js +615 -549
  38. package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
  39. package/schematics/ng-generate/standalone-migration/bundle.js +2159 -1686
  40. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  41. package/testing/index.d.ts +1 -1
@@ -2539,6 +2539,15 @@ var Identifiers = _Identifiers;
2539
2539
  (() => {
2540
2540
  _Identifiers.contentQuery = { name: "\u0275\u0275contentQuery", moduleName: CORE };
2541
2541
  })();
2542
+ (() => {
2543
+ _Identifiers.viewQuerySignal = { name: "\u0275\u0275viewQuerySignal", moduleName: CORE };
2544
+ })();
2545
+ (() => {
2546
+ _Identifiers.contentQuerySignal = { name: "\u0275\u0275contentQuerySignal", moduleName: CORE };
2547
+ })();
2548
+ (() => {
2549
+ _Identifiers.queryAdvance = { name: "\u0275\u0275queryAdvance", moduleName: CORE };
2550
+ })();
2542
2551
  (() => {
2543
2552
  _Identifiers.NgOnChangesFeature = { name: "\u0275\u0275NgOnChangesFeature", moduleName: CORE };
2544
2553
  })();
@@ -4284,11 +4293,11 @@ var CHAINABLE_INSTRUCTIONS = /* @__PURE__ */ new Set([
4284
4293
  function invokeInstruction(span, reference2, params) {
4285
4294
  return importExpr(reference2, null, span).callFn(params, span);
4286
4295
  }
4287
- function temporaryAllocator(statements, name) {
4296
+ function temporaryAllocator(pushStatement, name) {
4288
4297
  let temp = null;
4289
4298
  return () => {
4290
4299
  if (!temp) {
4291
- statements.push(new DeclareVarStmt(TEMPORARY_NAME, void 0, DYNAMIC_TYPE));
4300
+ pushStatement(new DeclareVarStmt(TEMPORARY_NAME, void 0, DYNAMIC_TYPE));
4292
4301
  temp = variable(name);
4293
4302
  }
4294
4303
  return temp;
@@ -4368,24 +4377,6 @@ function trimTrailingNulls(parameters) {
4368
4377
  }
4369
4378
  return parameters;
4370
4379
  }
4371
- function getQueryPredicate(query, constantPool) {
4372
- if (Array.isArray(query.predicate)) {
4373
- let predicate = [];
4374
- query.predicate.forEach((selector) => {
4375
- const selectors = selector.split(",").map((token) => literal(token.trim()));
4376
- predicate.push(...selectors);
4377
- });
4378
- return constantPool.getConstLiteral(literalArr(predicate), true);
4379
- } else {
4380
- switch (query.predicate.forwardRef) {
4381
- case 0:
4382
- case 2:
4383
- return query.predicate.expression;
4384
- case 1:
4385
- return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
4386
- }
4387
- }
4388
- }
4389
4380
  var DefinitionMap = class {
4390
4381
  constructor() {
4391
4382
  this.values = [];
@@ -6651,6 +6642,7 @@ var animationKeywords = /* @__PURE__ */ new Set([
6651
6642
  "jump-start",
6652
6643
  "start"
6653
6644
  ]);
6645
+ var scopedAtRuleIdentifiers = ["@media", "@supports", "@document", "@layer", "@container", "@scope", "@starting-style"];
6654
6646
  var ShadowCss = class {
6655
6647
  constructor() {
6656
6648
  this._animationDeclarationKeyframesRe = /(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
@@ -6785,7 +6777,7 @@ var ShadowCss = class {
6785
6777
  let content = rule.content;
6786
6778
  if (rule.selector[0] !== "@") {
6787
6779
  selector = this._scopeSelector(rule.selector, scopeSelector, hostSelector);
6788
- } else if (rule.selector.startsWith("@media") || rule.selector.startsWith("@supports") || rule.selector.startsWith("@document") || rule.selector.startsWith("@layer") || rule.selector.startsWith("@container") || rule.selector.startsWith("@scope")) {
6780
+ } else if (scopedAtRuleIdentifiers.some((atRule) => rule.selector.startsWith(atRule))) {
6789
6781
  content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
6790
6782
  } else if (rule.selector.startsWith("@font-face") || rule.selector.startsWith("@page")) {
6791
6783
  content = this._stripScopingSelectors(rule.content);
@@ -20065,466 +20057,133 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
20065
20057
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
20066
20058
  var USE_TEMPLATE_PIPELINE = false;
20067
20059
 
20068
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
20069
- var IMPORTANT_FLAG = "!important";
20070
- var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
20071
- var StylingBuilder = class {
20072
- constructor(_directiveExpr) {
20073
- this._directiveExpr = _directiveExpr;
20074
- this._hasInitialValues = false;
20075
- this.hasBindings = false;
20076
- this.hasBindingsWithPipes = false;
20077
- this._classMapInput = null;
20078
- this._styleMapInput = null;
20079
- this._singleStyleInputs = null;
20080
- this._singleClassInputs = null;
20081
- this._lastStylingInput = null;
20082
- this._firstStylingInput = null;
20083
- this._stylesIndex = /* @__PURE__ */ new Map();
20084
- this._classesIndex = /* @__PURE__ */ new Map();
20085
- this._initialStyleValues = [];
20086
- this._initialClassValues = [];
20060
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
20061
+ var HtmlParser = class extends Parser2 {
20062
+ constructor() {
20063
+ super(getHtmlTagDefinition);
20087
20064
  }
20088
- registerBoundInput(input) {
20089
- let binding = null;
20090
- let name = input.name;
20091
- switch (input.type) {
20092
- case 0:
20093
- binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);
20094
- break;
20095
- case 3:
20096
- binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);
20097
- break;
20098
- case 2:
20099
- binding = this.registerClassInput(name, false, input.value, input.sourceSpan);
20100
- break;
20101
- }
20102
- return binding ? true : false;
20065
+ parse(source, url, options) {
20066
+ return super.parse(source, url, options);
20103
20067
  }
20104
- registerInputBasedOnName(name, expression, sourceSpan) {
20105
- let binding = null;
20106
- const prefix = name.substring(0, 6);
20107
- const isStyle = name === "style" || prefix === "style." || prefix === "style!";
20108
- const isClass = !isStyle && (name === "class" || prefix === "class." || prefix === "class!");
20109
- if (isStyle || isClass) {
20110
- const isMapBased = name.charAt(5) !== ".";
20111
- const property2 = name.slice(isMapBased ? 5 : 6);
20112
- if (isStyle) {
20113
- binding = this.registerStyleInput(property2, isMapBased, expression, sourceSpan);
20114
- } else {
20115
- binding = this.registerClassInput(property2, isMapBased, expression, sourceSpan);
20116
- }
20068
+ };
20069
+
20070
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
20071
+ var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
20072
+ var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
20073
+ var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
20074
+ var NO_WS_REGEXP = new RegExp(`[^${WS_CHARS}]`);
20075
+ var WS_REPLACE_REGEXP = new RegExp(`[${WS_CHARS}]{2,}`, "g");
20076
+ function hasPreserveWhitespacesAttr(attrs) {
20077
+ return attrs.some((attr) => attr.name === PRESERVE_WS_ATTR_NAME);
20078
+ }
20079
+ function replaceNgsp(value) {
20080
+ return value.replace(new RegExp(NGSP_UNICODE, "g"), " ");
20081
+ }
20082
+ var WhitespaceVisitor = class {
20083
+ visitElement(element2, context) {
20084
+ if (SKIP_WS_TRIM_TAGS.has(element2.name) || hasPreserveWhitespacesAttr(element2.attrs)) {
20085
+ return new Element2(element2.name, visitAll2(this, element2.attrs), element2.children, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
20117
20086
  }
20118
- return binding;
20087
+ return new Element2(element2.name, element2.attrs, visitAllWithSiblings(this, element2.children), element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
20119
20088
  }
20120
- registerStyleInput(name, isMapBased, value, sourceSpan, suffix) {
20121
- if (isEmptyExpression(value)) {
20122
- return null;
20123
- }
20124
- if (!isCssCustomProperty2(name)) {
20125
- name = hyphenate2(name);
20126
- }
20127
- const { property: property2, hasOverrideFlag, suffix: bindingSuffix } = parseProperty2(name);
20128
- suffix = typeof suffix === "string" && suffix.length !== 0 ? suffix : bindingSuffix;
20129
- const entry = { name: property2, suffix, value, sourceSpan, hasOverrideFlag };
20130
- if (isMapBased) {
20131
- this._styleMapInput = entry;
20132
- } else {
20133
- (this._singleStyleInputs = this._singleStyleInputs || []).push(entry);
20134
- registerIntoMap(this._stylesIndex, property2);
20135
- }
20136
- this._lastStylingInput = entry;
20137
- this._firstStylingInput = this._firstStylingInput || entry;
20138
- this._checkForPipes(value);
20139
- this.hasBindings = true;
20140
- return entry;
20089
+ visitAttribute(attribute2, context) {
20090
+ return attribute2.name !== PRESERVE_WS_ATTR_NAME ? attribute2 : null;
20141
20091
  }
20142
- registerClassInput(name, isMapBased, value, sourceSpan) {
20143
- if (isEmptyExpression(value)) {
20144
- return null;
20145
- }
20146
- const { property: property2, hasOverrideFlag } = parseProperty2(name);
20147
- const entry = { name: property2, value, sourceSpan, hasOverrideFlag, suffix: null };
20148
- if (isMapBased) {
20149
- this._classMapInput = entry;
20150
- } else {
20151
- (this._singleClassInputs = this._singleClassInputs || []).push(entry);
20152
- registerIntoMap(this._classesIndex, property2);
20092
+ visitText(text2, context) {
20093
+ const isNotBlank = text2.value.match(NO_WS_REGEXP);
20094
+ const hasExpansionSibling = context && (context.prev instanceof Expansion || context.next instanceof Expansion);
20095
+ if (isNotBlank || hasExpansionSibling) {
20096
+ const tokens = text2.tokens.map((token) => token.type === 5 ? createWhitespaceProcessedTextToken(token) : token);
20097
+ const value = processWhitespace(text2.value);
20098
+ return new Text4(value, text2.sourceSpan, tokens, text2.i18n);
20153
20099
  }
20154
- this._lastStylingInput = entry;
20155
- this._firstStylingInput = this._firstStylingInput || entry;
20156
- this._checkForPipes(value);
20157
- this.hasBindings = true;
20158
- return entry;
20100
+ return null;
20159
20101
  }
20160
- _checkForPipes(value) {
20161
- if (value instanceof ASTWithSource && value.ast instanceof BindingPipe) {
20162
- this.hasBindingsWithPipes = true;
20163
- }
20102
+ visitComment(comment, context) {
20103
+ return comment;
20164
20104
  }
20165
- registerStyleAttr(value) {
20166
- this._initialStyleValues = parse(value);
20167
- this._hasInitialValues = true;
20105
+ visitExpansion(expansion, context) {
20106
+ return expansion;
20168
20107
  }
20169
- registerClassAttr(value) {
20170
- this._initialClassValues = value.trim().split(/\s+/g);
20171
- this._hasInitialValues = true;
20108
+ visitExpansionCase(expansionCase, context) {
20109
+ return expansionCase;
20172
20110
  }
20173
- populateInitialStylingAttrs(attrs) {
20174
- if (this._initialClassValues.length) {
20175
- attrs.push(literal(1));
20176
- for (let i = 0; i < this._initialClassValues.length; i++) {
20177
- attrs.push(literal(this._initialClassValues[i]));
20178
- }
20179
- }
20180
- if (this._initialStyleValues.length) {
20181
- attrs.push(literal(2));
20182
- for (let i = 0; i < this._initialStyleValues.length; i += 2) {
20183
- attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));
20184
- }
20185
- }
20111
+ visitBlock(block, context) {
20112
+ return new Block(block.name, block.parameters, visitAllWithSiblings(this, block.children), block.sourceSpan, block.nameSpan, block.startSourceSpan, block.endSourceSpan);
20186
20113
  }
20187
- assignHostAttrs(attrs, definitionMap) {
20188
- if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {
20189
- this.populateInitialStylingAttrs(attrs);
20190
- definitionMap.set("hostAttrs", literalArr(attrs));
20114
+ visitBlockParameter(parameter, context) {
20115
+ return parameter;
20116
+ }
20117
+ };
20118
+ function createWhitespaceProcessedTextToken({ type, parts, sourceSpan }) {
20119
+ return { type, parts: [processWhitespace(parts[0])], sourceSpan };
20120
+ }
20121
+ function processWhitespace(text2) {
20122
+ return replaceNgsp(text2).replace(WS_REPLACE_REGEXP, " ");
20123
+ }
20124
+ function visitAllWithSiblings(visitor, nodes) {
20125
+ const result = [];
20126
+ nodes.forEach((ast, i) => {
20127
+ const context = { prev: nodes[i - 1], next: nodes[i + 1] };
20128
+ const astResult = ast.visit(visitor, context);
20129
+ if (astResult) {
20130
+ result.push(astResult);
20191
20131
  }
20132
+ });
20133
+ return result;
20134
+ }
20135
+
20136
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
20137
+ var PROPERTY_PARTS_SEPARATOR = ".";
20138
+ var ATTRIBUTE_PREFIX = "attr";
20139
+ var CLASS_PREFIX = "class";
20140
+ var STYLE_PREFIX = "style";
20141
+ var TEMPLATE_ATTR_PREFIX = "*";
20142
+ var ANIMATE_PROP_PREFIX = "animate-";
20143
+ var BindingParser = class {
20144
+ constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors) {
20145
+ this._exprParser = _exprParser;
20146
+ this._interpolationConfig = _interpolationConfig;
20147
+ this._schemaRegistry = _schemaRegistry;
20148
+ this.errors = errors;
20192
20149
  }
20193
- buildClassMapInstruction(valueConverter) {
20194
- if (this._classMapInput) {
20195
- return this._buildMapBasedInstruction(valueConverter, true, this._classMapInput);
20150
+ get interpolationConfig() {
20151
+ return this._interpolationConfig;
20152
+ }
20153
+ createBoundHostProperties(properties, sourceSpan) {
20154
+ const boundProps = [];
20155
+ for (const propName of Object.keys(properties)) {
20156
+ const expression = properties[propName];
20157
+ if (typeof expression === "string") {
20158
+ this.parsePropertyBinding(
20159
+ propName,
20160
+ expression,
20161
+ true,
20162
+ false,
20163
+ sourceSpan,
20164
+ sourceSpan.start.offset,
20165
+ void 0,
20166
+ [],
20167
+ boundProps,
20168
+ sourceSpan
20169
+ );
20170
+ } else {
20171
+ this._reportError(`Value of the host property binding "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
20172
+ }
20196
20173
  }
20197
- return null;
20174
+ return boundProps;
20198
20175
  }
20199
- buildStyleMapInstruction(valueConverter) {
20200
- if (this._styleMapInput) {
20201
- return this._buildMapBasedInstruction(valueConverter, false, this._styleMapInput);
20176
+ createDirectiveHostEventAsts(hostListeners, sourceSpan) {
20177
+ const targetEvents = [];
20178
+ for (const propName of Object.keys(hostListeners)) {
20179
+ const expression = hostListeners[propName];
20180
+ if (typeof expression === "string") {
20181
+ this.parseEvent(propName, expression, false, sourceSpan, sourceSpan, [], targetEvents, sourceSpan);
20182
+ } else {
20183
+ this._reportError(`Value of the host listener "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
20184
+ }
20202
20185
  }
20203
- return null;
20204
- }
20205
- _buildMapBasedInstruction(valueConverter, isClassBased, stylingInput) {
20206
- let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
20207
- const mapValue = stylingInput.value.visit(valueConverter);
20208
- let reference2;
20209
- if (mapValue instanceof Interpolation) {
20210
- totalBindingSlotsRequired += mapValue.expressions.length;
20211
- reference2 = isClassBased ? getClassMapInterpolationExpression(mapValue) : getStyleMapInterpolationExpression(mapValue);
20212
- } else {
20213
- reference2 = isClassBased ? Identifiers.classMap : Identifiers.styleMap;
20214
- }
20215
- return {
20216
- reference: reference2,
20217
- calls: [{
20218
- supportsInterpolation: true,
20219
- sourceSpan: stylingInput.sourceSpan,
20220
- allocateBindingSlots: totalBindingSlotsRequired,
20221
- params: (convertFn) => {
20222
- const convertResult = convertFn(mapValue);
20223
- const params = Array.isArray(convertResult) ? convertResult : [convertResult];
20224
- return params;
20225
- }
20226
- }]
20227
- };
20228
- }
20229
- _buildSingleInputs(reference2, inputs, valueConverter, getInterpolationExpressionFn, isClassBased) {
20230
- const instructions = [];
20231
- inputs.forEach((input) => {
20232
- const previousInstruction = instructions[instructions.length - 1];
20233
- const value = input.value.visit(valueConverter);
20234
- let referenceForCall = reference2;
20235
- let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
20236
- if (value instanceof Interpolation) {
20237
- totalBindingSlotsRequired += value.expressions.length;
20238
- if (getInterpolationExpressionFn) {
20239
- referenceForCall = getInterpolationExpressionFn(value);
20240
- }
20241
- }
20242
- const call2 = {
20243
- sourceSpan: input.sourceSpan,
20244
- allocateBindingSlots: totalBindingSlotsRequired,
20245
- supportsInterpolation: !!getInterpolationExpressionFn,
20246
- params: (convertFn) => {
20247
- const params = [];
20248
- params.push(literal(input.name));
20249
- const convertResult = convertFn(value);
20250
- if (Array.isArray(convertResult)) {
20251
- params.push(...convertResult);
20252
- } else {
20253
- params.push(convertResult);
20254
- }
20255
- if (!isClassBased && input.suffix !== null) {
20256
- params.push(literal(input.suffix));
20257
- }
20258
- return params;
20259
- }
20260
- };
20261
- if (previousInstruction && previousInstruction.reference === referenceForCall) {
20262
- previousInstruction.calls.push(call2);
20263
- } else {
20264
- instructions.push({ reference: referenceForCall, calls: [call2] });
20265
- }
20266
- });
20267
- return instructions;
20268
- }
20269
- _buildClassInputs(valueConverter) {
20270
- if (this._singleClassInputs) {
20271
- return this._buildSingleInputs(Identifiers.classProp, this._singleClassInputs, valueConverter, null, true);
20272
- }
20273
- return [];
20274
- }
20275
- _buildStyleInputs(valueConverter) {
20276
- if (this._singleStyleInputs) {
20277
- return this._buildSingleInputs(Identifiers.styleProp, this._singleStyleInputs, valueConverter, getStylePropInterpolationExpression, false);
20278
- }
20279
- return [];
20280
- }
20281
- buildUpdateLevelInstructions(valueConverter) {
20282
- const instructions = [];
20283
- if (this.hasBindings) {
20284
- const styleMapInstruction = this.buildStyleMapInstruction(valueConverter);
20285
- if (styleMapInstruction) {
20286
- instructions.push(styleMapInstruction);
20287
- }
20288
- const classMapInstruction = this.buildClassMapInstruction(valueConverter);
20289
- if (classMapInstruction) {
20290
- instructions.push(classMapInstruction);
20291
- }
20292
- instructions.push(...this._buildStyleInputs(valueConverter));
20293
- instructions.push(...this._buildClassInputs(valueConverter));
20294
- }
20295
- return instructions;
20296
- }
20297
- };
20298
- function registerIntoMap(map, key) {
20299
- if (!map.has(key)) {
20300
- map.set(key, map.size);
20301
- }
20302
- }
20303
- function parseProperty2(name) {
20304
- let hasOverrideFlag = false;
20305
- const overrideIndex = name.indexOf(IMPORTANT_FLAG);
20306
- if (overrideIndex !== -1) {
20307
- name = overrideIndex > 0 ? name.substring(0, overrideIndex) : "";
20308
- hasOverrideFlag = true;
20309
- }
20310
- let suffix = null;
20311
- let property2 = name;
20312
- const unitIndex = name.lastIndexOf(".");
20313
- if (unitIndex > 0) {
20314
- suffix = name.slice(unitIndex + 1);
20315
- property2 = name.substring(0, unitIndex);
20316
- }
20317
- return { property: property2, suffix, hasOverrideFlag };
20318
- }
20319
- function getClassMapInterpolationExpression(interpolation) {
20320
- switch (getInterpolationArgsLength(interpolation)) {
20321
- case 1:
20322
- return Identifiers.classMap;
20323
- case 3:
20324
- return Identifiers.classMapInterpolate1;
20325
- case 5:
20326
- return Identifiers.classMapInterpolate2;
20327
- case 7:
20328
- return Identifiers.classMapInterpolate3;
20329
- case 9:
20330
- return Identifiers.classMapInterpolate4;
20331
- case 11:
20332
- return Identifiers.classMapInterpolate5;
20333
- case 13:
20334
- return Identifiers.classMapInterpolate6;
20335
- case 15:
20336
- return Identifiers.classMapInterpolate7;
20337
- case 17:
20338
- return Identifiers.classMapInterpolate8;
20339
- default:
20340
- return Identifiers.classMapInterpolateV;
20341
- }
20342
- }
20343
- function getStyleMapInterpolationExpression(interpolation) {
20344
- switch (getInterpolationArgsLength(interpolation)) {
20345
- case 1:
20346
- return Identifiers.styleMap;
20347
- case 3:
20348
- return Identifiers.styleMapInterpolate1;
20349
- case 5:
20350
- return Identifiers.styleMapInterpolate2;
20351
- case 7:
20352
- return Identifiers.styleMapInterpolate3;
20353
- case 9:
20354
- return Identifiers.styleMapInterpolate4;
20355
- case 11:
20356
- return Identifiers.styleMapInterpolate5;
20357
- case 13:
20358
- return Identifiers.styleMapInterpolate6;
20359
- case 15:
20360
- return Identifiers.styleMapInterpolate7;
20361
- case 17:
20362
- return Identifiers.styleMapInterpolate8;
20363
- default:
20364
- return Identifiers.styleMapInterpolateV;
20365
- }
20366
- }
20367
- function getStylePropInterpolationExpression(interpolation) {
20368
- switch (getInterpolationArgsLength(interpolation)) {
20369
- case 1:
20370
- return Identifiers.styleProp;
20371
- case 3:
20372
- return Identifiers.stylePropInterpolate1;
20373
- case 5:
20374
- return Identifiers.stylePropInterpolate2;
20375
- case 7:
20376
- return Identifiers.stylePropInterpolate3;
20377
- case 9:
20378
- return Identifiers.stylePropInterpolate4;
20379
- case 11:
20380
- return Identifiers.stylePropInterpolate5;
20381
- case 13:
20382
- return Identifiers.stylePropInterpolate6;
20383
- case 15:
20384
- return Identifiers.stylePropInterpolate7;
20385
- case 17:
20386
- return Identifiers.stylePropInterpolate8;
20387
- default:
20388
- return Identifiers.stylePropInterpolateV;
20389
- }
20390
- }
20391
- function isCssCustomProperty2(name) {
20392
- return name.startsWith("--");
20393
- }
20394
- function isEmptyExpression(ast) {
20395
- if (ast instanceof ASTWithSource) {
20396
- ast = ast.ast;
20397
- }
20398
- return ast instanceof EmptyExpr;
20399
- }
20400
-
20401
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
20402
- var HtmlParser = class extends Parser2 {
20403
- constructor() {
20404
- super(getHtmlTagDefinition);
20405
- }
20406
- parse(source, url, options) {
20407
- return super.parse(source, url, options);
20408
- }
20409
- };
20410
-
20411
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
20412
- var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
20413
- var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
20414
- var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
20415
- var NO_WS_REGEXP = new RegExp(`[^${WS_CHARS}]`);
20416
- var WS_REPLACE_REGEXP = new RegExp(`[${WS_CHARS}]{2,}`, "g");
20417
- function hasPreserveWhitespacesAttr(attrs) {
20418
- return attrs.some((attr) => attr.name === PRESERVE_WS_ATTR_NAME);
20419
- }
20420
- function replaceNgsp(value) {
20421
- return value.replace(new RegExp(NGSP_UNICODE, "g"), " ");
20422
- }
20423
- var WhitespaceVisitor = class {
20424
- visitElement(element2, context) {
20425
- if (SKIP_WS_TRIM_TAGS.has(element2.name) || hasPreserveWhitespacesAttr(element2.attrs)) {
20426
- return new Element2(element2.name, visitAll2(this, element2.attrs), element2.children, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
20427
- }
20428
- return new Element2(element2.name, element2.attrs, visitAllWithSiblings(this, element2.children), element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
20429
- }
20430
- visitAttribute(attribute2, context) {
20431
- return attribute2.name !== PRESERVE_WS_ATTR_NAME ? attribute2 : null;
20432
- }
20433
- visitText(text2, context) {
20434
- const isNotBlank = text2.value.match(NO_WS_REGEXP);
20435
- const hasExpansionSibling = context && (context.prev instanceof Expansion || context.next instanceof Expansion);
20436
- if (isNotBlank || hasExpansionSibling) {
20437
- const tokens = text2.tokens.map((token) => token.type === 5 ? createWhitespaceProcessedTextToken(token) : token);
20438
- const value = processWhitespace(text2.value);
20439
- return new Text4(value, text2.sourceSpan, tokens, text2.i18n);
20440
- }
20441
- return null;
20442
- }
20443
- visitComment(comment, context) {
20444
- return comment;
20445
- }
20446
- visitExpansion(expansion, context) {
20447
- return expansion;
20448
- }
20449
- visitExpansionCase(expansionCase, context) {
20450
- return expansionCase;
20451
- }
20452
- visitBlock(block, context) {
20453
- return new Block(block.name, block.parameters, visitAllWithSiblings(this, block.children), block.sourceSpan, block.nameSpan, block.startSourceSpan, block.endSourceSpan);
20454
- }
20455
- visitBlockParameter(parameter, context) {
20456
- return parameter;
20457
- }
20458
- };
20459
- function createWhitespaceProcessedTextToken({ type, parts, sourceSpan }) {
20460
- return { type, parts: [processWhitespace(parts[0])], sourceSpan };
20461
- }
20462
- function processWhitespace(text2) {
20463
- return replaceNgsp(text2).replace(WS_REPLACE_REGEXP, " ");
20464
- }
20465
- function visitAllWithSiblings(visitor, nodes) {
20466
- const result = [];
20467
- nodes.forEach((ast, i) => {
20468
- const context = { prev: nodes[i - 1], next: nodes[i + 1] };
20469
- const astResult = ast.visit(visitor, context);
20470
- if (astResult) {
20471
- result.push(astResult);
20472
- }
20473
- });
20474
- return result;
20475
- }
20476
-
20477
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
20478
- var PROPERTY_PARTS_SEPARATOR = ".";
20479
- var ATTRIBUTE_PREFIX = "attr";
20480
- var CLASS_PREFIX = "class";
20481
- var STYLE_PREFIX = "style";
20482
- var TEMPLATE_ATTR_PREFIX = "*";
20483
- var ANIMATE_PROP_PREFIX = "animate-";
20484
- var BindingParser = class {
20485
- constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors) {
20486
- this._exprParser = _exprParser;
20487
- this._interpolationConfig = _interpolationConfig;
20488
- this._schemaRegistry = _schemaRegistry;
20489
- this.errors = errors;
20490
- }
20491
- get interpolationConfig() {
20492
- return this._interpolationConfig;
20493
- }
20494
- createBoundHostProperties(properties, sourceSpan) {
20495
- const boundProps = [];
20496
- for (const propName of Object.keys(properties)) {
20497
- const expression = properties[propName];
20498
- if (typeof expression === "string") {
20499
- this.parsePropertyBinding(
20500
- propName,
20501
- expression,
20502
- true,
20503
- false,
20504
- sourceSpan,
20505
- sourceSpan.start.offset,
20506
- void 0,
20507
- [],
20508
- boundProps,
20509
- sourceSpan
20510
- );
20511
- } else {
20512
- this._reportError(`Value of the host property binding "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
20513
- }
20514
- }
20515
- return boundProps;
20516
- }
20517
- createDirectiveHostEventAsts(hostListeners, sourceSpan) {
20518
- const targetEvents = [];
20519
- for (const propName of Object.keys(hostListeners)) {
20520
- const expression = hostListeners[propName];
20521
- if (typeof expression === "string") {
20522
- this.parseEvent(propName, expression, false, sourceSpan, sourceSpan, [], targetEvents, sourceSpan);
20523
- } else {
20524
- this._reportError(`Value of the host listener "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
20525
- }
20526
- }
20527
- return targetEvents;
20186
+ return targetEvents;
20528
20187
  }
20529
20188
  parseInterpolation(value, sourceSpan, interpolatedTokens) {
20530
20189
  const sourceInfo = sourceSpan.start.toString();
@@ -22126,39 +21785,372 @@ var I18nContext = class {
22126
21785
  } else {
22127
21786
  phs.push(...values);
22128
21787
  }
22129
- this.placeholders.set(key, phs);
22130
- });
22131
- this._unresolvedCtxCount--;
21788
+ this.placeholders.set(key, phs);
21789
+ });
21790
+ this._unresolvedCtxCount--;
21791
+ }
21792
+ };
21793
+ function wrap(symbol, index, contextId, closed) {
21794
+ const state = closed ? "/" : "";
21795
+ return wrapI18nPlaceholder(`${state}${symbol}${index}`, contextId);
21796
+ }
21797
+ function wrapTag(symbol, { index, ctx, isVoid }, closed) {
21798
+ return isVoid ? wrap(symbol, index, ctx) + wrap(symbol, index, ctx, true) : wrap(symbol, index, ctx, closed);
21799
+ }
21800
+ function findTemplateFn(ctx, templateIndex) {
21801
+ return (token) => typeof token === "object" && token.type === TagType.TEMPLATE && token.index === templateIndex && token.ctx === ctx;
21802
+ }
21803
+ function serializePlaceholderValue(value) {
21804
+ const element2 = (data, closed) => wrapTag("#", data, closed);
21805
+ const template2 = (data, closed) => wrapTag("*", data, closed);
21806
+ switch (value.type) {
21807
+ case TagType.ELEMENT:
21808
+ if (value.closed) {
21809
+ return element2(value, true) + (value.tmpl ? template2(value.tmpl, true) : "");
21810
+ }
21811
+ if (value.tmpl) {
21812
+ return template2(value.tmpl) + element2(value) + (value.isVoid ? template2(value.tmpl, true) : "");
21813
+ }
21814
+ return element2(value);
21815
+ case TagType.TEMPLATE:
21816
+ return template2(value, value.closed);
21817
+ default:
21818
+ return value;
21819
+ }
21820
+ }
21821
+
21822
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
21823
+ var IMPORTANT_FLAG = "!important";
21824
+ var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
21825
+ var StylingBuilder = class {
21826
+ constructor(_directiveExpr) {
21827
+ this._directiveExpr = _directiveExpr;
21828
+ this._hasInitialValues = false;
21829
+ this.hasBindings = false;
21830
+ this.hasBindingsWithPipes = false;
21831
+ this._classMapInput = null;
21832
+ this._styleMapInput = null;
21833
+ this._singleStyleInputs = null;
21834
+ this._singleClassInputs = null;
21835
+ this._lastStylingInput = null;
21836
+ this._firstStylingInput = null;
21837
+ this._stylesIndex = /* @__PURE__ */ new Map();
21838
+ this._classesIndex = /* @__PURE__ */ new Map();
21839
+ this._initialStyleValues = [];
21840
+ this._initialClassValues = [];
21841
+ }
21842
+ registerBoundInput(input) {
21843
+ let binding = null;
21844
+ let name = input.name;
21845
+ switch (input.type) {
21846
+ case 0:
21847
+ binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);
21848
+ break;
21849
+ case 3:
21850
+ binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);
21851
+ break;
21852
+ case 2:
21853
+ binding = this.registerClassInput(name, false, input.value, input.sourceSpan);
21854
+ break;
21855
+ }
21856
+ return binding ? true : false;
21857
+ }
21858
+ registerInputBasedOnName(name, expression, sourceSpan) {
21859
+ let binding = null;
21860
+ const prefix = name.substring(0, 6);
21861
+ const isStyle = name === "style" || prefix === "style." || prefix === "style!";
21862
+ const isClass = !isStyle && (name === "class" || prefix === "class." || prefix === "class!");
21863
+ if (isStyle || isClass) {
21864
+ const isMapBased = name.charAt(5) !== ".";
21865
+ const property2 = name.slice(isMapBased ? 5 : 6);
21866
+ if (isStyle) {
21867
+ binding = this.registerStyleInput(property2, isMapBased, expression, sourceSpan);
21868
+ } else {
21869
+ binding = this.registerClassInput(property2, isMapBased, expression, sourceSpan);
21870
+ }
21871
+ }
21872
+ return binding;
21873
+ }
21874
+ registerStyleInput(name, isMapBased, value, sourceSpan, suffix) {
21875
+ if (isEmptyExpression(value)) {
21876
+ return null;
21877
+ }
21878
+ if (!isCssCustomProperty2(name)) {
21879
+ name = hyphenate2(name);
21880
+ }
21881
+ const { property: property2, hasOverrideFlag, suffix: bindingSuffix } = parseProperty2(name);
21882
+ suffix = typeof suffix === "string" && suffix.length !== 0 ? suffix : bindingSuffix;
21883
+ const entry = { name: property2, suffix, value, sourceSpan, hasOverrideFlag };
21884
+ if (isMapBased) {
21885
+ this._styleMapInput = entry;
21886
+ } else {
21887
+ (this._singleStyleInputs = this._singleStyleInputs || []).push(entry);
21888
+ registerIntoMap(this._stylesIndex, property2);
21889
+ }
21890
+ this._lastStylingInput = entry;
21891
+ this._firstStylingInput = this._firstStylingInput || entry;
21892
+ this._checkForPipes(value);
21893
+ this.hasBindings = true;
21894
+ return entry;
21895
+ }
21896
+ registerClassInput(name, isMapBased, value, sourceSpan) {
21897
+ if (isEmptyExpression(value)) {
21898
+ return null;
21899
+ }
21900
+ const { property: property2, hasOverrideFlag } = parseProperty2(name);
21901
+ const entry = { name: property2, value, sourceSpan, hasOverrideFlag, suffix: null };
21902
+ if (isMapBased) {
21903
+ this._classMapInput = entry;
21904
+ } else {
21905
+ (this._singleClassInputs = this._singleClassInputs || []).push(entry);
21906
+ registerIntoMap(this._classesIndex, property2);
21907
+ }
21908
+ this._lastStylingInput = entry;
21909
+ this._firstStylingInput = this._firstStylingInput || entry;
21910
+ this._checkForPipes(value);
21911
+ this.hasBindings = true;
21912
+ return entry;
21913
+ }
21914
+ _checkForPipes(value) {
21915
+ if (value instanceof ASTWithSource && value.ast instanceof BindingPipe) {
21916
+ this.hasBindingsWithPipes = true;
21917
+ }
21918
+ }
21919
+ registerStyleAttr(value) {
21920
+ this._initialStyleValues = parse(value);
21921
+ this._hasInitialValues = true;
21922
+ }
21923
+ registerClassAttr(value) {
21924
+ this._initialClassValues = value.trim().split(/\s+/g);
21925
+ this._hasInitialValues = true;
21926
+ }
21927
+ populateInitialStylingAttrs(attrs) {
21928
+ if (this._initialClassValues.length) {
21929
+ attrs.push(literal(1));
21930
+ for (let i = 0; i < this._initialClassValues.length; i++) {
21931
+ attrs.push(literal(this._initialClassValues[i]));
21932
+ }
21933
+ }
21934
+ if (this._initialStyleValues.length) {
21935
+ attrs.push(literal(2));
21936
+ for (let i = 0; i < this._initialStyleValues.length; i += 2) {
21937
+ attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));
21938
+ }
21939
+ }
21940
+ }
21941
+ assignHostAttrs(attrs, definitionMap) {
21942
+ if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {
21943
+ this.populateInitialStylingAttrs(attrs);
21944
+ definitionMap.set("hostAttrs", literalArr(attrs));
21945
+ }
21946
+ }
21947
+ buildClassMapInstruction(valueConverter) {
21948
+ if (this._classMapInput) {
21949
+ return this._buildMapBasedInstruction(valueConverter, true, this._classMapInput);
21950
+ }
21951
+ return null;
21952
+ }
21953
+ buildStyleMapInstruction(valueConverter) {
21954
+ if (this._styleMapInput) {
21955
+ return this._buildMapBasedInstruction(valueConverter, false, this._styleMapInput);
21956
+ }
21957
+ return null;
21958
+ }
21959
+ _buildMapBasedInstruction(valueConverter, isClassBased, stylingInput) {
21960
+ let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
21961
+ const mapValue = stylingInput.value.visit(valueConverter);
21962
+ let reference2;
21963
+ if (mapValue instanceof Interpolation) {
21964
+ totalBindingSlotsRequired += mapValue.expressions.length;
21965
+ reference2 = isClassBased ? getClassMapInterpolationExpression(mapValue) : getStyleMapInterpolationExpression(mapValue);
21966
+ } else {
21967
+ reference2 = isClassBased ? Identifiers.classMap : Identifiers.styleMap;
21968
+ }
21969
+ return {
21970
+ reference: reference2,
21971
+ calls: [{
21972
+ supportsInterpolation: true,
21973
+ sourceSpan: stylingInput.sourceSpan,
21974
+ allocateBindingSlots: totalBindingSlotsRequired,
21975
+ params: (convertFn) => {
21976
+ const convertResult = convertFn(mapValue);
21977
+ const params = Array.isArray(convertResult) ? convertResult : [convertResult];
21978
+ return params;
21979
+ }
21980
+ }]
21981
+ };
21982
+ }
21983
+ _buildSingleInputs(reference2, inputs, valueConverter, getInterpolationExpressionFn, isClassBased) {
21984
+ const instructions = [];
21985
+ inputs.forEach((input) => {
21986
+ const previousInstruction = instructions[instructions.length - 1];
21987
+ const value = input.value.visit(valueConverter);
21988
+ let referenceForCall = reference2;
21989
+ let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
21990
+ if (value instanceof Interpolation) {
21991
+ totalBindingSlotsRequired += value.expressions.length;
21992
+ if (getInterpolationExpressionFn) {
21993
+ referenceForCall = getInterpolationExpressionFn(value);
21994
+ }
21995
+ }
21996
+ const call2 = {
21997
+ sourceSpan: input.sourceSpan,
21998
+ allocateBindingSlots: totalBindingSlotsRequired,
21999
+ supportsInterpolation: !!getInterpolationExpressionFn,
22000
+ params: (convertFn) => {
22001
+ const params = [];
22002
+ params.push(literal(input.name));
22003
+ const convertResult = convertFn(value);
22004
+ if (Array.isArray(convertResult)) {
22005
+ params.push(...convertResult);
22006
+ } else {
22007
+ params.push(convertResult);
22008
+ }
22009
+ if (!isClassBased && input.suffix !== null) {
22010
+ params.push(literal(input.suffix));
22011
+ }
22012
+ return params;
22013
+ }
22014
+ };
22015
+ if (previousInstruction && previousInstruction.reference === referenceForCall) {
22016
+ previousInstruction.calls.push(call2);
22017
+ } else {
22018
+ instructions.push({ reference: referenceForCall, calls: [call2] });
22019
+ }
22020
+ });
22021
+ return instructions;
22022
+ }
22023
+ _buildClassInputs(valueConverter) {
22024
+ if (this._singleClassInputs) {
22025
+ return this._buildSingleInputs(Identifiers.classProp, this._singleClassInputs, valueConverter, null, true);
22026
+ }
22027
+ return [];
22028
+ }
22029
+ _buildStyleInputs(valueConverter) {
22030
+ if (this._singleStyleInputs) {
22031
+ return this._buildSingleInputs(Identifiers.styleProp, this._singleStyleInputs, valueConverter, getStylePropInterpolationExpression, false);
22032
+ }
22033
+ return [];
22034
+ }
22035
+ buildUpdateLevelInstructions(valueConverter) {
22036
+ const instructions = [];
22037
+ if (this.hasBindings) {
22038
+ const styleMapInstruction = this.buildStyleMapInstruction(valueConverter);
22039
+ if (styleMapInstruction) {
22040
+ instructions.push(styleMapInstruction);
22041
+ }
22042
+ const classMapInstruction = this.buildClassMapInstruction(valueConverter);
22043
+ if (classMapInstruction) {
22044
+ instructions.push(classMapInstruction);
22045
+ }
22046
+ instructions.push(...this._buildStyleInputs(valueConverter));
22047
+ instructions.push(...this._buildClassInputs(valueConverter));
22048
+ }
22049
+ return instructions;
22132
22050
  }
22133
22051
  };
22134
- function wrap(symbol, index, contextId, closed) {
22135
- const state = closed ? "/" : "";
22136
- return wrapI18nPlaceholder(`${state}${symbol}${index}`, contextId);
22052
+ function registerIntoMap(map, key) {
22053
+ if (!map.has(key)) {
22054
+ map.set(key, map.size);
22055
+ }
22137
22056
  }
22138
- function wrapTag(symbol, { index, ctx, isVoid }, closed) {
22139
- return isVoid ? wrap(symbol, index, ctx) + wrap(symbol, index, ctx, true) : wrap(symbol, index, ctx, closed);
22057
+ function parseProperty2(name) {
22058
+ let hasOverrideFlag = false;
22059
+ const overrideIndex = name.indexOf(IMPORTANT_FLAG);
22060
+ if (overrideIndex !== -1) {
22061
+ name = overrideIndex > 0 ? name.substring(0, overrideIndex) : "";
22062
+ hasOverrideFlag = true;
22063
+ }
22064
+ let suffix = null;
22065
+ let property2 = name;
22066
+ const unitIndex = name.lastIndexOf(".");
22067
+ if (unitIndex > 0) {
22068
+ suffix = name.slice(unitIndex + 1);
22069
+ property2 = name.substring(0, unitIndex);
22070
+ }
22071
+ return { property: property2, suffix, hasOverrideFlag };
22140
22072
  }
22141
- function findTemplateFn(ctx, templateIndex) {
22142
- return (token) => typeof token === "object" && token.type === TagType.TEMPLATE && token.index === templateIndex && token.ctx === ctx;
22073
+ function getClassMapInterpolationExpression(interpolation) {
22074
+ switch (getInterpolationArgsLength(interpolation)) {
22075
+ case 1:
22076
+ return Identifiers.classMap;
22077
+ case 3:
22078
+ return Identifiers.classMapInterpolate1;
22079
+ case 5:
22080
+ return Identifiers.classMapInterpolate2;
22081
+ case 7:
22082
+ return Identifiers.classMapInterpolate3;
22083
+ case 9:
22084
+ return Identifiers.classMapInterpolate4;
22085
+ case 11:
22086
+ return Identifiers.classMapInterpolate5;
22087
+ case 13:
22088
+ return Identifiers.classMapInterpolate6;
22089
+ case 15:
22090
+ return Identifiers.classMapInterpolate7;
22091
+ case 17:
22092
+ return Identifiers.classMapInterpolate8;
22093
+ default:
22094
+ return Identifiers.classMapInterpolateV;
22095
+ }
22143
22096
  }
22144
- function serializePlaceholderValue(value) {
22145
- const element2 = (data, closed) => wrapTag("#", data, closed);
22146
- const template2 = (data, closed) => wrapTag("*", data, closed);
22147
- switch (value.type) {
22148
- case TagType.ELEMENT:
22149
- if (value.closed) {
22150
- return element2(value, true) + (value.tmpl ? template2(value.tmpl, true) : "");
22151
- }
22152
- if (value.tmpl) {
22153
- return template2(value.tmpl) + element2(value) + (value.isVoid ? template2(value.tmpl, true) : "");
22154
- }
22155
- return element2(value);
22156
- case TagType.TEMPLATE:
22157
- return template2(value, value.closed);
22097
+ function getStyleMapInterpolationExpression(interpolation) {
22098
+ switch (getInterpolationArgsLength(interpolation)) {
22099
+ case 1:
22100
+ return Identifiers.styleMap;
22101
+ case 3:
22102
+ return Identifiers.styleMapInterpolate1;
22103
+ case 5:
22104
+ return Identifiers.styleMapInterpolate2;
22105
+ case 7:
22106
+ return Identifiers.styleMapInterpolate3;
22107
+ case 9:
22108
+ return Identifiers.styleMapInterpolate4;
22109
+ case 11:
22110
+ return Identifiers.styleMapInterpolate5;
22111
+ case 13:
22112
+ return Identifiers.styleMapInterpolate6;
22113
+ case 15:
22114
+ return Identifiers.styleMapInterpolate7;
22115
+ case 17:
22116
+ return Identifiers.styleMapInterpolate8;
22158
22117
  default:
22159
- return value;
22118
+ return Identifiers.styleMapInterpolateV;
22119
+ }
22120
+ }
22121
+ function getStylePropInterpolationExpression(interpolation) {
22122
+ switch (getInterpolationArgsLength(interpolation)) {
22123
+ case 1:
22124
+ return Identifiers.styleProp;
22125
+ case 3:
22126
+ return Identifiers.stylePropInterpolate1;
22127
+ case 5:
22128
+ return Identifiers.stylePropInterpolate2;
22129
+ case 7:
22130
+ return Identifiers.stylePropInterpolate3;
22131
+ case 9:
22132
+ return Identifiers.stylePropInterpolate4;
22133
+ case 11:
22134
+ return Identifiers.stylePropInterpolate5;
22135
+ case 13:
22136
+ return Identifiers.stylePropInterpolate6;
22137
+ case 15:
22138
+ return Identifiers.stylePropInterpolate7;
22139
+ case 17:
22140
+ return Identifiers.stylePropInterpolate8;
22141
+ default:
22142
+ return Identifiers.stylePropInterpolateV;
22160
22143
  }
22161
22144
  }
22145
+ function isCssCustomProperty2(name) {
22146
+ return name.startsWith("--");
22147
+ }
22148
+ function isEmptyExpression(ast) {
22149
+ if (ast instanceof ASTWithSource) {
22150
+ ast = ast.ast;
22151
+ }
22152
+ return ast instanceof EmptyExpr;
22153
+ }
22162
22154
 
22163
22155
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
22164
22156
  var NG_CONTENT_SELECT_ATTR2 = "select";
@@ -23847,6 +23839,123 @@ function createClosureModeGuard2() {
23847
23839
  return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
23848
23840
  }
23849
23841
 
23842
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/query_generation.mjs
23843
+ function toQueryFlags(query) {
23844
+ return (query.descendants ? 1 : 0) | (query.static ? 2 : 0) | (query.emitDistinctChangesOnly ? 4 : 0);
23845
+ }
23846
+ function getQueryPredicate(query, constantPool) {
23847
+ if (Array.isArray(query.predicate)) {
23848
+ let predicate = [];
23849
+ query.predicate.forEach((selector) => {
23850
+ const selectors = selector.split(",").map((token) => literal(token.trim()));
23851
+ predicate.push(...selectors);
23852
+ });
23853
+ return constantPool.getConstLiteral(literalArr(predicate), true);
23854
+ } else {
23855
+ switch (query.predicate.forwardRef) {
23856
+ case 0:
23857
+ case 2:
23858
+ return query.predicate.expression;
23859
+ case 1:
23860
+ return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
23861
+ }
23862
+ }
23863
+ }
23864
+ function createQueryCreateCall(query, constantPool, queryTypeFns, prependParams) {
23865
+ const parameters = [];
23866
+ if (prependParams !== void 0) {
23867
+ parameters.push(...prependParams);
23868
+ }
23869
+ if (query.isSignal) {
23870
+ parameters.push(new ReadPropExpr(variable(CONTEXT_NAME), query.propertyName));
23871
+ }
23872
+ parameters.push(getQueryPredicate(query, constantPool), literal(toQueryFlags(query)));
23873
+ if (query.read) {
23874
+ parameters.push(query.read);
23875
+ }
23876
+ const queryCreateFn = query.isSignal ? queryTypeFns.signalBased : queryTypeFns.nonSignal;
23877
+ return importExpr(queryCreateFn).callFn(parameters);
23878
+ }
23879
+ var queryAdvancePlaceholder = Symbol("queryAdvancePlaceholder");
23880
+ function collapseAdvanceStatements(statements) {
23881
+ const result = [];
23882
+ let advanceCollapseCount = 0;
23883
+ const flushAdvanceCount = () => {
23884
+ if (advanceCollapseCount > 0) {
23885
+ result.unshift(importExpr(Identifiers.queryAdvance).callFn(advanceCollapseCount === 1 ? [] : [literal(advanceCollapseCount)]).toStmt());
23886
+ advanceCollapseCount = 0;
23887
+ }
23888
+ };
23889
+ for (let i = statements.length - 1; i >= 0; i--) {
23890
+ const st = statements[i];
23891
+ if (st === queryAdvancePlaceholder) {
23892
+ advanceCollapseCount++;
23893
+ } else {
23894
+ flushAdvanceCount();
23895
+ result.unshift(st);
23896
+ }
23897
+ }
23898
+ flushAdvanceCount();
23899
+ return result;
23900
+ }
23901
+ function createViewQueriesFunction(viewQueries, constantPool, name) {
23902
+ const createStatements = [];
23903
+ const updateStatements = [];
23904
+ const tempAllocator = temporaryAllocator((st) => updateStatements.push(st), TEMPORARY_NAME);
23905
+ viewQueries.forEach((query) => {
23906
+ const queryDefinitionCall = createQueryCreateCall(query, constantPool, {
23907
+ signalBased: Identifiers.viewQuerySignal,
23908
+ nonSignal: Identifiers.viewQuery
23909
+ });
23910
+ createStatements.push(queryDefinitionCall.toStmt());
23911
+ if (query.isSignal) {
23912
+ updateStatements.push(queryAdvancePlaceholder);
23913
+ return;
23914
+ }
23915
+ const temporary = tempAllocator();
23916
+ const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
23917
+ const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
23918
+ const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
23919
+ updateStatements.push(refresh.and(updateDirective).toStmt());
23920
+ });
23921
+ const viewQueryFnName = name ? `${name}_Query` : null;
23922
+ return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [
23923
+ renderFlagCheckIfStmt(1, createStatements),
23924
+ renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))
23925
+ ], INFERRED_TYPE, null, viewQueryFnName);
23926
+ }
23927
+ function createContentQueriesFunction(queries, constantPool, name) {
23928
+ const createStatements = [];
23929
+ const updateStatements = [];
23930
+ const tempAllocator = temporaryAllocator((st) => updateStatements.push(st), TEMPORARY_NAME);
23931
+ for (const query of queries) {
23932
+ createStatements.push(createQueryCreateCall(
23933
+ query,
23934
+ constantPool,
23935
+ { nonSignal: Identifiers.contentQuery, signalBased: Identifiers.contentQuerySignal },
23936
+ [variable("dirIndex")]
23937
+ ).toStmt());
23938
+ if (query.isSignal) {
23939
+ updateStatements.push(queryAdvancePlaceholder);
23940
+ continue;
23941
+ }
23942
+ const temporary = tempAllocator();
23943
+ const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
23944
+ const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
23945
+ const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
23946
+ updateStatements.push(refresh.and(updateDirective).toStmt());
23947
+ }
23948
+ const contentQueriesFnName = name ? `${name}_ContentQueries` : null;
23949
+ return fn([
23950
+ new FnParam(RENDER_FLAGS, NUMBER_TYPE),
23951
+ new FnParam(CONTEXT_NAME, null),
23952
+ new FnParam("dirIndex", null)
23953
+ ], [
23954
+ renderFlagCheckIfStmt(1, createStatements),
23955
+ renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))
23956
+ ], INFERRED_TYPE, null, contentQueriesFnName);
23957
+ }
23958
+
23850
23959
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23851
23960
  var ATTR_REGEX = /attr\.([^\]]+)/;
23852
23961
  var COMPONENT_VARIABLE = "%COMP%";
@@ -23956,7 +24065,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
23956
24065
  const fnName = `${templateTypeName}_DeferFn`;
23957
24066
  allDeferrableDepsFn = createDeferredDepsFunction(constantPool, fnName, meta.deferrableTypes);
23958
24067
  }
23959
- if (!USE_TEMPLATE_PIPELINE) {
24068
+ if (!USE_TEMPLATE_PIPELINE && !meta.useTemplatePipeline) {
23960
24069
  const template2 = meta.template;
23961
24070
  const templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, Identifiers.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.deferBlocks, /* @__PURE__ */ new Map(), allDeferrableDepsFn);
23962
24071
  const templateFunctionExpression = templateBuilder.buildTemplateFunction(template2.nodes, []);
@@ -24062,16 +24171,6 @@ function compileDeclarationList(list, mode) {
24062
24171
  throw new Error(`Unsupported with an array of pre-resolved dependencies`);
24063
24172
  }
24064
24173
  }
24065
- function prepareQueryParams(query, constantPool) {
24066
- const parameters = [getQueryPredicate(query, constantPool), literal(toQueryFlags(query))];
24067
- if (query.read) {
24068
- parameters.push(query.read);
24069
- }
24070
- return parameters;
24071
- }
24072
- function toQueryFlags(query) {
24073
- return (query.descendants ? 1 : 0) | (query.static ? 2 : 0) | (query.emitDistinctChangesOnly ? 4 : 0);
24074
- }
24075
24174
  function convertAttributesToExpressions(attributes) {
24076
24175
  const values = [];
24077
24176
  for (let key of Object.getOwnPropertyNames(attributes)) {
@@ -24080,28 +24179,6 @@ function convertAttributesToExpressions(attributes) {
24080
24179
  }
24081
24180
  return values;
24082
24181
  }
24083
- function createContentQueriesFunction(queries, constantPool, name) {
24084
- const createStatements = [];
24085
- const updateStatements = [];
24086
- const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
24087
- for (const query of queries) {
24088
- createStatements.push(importExpr(Identifiers.contentQuery).callFn([variable("dirIndex"), ...prepareQueryParams(query, constantPool)]).toStmt());
24089
- const temporary = tempAllocator();
24090
- const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
24091
- const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
24092
- const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
24093
- updateStatements.push(refresh.and(updateDirective).toStmt());
24094
- }
24095
- const contentQueriesFnName = name ? `${name}_ContentQueries` : null;
24096
- return fn([
24097
- new FnParam(RENDER_FLAGS, NUMBER_TYPE),
24098
- new FnParam(CONTEXT_NAME, null),
24099
- new FnParam("dirIndex", null)
24100
- ], [
24101
- renderFlagCheckIfStmt(1, createStatements),
24102
- renderFlagCheckIfStmt(2, updateStatements)
24103
- ], INFERRED_TYPE, null, contentQueriesFnName);
24104
- }
24105
24182
  function stringAsType(str) {
24106
24183
  return expressionType(literal(str));
24107
24184
  }
@@ -24153,29 +24230,10 @@ function createDirectiveType(meta) {
24153
24230
  }
24154
24231
  return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams));
24155
24232
  }
24156
- function createViewQueriesFunction(viewQueries, constantPool, name) {
24157
- const createStatements = [];
24158
- const updateStatements = [];
24159
- const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
24160
- viewQueries.forEach((query) => {
24161
- const queryDefinition = importExpr(Identifiers.viewQuery).callFn(prepareQueryParams(query, constantPool));
24162
- createStatements.push(queryDefinition.toStmt());
24163
- const temporary = tempAllocator();
24164
- const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
24165
- const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
24166
- const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
24167
- updateStatements.push(refresh.and(updateDirective).toStmt());
24168
- });
24169
- const viewQueryFnName = name ? `${name}_Query` : null;
24170
- return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [
24171
- renderFlagCheckIfStmt(1, createStatements),
24172
- renderFlagCheckIfStmt(2, updateStatements)
24173
- ], INFERRED_TYPE, null, viewQueryFnName);
24174
- }
24175
24233
  function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindingParser, constantPool, selector, name, definitionMap) {
24176
24234
  const bindings = bindingParser.createBoundHostProperties(hostBindingsMetadata.properties, typeSourceSpan);
24177
24235
  const eventBindings = bindingParser.createDirectiveHostEventAsts(hostBindingsMetadata.listeners, typeSourceSpan);
24178
- if (USE_TEMPLATE_PIPELINE) {
24236
+ if (USE_TEMPLATE_PIPELINE || hostBindingsMetadata.useTemplatePipeline) {
24179
24237
  if (hostBindingsMetadata.specialAttributes.styleAttr) {
24180
24238
  hostBindingsMetadata.attributes["style"] = literal(hostBindingsMetadata.specialAttributes.styleAttr);
24181
24239
  }
@@ -25100,6 +25158,7 @@ var ResourceLoader = class {
25100
25158
  };
25101
25159
 
25102
25160
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
25161
+ var SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT = false;
25103
25162
  var CompilerFacadeImpl = class {
25104
25163
  constructor(jitEvaluator = new JitEvaluator()) {
25105
25164
  this.jitEvaluator = jitEvaluator;
@@ -25232,7 +25291,8 @@ var CompilerFacadeImpl = class {
25232
25291
  animations: facade.animations != null ? new WrappedNodeExpr(facade.animations) : null,
25233
25292
  viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) : null,
25234
25293
  relativeContextFilePath: "",
25235
- i18nUseExternalIds: true
25294
+ i18nUseExternalIds: true,
25295
+ useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
25236
25296
  });
25237
25297
  const jitExpressionSourceMap = `ng:///${facade.name}.js`;
25238
25298
  return this.compileComponentFromMeta(angularCoreEnv, jitExpressionSourceMap, meta);
@@ -25282,6 +25342,7 @@ var CompilerFacadeImpl = class {
25282
25342
  };
25283
25343
  function convertToR3QueryMetadata(facade) {
25284
25344
  return __spreadProps(__spreadValues({}, facade), {
25345
+ isSignal: facade.isSignal,
25285
25346
  predicate: convertQueryPredicate(facade.predicate),
25286
25347
  read: facade.read ? new WrappedNodeExpr(facade.read) : null,
25287
25348
  static: facade.static,
@@ -25297,7 +25358,8 @@ function convertQueryDeclarationToMetadata(declaration) {
25297
25358
  descendants: (_b2 = declaration.descendants) != null ? _b2 : false,
25298
25359
  read: declaration.read ? new WrappedNodeExpr(declaration.read) : null,
25299
25360
  static: (_c2 = declaration.static) != null ? _c2 : false,
25300
- emitDistinctChangesOnly: (_d2 = declaration.emitDistinctChangesOnly) != null ? _d2 : true
25361
+ emitDistinctChangesOnly: (_d2 = declaration.emitDistinctChangesOnly) != null ? _d2 : true,
25362
+ isSignal: !!declaration.isSignal
25301
25363
  };
25302
25364
  }
25303
25365
  function convertQueryPredicate(predicate) {
@@ -25331,7 +25393,9 @@ function convertDirectiveFacadeToMetadata(facade) {
25331
25393
  typeSourceSpan: facade.typeSourceSpan,
25332
25394
  type: wrapReference(facade.type),
25333
25395
  deps: null,
25334
- host: extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host),
25396
+ host: __spreadProps(__spreadValues({}, extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host)), {
25397
+ useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
25398
+ }),
25335
25399
  inputs: __spreadValues(__spreadValues({}, inputsFromMetadata), inputsFromType),
25336
25400
  outputs: __spreadValues(__spreadValues({}, outputsFromMetadata), outputsFromType),
25337
25401
  queries: facade.queries.map(convertToR3QueryMetadata),
@@ -25374,7 +25438,8 @@ function convertHostDeclarationToMetadata(host = {}) {
25374
25438
  specialAttributes: {
25375
25439
  classAttr: host.classAttribute,
25376
25440
  styleAttr: host.styleAttribute
25377
- }
25441
+ },
25442
+ useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
25378
25443
  };
25379
25444
  }
25380
25445
  function convertHostDirectivesToMetadata(metadata) {
@@ -25439,7 +25504,8 @@ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMap
25439
25504
  interpolation,
25440
25505
  declarationListEmitMode: 2,
25441
25506
  relativeContextFilePath: "",
25442
- i18nUseExternalIds: true
25507
+ i18nUseExternalIds: true,
25508
+ useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
25443
25509
  });
25444
25510
  }
25445
25511
  function convertDeclarationFacadeToMetadata(declaration) {
@@ -25673,7 +25739,7 @@ function publishFacade(global) {
25673
25739
  }
25674
25740
 
25675
25741
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
25676
- var VERSION2 = new Version("17.1.2");
25742
+ var VERSION2 = new Version("17.2.0-next.1");
25677
25743
 
25678
25744
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
25679
25745
  var _VisitorMode;