@angular/core 18.1.0-next.1 → 18.1.0-next.3

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 (47) hide show
  1. package/esm2022/rxjs-interop/src/to_signal.mjs +7 -3
  2. package/esm2022/src/authoring/model/model_signal.mjs +2 -3
  3. package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +2 -2
  4. package/esm2022/src/core.mjs +1 -1
  5. package/esm2022/src/core_render3_private_export.mjs +2 -2
  6. package/esm2022/src/defer/instructions.mjs +2 -10
  7. package/esm2022/src/errors.mjs +1 -1
  8. package/esm2022/src/event_emitter.mjs +20 -11
  9. package/esm2022/src/hydration/event_replay.mjs +32 -14
  10. package/esm2022/src/linker/component_factory.mjs +1 -1
  11. package/esm2022/src/pending_tasks.mjs +15 -20
  12. package/esm2022/src/render3/after_render_hooks.mjs +67 -132
  13. package/esm2022/src/render3/chained_injector.mjs +34 -0
  14. package/esm2022/src/render3/component.mjs +1 -1
  15. package/esm2022/src/render3/component_ref.mjs +23 -35
  16. package/esm2022/src/render3/index.mjs +2 -2
  17. package/esm2022/src/render3/instructions/all.mjs +2 -1
  18. package/esm2022/src/render3/instructions/change_detection.mjs +27 -24
  19. package/esm2022/src/render3/instructions/let_declaration.mjs +39 -0
  20. package/esm2022/src/render3/jit/environment.mjs +4 -1
  21. package/esm2022/src/render3/reactive_lview_consumer.mjs +56 -3
  22. package/esm2022/src/render3/util/injector_discovery_utils.mjs +14 -5
  23. package/esm2022/src/render3/util/injector_utils.mjs +10 -1
  24. package/esm2022/src/version.mjs +1 -1
  25. package/esm2022/testing/src/logger.mjs +3 -3
  26. package/fesm2022/core.mjs +500 -424
  27. package/fesm2022/core.mjs.map +1 -1
  28. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  29. package/fesm2022/primitives/signals.mjs +1 -1
  30. package/fesm2022/rxjs-interop.mjs +7 -3
  31. package/fesm2022/rxjs-interop.mjs.map +1 -1
  32. package/fesm2022/testing.mjs +1 -1
  33. package/index.d.ts +246 -32
  34. package/package.json +1 -1
  35. package/primitives/event-dispatch/index.d.ts +1 -1
  36. package/primitives/signals/index.d.ts +1 -1
  37. package/rxjs-interop/index.d.ts +13 -6
  38. package/schematics/migrations/after-render-phase/bundle.js +623 -0
  39. package/schematics/migrations/after-render-phase/bundle.js.map +7 -0
  40. package/schematics/migrations/invalid-two-way-bindings/bundle.js +265 -61
  41. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +4 -4
  42. package/schematics/migrations.json +5 -0
  43. package/schematics/ng-generate/control-flow-migration/bundle.js +272 -61
  44. package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
  45. package/schematics/ng-generate/standalone-migration/bundle.js +320 -727
  46. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  47. package/testing/index.d.ts +1 -1
@@ -357,7 +357,7 @@ var require_semver = __commonJS({
357
357
  do {
358
358
  const a = this.build[i];
359
359
  const b = other.build[i];
360
- debug("prerelease compare", i, a, b);
360
+ debug("build compare", i, a, b);
361
361
  if (a === void 0 && b === void 0) {
362
362
  return 0;
363
363
  } else if (b === void 0) {
@@ -826,653 +826,39 @@ var require_coerce = __commonJS({
826
826
  }
827
827
  });
828
828
 
829
- // node_modules/yallist/iterator.js
830
- var require_iterator = __commonJS({
831
- "node_modules/yallist/iterator.js"(exports, module2) {
832
- "use strict";
833
- module2.exports = function(Yallist) {
834
- Yallist.prototype[Symbol.iterator] = function* () {
835
- for (let walker = this.head; walker; walker = walker.next) {
836
- yield walker.value;
837
- }
838
- };
839
- };
840
- }
841
- });
842
-
843
- // node_modules/yallist/yallist.js
844
- var require_yallist = __commonJS({
845
- "node_modules/yallist/yallist.js"(exports, module2) {
846
- "use strict";
847
- module2.exports = Yallist;
848
- Yallist.Node = Node;
849
- Yallist.create = Yallist;
850
- function Yallist(list) {
851
- var self = this;
852
- if (!(self instanceof Yallist)) {
853
- self = new Yallist();
854
- }
855
- self.tail = null;
856
- self.head = null;
857
- self.length = 0;
858
- if (list && typeof list.forEach === "function") {
859
- list.forEach(function(item) {
860
- self.push(item);
861
- });
862
- } else if (arguments.length > 0) {
863
- for (var i = 0, l = arguments.length; i < l; i++) {
864
- self.push(arguments[i]);
865
- }
866
- }
867
- return self;
868
- }
869
- Yallist.prototype.removeNode = function(node) {
870
- if (node.list !== this) {
871
- throw new Error("removing node which does not belong to this list");
872
- }
873
- var next = node.next;
874
- var prev = node.prev;
875
- if (next) {
876
- next.prev = prev;
877
- }
878
- if (prev) {
879
- prev.next = next;
880
- }
881
- if (node === this.head) {
882
- this.head = next;
883
- }
884
- if (node === this.tail) {
885
- this.tail = prev;
886
- }
887
- node.list.length--;
888
- node.next = null;
889
- node.prev = null;
890
- node.list = null;
891
- return next;
892
- };
893
- Yallist.prototype.unshiftNode = function(node) {
894
- if (node === this.head) {
895
- return;
896
- }
897
- if (node.list) {
898
- node.list.removeNode(node);
899
- }
900
- var head = this.head;
901
- node.list = this;
902
- node.next = head;
903
- if (head) {
904
- head.prev = node;
905
- }
906
- this.head = node;
907
- if (!this.tail) {
908
- this.tail = node;
909
- }
910
- this.length++;
911
- };
912
- Yallist.prototype.pushNode = function(node) {
913
- if (node === this.tail) {
914
- return;
915
- }
916
- if (node.list) {
917
- node.list.removeNode(node);
918
- }
919
- var tail = this.tail;
920
- node.list = this;
921
- node.prev = tail;
922
- if (tail) {
923
- tail.next = node;
924
- }
925
- this.tail = node;
926
- if (!this.head) {
927
- this.head = node;
928
- }
929
- this.length++;
930
- };
931
- Yallist.prototype.push = function() {
932
- for (var i = 0, l = arguments.length; i < l; i++) {
933
- push(this, arguments[i]);
934
- }
935
- return this.length;
936
- };
937
- Yallist.prototype.unshift = function() {
938
- for (var i = 0, l = arguments.length; i < l; i++) {
939
- unshift(this, arguments[i]);
940
- }
941
- return this.length;
942
- };
943
- Yallist.prototype.pop = function() {
944
- if (!this.tail) {
945
- return void 0;
946
- }
947
- var res = this.tail.value;
948
- this.tail = this.tail.prev;
949
- if (this.tail) {
950
- this.tail.next = null;
951
- } else {
952
- this.head = null;
953
- }
954
- this.length--;
955
- return res;
956
- };
957
- Yallist.prototype.shift = function() {
958
- if (!this.head) {
959
- return void 0;
960
- }
961
- var res = this.head.value;
962
- this.head = this.head.next;
963
- if (this.head) {
964
- this.head.prev = null;
965
- } else {
966
- this.tail = null;
967
- }
968
- this.length--;
969
- return res;
970
- };
971
- Yallist.prototype.forEach = function(fn2, thisp) {
972
- thisp = thisp || this;
973
- for (var walker = this.head, i = 0; walker !== null; i++) {
974
- fn2.call(thisp, walker.value, i, this);
975
- walker = walker.next;
976
- }
977
- };
978
- Yallist.prototype.forEachReverse = function(fn2, thisp) {
979
- thisp = thisp || this;
980
- for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
981
- fn2.call(thisp, walker.value, i, this);
982
- walker = walker.prev;
983
- }
984
- };
985
- Yallist.prototype.get = function(n2) {
986
- for (var i = 0, walker = this.head; walker !== null && i < n2; i++) {
987
- walker = walker.next;
988
- }
989
- if (i === n2 && walker !== null) {
990
- return walker.value;
991
- }
992
- };
993
- Yallist.prototype.getReverse = function(n2) {
994
- for (var i = 0, walker = this.tail; walker !== null && i < n2; i++) {
995
- walker = walker.prev;
996
- }
997
- if (i === n2 && walker !== null) {
998
- return walker.value;
999
- }
1000
- };
1001
- Yallist.prototype.map = function(fn2, thisp) {
1002
- thisp = thisp || this;
1003
- var res = new Yallist();
1004
- for (var walker = this.head; walker !== null; ) {
1005
- res.push(fn2.call(thisp, walker.value, this));
1006
- walker = walker.next;
1007
- }
1008
- return res;
1009
- };
1010
- Yallist.prototype.mapReverse = function(fn2, thisp) {
1011
- thisp = thisp || this;
1012
- var res = new Yallist();
1013
- for (var walker = this.tail; walker !== null; ) {
1014
- res.push(fn2.call(thisp, walker.value, this));
1015
- walker = walker.prev;
1016
- }
1017
- return res;
1018
- };
1019
- Yallist.prototype.reduce = function(fn2, initial) {
1020
- var acc;
1021
- var walker = this.head;
1022
- if (arguments.length > 1) {
1023
- acc = initial;
1024
- } else if (this.head) {
1025
- walker = this.head.next;
1026
- acc = this.head.value;
1027
- } else {
1028
- throw new TypeError("Reduce of empty list with no initial value");
1029
- }
1030
- for (var i = 0; walker !== null; i++) {
1031
- acc = fn2(acc, walker.value, i);
1032
- walker = walker.next;
1033
- }
1034
- return acc;
1035
- };
1036
- Yallist.prototype.reduceReverse = function(fn2, initial) {
1037
- var acc;
1038
- var walker = this.tail;
1039
- if (arguments.length > 1) {
1040
- acc = initial;
1041
- } else if (this.tail) {
1042
- walker = this.tail.prev;
1043
- acc = this.tail.value;
1044
- } else {
1045
- throw new TypeError("Reduce of empty list with no initial value");
1046
- }
1047
- for (var i = this.length - 1; walker !== null; i--) {
1048
- acc = fn2(acc, walker.value, i);
1049
- walker = walker.prev;
1050
- }
1051
- return acc;
1052
- };
1053
- Yallist.prototype.toArray = function() {
1054
- var arr = new Array(this.length);
1055
- for (var i = 0, walker = this.head; walker !== null; i++) {
1056
- arr[i] = walker.value;
1057
- walker = walker.next;
1058
- }
1059
- return arr;
1060
- };
1061
- Yallist.prototype.toArrayReverse = function() {
1062
- var arr = new Array(this.length);
1063
- for (var i = 0, walker = this.tail; walker !== null; i++) {
1064
- arr[i] = walker.value;
1065
- walker = walker.prev;
1066
- }
1067
- return arr;
1068
- };
1069
- Yallist.prototype.slice = function(from, to) {
1070
- to = to || this.length;
1071
- if (to < 0) {
1072
- to += this.length;
1073
- }
1074
- from = from || 0;
1075
- if (from < 0) {
1076
- from += this.length;
1077
- }
1078
- var ret = new Yallist();
1079
- if (to < from || to < 0) {
1080
- return ret;
1081
- }
1082
- if (from < 0) {
1083
- from = 0;
1084
- }
1085
- if (to > this.length) {
1086
- to = this.length;
1087
- }
1088
- for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
1089
- walker = walker.next;
1090
- }
1091
- for (; walker !== null && i < to; i++, walker = walker.next) {
1092
- ret.push(walker.value);
1093
- }
1094
- return ret;
1095
- };
1096
- Yallist.prototype.sliceReverse = function(from, to) {
1097
- to = to || this.length;
1098
- if (to < 0) {
1099
- to += this.length;
1100
- }
1101
- from = from || 0;
1102
- if (from < 0) {
1103
- from += this.length;
1104
- }
1105
- var ret = new Yallist();
1106
- if (to < from || to < 0) {
1107
- return ret;
1108
- }
1109
- if (from < 0) {
1110
- from = 0;
1111
- }
1112
- if (to > this.length) {
1113
- to = this.length;
1114
- }
1115
- for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
1116
- walker = walker.prev;
1117
- }
1118
- for (; walker !== null && i > from; i--, walker = walker.prev) {
1119
- ret.push(walker.value);
1120
- }
1121
- return ret;
1122
- };
1123
- Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
1124
- if (start > this.length) {
1125
- start = this.length - 1;
1126
- }
1127
- if (start < 0) {
1128
- start = this.length + start;
1129
- }
1130
- for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
1131
- walker = walker.next;
1132
- }
1133
- var ret = [];
1134
- for (var i = 0; walker && i < deleteCount; i++) {
1135
- ret.push(walker.value);
1136
- walker = this.removeNode(walker);
1137
- }
1138
- if (walker === null) {
1139
- walker = this.tail;
1140
- }
1141
- if (walker !== this.head && walker !== this.tail) {
1142
- walker = walker.prev;
1143
- }
1144
- for (var i = 0; i < nodes.length; i++) {
1145
- walker = insert(this, walker, nodes[i]);
1146
- }
1147
- return ret;
1148
- };
1149
- Yallist.prototype.reverse = function() {
1150
- var head = this.head;
1151
- var tail = this.tail;
1152
- for (var walker = head; walker !== null; walker = walker.prev) {
1153
- var p2 = walker.prev;
1154
- walker.prev = walker.next;
1155
- walker.next = p2;
1156
- }
1157
- this.head = tail;
1158
- this.tail = head;
1159
- return this;
1160
- };
1161
- function insert(self, node, value) {
1162
- var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);
1163
- if (inserted.next === null) {
1164
- self.tail = inserted;
1165
- }
1166
- if (inserted.prev === null) {
1167
- self.head = inserted;
1168
- }
1169
- self.length++;
1170
- return inserted;
1171
- }
1172
- function push(self, item) {
1173
- self.tail = new Node(item, self.tail, null, self);
1174
- if (!self.head) {
1175
- self.head = self.tail;
1176
- }
1177
- self.length++;
1178
- }
1179
- function unshift(self, item) {
1180
- self.head = new Node(item, null, self.head, self);
1181
- if (!self.tail) {
1182
- self.tail = self.head;
1183
- }
1184
- self.length++;
1185
- }
1186
- function Node(value, prev, next, list) {
1187
- if (!(this instanceof Node)) {
1188
- return new Node(value, prev, next, list);
1189
- }
1190
- this.list = list;
1191
- this.value = value;
1192
- if (prev) {
1193
- prev.next = this;
1194
- this.prev = prev;
1195
- } else {
1196
- this.prev = null;
1197
- }
1198
- if (next) {
1199
- next.prev = this;
1200
- this.next = next;
1201
- } else {
1202
- this.next = null;
1203
- }
1204
- }
1205
- try {
1206
- require_iterator()(Yallist);
1207
- } catch (er) {
1208
- }
1209
- }
1210
- });
1211
-
1212
- // node_modules/semver/node_modules/lru-cache/index.js
1213
- var require_lru_cache = __commonJS({
1214
- "node_modules/semver/node_modules/lru-cache/index.js"(exports, module2) {
1215
- "use strict";
1216
- var Yallist = require_yallist();
1217
- var MAX = Symbol("max");
1218
- var LENGTH = Symbol("length");
1219
- var LENGTH_CALCULATOR = Symbol("lengthCalculator");
1220
- var ALLOW_STALE = Symbol("allowStale");
1221
- var MAX_AGE = Symbol("maxAge");
1222
- var DISPOSE = Symbol("dispose");
1223
- var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
1224
- var LRU_LIST = Symbol("lruList");
1225
- var CACHE = Symbol("cache");
1226
- var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
1227
- var naiveLength = () => 1;
829
+ // node_modules/semver/internal/lrucache.js
830
+ var require_lrucache = __commonJS({
831
+ "node_modules/semver/internal/lrucache.js"(exports, module2) {
1228
832
  var LRUCache = class {
1229
- constructor(options) {
1230
- if (typeof options === "number")
1231
- options = { max: options };
1232
- if (!options)
1233
- options = {};
1234
- if (options.max && (typeof options.max !== "number" || options.max < 0))
1235
- throw new TypeError("max must be a non-negative number");
1236
- const max = this[MAX] = options.max || Infinity;
1237
- const lc = options.length || naiveLength;
1238
- this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
1239
- this[ALLOW_STALE] = options.stale || false;
1240
- if (options.maxAge && typeof options.maxAge !== "number")
1241
- throw new TypeError("maxAge must be a number");
1242
- this[MAX_AGE] = options.maxAge || 0;
1243
- this[DISPOSE] = options.dispose;
1244
- this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
1245
- this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
1246
- this.reset();
1247
- }
1248
- set max(mL) {
1249
- if (typeof mL !== "number" || mL < 0)
1250
- throw new TypeError("max must be a non-negative number");
1251
- this[MAX] = mL || Infinity;
1252
- trim(this);
1253
- }
1254
- get max() {
1255
- return this[MAX];
1256
- }
1257
- set allowStale(allowStale) {
1258
- this[ALLOW_STALE] = !!allowStale;
1259
- }
1260
- get allowStale() {
1261
- return this[ALLOW_STALE];
1262
- }
1263
- set maxAge(mA) {
1264
- if (typeof mA !== "number")
1265
- throw new TypeError("maxAge must be a non-negative number");
1266
- this[MAX_AGE] = mA;
1267
- trim(this);
1268
- }
1269
- get maxAge() {
1270
- return this[MAX_AGE];
1271
- }
1272
- set lengthCalculator(lC) {
1273
- if (typeof lC !== "function")
1274
- lC = naiveLength;
1275
- if (lC !== this[LENGTH_CALCULATOR]) {
1276
- this[LENGTH_CALCULATOR] = lC;
1277
- this[LENGTH] = 0;
1278
- this[LRU_LIST].forEach((hit) => {
1279
- hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
1280
- this[LENGTH] += hit.length;
1281
- });
1282
- }
1283
- trim(this);
1284
- }
1285
- get lengthCalculator() {
1286
- return this[LENGTH_CALCULATOR];
1287
- }
1288
- get length() {
1289
- return this[LENGTH];
1290
- }
1291
- get itemCount() {
1292
- return this[LRU_LIST].length;
1293
- }
1294
- rforEach(fn2, thisp) {
1295
- thisp = thisp || this;
1296
- for (let walker = this[LRU_LIST].tail; walker !== null; ) {
1297
- const prev = walker.prev;
1298
- forEachStep(this, fn2, walker, thisp);
1299
- walker = prev;
1300
- }
1301
- }
1302
- forEach(fn2, thisp) {
1303
- thisp = thisp || this;
1304
- for (let walker = this[LRU_LIST].head; walker !== null; ) {
1305
- const next = walker.next;
1306
- forEachStep(this, fn2, walker, thisp);
1307
- walker = next;
1308
- }
1309
- }
1310
- keys() {
1311
- return this[LRU_LIST].toArray().map((k) => k.key);
1312
- }
1313
- values() {
1314
- return this[LRU_LIST].toArray().map((k) => k.value);
1315
- }
1316
- reset() {
1317
- if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
1318
- this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
1319
- }
1320
- this[CACHE] = /* @__PURE__ */ new Map();
1321
- this[LRU_LIST] = new Yallist();
1322
- this[LENGTH] = 0;
1323
- }
1324
- dump() {
1325
- return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
1326
- k: hit.key,
1327
- v: hit.value,
1328
- e: hit.now + (hit.maxAge || 0)
1329
- }).toArray().filter((h) => h);
1330
- }
1331
- dumpLru() {
1332
- return this[LRU_LIST];
1333
- }
1334
- set(key, value, maxAge) {
1335
- maxAge = maxAge || this[MAX_AGE];
1336
- if (maxAge && typeof maxAge !== "number")
1337
- throw new TypeError("maxAge must be a number");
1338
- const now = maxAge ? Date.now() : 0;
1339
- const len = this[LENGTH_CALCULATOR](value, key);
1340
- if (this[CACHE].has(key)) {
1341
- if (len > this[MAX]) {
1342
- del(this, this[CACHE].get(key));
1343
- return false;
1344
- }
1345
- const node = this[CACHE].get(key);
1346
- const item = node.value;
1347
- if (this[DISPOSE]) {
1348
- if (!this[NO_DISPOSE_ON_SET])
1349
- this[DISPOSE](key, item.value);
1350
- }
1351
- item.now = now;
1352
- item.maxAge = maxAge;
1353
- item.value = value;
1354
- this[LENGTH] += len - item.length;
1355
- item.length = len;
1356
- this.get(key);
1357
- trim(this);
1358
- return true;
1359
- }
1360
- const hit = new Entry(key, value, len, now, maxAge);
1361
- if (hit.length > this[MAX]) {
1362
- if (this[DISPOSE])
1363
- this[DISPOSE](key, value);
1364
- return false;
1365
- }
1366
- this[LENGTH] += hit.length;
1367
- this[LRU_LIST].unshift(hit);
1368
- this[CACHE].set(key, this[LRU_LIST].head);
1369
- trim(this);
1370
- return true;
1371
- }
1372
- has(key) {
1373
- if (!this[CACHE].has(key))
1374
- return false;
1375
- const hit = this[CACHE].get(key).value;
1376
- return !isStale(this, hit);
833
+ constructor() {
834
+ this.max = 1e3;
835
+ this.map = /* @__PURE__ */ new Map();
1377
836
  }
1378
837
  get(key) {
1379
- return get(this, key, true);
1380
- }
1381
- peek(key) {
1382
- return get(this, key, false);
1383
- }
1384
- pop() {
1385
- const node = this[LRU_LIST].tail;
1386
- if (!node)
1387
- return null;
1388
- del(this, node);
1389
- return node.value;
1390
- }
1391
- del(key) {
1392
- del(this, this[CACHE].get(key));
1393
- }
1394
- load(arr) {
1395
- this.reset();
1396
- const now = Date.now();
1397
- for (let l = arr.length - 1; l >= 0; l--) {
1398
- const hit = arr[l];
1399
- const expiresAt = hit.e || 0;
1400
- if (expiresAt === 0)
1401
- this.set(hit.k, hit.v);
1402
- else {
1403
- const maxAge = expiresAt - now;
1404
- if (maxAge > 0) {
1405
- this.set(hit.k, hit.v, maxAge);
1406
- }
1407
- }
838
+ const value = this.map.get(key);
839
+ if (value === void 0) {
840
+ return void 0;
841
+ } else {
842
+ this.map.delete(key);
843
+ this.map.set(key, value);
844
+ return value;
1408
845
  }
1409
846
  }
1410
- prune() {
1411
- this[CACHE].forEach((value, key) => get(this, key, false));
847
+ delete(key) {
848
+ return this.map.delete(key);
1412
849
  }
1413
- };
1414
- var get = (self, key, doUse) => {
1415
- const node = self[CACHE].get(key);
1416
- if (node) {
1417
- const hit = node.value;
1418
- if (isStale(self, hit)) {
1419
- del(self, node);
1420
- if (!self[ALLOW_STALE])
1421
- return void 0;
1422
- } else {
1423
- if (doUse) {
1424
- if (self[UPDATE_AGE_ON_GET])
1425
- node.value.now = Date.now();
1426
- self[LRU_LIST].unshiftNode(node);
850
+ set(key, value) {
851
+ const deleted = this.delete(key);
852
+ if (!deleted && value !== void 0) {
853
+ if (this.map.size >= this.max) {
854
+ const firstKey = this.map.keys().next().value;
855
+ this.delete(firstKey);
1427
856
  }
857
+ this.map.set(key, value);
1428
858
  }
1429
- return hit.value;
1430
- }
1431
- };
1432
- var isStale = (self, hit) => {
1433
- if (!hit || !hit.maxAge && !self[MAX_AGE])
1434
- return false;
1435
- const diff = Date.now() - hit.now;
1436
- return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
1437
- };
1438
- var trim = (self) => {
1439
- if (self[LENGTH] > self[MAX]) {
1440
- for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
1441
- const prev = walker.prev;
1442
- del(self, walker);
1443
- walker = prev;
1444
- }
1445
- }
1446
- };
1447
- var del = (self, node) => {
1448
- if (node) {
1449
- const hit = node.value;
1450
- if (self[DISPOSE])
1451
- self[DISPOSE](hit.key, hit.value);
1452
- self[LENGTH] -= hit.length;
1453
- self[CACHE].delete(hit.key);
1454
- self[LRU_LIST].removeNode(node);
1455
- }
1456
- };
1457
- var Entry = class {
1458
- constructor(key, value, length, now, maxAge) {
1459
- this.key = key;
1460
- this.value = value;
1461
- this.length = length;
1462
- this.now = now;
1463
- this.maxAge = maxAge || 0;
859
+ return this;
1464
860
  }
1465
861
  };
1466
- var forEachStep = (self, fn2, node, thisp) => {
1467
- let hit = node.value;
1468
- if (isStale(self, hit)) {
1469
- del(self, node);
1470
- if (!self[ALLOW_STALE])
1471
- hit = void 0;
1472
- }
1473
- if (hit)
1474
- fn2.call(thisp, hit.value, hit.key, self);
1475
- };
1476
862
  module2.exports = LRUCache;
1477
863
  }
1478
864
  });
@@ -1601,8 +987,8 @@ var require_range = __commonJS({
1601
987
  }
1602
988
  };
1603
989
  module2.exports = Range;
1604
- var LRU = require_lru_cache();
1605
- var cache = new LRU({ max: 1e3 });
990
+ var LRU = require_lrucache();
991
+ var cache = new LRU();
1606
992
  var parseOptions = require_parse_options();
1607
993
  var Comparator = require_comparator();
1608
994
  var debug = require_debug();
@@ -1780,7 +1166,7 @@ var require_range = __commonJS({
1780
1166
  debug("replaceGTE0", comp, options);
1781
1167
  return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1782
1168
  };
1783
- var hyphenReplace = (incPr) => ($02, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
1169
+ var hyphenReplace = (incPr) => ($02, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1784
1170
  if (isX(fM)) {
1785
1171
  from = "";
1786
1172
  } else if (isX(fm)) {
@@ -5699,6 +5085,15 @@ var Identifiers = _Identifiers;
5699
5085
  (() => {
5700
5086
  _Identifiers.twoWayListener = { name: "\u0275\u0275twoWayListener", moduleName: CORE };
5701
5087
  })();
5088
+ (() => {
5089
+ _Identifiers.declareLet = { name: "\u0275\u0275declareLet", moduleName: CORE };
5090
+ })();
5091
+ (() => {
5092
+ _Identifiers.storeLet = { name: "\u0275\u0275storeLet", moduleName: CORE };
5093
+ })();
5094
+ (() => {
5095
+ _Identifiers.readContextLet = { name: "\u0275\u0275readContextLet", moduleName: CORE };
5096
+ })();
5702
5097
  (() => {
5703
5098
  _Identifiers.NgOnChangesFeature = { name: "\u0275\u0275NgOnChangesFeature", moduleName: CORE };
5704
5099
  })();
@@ -9590,16 +8985,18 @@ var OpKind;
9590
8985
  OpKind2[OpKind2["Repeater"] = 35] = "Repeater";
9591
8986
  OpKind2[OpKind2["TwoWayProperty"] = 36] = "TwoWayProperty";
9592
8987
  OpKind2[OpKind2["TwoWayListener"] = 37] = "TwoWayListener";
9593
- OpKind2[OpKind2["I18nStart"] = 38] = "I18nStart";
9594
- OpKind2[OpKind2["I18n"] = 39] = "I18n";
9595
- OpKind2[OpKind2["I18nEnd"] = 40] = "I18nEnd";
9596
- OpKind2[OpKind2["I18nExpression"] = 41] = "I18nExpression";
9597
- OpKind2[OpKind2["I18nApply"] = 42] = "I18nApply";
9598
- OpKind2[OpKind2["IcuStart"] = 43] = "IcuStart";
9599
- OpKind2[OpKind2["IcuEnd"] = 44] = "IcuEnd";
9600
- OpKind2[OpKind2["IcuPlaceholder"] = 45] = "IcuPlaceholder";
9601
- OpKind2[OpKind2["I18nContext"] = 46] = "I18nContext";
9602
- OpKind2[OpKind2["I18nAttributes"] = 47] = "I18nAttributes";
8988
+ OpKind2[OpKind2["DeclareLet"] = 38] = "DeclareLet";
8989
+ OpKind2[OpKind2["StoreLet"] = 39] = "StoreLet";
8990
+ OpKind2[OpKind2["I18nStart"] = 40] = "I18nStart";
8991
+ OpKind2[OpKind2["I18n"] = 41] = "I18n";
8992
+ OpKind2[OpKind2["I18nEnd"] = 42] = "I18nEnd";
8993
+ OpKind2[OpKind2["I18nExpression"] = 43] = "I18nExpression";
8994
+ OpKind2[OpKind2["I18nApply"] = 44] = "I18nApply";
8995
+ OpKind2[OpKind2["IcuStart"] = 45] = "IcuStart";
8996
+ OpKind2[OpKind2["IcuEnd"] = 46] = "IcuEnd";
8997
+ OpKind2[OpKind2["IcuPlaceholder"] = 47] = "IcuPlaceholder";
8998
+ OpKind2[OpKind2["I18nContext"] = 48] = "I18nContext";
8999
+ OpKind2[OpKind2["I18nAttributes"] = 49] = "I18nAttributes";
9603
9000
  })(OpKind || (OpKind = {}));
9604
9001
  var ExpressionKind;
9605
9002
  (function(ExpressionKind2) {
@@ -9609,24 +9006,26 @@ var ExpressionKind;
9609
9006
  ExpressionKind2[ExpressionKind2["ReadVariable"] = 3] = "ReadVariable";
9610
9007
  ExpressionKind2[ExpressionKind2["NextContext"] = 4] = "NextContext";
9611
9008
  ExpressionKind2[ExpressionKind2["Reference"] = 5] = "Reference";
9612
- ExpressionKind2[ExpressionKind2["GetCurrentView"] = 6] = "GetCurrentView";
9613
- ExpressionKind2[ExpressionKind2["RestoreView"] = 7] = "RestoreView";
9614
- ExpressionKind2[ExpressionKind2["ResetView"] = 8] = "ResetView";
9615
- ExpressionKind2[ExpressionKind2["PureFunctionExpr"] = 9] = "PureFunctionExpr";
9616
- ExpressionKind2[ExpressionKind2["PureFunctionParameterExpr"] = 10] = "PureFunctionParameterExpr";
9617
- ExpressionKind2[ExpressionKind2["PipeBinding"] = 11] = "PipeBinding";
9618
- ExpressionKind2[ExpressionKind2["PipeBindingVariadic"] = 12] = "PipeBindingVariadic";
9619
- ExpressionKind2[ExpressionKind2["SafePropertyRead"] = 13] = "SafePropertyRead";
9620
- ExpressionKind2[ExpressionKind2["SafeKeyedRead"] = 14] = "SafeKeyedRead";
9621
- ExpressionKind2[ExpressionKind2["SafeInvokeFunction"] = 15] = "SafeInvokeFunction";
9622
- ExpressionKind2[ExpressionKind2["SafeTernaryExpr"] = 16] = "SafeTernaryExpr";
9623
- ExpressionKind2[ExpressionKind2["EmptyExpr"] = 17] = "EmptyExpr";
9624
- ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 18] = "AssignTemporaryExpr";
9625
- ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 19] = "ReadTemporaryExpr";
9626
- ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 20] = "SlotLiteralExpr";
9627
- ExpressionKind2[ExpressionKind2["ConditionalCase"] = 21] = "ConditionalCase";
9628
- ExpressionKind2[ExpressionKind2["ConstCollected"] = 22] = "ConstCollected";
9629
- ExpressionKind2[ExpressionKind2["TwoWayBindingSet"] = 23] = "TwoWayBindingSet";
9009
+ ExpressionKind2[ExpressionKind2["StoreLet"] = 6] = "StoreLet";
9010
+ ExpressionKind2[ExpressionKind2["ContextLetReference"] = 7] = "ContextLetReference";
9011
+ ExpressionKind2[ExpressionKind2["GetCurrentView"] = 8] = "GetCurrentView";
9012
+ ExpressionKind2[ExpressionKind2["RestoreView"] = 9] = "RestoreView";
9013
+ ExpressionKind2[ExpressionKind2["ResetView"] = 10] = "ResetView";
9014
+ ExpressionKind2[ExpressionKind2["PureFunctionExpr"] = 11] = "PureFunctionExpr";
9015
+ ExpressionKind2[ExpressionKind2["PureFunctionParameterExpr"] = 12] = "PureFunctionParameterExpr";
9016
+ ExpressionKind2[ExpressionKind2["PipeBinding"] = 13] = "PipeBinding";
9017
+ ExpressionKind2[ExpressionKind2["PipeBindingVariadic"] = 14] = "PipeBindingVariadic";
9018
+ ExpressionKind2[ExpressionKind2["SafePropertyRead"] = 15] = "SafePropertyRead";
9019
+ ExpressionKind2[ExpressionKind2["SafeKeyedRead"] = 16] = "SafeKeyedRead";
9020
+ ExpressionKind2[ExpressionKind2["SafeInvokeFunction"] = 17] = "SafeInvokeFunction";
9021
+ ExpressionKind2[ExpressionKind2["SafeTernaryExpr"] = 18] = "SafeTernaryExpr";
9022
+ ExpressionKind2[ExpressionKind2["EmptyExpr"] = 19] = "EmptyExpr";
9023
+ ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 20] = "AssignTemporaryExpr";
9024
+ ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 21] = "ReadTemporaryExpr";
9025
+ ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 22] = "SlotLiteralExpr";
9026
+ ExpressionKind2[ExpressionKind2["ConditionalCase"] = 23] = "ConditionalCase";
9027
+ ExpressionKind2[ExpressionKind2["ConstCollected"] = 24] = "ConstCollected";
9028
+ ExpressionKind2[ExpressionKind2["TwoWayBindingSet"] = 25] = "TwoWayBindingSet";
9630
9029
  })(ExpressionKind || (ExpressionKind = {}));
9631
9030
  var VariableFlags;
9632
9031
  (function(VariableFlags2) {
@@ -9721,8 +9120,8 @@ var TRAIT_CONSUMES_VARS = {
9721
9120
  function hasConsumesSlotTrait(op) {
9722
9121
  return op[ConsumesSlot] === true;
9723
9122
  }
9724
- function hasDependsOnSlotContextTrait(op) {
9725
- return op[DependsOnSlotContext] === true;
9123
+ function hasDependsOnSlotContextTrait(value) {
9124
+ return value[DependsOnSlotContext] === true;
9726
9125
  }
9727
9126
  function hasConsumesVarsTrait(value) {
9728
9127
  return value[ConsumesVarsTrait] === true;
@@ -9932,6 +9331,15 @@ function createI18nApplyOp(owner, handle, sourceSpan) {
9932
9331
  sourceSpan
9933
9332
  }, NEW_OP);
9934
9333
  }
9334
+ function createStoreLetOp(target, declaredName, value, sourceSpan) {
9335
+ return __spreadValues(__spreadValues(__spreadValues({
9336
+ kind: OpKind.StoreLet,
9337
+ target,
9338
+ declaredName,
9339
+ value,
9340
+ sourceSpan
9341
+ }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
9342
+ }
9935
9343
 
9936
9344
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
9937
9345
  var _a;
@@ -9940,6 +9348,8 @@ var _c;
9940
9348
  var _d;
9941
9349
  var _e;
9942
9350
  var _f;
9351
+ var _g;
9352
+ var _h;
9943
9353
  function isIrExpression(expr) {
9944
9354
  return expr instanceof ExpressionBase;
9945
9355
  }
@@ -9990,6 +9400,56 @@ var ReferenceExpr = class extends ExpressionBase {
9990
9400
  return new ReferenceExpr(this.target, this.targetSlot, this.offset);
9991
9401
  }
9992
9402
  };
9403
+ var _StoreLetExpr = class extends ExpressionBase {
9404
+ constructor(target, value, sourceSpan) {
9405
+ super();
9406
+ this.target = target;
9407
+ this.value = value;
9408
+ this.sourceSpan = sourceSpan;
9409
+ this.kind = ExpressionKind.StoreLet;
9410
+ this[_a] = true;
9411
+ this[_b] = true;
9412
+ }
9413
+ visitExpression() {
9414
+ }
9415
+ isEquivalent(e) {
9416
+ return e instanceof _StoreLetExpr && e.target === this.target && e.value.isEquivalent(this.value);
9417
+ }
9418
+ isConstant() {
9419
+ return false;
9420
+ }
9421
+ transformInternalExpressions(transform2, flags) {
9422
+ this.value = transformExpressionsInExpression(this.value, transform2, flags);
9423
+ }
9424
+ clone() {
9425
+ return new _StoreLetExpr(this.target, this.value, this.sourceSpan);
9426
+ }
9427
+ };
9428
+ var StoreLetExpr = _StoreLetExpr;
9429
+ (() => {
9430
+ _a = ConsumesVarsTrait, _b = DependsOnSlotContext;
9431
+ })();
9432
+ var ContextLetReferenceExpr = class extends ExpressionBase {
9433
+ constructor(target, targetSlot) {
9434
+ super();
9435
+ this.target = target;
9436
+ this.targetSlot = targetSlot;
9437
+ this.kind = ExpressionKind.ContextLetReference;
9438
+ }
9439
+ visitExpression() {
9440
+ }
9441
+ isEquivalent(e) {
9442
+ return e instanceof ContextLetReferenceExpr && e.target === this.target;
9443
+ }
9444
+ isConstant() {
9445
+ return false;
9446
+ }
9447
+ transformInternalExpressions() {
9448
+ }
9449
+ clone() {
9450
+ return new ContextLetReferenceExpr(this.target, this.targetSlot);
9451
+ }
9452
+ };
9993
9453
  var ContextExpr = class extends ExpressionBase {
9994
9454
  constructor(view) {
9995
9455
  super();
@@ -10178,8 +9638,8 @@ var _PureFunctionExpr = class extends ExpressionBase {
10178
9638
  constructor(expression, args) {
10179
9639
  super();
10180
9640
  this.kind = ExpressionKind.PureFunctionExpr;
10181
- this[_a] = true;
10182
- this[_b] = true;
9641
+ this[_c] = true;
9642
+ this[_d] = true;
10183
9643
  this.varOffset = null;
10184
9644
  this.fn = null;
10185
9645
  this.body = expression;
@@ -10221,7 +9681,7 @@ var _PureFunctionExpr = class extends ExpressionBase {
10221
9681
  };
10222
9682
  var PureFunctionExpr = _PureFunctionExpr;
10223
9683
  (() => {
10224
- _a = ConsumesVarsTrait, _b = UsesVarOffset;
9684
+ _c = ConsumesVarsTrait, _d = UsesVarOffset;
10225
9685
  })();
10226
9686
  var PureFunctionParameterExpr = class extends ExpressionBase {
10227
9687
  constructor(index) {
@@ -10251,8 +9711,8 @@ var _PipeBindingExpr = class extends ExpressionBase {
10251
9711
  this.name = name;
10252
9712
  this.args = args;
10253
9713
  this.kind = ExpressionKind.PipeBinding;
10254
- this[_c] = true;
10255
- this[_d] = true;
9714
+ this[_e] = true;
9715
+ this[_f] = true;
10256
9716
  this.varOffset = null;
10257
9717
  }
10258
9718
  visitExpression(visitor, context) {
@@ -10279,7 +9739,7 @@ var _PipeBindingExpr = class extends ExpressionBase {
10279
9739
  };
10280
9740
  var PipeBindingExpr = _PipeBindingExpr;
10281
9741
  (() => {
10282
- _c = ConsumesVarsTrait, _d = UsesVarOffset;
9742
+ _e = ConsumesVarsTrait, _f = UsesVarOffset;
10283
9743
  })();
10284
9744
  var _PipeBindingVariadicExpr = class extends ExpressionBase {
10285
9745
  constructor(target, targetSlot, name, args, numArgs) {
@@ -10290,8 +9750,8 @@ var _PipeBindingVariadicExpr = class extends ExpressionBase {
10290
9750
  this.args = args;
10291
9751
  this.numArgs = numArgs;
10292
9752
  this.kind = ExpressionKind.PipeBindingVariadic;
10293
- this[_e] = true;
10294
- this[_f] = true;
9753
+ this[_g] = true;
9754
+ this[_h] = true;
10295
9755
  this.varOffset = null;
10296
9756
  }
10297
9757
  visitExpression(visitor, context) {
@@ -10314,7 +9774,7 @@ var _PipeBindingVariadicExpr = class extends ExpressionBase {
10314
9774
  };
10315
9775
  var PipeBindingVariadicExpr = _PipeBindingVariadicExpr;
10316
9776
  (() => {
10317
- _e = ConsumesVarsTrait, _f = UsesVarOffset;
9777
+ _g = ConsumesVarsTrait, _h = UsesVarOffset;
10318
9778
  })();
10319
9779
  var SafePropertyReadExpr = class extends ExpressionBase {
10320
9780
  constructor(receiver, name) {
@@ -10673,6 +10133,9 @@ function transformExpressionsInOp(op, transform2, flags) {
10673
10133
  case OpKind.DeferWhen:
10674
10134
  op.expr = transformExpressionsInExpression(op.expr, transform2, flags);
10675
10135
  break;
10136
+ case OpKind.StoreLet:
10137
+ op.value = transformExpressionsInExpression(op.value, transform2, flags);
10138
+ break;
10676
10139
  case OpKind.Advance:
10677
10140
  case OpKind.Container:
10678
10141
  case OpKind.ContainerEnd:
@@ -10698,6 +10161,7 @@ function transformExpressionsInOp(op, transform2, flags) {
10698
10161
  case OpKind.Text:
10699
10162
  case OpKind.I18nAttributes:
10700
10163
  case OpKind.IcuPlaceholder:
10164
+ case OpKind.DeclareLet:
10701
10165
  break;
10702
10166
  default:
10703
10167
  throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
@@ -11213,6 +10677,15 @@ function createDeferOnOp(defer2, trigger, prefetch, sourceSpan) {
11213
10677
  sourceSpan
11214
10678
  }, NEW_OP);
11215
10679
  }
10680
+ function createDeclareLetOp(xref, declaredName, sourceSpan) {
10681
+ return __spreadValues(__spreadValues({
10682
+ kind: OpKind.DeclareLet,
10683
+ xref,
10684
+ declaredName,
10685
+ sourceSpan,
10686
+ handle: new SlotHandle()
10687
+ }, TRAIT_CONSUMES_SLOT), NEW_OP);
10688
+ }
11216
10689
  function createI18nMessageOp(xref, i18nContext, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {
11217
10690
  return __spreadValues({
11218
10691
  kind: OpKind.I18nMessage,
@@ -11758,7 +11231,8 @@ var CHAINABLE = /* @__PURE__ */ new Set([
11758
11231
  Identifiers.syntheticHostProperty,
11759
11232
  Identifiers.templateCreate,
11760
11233
  Identifiers.twoWayProperty,
11761
- Identifiers.twoWayListener
11234
+ Identifiers.twoWayListener,
11235
+ Identifiers.declareLet
11762
11236
  ]);
11763
11237
  function chain(job) {
11764
11238
  for (const unit of job.units) {
@@ -12662,18 +12136,29 @@ function generateAdvance(job) {
12662
12136
  }
12663
12137
  let slotContext = 0;
12664
12138
  for (const op of unit.update) {
12665
- if (!hasDependsOnSlotContextTrait(op)) {
12139
+ let consumer = null;
12140
+ if (hasDependsOnSlotContextTrait(op)) {
12141
+ consumer = op;
12142
+ } else {
12143
+ visitExpressionsInOp(op, (expr) => {
12144
+ if (consumer === null && hasDependsOnSlotContextTrait(expr)) {
12145
+ consumer = expr;
12146
+ }
12147
+ });
12148
+ }
12149
+ if (consumer === null) {
12666
12150
  continue;
12667
- } else if (!slotMap.has(op.target)) {
12668
- throw new Error(`AssertionError: reference to unknown slot for target ${op.target}`);
12669
12151
  }
12670
- const slot = slotMap.get(op.target);
12152
+ if (!slotMap.has(consumer.target)) {
12153
+ throw new Error(`AssertionError: reference to unknown slot for target ${consumer.target}`);
12154
+ }
12155
+ const slot = slotMap.get(consumer.target);
12671
12156
  if (slotContext !== slot) {
12672
12157
  const delta = slot - slotContext;
12673
12158
  if (delta < 0) {
12674
12159
  throw new Error(`AssertionError: slot counter should never need to move backwards`);
12675
12160
  }
12676
- OpList.insertBefore(createAdvanceOp(delta, op.sourceSpan), op);
12161
+ OpList.insertBefore(createAdvanceOp(delta, consumer.sourceSpan), op);
12677
12162
  slotContext = slot;
12678
12163
  }
12679
12164
  }
@@ -12728,12 +12213,11 @@ function recursivelyProcessView(view, parentScope) {
12728
12213
  break;
12729
12214
  case OpKind.Listener:
12730
12215
  case OpKind.TwoWayListener:
12731
- op.handlerOps.prepend(generateVariablesInScopeForView(view, scope));
12216
+ op.handlerOps.prepend(generateVariablesInScopeForView(view, scope, true));
12732
12217
  break;
12733
12218
  }
12734
12219
  }
12735
- const preambleOps = generateVariablesInScopeForView(view, scope);
12736
- view.update.prepend(preambleOps);
12220
+ view.update.prepend(generateVariablesInScopeForView(view, scope, false));
12737
12221
  }
12738
12222
  function getScopeForView(view, parent) {
12739
12223
  const scope = {
@@ -12746,6 +12230,7 @@ function getScopeForView(view, parent) {
12746
12230
  contextVariables: /* @__PURE__ */ new Map(),
12747
12231
  aliases: view.aliases,
12748
12232
  references: [],
12233
+ letDeclarations: [],
12749
12234
  parent
12750
12235
  };
12751
12236
  for (const identifier of view.contextVariables.keys()) {
@@ -12776,11 +12261,22 @@ function getScopeForView(view, parent) {
12776
12261
  });
12777
12262
  }
12778
12263
  break;
12264
+ case OpKind.DeclareLet:
12265
+ scope.letDeclarations.push({
12266
+ targetId: op.xref,
12267
+ targetSlot: op.handle,
12268
+ variable: {
12269
+ kind: SemanticVariableKind.Identifier,
12270
+ name: null,
12271
+ identifier: op.declaredName
12272
+ }
12273
+ });
12274
+ break;
12779
12275
  }
12780
12276
  }
12781
12277
  return scope;
12782
12278
  }
12783
- function generateVariablesInScopeForView(view, scope) {
12279
+ function generateVariablesInScopeForView(view, scope, isListener) {
12784
12280
  const newOps = [];
12785
12281
  if (scope.view !== view.xref) {
12786
12282
  newOps.push(createVariableOp(view.job.allocateXrefId(), scope.viewContextVariable, new NextContextExpr(), VariableFlags.None));
@@ -12797,8 +12293,13 @@ function generateVariablesInScopeForView(view, scope) {
12797
12293
  for (const ref of scope.references) {
12798
12294
  newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.targetSlot, ref.offset), VariableFlags.None));
12799
12295
  }
12296
+ if (scope.view !== view.xref || isListener) {
12297
+ for (const decl of scope.letDeclarations) {
12298
+ newOps.push(createVariableOp(view.job.allocateXrefId(), decl.variable, new ContextLetReferenceExpr(decl.targetId, decl.targetSlot), VariableFlags.None));
12299
+ }
12300
+ }
12800
12301
  if (scope.parent !== null) {
12801
- newOps.push(...generateVariablesInScopeForView(view, scope.parent));
12302
+ newOps.push(...generateVariablesInScopeForView(view, scope.parent, false));
12802
12303
  }
12803
12304
  return newOps;
12804
12305
  }
@@ -13920,13 +13421,15 @@ var _ParseAST = class {
13920
13421
  const keyStart = this.inputIndex;
13921
13422
  const quoted = this.next.isString();
13922
13423
  const key = this.expectIdentifierOrKeywordOrString();
13923
- keys.push({ key, quoted });
13424
+ const literalMapKey = { key, quoted };
13425
+ keys.push(literalMapKey);
13924
13426
  if (quoted) {
13925
13427
  this.expectCharacter($COLON);
13926
13428
  values.push(this.parsePipe());
13927
13429
  } else if (this.consumeOptionalCharacter($COLON)) {
13928
13430
  values.push(this.parsePipe());
13929
13431
  } else {
13432
+ literalMapKey.isShorthandInitialized = true;
13930
13433
  const span = this.span(keyStart);
13931
13434
  const sourceSpan = this.sourceSpan(keyStart);
13932
13435
  values.push(new PropertyRead(span, sourceSpan, sourceSpan, new ImplicitReceiver(span, sourceSpan), key));
@@ -19605,6 +19108,7 @@ function mergeNextContextsInOps(ops) {
19605
19108
  break;
19606
19109
  case ExpressionKind.GetCurrentView:
19607
19110
  case ExpressionKind.Reference:
19111
+ case ExpressionKind.ContextLetReference:
19608
19112
  tryToMerge = false;
19609
19113
  break;
19610
19114
  }
@@ -20224,6 +19728,15 @@ function repeater(collection, sourceSpan) {
20224
19728
  function deferWhen(prefetch, expr, sourceSpan) {
20225
19729
  return call(prefetch ? Identifiers.deferPrefetchWhen : Identifiers.deferWhen, [expr], sourceSpan);
20226
19730
  }
19731
+ function declareLet(slot, sourceSpan) {
19732
+ return call(Identifiers.declareLet, [literal(slot)], sourceSpan);
19733
+ }
19734
+ function storeLet(value, sourceSpan) {
19735
+ return importExpr(Identifiers.storeLet).callFn([value], sourceSpan);
19736
+ }
19737
+ function readContextLet(slot) {
19738
+ return importExpr(Identifiers.readContextLet).callFn([literal(slot)]);
19739
+ }
20227
19740
  function i18n(slot, constIndex, subTemplateIndex, sourceSpan) {
20228
19741
  const args = [literal(slot), literal(constIndex)];
20229
19742
  if (subTemplateIndex) {
@@ -20538,7 +20051,7 @@ function reify(job) {
20538
20051
  }
20539
20052
  }
20540
20053
  function reifyCreateOperations(unit, ops) {
20541
- var _a2, _b2, _c2, _d2, _e2, _f2, _g;
20054
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
20542
20055
  for (const op of ops) {
20543
20056
  transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None);
20544
20057
  switch (op.kind) {
@@ -20597,6 +20110,9 @@ function reifyCreateOperations(unit, ops) {
20597
20110
  case OpKind.Pipe:
20598
20111
  OpList.replace(op, pipe(op.handle.slot, op.name));
20599
20112
  break;
20113
+ case OpKind.DeclareLet:
20114
+ OpList.replace(op, declareLet(op.handle.slot, op.sourceSpan));
20115
+ break;
20600
20116
  case OpKind.Listener:
20601
20117
  const listenerFn = reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, op.consumesDollarEvent);
20602
20118
  const eventTargetResolver = op.eventTarget ? GLOBAL_TARGET_RESOLVERS.get(op.eventTarget) : null;
@@ -20643,7 +20159,7 @@ function reifyCreateOperations(unit, ops) {
20643
20159
  case DeferTriggerKind.Interaction:
20644
20160
  case DeferTriggerKind.Hover:
20645
20161
  case DeferTriggerKind.Viewport:
20646
- if (((_g = op.trigger.targetSlot) == null ? void 0 : _g.slot) == null || op.trigger.targetSlotViewSteps === null) {
20162
+ if (((_g2 = op.trigger.targetSlot) == null ? void 0 : _g2.slot) == null || op.trigger.targetSlotViewSteps === null) {
20647
20163
  throw new Error(`Slot or view steps not set in trigger reification for trigger kind ${op.trigger.kind}`);
20648
20164
  }
20649
20165
  args = [op.trigger.targetSlot.slot];
@@ -20804,6 +20320,8 @@ function reifyUpdateOperations(_unit, ops) {
20804
20320
  case OpKind.DeferWhen:
20805
20321
  OpList.replace(op, deferWhen(op.prefetch, op.expr, op.sourceSpan));
20806
20322
  break;
20323
+ case OpKind.StoreLet:
20324
+ throw new Error(`AssertionError: unexpected storeLet ${op.declaredName}`);
20807
20325
  case OpKind.Statement:
20808
20326
  break;
20809
20327
  default:
@@ -20861,6 +20379,10 @@ function reifyIrExpression(expr) {
20861
20379
  return pipeBindV(expr.targetSlot.slot, expr.varOffset, expr.args);
20862
20380
  case ExpressionKind.SlotLiteralExpr:
20863
20381
  return literal(expr.slot.slot);
20382
+ case ExpressionKind.ContextLetReference:
20383
+ return readContextLet(expr.targetSlot.slot);
20384
+ case ExpressionKind.StoreLet:
20385
+ return storeLet(expr.value, expr.sourceSpan);
20864
20386
  default:
20865
20387
  throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${ExpressionKind[expr.kind]}`);
20866
20388
  }
@@ -21413,7 +20935,7 @@ function saveAndRestoreView(job) {
21413
20935
  if (!needsRestoreView) {
21414
20936
  for (const handlerOp of op.handlerOps) {
21415
20937
  visitExpressionsInOp(handlerOp, (expr) => {
21416
- if (expr instanceof ReferenceExpr) {
20938
+ if (expr instanceof ReferenceExpr || expr instanceof ContextLetReferenceExpr) {
21417
20939
  needsRestoreView = true;
21418
20940
  }
21419
20941
  });
@@ -21738,6 +21260,7 @@ function varsUsedByOp(op) {
21738
21260
  case OpKind.I18nExpression:
21739
21261
  case OpKind.Conditional:
21740
21262
  case OpKind.DeferWhen:
21263
+ case OpKind.StoreLet:
21741
21264
  return 1;
21742
21265
  case OpKind.RepeaterCreate:
21743
21266
  return op.emptyView ? 1 : 0;
@@ -21753,6 +21276,8 @@ function varsUsedByIrExpression(expr) {
21753
21276
  return 1 + expr.args.length;
21754
21277
  case ExpressionKind.PipeBindingVariadic:
21755
21278
  return 1 + expr.numArgs;
21279
+ case ExpressionKind.StoreLet:
21280
+ return 1;
21756
21281
  default:
21757
21282
  throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`);
21758
21283
  }
@@ -21904,7 +21429,10 @@ function fencesForIrExpression(expr) {
21904
21429
  return Fence.ViewContextRead | Fence.ViewContextWrite;
21905
21430
  case ExpressionKind.RestoreView:
21906
21431
  return Fence.ViewContextRead | Fence.ViewContextWrite | Fence.SideEffectful;
21432
+ case ExpressionKind.StoreLet:
21433
+ return Fence.SideEffectful;
21907
21434
  case ExpressionKind.Reference:
21435
+ case ExpressionKind.ContextLetReference:
21908
21436
  return Fence.ViewContextRead;
21909
21437
  default:
21910
21438
  return Fence.None;
@@ -22046,6 +21574,59 @@ function wrapI18nIcus(job) {
22046
21574
  }
22047
21575
  }
22048
21576
 
21577
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/store_let_optimization.mjs
21578
+ function optimizeStoreLet(job) {
21579
+ const letUsedExternally = /* @__PURE__ */ new Set();
21580
+ for (const unit of job.units) {
21581
+ for (const op of unit.ops()) {
21582
+ visitExpressionsInOp(op, (expr) => {
21583
+ if (expr instanceof ContextLetReferenceExpr) {
21584
+ letUsedExternally.add(expr.target);
21585
+ }
21586
+ });
21587
+ }
21588
+ }
21589
+ for (const unit of job.units) {
21590
+ for (const op of unit.update) {
21591
+ transformExpressionsInOp(op, (expression) => expression instanceof StoreLetExpr && !letUsedExternally.has(expression.target) ? expression.value : expression, VisitorContextFlag.None);
21592
+ }
21593
+ }
21594
+ }
21595
+
21596
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_illegal_let_references.mjs
21597
+ function removeIllegalLetReferences(job) {
21598
+ for (const unit of job.units) {
21599
+ for (const op of unit.update) {
21600
+ if (op.kind !== OpKind.Variable || op.variable.kind !== SemanticVariableKind.Identifier || !(op.initializer instanceof StoreLetExpr)) {
21601
+ continue;
21602
+ }
21603
+ const name = op.variable.identifier;
21604
+ let current = op;
21605
+ while (current && current.kind !== OpKind.ListEnd) {
21606
+ transformExpressionsInOp(current, (expr) => expr instanceof LexicalReadExpr && expr.name === name ? literal(void 0) : expr, VisitorContextFlag.None);
21607
+ current = current.prev;
21608
+ }
21609
+ }
21610
+ }
21611
+ }
21612
+
21613
+ // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_local_let_references.mjs
21614
+ function generateLocalLetReferences(job) {
21615
+ for (const unit of job.units) {
21616
+ for (const op of unit.update) {
21617
+ if (op.kind !== OpKind.StoreLet) {
21618
+ continue;
21619
+ }
21620
+ const variable2 = {
21621
+ kind: SemanticVariableKind.Identifier,
21622
+ name: null,
21623
+ identifier: op.declaredName
21624
+ };
21625
+ OpList.replace(op, createVariableOp(job.allocateXrefId(), variable2, new StoreLetExpr(op.target, op.value, op.sourceSpan), VariableFlags.None));
21626
+ }
21627
+ }
21628
+ }
21629
+
22049
21630
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
22050
21631
  var phases = [
22051
21632
  { kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
@@ -22073,11 +21654,13 @@ var phases = [
22073
21654
  { kind: CompilationJobKind.Tmpl, fn: createVariadicPipes },
22074
21655
  { kind: CompilationJobKind.Both, fn: generatePureLiteralStructures },
22075
21656
  { kind: CompilationJobKind.Tmpl, fn: generateProjectionDefs },
21657
+ { kind: CompilationJobKind.Tmpl, fn: generateLocalLetReferences },
22076
21658
  { kind: CompilationJobKind.Tmpl, fn: generateVariables },
22077
21659
  { kind: CompilationJobKind.Tmpl, fn: saveAndRestoreView },
22078
21660
  { kind: CompilationJobKind.Both, fn: deleteAnyCasts },
22079
21661
  { kind: CompilationJobKind.Both, fn: resolveDollarEvent },
22080
21662
  { kind: CompilationJobKind.Tmpl, fn: generateTrackVariables },
21663
+ { kind: CompilationJobKind.Tmpl, fn: removeIllegalLetReferences },
22081
21664
  { kind: CompilationJobKind.Both, fn: resolveNames },
22082
21665
  { kind: CompilationJobKind.Tmpl, fn: resolveDeferTargetNames },
22083
21666
  { kind: CompilationJobKind.Tmpl, fn: transformTwoWayBindingSet },
@@ -22089,6 +21672,7 @@ var phases = [
22089
21672
  { kind: CompilationJobKind.Both, fn: expandSafeReads },
22090
21673
  { kind: CompilationJobKind.Both, fn: generateTemporaryVariables },
22091
21674
  { kind: CompilationJobKind.Both, fn: optimizeVariables },
21675
+ { kind: CompilationJobKind.Both, fn: optimizeStoreLet },
22092
21676
  { kind: CompilationJobKind.Tmpl, fn: allocateSlots },
22093
21677
  { kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
22094
21678
  { kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
@@ -22305,6 +21889,7 @@ function ingestNodes(unit, template2) {
22305
21889
  } else if (node instanceof ForLoopBlock) {
22306
21890
  ingestForBlock(unit, node);
22307
21891
  } else if (node instanceof LetDeclaration) {
21892
+ ingestLetDeclaration(unit, node);
22308
21893
  } else {
22309
21894
  throw new Error(`Unsupported template node: ${node.constructor.name}`);
22310
21895
  }
@@ -22477,7 +22062,7 @@ function ingestDeferView(unit, suffix, i18nMeta, children, sourceSpan) {
22477
22062
  return templateOp;
22478
22063
  }
22479
22064
  function ingestDeferBlock(unit, deferBlock) {
22480
- var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
22065
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
22481
22066
  let ownResolverFn = null;
22482
22067
  if (unit.job.deferMeta.mode === 0) {
22483
22068
  if (!unit.job.deferMeta.blocks.has(deferBlock)) {
@@ -22487,8 +22072,8 @@ function ingestDeferBlock(unit, deferBlock) {
22487
22072
  }
22488
22073
  const main = ingestDeferView(unit, "", deferBlock.i18n, deferBlock.children, deferBlock.sourceSpan);
22489
22074
  const loading = ingestDeferView(unit, "Loading", (_b2 = deferBlock.loading) == null ? void 0 : _b2.i18n, (_c2 = deferBlock.loading) == null ? void 0 : _c2.children, (_d2 = deferBlock.loading) == null ? void 0 : _d2.sourceSpan);
22490
- const placeholder = ingestDeferView(unit, "Placeholder", (_e2 = deferBlock.placeholder) == null ? void 0 : _e2.i18n, (_f2 = deferBlock.placeholder) == null ? void 0 : _f2.children, (_g = deferBlock.placeholder) == null ? void 0 : _g.sourceSpan);
22491
- const error = ingestDeferView(unit, "Error", (_h = deferBlock.error) == null ? void 0 : _h.i18n, (_i = deferBlock.error) == null ? void 0 : _i.children, (_j = deferBlock.error) == null ? void 0 : _j.sourceSpan);
22075
+ const placeholder = ingestDeferView(unit, "Placeholder", (_e2 = deferBlock.placeholder) == null ? void 0 : _e2.i18n, (_f2 = deferBlock.placeholder) == null ? void 0 : _f2.children, (_g2 = deferBlock.placeholder) == null ? void 0 : _g2.sourceSpan);
22076
+ const error = ingestDeferView(unit, "Error", (_h2 = deferBlock.error) == null ? void 0 : _h2.i18n, (_i = deferBlock.error) == null ? void 0 : _i.children, (_j = deferBlock.error) == null ? void 0 : _j.sourceSpan);
22492
22077
  const deferXref = unit.job.allocateXrefId();
22493
22078
  const deferOp = createDeferOp(deferXref, main.xref, main.handle, ownResolverFn, unit.job.allDeferrableDepsFn, deferBlock.sourceSpan);
22494
22079
  deferOp.placeholderView = (_k = placeholder == null ? void 0 : placeholder.xref) != null ? _k : null;
@@ -22651,6 +22236,11 @@ function getComputedForLoopVariableExpression(variable2, indexName, countName) {
22651
22236
  throw new Error(`AssertionError: unknown @for loop variable ${variable2.value}`);
22652
22237
  }
22653
22238
  }
22239
+ function ingestLetDeclaration(unit, node) {
22240
+ const target = unit.job.allocateXrefId();
22241
+ unit.create.push(createDeclareLetOp(target, node.name, node.sourceSpan));
22242
+ unit.update.push(createStoreLetOp(target, node.name, convertAst(node.value, unit.job, node.valueSpan), node.sourceSpan));
22243
+ }
22654
22244
  function convertAst(ast, job, baseSourceSpan) {
22655
22245
  if (ast instanceof ASTWithSource) {
22656
22246
  return convertAst(ast.ast, job, baseSourceSpan);
@@ -26141,7 +25731,7 @@ function convertDirectiveFacadeToMetadata(facade) {
26141
25731
  });
26142
25732
  }
26143
25733
  function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
26144
- var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i;
25734
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i;
26145
25735
  return {
26146
25736
  name: declaration.type.name,
26147
25737
  type: wrapReference(declaration.type),
@@ -26155,11 +25745,11 @@ function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
26155
25745
  providers: declaration.providers !== void 0 ? new WrappedNodeExpr(declaration.providers) : null,
26156
25746
  exportAs: (_e2 = declaration.exportAs) != null ? _e2 : null,
26157
25747
  usesInheritance: (_f2 = declaration.usesInheritance) != null ? _f2 : false,
26158
- lifecycle: { usesOnChanges: (_g = declaration.usesOnChanges) != null ? _g : false },
25748
+ lifecycle: { usesOnChanges: (_g2 = declaration.usesOnChanges) != null ? _g2 : false },
26159
25749
  deps: null,
26160
25750
  typeArgumentCount: 0,
26161
25751
  fullInheritance: false,
26162
- isStandalone: (_h = declaration.isStandalone) != null ? _h : false,
25752
+ isStandalone: (_h2 = declaration.isStandalone) != null ? _h2 : false,
26163
25753
  isSignal: (_i = declaration.isSignal) != null ? _i : false,
26164
25754
  hostDirectives: convertHostDirectivesToMetadata(declaration)
26165
25755
  };
@@ -26461,7 +26051,7 @@ function publishFacade(global) {
26461
26051
  }
26462
26052
 
26463
26053
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
26464
- var VERSION2 = new Version("18.1.0-next.1");
26054
+ var VERSION2 = new Version("18.1.0-next.3");
26465
26055
 
26466
26056
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
26467
26057
  var _I18N_ATTR = "i18n";
@@ -27565,7 +27155,7 @@ var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
27565
27155
  function compileDeclareClassMetadata(metadata) {
27566
27156
  const definitionMap = new DefinitionMap();
27567
27157
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
27568
- definitionMap.set("version", literal("18.1.0-next.1"));
27158
+ definitionMap.set("version", literal("18.1.0-next.3"));
27569
27159
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27570
27160
  definitionMap.set("type", metadata.type);
27571
27161
  definitionMap.set("decorators", metadata.decorators);
@@ -27584,7 +27174,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
27584
27174
  callbackReturnDefinitionMap.set("ctorParameters", (_a2 = metadata.ctorParameters) != null ? _a2 : literal(null));
27585
27175
  callbackReturnDefinitionMap.set("propDecorators", (_b2 = metadata.propDecorators) != null ? _b2 : literal(null));
27586
27176
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
27587
- definitionMap.set("version", literal("18.1.0-next.1"));
27177
+ definitionMap.set("version", literal("18.1.0-next.3"));
27588
27178
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27589
27179
  definitionMap.set("type", metadata.type);
27590
27180
  definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
@@ -27652,7 +27242,7 @@ function createDirectiveDefinitionMap(meta) {
27652
27242
  const definitionMap = new DefinitionMap();
27653
27243
  const minVersion = getMinimumVersionForPartialOutput(meta);
27654
27244
  definitionMap.set("minVersion", literal(minVersion));
27655
- definitionMap.set("version", literal("18.1.0-next.1"));
27245
+ definitionMap.set("version", literal("18.1.0-next.3"));
27656
27246
  definitionMap.set("type", meta.type.value);
27657
27247
  if (meta.isStandalone) {
27658
27248
  definitionMap.set("isStandalone", literal(meta.isStandalone));
@@ -27970,7 +27560,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION2 = "12.0.0";
27970
27560
  function compileDeclareFactoryFunction(meta) {
27971
27561
  const definitionMap = new DefinitionMap();
27972
27562
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION2));
27973
- definitionMap.set("version", literal("18.1.0-next.1"));
27563
+ definitionMap.set("version", literal("18.1.0-next.3"));
27974
27564
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27975
27565
  definitionMap.set("type", meta.type.value);
27976
27566
  definitionMap.set("deps", compileDependencies(meta.deps));
@@ -27993,7 +27583,7 @@ function compileDeclareInjectableFromMetadata(meta) {
27993
27583
  function createInjectableDefinitionMap(meta) {
27994
27584
  const definitionMap = new DefinitionMap();
27995
27585
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
27996
- definitionMap.set("version", literal("18.1.0-next.1"));
27586
+ definitionMap.set("version", literal("18.1.0-next.3"));
27997
27587
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27998
27588
  definitionMap.set("type", meta.type.value);
27999
27589
  if (meta.providedIn !== void 0) {
@@ -28031,7 +27621,7 @@ function compileDeclareInjectorFromMetadata(meta) {
28031
27621
  function createInjectorDefinitionMap(meta) {
28032
27622
  const definitionMap = new DefinitionMap();
28033
27623
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
28034
- definitionMap.set("version", literal("18.1.0-next.1"));
27624
+ definitionMap.set("version", literal("18.1.0-next.3"));
28035
27625
  definitionMap.set("ngImport", importExpr(Identifiers.core));
28036
27626
  definitionMap.set("type", meta.type.value);
28037
27627
  definitionMap.set("providers", meta.providers);
@@ -28055,7 +27645,7 @@ function createNgModuleDefinitionMap(meta) {
28055
27645
  throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
28056
27646
  }
28057
27647
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
28058
- definitionMap.set("version", literal("18.1.0-next.1"));
27648
+ definitionMap.set("version", literal("18.1.0-next.3"));
28059
27649
  definitionMap.set("ngImport", importExpr(Identifiers.core));
28060
27650
  definitionMap.set("type", meta.type.value);
28061
27651
  if (meta.bootstrap.length > 0) {
@@ -28090,7 +27680,7 @@ function compileDeclarePipeFromMetadata(meta) {
28090
27680
  function createPipeDefinitionMap(meta) {
28091
27681
  const definitionMap = new DefinitionMap();
28092
27682
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
28093
- definitionMap.set("version", literal("18.1.0-next.1"));
27683
+ definitionMap.set("version", literal("18.1.0-next.3"));
28094
27684
  definitionMap.set("ngImport", importExpr(Identifiers.core));
28095
27685
  definitionMap.set("type", meta.type.value);
28096
27686
  if (meta.isStandalone) {
@@ -28107,7 +27697,7 @@ function createPipeDefinitionMap(meta) {
28107
27697
  publishFacade(_global);
28108
27698
 
28109
27699
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version.mjs
28110
- var VERSION3 = new Version("18.1.0-next.1");
27700
+ var VERSION3 = new Version("18.1.0-next.3");
28111
27701
 
28112
27702
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
28113
27703
  var import_typescript5 = __toESM(require("typescript"), 1);
@@ -32777,14 +32367,16 @@ var import_typescript38 = __toESM(require("typescript"), 1);
32777
32367
  var import_typescript34 = __toESM(require("typescript"), 1);
32778
32368
  function createGenerateUniqueIdentifierHelper() {
32779
32369
  const generatedIdentifiers = /* @__PURE__ */ new Set();
32370
+ const isGeneratedIdentifier = (sf, identifierName2) => generatedIdentifiers.has(`${sf.fileName}@@${identifierName2}`);
32371
+ const markIdentifierAsGenerated = (sf, identifierName2) => generatedIdentifiers.add(`${sf.fileName}@@${identifierName2}`);
32780
32372
  return (sourceFile, symbolName) => {
32781
32373
  const sf = sourceFile;
32782
32374
  if (sf.identifiers === void 0) {
32783
32375
  throw new Error("Source file unexpectedly lacks map of parsed `identifiers`.");
32784
32376
  }
32785
- const isUniqueIdentifier = (name2) => !sf.identifiers.has(name2) && !generatedIdentifiers.has(name2);
32377
+ const isUniqueIdentifier = (name2) => !sf.identifiers.has(name2) && !isGeneratedIdentifier(sf, name2);
32786
32378
  if (isUniqueIdentifier(symbolName)) {
32787
- generatedIdentifiers.add(symbolName);
32379
+ markIdentifierAsGenerated(sf, symbolName);
32788
32380
  return null;
32789
32381
  }
32790
32382
  let name = null;
@@ -32792,7 +32384,7 @@ function createGenerateUniqueIdentifierHelper() {
32792
32384
  do {
32793
32385
  name = `${symbolName}_${counter++}`;
32794
32386
  } while (!isUniqueIdentifier(name));
32795
- generatedIdentifiers.add(name);
32387
+ markIdentifierAsGenerated(sf, name);
32796
32388
  return import_typescript34.default.factory.createUniqueName(name, import_typescript34.default.GeneratedIdentifierFlags.Optimistic);
32797
32389
  };
32798
32390
  }
@@ -44122,18 +43714,16 @@ var TemplateTypeCheckerImpl = class {
44122
43714
  for (const tag of REGISTRY2.allKnownElementNames()) {
44123
43715
  tagMap.set(tag, null);
44124
43716
  }
44125
- const scope = this.getScopeData(component);
44126
- if (scope !== null) {
44127
- for (const directive of scope.directives) {
44128
- if (directive.selector === null) {
43717
+ const potentialDirectives = this.getPotentialTemplateDirectives(component);
43718
+ for (const directive of potentialDirectives) {
43719
+ if (directive.selector === null) {
43720
+ continue;
43721
+ }
43722
+ for (const selector of CssSelector.parse(directive.selector)) {
43723
+ if (selector.element === null || tagMap.has(selector.element)) {
44129
43724
  continue;
44130
43725
  }
44131
- for (const selector of CssSelector.parse(directive.selector)) {
44132
- if (selector.element === null || tagMap.has(selector.element)) {
44133
- continue;
44134
- }
44135
- tagMap.set(selector.element, directive);
44136
- }
43726
+ tagMap.set(selector.element, directive);
44137
43727
  }
44138
43728
  }
44139
43729
  this.elementTagCache.set(component, tagMap);
@@ -46217,17 +45807,20 @@ var FunctionExtractor = class {
46217
45807
  this.typeChecker = typeChecker;
46218
45808
  }
46219
45809
  extract() {
45810
+ var _a2;
46220
45811
  const signature = this.typeChecker.getSignatureFromDeclaration(this.declaration);
46221
45812
  const returnType = signature ? this.typeChecker.typeToString(this.typeChecker.getReturnTypeOfSignature(signature)) : "unknown";
45813
+ const jsdocsTags = extractJsDocTags(this.declaration);
46222
45814
  return {
46223
45815
  params: extractAllParams(this.declaration.parameters, this.typeChecker),
46224
45816
  name: this.name,
46225
45817
  isNewType: import_typescript100.default.isConstructSignatureDeclaration(this.declaration),
46226
45818
  returnType,
45819
+ returnDescription: (_a2 = jsdocsTags.find((tag) => tag.name === "returns")) == null ? void 0 : _a2.comment,
46227
45820
  entryType: EntryType.Function,
46228
45821
  generics: extractGenerics(this.declaration),
46229
45822
  description: extractJsDocDescription(this.declaration),
46230
- jsdocTags: extractJsDocTags(this.declaration),
45823
+ jsdocTags: jsdocsTags,
46231
45824
  rawComment: extractRawJsDoc(this.declaration)
46232
45825
  };
46233
45826
  }
@@ -51214,7 +50807,7 @@ function analyzeTestingModules(testObjects, typeChecker) {
51214
50807
  continue;
51215
50808
  }
51216
50809
  const importsProp = findLiteralProperty(obj, "imports");
51217
- const importElements = importsProp && hasNgModuleMetadataElements(importsProp) ? importsProp.initializer.elements.filter((el) => {
50810
+ const importElements = importsProp && hasNgModuleMetadataElements(importsProp) && import_typescript136.default.isArrayLiteralExpression(importsProp.initializer) ? importsProp.initializer.elements.filter((el) => {
51218
50811
  return !import_typescript136.default.isCallExpression(el) && !isClassReferenceInAngularModule(el, /^BrowserAnimationsModule|NoopAnimationsModule$/, "platform-browser/animations", typeChecker);
51219
50812
  }) : null;
51220
50813
  for (const decl of declarations) {
@@ -51241,7 +50834,7 @@ function analyzeTestingModules(testObjects, typeChecker) {
51241
50834
  function extractDeclarationsFromTestObject(obj, typeChecker) {
51242
50835
  const results = [];
51243
50836
  const declarations = findLiteralProperty(obj, "declarations");
51244
- if (declarations && hasNgModuleMetadataElements(declarations)) {
50837
+ if (declarations && hasNgModuleMetadataElements(declarations) && import_typescript136.default.isArrayLiteralExpression(declarations.initializer)) {
51245
50838
  for (const element2 of declarations.initializer.elements) {
51246
50839
  const declaration = findClassDeclaration(element2, typeChecker);
51247
50840
  if (declaration && declaration.getSourceFile().fileName === obj.getSourceFile().fileName) {