@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
@@ -2470,6 +2470,15 @@ var Identifiers = _Identifiers;
2470
2470
  (() => {
2471
2471
  _Identifiers.contentQuery = { name: "\u0275\u0275contentQuery", moduleName: CORE };
2472
2472
  })();
2473
+ (() => {
2474
+ _Identifiers.viewQuerySignal = { name: "\u0275\u0275viewQuerySignal", moduleName: CORE };
2475
+ })();
2476
+ (() => {
2477
+ _Identifiers.contentQuerySignal = { name: "\u0275\u0275contentQuerySignal", moduleName: CORE };
2478
+ })();
2479
+ (() => {
2480
+ _Identifiers.queryAdvance = { name: "\u0275\u0275queryAdvance", moduleName: CORE };
2481
+ })();
2473
2482
  (() => {
2474
2483
  _Identifiers.NgOnChangesFeature = { name: "\u0275\u0275NgOnChangesFeature", moduleName: CORE };
2475
2484
  })();
@@ -4215,11 +4224,11 @@ var CHAINABLE_INSTRUCTIONS = /* @__PURE__ */ new Set([
4215
4224
  function invokeInstruction(span, reference2, params) {
4216
4225
  return importExpr(reference2, null, span).callFn(params, span);
4217
4226
  }
4218
- function temporaryAllocator(statements, name) {
4227
+ function temporaryAllocator(pushStatement, name) {
4219
4228
  let temp = null;
4220
4229
  return () => {
4221
4230
  if (!temp) {
4222
- statements.push(new DeclareVarStmt(TEMPORARY_NAME, void 0, DYNAMIC_TYPE));
4231
+ pushStatement(new DeclareVarStmt(TEMPORARY_NAME, void 0, DYNAMIC_TYPE));
4223
4232
  temp = variable(name);
4224
4233
  }
4225
4234
  return temp;
@@ -4299,24 +4308,6 @@ function trimTrailingNulls(parameters) {
4299
4308
  }
4300
4309
  return parameters;
4301
4310
  }
4302
- function getQueryPredicate(query, constantPool) {
4303
- if (Array.isArray(query.predicate)) {
4304
- let predicate = [];
4305
- query.predicate.forEach((selector) => {
4306
- const selectors = selector.split(",").map((token) => literal(token.trim()));
4307
- predicate.push(...selectors);
4308
- });
4309
- return constantPool.getConstLiteral(literalArr(predicate), true);
4310
- } else {
4311
- switch (query.predicate.forwardRef) {
4312
- case 0:
4313
- case 2:
4314
- return query.predicate.expression;
4315
- case 1:
4316
- return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
4317
- }
4318
- }
4319
- }
4320
4311
  var DefinitionMap = class {
4321
4312
  constructor() {
4322
4313
  this.values = [];
@@ -6582,6 +6573,7 @@ var animationKeywords = /* @__PURE__ */ new Set([
6582
6573
  "jump-start",
6583
6574
  "start"
6584
6575
  ]);
6576
+ var scopedAtRuleIdentifiers = ["@media", "@supports", "@document", "@layer", "@container", "@scope", "@starting-style"];
6585
6577
  var ShadowCss = class {
6586
6578
  constructor() {
6587
6579
  this._animationDeclarationKeyframesRe = /(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
@@ -6716,7 +6708,7 @@ var ShadowCss = class {
6716
6708
  let content = rule.content;
6717
6709
  if (rule.selector[0] !== "@") {
6718
6710
  selector = this._scopeSelector(rule.selector, scopeSelector, hostSelector);
6719
- } 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")) {
6711
+ } else if (scopedAtRuleIdentifiers.some((atRule) => rule.selector.startsWith(atRule))) {
6720
6712
  content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
6721
6713
  } else if (rule.selector.startsWith("@font-face") || rule.selector.startsWith("@page")) {
6722
6714
  content = this._stripScopingSelectors(rule.content);
@@ -19996,466 +19988,133 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
19996
19988
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
19997
19989
  var USE_TEMPLATE_PIPELINE = false;
19998
19990
 
19999
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
20000
- var IMPORTANT_FLAG = "!important";
20001
- var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
20002
- var StylingBuilder = class {
20003
- constructor(_directiveExpr) {
20004
- this._directiveExpr = _directiveExpr;
20005
- this._hasInitialValues = false;
20006
- this.hasBindings = false;
20007
- this.hasBindingsWithPipes = false;
20008
- this._classMapInput = null;
20009
- this._styleMapInput = null;
20010
- this._singleStyleInputs = null;
20011
- this._singleClassInputs = null;
20012
- this._lastStylingInput = null;
20013
- this._firstStylingInput = null;
20014
- this._stylesIndex = /* @__PURE__ */ new Map();
20015
- this._classesIndex = /* @__PURE__ */ new Map();
20016
- this._initialStyleValues = [];
20017
- this._initialClassValues = [];
19991
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
19992
+ var HtmlParser = class extends Parser2 {
19993
+ constructor() {
19994
+ super(getHtmlTagDefinition);
20018
19995
  }
20019
- registerBoundInput(input) {
20020
- let binding = null;
20021
- let name = input.name;
20022
- switch (input.type) {
20023
- case 0:
20024
- binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);
20025
- break;
20026
- case 3:
20027
- binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);
20028
- break;
20029
- case 2:
20030
- binding = this.registerClassInput(name, false, input.value, input.sourceSpan);
20031
- break;
20032
- }
20033
- return binding ? true : false;
19996
+ parse(source, url, options) {
19997
+ return super.parse(source, url, options);
20034
19998
  }
20035
- registerInputBasedOnName(name, expression, sourceSpan) {
20036
- let binding = null;
20037
- const prefix = name.substring(0, 6);
20038
- const isStyle = name === "style" || prefix === "style." || prefix === "style!";
20039
- const isClass = !isStyle && (name === "class" || prefix === "class." || prefix === "class!");
20040
- if (isStyle || isClass) {
20041
- const isMapBased = name.charAt(5) !== ".";
20042
- const property2 = name.slice(isMapBased ? 5 : 6);
20043
- if (isStyle) {
20044
- binding = this.registerStyleInput(property2, isMapBased, expression, sourceSpan);
20045
- } else {
20046
- binding = this.registerClassInput(property2, isMapBased, expression, sourceSpan);
20047
- }
19999
+ };
20000
+
20001
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
20002
+ var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
20003
+ var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
20004
+ var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
20005
+ var NO_WS_REGEXP = new RegExp(`[^${WS_CHARS}]`);
20006
+ var WS_REPLACE_REGEXP = new RegExp(`[${WS_CHARS}]{2,}`, "g");
20007
+ function hasPreserveWhitespacesAttr(attrs) {
20008
+ return attrs.some((attr) => attr.name === PRESERVE_WS_ATTR_NAME);
20009
+ }
20010
+ function replaceNgsp(value) {
20011
+ return value.replace(new RegExp(NGSP_UNICODE, "g"), " ");
20012
+ }
20013
+ var WhitespaceVisitor = class {
20014
+ visitElement(element2, context) {
20015
+ if (SKIP_WS_TRIM_TAGS.has(element2.name) || hasPreserveWhitespacesAttr(element2.attrs)) {
20016
+ return new Element2(element2.name, visitAll2(this, element2.attrs), element2.children, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
20048
20017
  }
20049
- return binding;
20018
+ return new Element2(element2.name, element2.attrs, visitAllWithSiblings(this, element2.children), element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
20050
20019
  }
20051
- registerStyleInput(name, isMapBased, value, sourceSpan, suffix) {
20052
- if (isEmptyExpression(value)) {
20053
- return null;
20054
- }
20055
- if (!isCssCustomProperty2(name)) {
20056
- name = hyphenate2(name);
20057
- }
20058
- const { property: property2, hasOverrideFlag, suffix: bindingSuffix } = parseProperty2(name);
20059
- suffix = typeof suffix === "string" && suffix.length !== 0 ? suffix : bindingSuffix;
20060
- const entry = { name: property2, suffix, value, sourceSpan, hasOverrideFlag };
20061
- if (isMapBased) {
20062
- this._styleMapInput = entry;
20063
- } else {
20064
- (this._singleStyleInputs = this._singleStyleInputs || []).push(entry);
20065
- registerIntoMap(this._stylesIndex, property2);
20066
- }
20067
- this._lastStylingInput = entry;
20068
- this._firstStylingInput = this._firstStylingInput || entry;
20069
- this._checkForPipes(value);
20070
- this.hasBindings = true;
20071
- return entry;
20020
+ visitAttribute(attribute2, context) {
20021
+ return attribute2.name !== PRESERVE_WS_ATTR_NAME ? attribute2 : null;
20072
20022
  }
20073
- registerClassInput(name, isMapBased, value, sourceSpan) {
20074
- if (isEmptyExpression(value)) {
20075
- return null;
20076
- }
20077
- const { property: property2, hasOverrideFlag } = parseProperty2(name);
20078
- const entry = { name: property2, value, sourceSpan, hasOverrideFlag, suffix: null };
20079
- if (isMapBased) {
20080
- this._classMapInput = entry;
20081
- } else {
20082
- (this._singleClassInputs = this._singleClassInputs || []).push(entry);
20083
- registerIntoMap(this._classesIndex, property2);
20023
+ visitText(text2, context) {
20024
+ const isNotBlank = text2.value.match(NO_WS_REGEXP);
20025
+ const hasExpansionSibling = context && (context.prev instanceof Expansion || context.next instanceof Expansion);
20026
+ if (isNotBlank || hasExpansionSibling) {
20027
+ const tokens = text2.tokens.map((token) => token.type === 5 ? createWhitespaceProcessedTextToken(token) : token);
20028
+ const value = processWhitespace(text2.value);
20029
+ return new Text4(value, text2.sourceSpan, tokens, text2.i18n);
20084
20030
  }
20085
- this._lastStylingInput = entry;
20086
- this._firstStylingInput = this._firstStylingInput || entry;
20087
- this._checkForPipes(value);
20088
- this.hasBindings = true;
20089
- return entry;
20031
+ return null;
20090
20032
  }
20091
- _checkForPipes(value) {
20092
- if (value instanceof ASTWithSource && value.ast instanceof BindingPipe) {
20093
- this.hasBindingsWithPipes = true;
20094
- }
20033
+ visitComment(comment, context) {
20034
+ return comment;
20095
20035
  }
20096
- registerStyleAttr(value) {
20097
- this._initialStyleValues = parse(value);
20098
- this._hasInitialValues = true;
20036
+ visitExpansion(expansion, context) {
20037
+ return expansion;
20099
20038
  }
20100
- registerClassAttr(value) {
20101
- this._initialClassValues = value.trim().split(/\s+/g);
20102
- this._hasInitialValues = true;
20039
+ visitExpansionCase(expansionCase, context) {
20040
+ return expansionCase;
20103
20041
  }
20104
- populateInitialStylingAttrs(attrs) {
20105
- if (this._initialClassValues.length) {
20106
- attrs.push(literal(1));
20107
- for (let i = 0; i < this._initialClassValues.length; i++) {
20108
- attrs.push(literal(this._initialClassValues[i]));
20109
- }
20110
- }
20111
- if (this._initialStyleValues.length) {
20112
- attrs.push(literal(2));
20113
- for (let i = 0; i < this._initialStyleValues.length; i += 2) {
20114
- attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));
20115
- }
20116
- }
20042
+ visitBlock(block, context) {
20043
+ return new Block(block.name, block.parameters, visitAllWithSiblings(this, block.children), block.sourceSpan, block.nameSpan, block.startSourceSpan, block.endSourceSpan);
20117
20044
  }
20118
- assignHostAttrs(attrs, definitionMap) {
20119
- if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {
20120
- this.populateInitialStylingAttrs(attrs);
20121
- definitionMap.set("hostAttrs", literalArr(attrs));
20045
+ visitBlockParameter(parameter, context) {
20046
+ return parameter;
20047
+ }
20048
+ };
20049
+ function createWhitespaceProcessedTextToken({ type, parts, sourceSpan }) {
20050
+ return { type, parts: [processWhitespace(parts[0])], sourceSpan };
20051
+ }
20052
+ function processWhitespace(text2) {
20053
+ return replaceNgsp(text2).replace(WS_REPLACE_REGEXP, " ");
20054
+ }
20055
+ function visitAllWithSiblings(visitor, nodes) {
20056
+ const result = [];
20057
+ nodes.forEach((ast, i) => {
20058
+ const context = { prev: nodes[i - 1], next: nodes[i + 1] };
20059
+ const astResult = ast.visit(visitor, context);
20060
+ if (astResult) {
20061
+ result.push(astResult);
20122
20062
  }
20063
+ });
20064
+ return result;
20065
+ }
20066
+
20067
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
20068
+ var PROPERTY_PARTS_SEPARATOR = ".";
20069
+ var ATTRIBUTE_PREFIX = "attr";
20070
+ var CLASS_PREFIX = "class";
20071
+ var STYLE_PREFIX = "style";
20072
+ var TEMPLATE_ATTR_PREFIX = "*";
20073
+ var ANIMATE_PROP_PREFIX = "animate-";
20074
+ var BindingParser = class {
20075
+ constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors) {
20076
+ this._exprParser = _exprParser;
20077
+ this._interpolationConfig = _interpolationConfig;
20078
+ this._schemaRegistry = _schemaRegistry;
20079
+ this.errors = errors;
20123
20080
  }
20124
- buildClassMapInstruction(valueConverter) {
20125
- if (this._classMapInput) {
20126
- return this._buildMapBasedInstruction(valueConverter, true, this._classMapInput);
20081
+ get interpolationConfig() {
20082
+ return this._interpolationConfig;
20083
+ }
20084
+ createBoundHostProperties(properties, sourceSpan) {
20085
+ const boundProps = [];
20086
+ for (const propName of Object.keys(properties)) {
20087
+ const expression = properties[propName];
20088
+ if (typeof expression === "string") {
20089
+ this.parsePropertyBinding(
20090
+ propName,
20091
+ expression,
20092
+ true,
20093
+ false,
20094
+ sourceSpan,
20095
+ sourceSpan.start.offset,
20096
+ void 0,
20097
+ [],
20098
+ boundProps,
20099
+ sourceSpan
20100
+ );
20101
+ } else {
20102
+ this._reportError(`Value of the host property binding "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
20103
+ }
20127
20104
  }
20128
- return null;
20105
+ return boundProps;
20129
20106
  }
20130
- buildStyleMapInstruction(valueConverter) {
20131
- if (this._styleMapInput) {
20132
- return this._buildMapBasedInstruction(valueConverter, false, this._styleMapInput);
20107
+ createDirectiveHostEventAsts(hostListeners, sourceSpan) {
20108
+ const targetEvents = [];
20109
+ for (const propName of Object.keys(hostListeners)) {
20110
+ const expression = hostListeners[propName];
20111
+ if (typeof expression === "string") {
20112
+ this.parseEvent(propName, expression, false, sourceSpan, sourceSpan, [], targetEvents, sourceSpan);
20113
+ } else {
20114
+ this._reportError(`Value of the host listener "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
20115
+ }
20133
20116
  }
20134
- return null;
20135
- }
20136
- _buildMapBasedInstruction(valueConverter, isClassBased, stylingInput) {
20137
- let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
20138
- const mapValue = stylingInput.value.visit(valueConverter);
20139
- let reference2;
20140
- if (mapValue instanceof Interpolation) {
20141
- totalBindingSlotsRequired += mapValue.expressions.length;
20142
- reference2 = isClassBased ? getClassMapInterpolationExpression(mapValue) : getStyleMapInterpolationExpression(mapValue);
20143
- } else {
20144
- reference2 = isClassBased ? Identifiers.classMap : Identifiers.styleMap;
20145
- }
20146
- return {
20147
- reference: reference2,
20148
- calls: [{
20149
- supportsInterpolation: true,
20150
- sourceSpan: stylingInput.sourceSpan,
20151
- allocateBindingSlots: totalBindingSlotsRequired,
20152
- params: (convertFn) => {
20153
- const convertResult = convertFn(mapValue);
20154
- const params = Array.isArray(convertResult) ? convertResult : [convertResult];
20155
- return params;
20156
- }
20157
- }]
20158
- };
20159
- }
20160
- _buildSingleInputs(reference2, inputs, valueConverter, getInterpolationExpressionFn, isClassBased) {
20161
- const instructions = [];
20162
- inputs.forEach((input) => {
20163
- const previousInstruction = instructions[instructions.length - 1];
20164
- const value = input.value.visit(valueConverter);
20165
- let referenceForCall = reference2;
20166
- let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
20167
- if (value instanceof Interpolation) {
20168
- totalBindingSlotsRequired += value.expressions.length;
20169
- if (getInterpolationExpressionFn) {
20170
- referenceForCall = getInterpolationExpressionFn(value);
20171
- }
20172
- }
20173
- const call2 = {
20174
- sourceSpan: input.sourceSpan,
20175
- allocateBindingSlots: totalBindingSlotsRequired,
20176
- supportsInterpolation: !!getInterpolationExpressionFn,
20177
- params: (convertFn) => {
20178
- const params = [];
20179
- params.push(literal(input.name));
20180
- const convertResult = convertFn(value);
20181
- if (Array.isArray(convertResult)) {
20182
- params.push(...convertResult);
20183
- } else {
20184
- params.push(convertResult);
20185
- }
20186
- if (!isClassBased && input.suffix !== null) {
20187
- params.push(literal(input.suffix));
20188
- }
20189
- return params;
20190
- }
20191
- };
20192
- if (previousInstruction && previousInstruction.reference === referenceForCall) {
20193
- previousInstruction.calls.push(call2);
20194
- } else {
20195
- instructions.push({ reference: referenceForCall, calls: [call2] });
20196
- }
20197
- });
20198
- return instructions;
20199
- }
20200
- _buildClassInputs(valueConverter) {
20201
- if (this._singleClassInputs) {
20202
- return this._buildSingleInputs(Identifiers.classProp, this._singleClassInputs, valueConverter, null, true);
20203
- }
20204
- return [];
20205
- }
20206
- _buildStyleInputs(valueConverter) {
20207
- if (this._singleStyleInputs) {
20208
- return this._buildSingleInputs(Identifiers.styleProp, this._singleStyleInputs, valueConverter, getStylePropInterpolationExpression, false);
20209
- }
20210
- return [];
20211
- }
20212
- buildUpdateLevelInstructions(valueConverter) {
20213
- const instructions = [];
20214
- if (this.hasBindings) {
20215
- const styleMapInstruction = this.buildStyleMapInstruction(valueConverter);
20216
- if (styleMapInstruction) {
20217
- instructions.push(styleMapInstruction);
20218
- }
20219
- const classMapInstruction = this.buildClassMapInstruction(valueConverter);
20220
- if (classMapInstruction) {
20221
- instructions.push(classMapInstruction);
20222
- }
20223
- instructions.push(...this._buildStyleInputs(valueConverter));
20224
- instructions.push(...this._buildClassInputs(valueConverter));
20225
- }
20226
- return instructions;
20227
- }
20228
- };
20229
- function registerIntoMap(map, key) {
20230
- if (!map.has(key)) {
20231
- map.set(key, map.size);
20232
- }
20233
- }
20234
- function parseProperty2(name) {
20235
- let hasOverrideFlag = false;
20236
- const overrideIndex = name.indexOf(IMPORTANT_FLAG);
20237
- if (overrideIndex !== -1) {
20238
- name = overrideIndex > 0 ? name.substring(0, overrideIndex) : "";
20239
- hasOverrideFlag = true;
20240
- }
20241
- let suffix = null;
20242
- let property2 = name;
20243
- const unitIndex = name.lastIndexOf(".");
20244
- if (unitIndex > 0) {
20245
- suffix = name.slice(unitIndex + 1);
20246
- property2 = name.substring(0, unitIndex);
20247
- }
20248
- return { property: property2, suffix, hasOverrideFlag };
20249
- }
20250
- function getClassMapInterpolationExpression(interpolation) {
20251
- switch (getInterpolationArgsLength(interpolation)) {
20252
- case 1:
20253
- return Identifiers.classMap;
20254
- case 3:
20255
- return Identifiers.classMapInterpolate1;
20256
- case 5:
20257
- return Identifiers.classMapInterpolate2;
20258
- case 7:
20259
- return Identifiers.classMapInterpolate3;
20260
- case 9:
20261
- return Identifiers.classMapInterpolate4;
20262
- case 11:
20263
- return Identifiers.classMapInterpolate5;
20264
- case 13:
20265
- return Identifiers.classMapInterpolate6;
20266
- case 15:
20267
- return Identifiers.classMapInterpolate7;
20268
- case 17:
20269
- return Identifiers.classMapInterpolate8;
20270
- default:
20271
- return Identifiers.classMapInterpolateV;
20272
- }
20273
- }
20274
- function getStyleMapInterpolationExpression(interpolation) {
20275
- switch (getInterpolationArgsLength(interpolation)) {
20276
- case 1:
20277
- return Identifiers.styleMap;
20278
- case 3:
20279
- return Identifiers.styleMapInterpolate1;
20280
- case 5:
20281
- return Identifiers.styleMapInterpolate2;
20282
- case 7:
20283
- return Identifiers.styleMapInterpolate3;
20284
- case 9:
20285
- return Identifiers.styleMapInterpolate4;
20286
- case 11:
20287
- return Identifiers.styleMapInterpolate5;
20288
- case 13:
20289
- return Identifiers.styleMapInterpolate6;
20290
- case 15:
20291
- return Identifiers.styleMapInterpolate7;
20292
- case 17:
20293
- return Identifiers.styleMapInterpolate8;
20294
- default:
20295
- return Identifiers.styleMapInterpolateV;
20296
- }
20297
- }
20298
- function getStylePropInterpolationExpression(interpolation) {
20299
- switch (getInterpolationArgsLength(interpolation)) {
20300
- case 1:
20301
- return Identifiers.styleProp;
20302
- case 3:
20303
- return Identifiers.stylePropInterpolate1;
20304
- case 5:
20305
- return Identifiers.stylePropInterpolate2;
20306
- case 7:
20307
- return Identifiers.stylePropInterpolate3;
20308
- case 9:
20309
- return Identifiers.stylePropInterpolate4;
20310
- case 11:
20311
- return Identifiers.stylePropInterpolate5;
20312
- case 13:
20313
- return Identifiers.stylePropInterpolate6;
20314
- case 15:
20315
- return Identifiers.stylePropInterpolate7;
20316
- case 17:
20317
- return Identifiers.stylePropInterpolate8;
20318
- default:
20319
- return Identifiers.stylePropInterpolateV;
20320
- }
20321
- }
20322
- function isCssCustomProperty2(name) {
20323
- return name.startsWith("--");
20324
- }
20325
- function isEmptyExpression(ast) {
20326
- if (ast instanceof ASTWithSource) {
20327
- ast = ast.ast;
20328
- }
20329
- return ast instanceof EmptyExpr;
20330
- }
20331
-
20332
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
20333
- var HtmlParser = class extends Parser2 {
20334
- constructor() {
20335
- super(getHtmlTagDefinition);
20336
- }
20337
- parse(source, url, options) {
20338
- return super.parse(source, url, options);
20339
- }
20340
- };
20341
-
20342
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
20343
- var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
20344
- var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
20345
- var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
20346
- var NO_WS_REGEXP = new RegExp(`[^${WS_CHARS}]`);
20347
- var WS_REPLACE_REGEXP = new RegExp(`[${WS_CHARS}]{2,}`, "g");
20348
- function hasPreserveWhitespacesAttr(attrs) {
20349
- return attrs.some((attr) => attr.name === PRESERVE_WS_ATTR_NAME);
20350
- }
20351
- function replaceNgsp(value) {
20352
- return value.replace(new RegExp(NGSP_UNICODE, "g"), " ");
20353
- }
20354
- var WhitespaceVisitor = class {
20355
- visitElement(element2, context) {
20356
- if (SKIP_WS_TRIM_TAGS.has(element2.name) || hasPreserveWhitespacesAttr(element2.attrs)) {
20357
- return new Element2(element2.name, visitAll2(this, element2.attrs), element2.children, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
20358
- }
20359
- return new Element2(element2.name, element2.attrs, visitAllWithSiblings(this, element2.children), element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
20360
- }
20361
- visitAttribute(attribute2, context) {
20362
- return attribute2.name !== PRESERVE_WS_ATTR_NAME ? attribute2 : null;
20363
- }
20364
- visitText(text2, context) {
20365
- const isNotBlank = text2.value.match(NO_WS_REGEXP);
20366
- const hasExpansionSibling = context && (context.prev instanceof Expansion || context.next instanceof Expansion);
20367
- if (isNotBlank || hasExpansionSibling) {
20368
- const tokens = text2.tokens.map((token) => token.type === 5 ? createWhitespaceProcessedTextToken(token) : token);
20369
- const value = processWhitespace(text2.value);
20370
- return new Text4(value, text2.sourceSpan, tokens, text2.i18n);
20371
- }
20372
- return null;
20373
- }
20374
- visitComment(comment, context) {
20375
- return comment;
20376
- }
20377
- visitExpansion(expansion, context) {
20378
- return expansion;
20379
- }
20380
- visitExpansionCase(expansionCase, context) {
20381
- return expansionCase;
20382
- }
20383
- visitBlock(block, context) {
20384
- return new Block(block.name, block.parameters, visitAllWithSiblings(this, block.children), block.sourceSpan, block.nameSpan, block.startSourceSpan, block.endSourceSpan);
20385
- }
20386
- visitBlockParameter(parameter, context) {
20387
- return parameter;
20388
- }
20389
- };
20390
- function createWhitespaceProcessedTextToken({ type, parts, sourceSpan }) {
20391
- return { type, parts: [processWhitespace(parts[0])], sourceSpan };
20392
- }
20393
- function processWhitespace(text2) {
20394
- return replaceNgsp(text2).replace(WS_REPLACE_REGEXP, " ");
20395
- }
20396
- function visitAllWithSiblings(visitor, nodes) {
20397
- const result = [];
20398
- nodes.forEach((ast, i) => {
20399
- const context = { prev: nodes[i - 1], next: nodes[i + 1] };
20400
- const astResult = ast.visit(visitor, context);
20401
- if (astResult) {
20402
- result.push(astResult);
20403
- }
20404
- });
20405
- return result;
20406
- }
20407
-
20408
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
20409
- var PROPERTY_PARTS_SEPARATOR = ".";
20410
- var ATTRIBUTE_PREFIX = "attr";
20411
- var CLASS_PREFIX = "class";
20412
- var STYLE_PREFIX = "style";
20413
- var TEMPLATE_ATTR_PREFIX = "*";
20414
- var ANIMATE_PROP_PREFIX = "animate-";
20415
- var BindingParser = class {
20416
- constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors) {
20417
- this._exprParser = _exprParser;
20418
- this._interpolationConfig = _interpolationConfig;
20419
- this._schemaRegistry = _schemaRegistry;
20420
- this.errors = errors;
20421
- }
20422
- get interpolationConfig() {
20423
- return this._interpolationConfig;
20424
- }
20425
- createBoundHostProperties(properties, sourceSpan) {
20426
- const boundProps = [];
20427
- for (const propName of Object.keys(properties)) {
20428
- const expression = properties[propName];
20429
- if (typeof expression === "string") {
20430
- this.parsePropertyBinding(
20431
- propName,
20432
- expression,
20433
- true,
20434
- false,
20435
- sourceSpan,
20436
- sourceSpan.start.offset,
20437
- void 0,
20438
- [],
20439
- boundProps,
20440
- sourceSpan
20441
- );
20442
- } else {
20443
- this._reportError(`Value of the host property binding "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
20444
- }
20445
- }
20446
- return boundProps;
20447
- }
20448
- createDirectiveHostEventAsts(hostListeners, sourceSpan) {
20449
- const targetEvents = [];
20450
- for (const propName of Object.keys(hostListeners)) {
20451
- const expression = hostListeners[propName];
20452
- if (typeof expression === "string") {
20453
- this.parseEvent(propName, expression, false, sourceSpan, sourceSpan, [], targetEvents, sourceSpan);
20454
- } else {
20455
- this._reportError(`Value of the host listener "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
20456
- }
20457
- }
20458
- return targetEvents;
20117
+ return targetEvents;
20459
20118
  }
20460
20119
  parseInterpolation(value, sourceSpan, interpolatedTokens) {
20461
20120
  const sourceInfo = sourceSpan.start.toString();
@@ -22057,39 +21716,372 @@ var I18nContext = class {
22057
21716
  } else {
22058
21717
  phs.push(...values);
22059
21718
  }
22060
- this.placeholders.set(key, phs);
22061
- });
22062
- this._unresolvedCtxCount--;
21719
+ this.placeholders.set(key, phs);
21720
+ });
21721
+ this._unresolvedCtxCount--;
21722
+ }
21723
+ };
21724
+ function wrap(symbol, index, contextId, closed) {
21725
+ const state = closed ? "/" : "";
21726
+ return wrapI18nPlaceholder(`${state}${symbol}${index}`, contextId);
21727
+ }
21728
+ function wrapTag(symbol, { index, ctx, isVoid }, closed) {
21729
+ return isVoid ? wrap(symbol, index, ctx) + wrap(symbol, index, ctx, true) : wrap(symbol, index, ctx, closed);
21730
+ }
21731
+ function findTemplateFn(ctx, templateIndex) {
21732
+ return (token) => typeof token === "object" && token.type === TagType.TEMPLATE && token.index === templateIndex && token.ctx === ctx;
21733
+ }
21734
+ function serializePlaceholderValue(value) {
21735
+ const element2 = (data, closed) => wrapTag("#", data, closed);
21736
+ const template2 = (data, closed) => wrapTag("*", data, closed);
21737
+ switch (value.type) {
21738
+ case TagType.ELEMENT:
21739
+ if (value.closed) {
21740
+ return element2(value, true) + (value.tmpl ? template2(value.tmpl, true) : "");
21741
+ }
21742
+ if (value.tmpl) {
21743
+ return template2(value.tmpl) + element2(value) + (value.isVoid ? template2(value.tmpl, true) : "");
21744
+ }
21745
+ return element2(value);
21746
+ case TagType.TEMPLATE:
21747
+ return template2(value, value.closed);
21748
+ default:
21749
+ return value;
21750
+ }
21751
+ }
21752
+
21753
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
21754
+ var IMPORTANT_FLAG = "!important";
21755
+ var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
21756
+ var StylingBuilder = class {
21757
+ constructor(_directiveExpr) {
21758
+ this._directiveExpr = _directiveExpr;
21759
+ this._hasInitialValues = false;
21760
+ this.hasBindings = false;
21761
+ this.hasBindingsWithPipes = false;
21762
+ this._classMapInput = null;
21763
+ this._styleMapInput = null;
21764
+ this._singleStyleInputs = null;
21765
+ this._singleClassInputs = null;
21766
+ this._lastStylingInput = null;
21767
+ this._firstStylingInput = null;
21768
+ this._stylesIndex = /* @__PURE__ */ new Map();
21769
+ this._classesIndex = /* @__PURE__ */ new Map();
21770
+ this._initialStyleValues = [];
21771
+ this._initialClassValues = [];
21772
+ }
21773
+ registerBoundInput(input) {
21774
+ let binding = null;
21775
+ let name = input.name;
21776
+ switch (input.type) {
21777
+ case 0:
21778
+ binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);
21779
+ break;
21780
+ case 3:
21781
+ binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);
21782
+ break;
21783
+ case 2:
21784
+ binding = this.registerClassInput(name, false, input.value, input.sourceSpan);
21785
+ break;
21786
+ }
21787
+ return binding ? true : false;
21788
+ }
21789
+ registerInputBasedOnName(name, expression, sourceSpan) {
21790
+ let binding = null;
21791
+ const prefix = name.substring(0, 6);
21792
+ const isStyle = name === "style" || prefix === "style." || prefix === "style!";
21793
+ const isClass = !isStyle && (name === "class" || prefix === "class." || prefix === "class!");
21794
+ if (isStyle || isClass) {
21795
+ const isMapBased = name.charAt(5) !== ".";
21796
+ const property2 = name.slice(isMapBased ? 5 : 6);
21797
+ if (isStyle) {
21798
+ binding = this.registerStyleInput(property2, isMapBased, expression, sourceSpan);
21799
+ } else {
21800
+ binding = this.registerClassInput(property2, isMapBased, expression, sourceSpan);
21801
+ }
21802
+ }
21803
+ return binding;
21804
+ }
21805
+ registerStyleInput(name, isMapBased, value, sourceSpan, suffix) {
21806
+ if (isEmptyExpression(value)) {
21807
+ return null;
21808
+ }
21809
+ if (!isCssCustomProperty2(name)) {
21810
+ name = hyphenate2(name);
21811
+ }
21812
+ const { property: property2, hasOverrideFlag, suffix: bindingSuffix } = parseProperty2(name);
21813
+ suffix = typeof suffix === "string" && suffix.length !== 0 ? suffix : bindingSuffix;
21814
+ const entry = { name: property2, suffix, value, sourceSpan, hasOverrideFlag };
21815
+ if (isMapBased) {
21816
+ this._styleMapInput = entry;
21817
+ } else {
21818
+ (this._singleStyleInputs = this._singleStyleInputs || []).push(entry);
21819
+ registerIntoMap(this._stylesIndex, property2);
21820
+ }
21821
+ this._lastStylingInput = entry;
21822
+ this._firstStylingInput = this._firstStylingInput || entry;
21823
+ this._checkForPipes(value);
21824
+ this.hasBindings = true;
21825
+ return entry;
21826
+ }
21827
+ registerClassInput(name, isMapBased, value, sourceSpan) {
21828
+ if (isEmptyExpression(value)) {
21829
+ return null;
21830
+ }
21831
+ const { property: property2, hasOverrideFlag } = parseProperty2(name);
21832
+ const entry = { name: property2, value, sourceSpan, hasOverrideFlag, suffix: null };
21833
+ if (isMapBased) {
21834
+ this._classMapInput = entry;
21835
+ } else {
21836
+ (this._singleClassInputs = this._singleClassInputs || []).push(entry);
21837
+ registerIntoMap(this._classesIndex, property2);
21838
+ }
21839
+ this._lastStylingInput = entry;
21840
+ this._firstStylingInput = this._firstStylingInput || entry;
21841
+ this._checkForPipes(value);
21842
+ this.hasBindings = true;
21843
+ return entry;
21844
+ }
21845
+ _checkForPipes(value) {
21846
+ if (value instanceof ASTWithSource && value.ast instanceof BindingPipe) {
21847
+ this.hasBindingsWithPipes = true;
21848
+ }
21849
+ }
21850
+ registerStyleAttr(value) {
21851
+ this._initialStyleValues = parse(value);
21852
+ this._hasInitialValues = true;
21853
+ }
21854
+ registerClassAttr(value) {
21855
+ this._initialClassValues = value.trim().split(/\s+/g);
21856
+ this._hasInitialValues = true;
21857
+ }
21858
+ populateInitialStylingAttrs(attrs) {
21859
+ if (this._initialClassValues.length) {
21860
+ attrs.push(literal(1));
21861
+ for (let i = 0; i < this._initialClassValues.length; i++) {
21862
+ attrs.push(literal(this._initialClassValues[i]));
21863
+ }
21864
+ }
21865
+ if (this._initialStyleValues.length) {
21866
+ attrs.push(literal(2));
21867
+ for (let i = 0; i < this._initialStyleValues.length; i += 2) {
21868
+ attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));
21869
+ }
21870
+ }
21871
+ }
21872
+ assignHostAttrs(attrs, definitionMap) {
21873
+ if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {
21874
+ this.populateInitialStylingAttrs(attrs);
21875
+ definitionMap.set("hostAttrs", literalArr(attrs));
21876
+ }
21877
+ }
21878
+ buildClassMapInstruction(valueConverter) {
21879
+ if (this._classMapInput) {
21880
+ return this._buildMapBasedInstruction(valueConverter, true, this._classMapInput);
21881
+ }
21882
+ return null;
21883
+ }
21884
+ buildStyleMapInstruction(valueConverter) {
21885
+ if (this._styleMapInput) {
21886
+ return this._buildMapBasedInstruction(valueConverter, false, this._styleMapInput);
21887
+ }
21888
+ return null;
21889
+ }
21890
+ _buildMapBasedInstruction(valueConverter, isClassBased, stylingInput) {
21891
+ let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
21892
+ const mapValue = stylingInput.value.visit(valueConverter);
21893
+ let reference2;
21894
+ if (mapValue instanceof Interpolation) {
21895
+ totalBindingSlotsRequired += mapValue.expressions.length;
21896
+ reference2 = isClassBased ? getClassMapInterpolationExpression(mapValue) : getStyleMapInterpolationExpression(mapValue);
21897
+ } else {
21898
+ reference2 = isClassBased ? Identifiers.classMap : Identifiers.styleMap;
21899
+ }
21900
+ return {
21901
+ reference: reference2,
21902
+ calls: [{
21903
+ supportsInterpolation: true,
21904
+ sourceSpan: stylingInput.sourceSpan,
21905
+ allocateBindingSlots: totalBindingSlotsRequired,
21906
+ params: (convertFn) => {
21907
+ const convertResult = convertFn(mapValue);
21908
+ const params = Array.isArray(convertResult) ? convertResult : [convertResult];
21909
+ return params;
21910
+ }
21911
+ }]
21912
+ };
21913
+ }
21914
+ _buildSingleInputs(reference2, inputs, valueConverter, getInterpolationExpressionFn, isClassBased) {
21915
+ const instructions = [];
21916
+ inputs.forEach((input) => {
21917
+ const previousInstruction = instructions[instructions.length - 1];
21918
+ const value = input.value.visit(valueConverter);
21919
+ let referenceForCall = reference2;
21920
+ let totalBindingSlotsRequired = MIN_STYLING_BINDING_SLOTS_REQUIRED;
21921
+ if (value instanceof Interpolation) {
21922
+ totalBindingSlotsRequired += value.expressions.length;
21923
+ if (getInterpolationExpressionFn) {
21924
+ referenceForCall = getInterpolationExpressionFn(value);
21925
+ }
21926
+ }
21927
+ const call2 = {
21928
+ sourceSpan: input.sourceSpan,
21929
+ allocateBindingSlots: totalBindingSlotsRequired,
21930
+ supportsInterpolation: !!getInterpolationExpressionFn,
21931
+ params: (convertFn) => {
21932
+ const params = [];
21933
+ params.push(literal(input.name));
21934
+ const convertResult = convertFn(value);
21935
+ if (Array.isArray(convertResult)) {
21936
+ params.push(...convertResult);
21937
+ } else {
21938
+ params.push(convertResult);
21939
+ }
21940
+ if (!isClassBased && input.suffix !== null) {
21941
+ params.push(literal(input.suffix));
21942
+ }
21943
+ return params;
21944
+ }
21945
+ };
21946
+ if (previousInstruction && previousInstruction.reference === referenceForCall) {
21947
+ previousInstruction.calls.push(call2);
21948
+ } else {
21949
+ instructions.push({ reference: referenceForCall, calls: [call2] });
21950
+ }
21951
+ });
21952
+ return instructions;
21953
+ }
21954
+ _buildClassInputs(valueConverter) {
21955
+ if (this._singleClassInputs) {
21956
+ return this._buildSingleInputs(Identifiers.classProp, this._singleClassInputs, valueConverter, null, true);
21957
+ }
21958
+ return [];
21959
+ }
21960
+ _buildStyleInputs(valueConverter) {
21961
+ if (this._singleStyleInputs) {
21962
+ return this._buildSingleInputs(Identifiers.styleProp, this._singleStyleInputs, valueConverter, getStylePropInterpolationExpression, false);
21963
+ }
21964
+ return [];
21965
+ }
21966
+ buildUpdateLevelInstructions(valueConverter) {
21967
+ const instructions = [];
21968
+ if (this.hasBindings) {
21969
+ const styleMapInstruction = this.buildStyleMapInstruction(valueConverter);
21970
+ if (styleMapInstruction) {
21971
+ instructions.push(styleMapInstruction);
21972
+ }
21973
+ const classMapInstruction = this.buildClassMapInstruction(valueConverter);
21974
+ if (classMapInstruction) {
21975
+ instructions.push(classMapInstruction);
21976
+ }
21977
+ instructions.push(...this._buildStyleInputs(valueConverter));
21978
+ instructions.push(...this._buildClassInputs(valueConverter));
21979
+ }
21980
+ return instructions;
22063
21981
  }
22064
21982
  };
22065
- function wrap(symbol, index, contextId, closed) {
22066
- const state = closed ? "/" : "";
22067
- return wrapI18nPlaceholder(`${state}${symbol}${index}`, contextId);
21983
+ function registerIntoMap(map, key) {
21984
+ if (!map.has(key)) {
21985
+ map.set(key, map.size);
21986
+ }
22068
21987
  }
22069
- function wrapTag(symbol, { index, ctx, isVoid }, closed) {
22070
- return isVoid ? wrap(symbol, index, ctx) + wrap(symbol, index, ctx, true) : wrap(symbol, index, ctx, closed);
21988
+ function parseProperty2(name) {
21989
+ let hasOverrideFlag = false;
21990
+ const overrideIndex = name.indexOf(IMPORTANT_FLAG);
21991
+ if (overrideIndex !== -1) {
21992
+ name = overrideIndex > 0 ? name.substring(0, overrideIndex) : "";
21993
+ hasOverrideFlag = true;
21994
+ }
21995
+ let suffix = null;
21996
+ let property2 = name;
21997
+ const unitIndex = name.lastIndexOf(".");
21998
+ if (unitIndex > 0) {
21999
+ suffix = name.slice(unitIndex + 1);
22000
+ property2 = name.substring(0, unitIndex);
22001
+ }
22002
+ return { property: property2, suffix, hasOverrideFlag };
22071
22003
  }
22072
- function findTemplateFn(ctx, templateIndex) {
22073
- return (token) => typeof token === "object" && token.type === TagType.TEMPLATE && token.index === templateIndex && token.ctx === ctx;
22004
+ function getClassMapInterpolationExpression(interpolation) {
22005
+ switch (getInterpolationArgsLength(interpolation)) {
22006
+ case 1:
22007
+ return Identifiers.classMap;
22008
+ case 3:
22009
+ return Identifiers.classMapInterpolate1;
22010
+ case 5:
22011
+ return Identifiers.classMapInterpolate2;
22012
+ case 7:
22013
+ return Identifiers.classMapInterpolate3;
22014
+ case 9:
22015
+ return Identifiers.classMapInterpolate4;
22016
+ case 11:
22017
+ return Identifiers.classMapInterpolate5;
22018
+ case 13:
22019
+ return Identifiers.classMapInterpolate6;
22020
+ case 15:
22021
+ return Identifiers.classMapInterpolate7;
22022
+ case 17:
22023
+ return Identifiers.classMapInterpolate8;
22024
+ default:
22025
+ return Identifiers.classMapInterpolateV;
22026
+ }
22074
22027
  }
22075
- function serializePlaceholderValue(value) {
22076
- const element2 = (data, closed) => wrapTag("#", data, closed);
22077
- const template2 = (data, closed) => wrapTag("*", data, closed);
22078
- switch (value.type) {
22079
- case TagType.ELEMENT:
22080
- if (value.closed) {
22081
- return element2(value, true) + (value.tmpl ? template2(value.tmpl, true) : "");
22082
- }
22083
- if (value.tmpl) {
22084
- return template2(value.tmpl) + element2(value) + (value.isVoid ? template2(value.tmpl, true) : "");
22085
- }
22086
- return element2(value);
22087
- case TagType.TEMPLATE:
22088
- return template2(value, value.closed);
22028
+ function getStyleMapInterpolationExpression(interpolation) {
22029
+ switch (getInterpolationArgsLength(interpolation)) {
22030
+ case 1:
22031
+ return Identifiers.styleMap;
22032
+ case 3:
22033
+ return Identifiers.styleMapInterpolate1;
22034
+ case 5:
22035
+ return Identifiers.styleMapInterpolate2;
22036
+ case 7:
22037
+ return Identifiers.styleMapInterpolate3;
22038
+ case 9:
22039
+ return Identifiers.styleMapInterpolate4;
22040
+ case 11:
22041
+ return Identifiers.styleMapInterpolate5;
22042
+ case 13:
22043
+ return Identifiers.styleMapInterpolate6;
22044
+ case 15:
22045
+ return Identifiers.styleMapInterpolate7;
22046
+ case 17:
22047
+ return Identifiers.styleMapInterpolate8;
22089
22048
  default:
22090
- return value;
22049
+ return Identifiers.styleMapInterpolateV;
22050
+ }
22051
+ }
22052
+ function getStylePropInterpolationExpression(interpolation) {
22053
+ switch (getInterpolationArgsLength(interpolation)) {
22054
+ case 1:
22055
+ return Identifiers.styleProp;
22056
+ case 3:
22057
+ return Identifiers.stylePropInterpolate1;
22058
+ case 5:
22059
+ return Identifiers.stylePropInterpolate2;
22060
+ case 7:
22061
+ return Identifiers.stylePropInterpolate3;
22062
+ case 9:
22063
+ return Identifiers.stylePropInterpolate4;
22064
+ case 11:
22065
+ return Identifiers.stylePropInterpolate5;
22066
+ case 13:
22067
+ return Identifiers.stylePropInterpolate6;
22068
+ case 15:
22069
+ return Identifiers.stylePropInterpolate7;
22070
+ case 17:
22071
+ return Identifiers.stylePropInterpolate8;
22072
+ default:
22073
+ return Identifiers.stylePropInterpolateV;
22091
22074
  }
22092
22075
  }
22076
+ function isCssCustomProperty2(name) {
22077
+ return name.startsWith("--");
22078
+ }
22079
+ function isEmptyExpression(ast) {
22080
+ if (ast instanceof ASTWithSource) {
22081
+ ast = ast.ast;
22082
+ }
22083
+ return ast instanceof EmptyExpr;
22084
+ }
22093
22085
 
22094
22086
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
22095
22087
  var NG_CONTENT_SELECT_ATTR2 = "select";
@@ -23778,6 +23770,123 @@ function createClosureModeGuard2() {
23778
23770
  return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
23779
23771
  }
23780
23772
 
23773
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/query_generation.mjs
23774
+ function toQueryFlags(query) {
23775
+ return (query.descendants ? 1 : 0) | (query.static ? 2 : 0) | (query.emitDistinctChangesOnly ? 4 : 0);
23776
+ }
23777
+ function getQueryPredicate(query, constantPool) {
23778
+ if (Array.isArray(query.predicate)) {
23779
+ let predicate = [];
23780
+ query.predicate.forEach((selector) => {
23781
+ const selectors = selector.split(",").map((token) => literal(token.trim()));
23782
+ predicate.push(...selectors);
23783
+ });
23784
+ return constantPool.getConstLiteral(literalArr(predicate), true);
23785
+ } else {
23786
+ switch (query.predicate.forwardRef) {
23787
+ case 0:
23788
+ case 2:
23789
+ return query.predicate.expression;
23790
+ case 1:
23791
+ return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
23792
+ }
23793
+ }
23794
+ }
23795
+ function createQueryCreateCall(query, constantPool, queryTypeFns, prependParams) {
23796
+ const parameters = [];
23797
+ if (prependParams !== void 0) {
23798
+ parameters.push(...prependParams);
23799
+ }
23800
+ if (query.isSignal) {
23801
+ parameters.push(new ReadPropExpr(variable(CONTEXT_NAME), query.propertyName));
23802
+ }
23803
+ parameters.push(getQueryPredicate(query, constantPool), literal(toQueryFlags(query)));
23804
+ if (query.read) {
23805
+ parameters.push(query.read);
23806
+ }
23807
+ const queryCreateFn = query.isSignal ? queryTypeFns.signalBased : queryTypeFns.nonSignal;
23808
+ return importExpr(queryCreateFn).callFn(parameters);
23809
+ }
23810
+ var queryAdvancePlaceholder = Symbol("queryAdvancePlaceholder");
23811
+ function collapseAdvanceStatements(statements) {
23812
+ const result = [];
23813
+ let advanceCollapseCount = 0;
23814
+ const flushAdvanceCount = () => {
23815
+ if (advanceCollapseCount > 0) {
23816
+ result.unshift(importExpr(Identifiers.queryAdvance).callFn(advanceCollapseCount === 1 ? [] : [literal(advanceCollapseCount)]).toStmt());
23817
+ advanceCollapseCount = 0;
23818
+ }
23819
+ };
23820
+ for (let i = statements.length - 1; i >= 0; i--) {
23821
+ const st = statements[i];
23822
+ if (st === queryAdvancePlaceholder) {
23823
+ advanceCollapseCount++;
23824
+ } else {
23825
+ flushAdvanceCount();
23826
+ result.unshift(st);
23827
+ }
23828
+ }
23829
+ flushAdvanceCount();
23830
+ return result;
23831
+ }
23832
+ function createViewQueriesFunction(viewQueries, constantPool, name) {
23833
+ const createStatements = [];
23834
+ const updateStatements = [];
23835
+ const tempAllocator = temporaryAllocator((st) => updateStatements.push(st), TEMPORARY_NAME);
23836
+ viewQueries.forEach((query) => {
23837
+ const queryDefinitionCall = createQueryCreateCall(query, constantPool, {
23838
+ signalBased: Identifiers.viewQuerySignal,
23839
+ nonSignal: Identifiers.viewQuery
23840
+ });
23841
+ createStatements.push(queryDefinitionCall.toStmt());
23842
+ if (query.isSignal) {
23843
+ updateStatements.push(queryAdvancePlaceholder);
23844
+ return;
23845
+ }
23846
+ const temporary = tempAllocator();
23847
+ const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
23848
+ const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
23849
+ const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
23850
+ updateStatements.push(refresh.and(updateDirective).toStmt());
23851
+ });
23852
+ const viewQueryFnName = name ? `${name}_Query` : null;
23853
+ return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [
23854
+ renderFlagCheckIfStmt(1, createStatements),
23855
+ renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))
23856
+ ], INFERRED_TYPE, null, viewQueryFnName);
23857
+ }
23858
+ function createContentQueriesFunction(queries, constantPool, name) {
23859
+ const createStatements = [];
23860
+ const updateStatements = [];
23861
+ const tempAllocator = temporaryAllocator((st) => updateStatements.push(st), TEMPORARY_NAME);
23862
+ for (const query of queries) {
23863
+ createStatements.push(createQueryCreateCall(
23864
+ query,
23865
+ constantPool,
23866
+ { nonSignal: Identifiers.contentQuery, signalBased: Identifiers.contentQuerySignal },
23867
+ [variable("dirIndex")]
23868
+ ).toStmt());
23869
+ if (query.isSignal) {
23870
+ updateStatements.push(queryAdvancePlaceholder);
23871
+ continue;
23872
+ }
23873
+ const temporary = tempAllocator();
23874
+ const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
23875
+ const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
23876
+ const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
23877
+ updateStatements.push(refresh.and(updateDirective).toStmt());
23878
+ }
23879
+ const contentQueriesFnName = name ? `${name}_ContentQueries` : null;
23880
+ return fn([
23881
+ new FnParam(RENDER_FLAGS, NUMBER_TYPE),
23882
+ new FnParam(CONTEXT_NAME, null),
23883
+ new FnParam("dirIndex", null)
23884
+ ], [
23885
+ renderFlagCheckIfStmt(1, createStatements),
23886
+ renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))
23887
+ ], INFERRED_TYPE, null, contentQueriesFnName);
23888
+ }
23889
+
23781
23890
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23782
23891
  var ATTR_REGEX = /attr\.([^\]]+)/;
23783
23892
  var COMPONENT_VARIABLE = "%COMP%";
@@ -23887,7 +23996,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
23887
23996
  const fnName = `${templateTypeName}_DeferFn`;
23888
23997
  allDeferrableDepsFn = createDeferredDepsFunction(constantPool, fnName, meta.deferrableTypes);
23889
23998
  }
23890
- if (!USE_TEMPLATE_PIPELINE) {
23999
+ if (!USE_TEMPLATE_PIPELINE && !meta.useTemplatePipeline) {
23891
24000
  const template2 = meta.template;
23892
24001
  const templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, Identifiers.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.deferBlocks, /* @__PURE__ */ new Map(), allDeferrableDepsFn);
23893
24002
  const templateFunctionExpression = templateBuilder.buildTemplateFunction(template2.nodes, []);
@@ -23993,16 +24102,6 @@ function compileDeclarationList(list, mode) {
23993
24102
  throw new Error(`Unsupported with an array of pre-resolved dependencies`);
23994
24103
  }
23995
24104
  }
23996
- function prepareQueryParams(query, constantPool) {
23997
- const parameters = [getQueryPredicate(query, constantPool), literal(toQueryFlags(query))];
23998
- if (query.read) {
23999
- parameters.push(query.read);
24000
- }
24001
- return parameters;
24002
- }
24003
- function toQueryFlags(query) {
24004
- return (query.descendants ? 1 : 0) | (query.static ? 2 : 0) | (query.emitDistinctChangesOnly ? 4 : 0);
24005
- }
24006
24105
  function convertAttributesToExpressions(attributes) {
24007
24106
  const values = [];
24008
24107
  for (let key of Object.getOwnPropertyNames(attributes)) {
@@ -24011,28 +24110,6 @@ function convertAttributesToExpressions(attributes) {
24011
24110
  }
24012
24111
  return values;
24013
24112
  }
24014
- function createContentQueriesFunction(queries, constantPool, name) {
24015
- const createStatements = [];
24016
- const updateStatements = [];
24017
- const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
24018
- for (const query of queries) {
24019
- createStatements.push(importExpr(Identifiers.contentQuery).callFn([variable("dirIndex"), ...prepareQueryParams(query, constantPool)]).toStmt());
24020
- const temporary = tempAllocator();
24021
- const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
24022
- const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
24023
- const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
24024
- updateStatements.push(refresh.and(updateDirective).toStmt());
24025
- }
24026
- const contentQueriesFnName = name ? `${name}_ContentQueries` : null;
24027
- return fn([
24028
- new FnParam(RENDER_FLAGS, NUMBER_TYPE),
24029
- new FnParam(CONTEXT_NAME, null),
24030
- new FnParam("dirIndex", null)
24031
- ], [
24032
- renderFlagCheckIfStmt(1, createStatements),
24033
- renderFlagCheckIfStmt(2, updateStatements)
24034
- ], INFERRED_TYPE, null, contentQueriesFnName);
24035
- }
24036
24113
  function stringAsType(str) {
24037
24114
  return expressionType(literal(str));
24038
24115
  }
@@ -24084,29 +24161,10 @@ function createDirectiveType(meta) {
24084
24161
  }
24085
24162
  return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams));
24086
24163
  }
24087
- function createViewQueriesFunction(viewQueries, constantPool, name) {
24088
- const createStatements = [];
24089
- const updateStatements = [];
24090
- const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
24091
- viewQueries.forEach((query) => {
24092
- const queryDefinition = importExpr(Identifiers.viewQuery).callFn(prepareQueryParams(query, constantPool));
24093
- createStatements.push(queryDefinition.toStmt());
24094
- const temporary = tempAllocator();
24095
- const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
24096
- const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
24097
- const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
24098
- updateStatements.push(refresh.and(updateDirective).toStmt());
24099
- });
24100
- const viewQueryFnName = name ? `${name}_Query` : null;
24101
- return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [
24102
- renderFlagCheckIfStmt(1, createStatements),
24103
- renderFlagCheckIfStmt(2, updateStatements)
24104
- ], INFERRED_TYPE, null, viewQueryFnName);
24105
- }
24106
24164
  function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindingParser, constantPool, selector, name, definitionMap) {
24107
24165
  const bindings = bindingParser.createBoundHostProperties(hostBindingsMetadata.properties, typeSourceSpan);
24108
24166
  const eventBindings = bindingParser.createDirectiveHostEventAsts(hostBindingsMetadata.listeners, typeSourceSpan);
24109
- if (USE_TEMPLATE_PIPELINE) {
24167
+ if (USE_TEMPLATE_PIPELINE || hostBindingsMetadata.useTemplatePipeline) {
24110
24168
  if (hostBindingsMetadata.specialAttributes.styleAttr) {
24111
24169
  hostBindingsMetadata.attributes["style"] = literal(hostBindingsMetadata.specialAttributes.styleAttr);
24112
24170
  }
@@ -25031,6 +25089,7 @@ var ResourceLoader = class {
25031
25089
  };
25032
25090
 
25033
25091
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
25092
+ var SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT = false;
25034
25093
  var CompilerFacadeImpl = class {
25035
25094
  constructor(jitEvaluator = new JitEvaluator()) {
25036
25095
  this.jitEvaluator = jitEvaluator;
@@ -25163,7 +25222,8 @@ var CompilerFacadeImpl = class {
25163
25222
  animations: facade.animations != null ? new WrappedNodeExpr(facade.animations) : null,
25164
25223
  viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) : null,
25165
25224
  relativeContextFilePath: "",
25166
- i18nUseExternalIds: true
25225
+ i18nUseExternalIds: true,
25226
+ useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
25167
25227
  });
25168
25228
  const jitExpressionSourceMap = `ng:///${facade.name}.js`;
25169
25229
  return this.compileComponentFromMeta(angularCoreEnv, jitExpressionSourceMap, meta);
@@ -25213,6 +25273,7 @@ var CompilerFacadeImpl = class {
25213
25273
  };
25214
25274
  function convertToR3QueryMetadata(facade) {
25215
25275
  return __spreadProps(__spreadValues({}, facade), {
25276
+ isSignal: facade.isSignal,
25216
25277
  predicate: convertQueryPredicate(facade.predicate),
25217
25278
  read: facade.read ? new WrappedNodeExpr(facade.read) : null,
25218
25279
  static: facade.static,
@@ -25228,7 +25289,8 @@ function convertQueryDeclarationToMetadata(declaration) {
25228
25289
  descendants: (_b2 = declaration.descendants) != null ? _b2 : false,
25229
25290
  read: declaration.read ? new WrappedNodeExpr(declaration.read) : null,
25230
25291
  static: (_c2 = declaration.static) != null ? _c2 : false,
25231
- emitDistinctChangesOnly: (_d2 = declaration.emitDistinctChangesOnly) != null ? _d2 : true
25292
+ emitDistinctChangesOnly: (_d2 = declaration.emitDistinctChangesOnly) != null ? _d2 : true,
25293
+ isSignal: !!declaration.isSignal
25232
25294
  };
25233
25295
  }
25234
25296
  function convertQueryPredicate(predicate) {
@@ -25262,7 +25324,9 @@ function convertDirectiveFacadeToMetadata(facade) {
25262
25324
  typeSourceSpan: facade.typeSourceSpan,
25263
25325
  type: wrapReference(facade.type),
25264
25326
  deps: null,
25265
- host: extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host),
25327
+ host: __spreadProps(__spreadValues({}, extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host)), {
25328
+ useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
25329
+ }),
25266
25330
  inputs: __spreadValues(__spreadValues({}, inputsFromMetadata), inputsFromType),
25267
25331
  outputs: __spreadValues(__spreadValues({}, outputsFromMetadata), outputsFromType),
25268
25332
  queries: facade.queries.map(convertToR3QueryMetadata),
@@ -25305,7 +25369,8 @@ function convertHostDeclarationToMetadata(host = {}) {
25305
25369
  specialAttributes: {
25306
25370
  classAttr: host.classAttribute,
25307
25371
  styleAttr: host.styleAttribute
25308
- }
25372
+ },
25373
+ useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
25309
25374
  };
25310
25375
  }
25311
25376
  function convertHostDirectivesToMetadata(metadata) {
@@ -25370,7 +25435,8 @@ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMap
25370
25435
  interpolation,
25371
25436
  declarationListEmitMode: 2,
25372
25437
  relativeContextFilePath: "",
25373
- i18nUseExternalIds: true
25438
+ i18nUseExternalIds: true,
25439
+ useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT
25374
25440
  });
25375
25441
  }
25376
25442
  function convertDeclarationFacadeToMetadata(declaration) {
@@ -25604,7 +25670,7 @@ function publishFacade(global) {
25604
25670
  }
25605
25671
 
25606
25672
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
25607
- var VERSION2 = new Version("17.1.2");
25673
+ var VERSION2 = new Version("17.2.0-next.1");
25608
25674
 
25609
25675
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
25610
25676
  var _VisitorMode;