@angular/compiler-cli 17.3.1 → 17.3.2

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 (65) hide show
  1. package/bundles/{chunk-6X7GQ6BQ.js → chunk-6IQBXGRH.js} +591 -245
  2. package/bundles/chunk-6IQBXGRH.js.map +6 -0
  3. package/bundles/{chunk-3ESFLGKJ.js → chunk-7OQMTKOE.js} +254 -233
  4. package/bundles/chunk-7OQMTKOE.js.map +6 -0
  5. package/bundles/{chunk-OXIOYWLB.js → chunk-KP3UXB5C.js} +59 -57
  6. package/bundles/{chunk-OXIOYWLB.js.map → chunk-KP3UXB5C.js.map} +1 -1
  7. package/bundles/{chunk-VH6EDOMC.js → chunk-LHQ7WPU2.js} +2038 -858
  8. package/bundles/chunk-LHQ7WPU2.js.map +6 -0
  9. package/bundles/{chunk-F2QV65AH.js → chunk-VXEF7SDM.js} +2 -2
  10. package/bundles/{chunk-E5DF5SRS.js → chunk-ZS3FJJVW.js} +16 -16
  11. package/bundles/chunk-ZS3FJJVW.js.map +6 -0
  12. package/bundles/index.js +7 -5
  13. package/bundles/index.js.map +1 -1
  14. package/bundles/linker/babel/index.js +2 -2
  15. package/bundles/linker/index.js +2 -2
  16. package/bundles/private/migrations.js +2 -2
  17. package/bundles/private/tooling.js +3 -3
  18. package/bundles/src/bin/ng_xi18n.js +4 -4
  19. package/bundles/src/bin/ngc.js +4 -4
  20. package/bundles_metadata.json +1 -1
  21. package/index.d.ts +1 -0
  22. package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
  23. package/linker/src/file_linker/translator.d.ts +2 -2
  24. package/linker/src/linker_import_generator.d.ts +5 -5
  25. package/package.json +2 -2
  26. package/src/ngtsc/annotations/directive/index.d.ts +1 -0
  27. package/src/ngtsc/annotations/directive/src/initializer_function_access.d.ts +17 -0
  28. package/src/ngtsc/annotations/directive/src/initializer_functions.d.ts +10 -6
  29. package/src/ngtsc/annotations/directive/src/input_function.d.ts +1 -1
  30. package/src/ngtsc/annotations/directive/src/model_function.d.ts +1 -1
  31. package/src/ngtsc/annotations/directive/src/output_function.d.ts +1 -1
  32. package/src/ngtsc/annotations/directive/src/query_functions.d.ts +1 -1
  33. package/src/ngtsc/annotations/index.d.ts +1 -1
  34. package/src/ngtsc/diagnostics/src/error_code.d.ts +5 -0
  35. package/src/ngtsc/docs/src/entities.d.ts +36 -1
  36. package/src/ngtsc/docs/src/function_extractor.d.ts +3 -2
  37. package/src/ngtsc/docs/src/initializer_api_function_extractor.d.ts +24 -0
  38. package/src/ngtsc/imports/index.d.ts +1 -1
  39. package/src/ngtsc/imports/src/core.d.ts +0 -9
  40. package/src/ngtsc/imports/src/patch_alias_reference_resolution.d.ts +3 -1
  41. package/src/ngtsc/reflection/src/host.d.ts +13 -3
  42. package/src/ngtsc/reflection/src/typescript.d.ts +8 -1
  43. package/src/ngtsc/reflection/src/util.d.ts +6 -1
  44. package/src/ngtsc/transform/index.d.ts +0 -1
  45. package/src/ngtsc/transform/src/declaration.d.ts +1 -1
  46. package/src/ngtsc/translator/index.d.ts +2 -2
  47. package/src/ngtsc/translator/src/api/import_generator.d.ts +22 -10
  48. package/src/ngtsc/translator/src/import_manager/check_unique_identifier_name.d.ts +13 -0
  49. package/src/ngtsc/translator/src/import_manager/import_manager.d.ts +94 -0
  50. package/src/ngtsc/translator/src/import_manager/import_typescript_transform.d.ts +17 -0
  51. package/src/ngtsc/translator/src/import_manager/reuse_generated_imports.d.ts +32 -0
  52. package/src/ngtsc/translator/src/import_manager/reuse_source_file_imports.d.ts +38 -0
  53. package/src/ngtsc/translator/src/translator.d.ts +3 -2
  54. package/src/ngtsc/translator/src/type_translator.d.ts +1 -1
  55. package/src/ngtsc/translator/src/typescript_translator.d.ts +2 -2
  56. package/src/ngtsc/typecheck/src/reference_emit_environment.d.ts +1 -1
  57. package/src/ngtsc/typecheck/src/ts_util.d.ts +0 -2
  58. package/src/transformers/jit_transforms/initializer_api_transforms/transform_api.d.ts +4 -4
  59. package/bundles/chunk-3ESFLGKJ.js.map +0 -6
  60. package/bundles/chunk-6X7GQ6BQ.js.map +0 -6
  61. package/bundles/chunk-E5DF5SRS.js.map +0 -6
  62. package/bundles/chunk-VH6EDOMC.js.map +0 -6
  63. package/src/ngtsc/transform/src/utils.d.ts +0 -15
  64. package/src/ngtsc/translator/src/import_manager.d.ts +0 -47
  65. /package/bundles/{chunk-F2QV65AH.js.map → chunk-VXEF7SDM.js.map} +0 -0
@@ -39,7 +39,7 @@ import {
39
39
  declarationTransformFactory,
40
40
  isHostDirectiveMetaForGlobalMode,
41
41
  ivyTransformFactory
42
- } from "./chunk-3ESFLGKJ.js";
42
+ } from "./chunk-7OQMTKOE.js";
43
43
  import {
44
44
  AbsoluteModuleStrategy,
45
45
  AliasStrategy,
@@ -89,7 +89,7 @@ import {
89
89
  toUnredirectedSourceFile,
90
90
  translateExpression,
91
91
  translateType
92
- } from "./chunk-6X7GQ6BQ.js";
92
+ } from "./chunk-6IQBXGRH.js";
93
93
  import {
94
94
  ActivePerfRecorder,
95
95
  DelegatingPerfRecorder,
@@ -152,6 +152,7 @@ var EntryType;
152
152
  EntryType2["Pipe"] = "pipe";
153
153
  EntryType2["TypeAlias"] = "type_alias";
154
154
  EntryType2["UndecoratedClass"] = "undecorated_class";
155
+ EntryType2["InitializerApiFunction"] = "initializer_api_function";
155
156
  })(EntryType || (EntryType = {}));
156
157
  var MemberType;
157
158
  (function(MemberType2) {
@@ -179,284 +180,11 @@ var MemberTags;
179
180
  MemberTags2["Inherited"] = "override";
180
181
  })(MemberTags || (MemberTags = {}));
181
182
 
182
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
183
- import { HtmlParser, MessageBundle } from "@angular/compiler";
184
- import ts40 from "typescript";
185
-
186
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
187
- import { Xliff, Xliff2, Xmb } from "@angular/compiler";
188
- import * as path from "path";
189
- function i18nGetExtension(formatName) {
190
- const format = formatName.toLowerCase();
191
- switch (format) {
192
- case "xmb":
193
- return "xmb";
194
- case "xlf":
195
- case "xlif":
196
- case "xliff":
197
- case "xlf2":
198
- case "xliff2":
199
- return "xlf";
200
- }
201
- throw new Error(`Unsupported format "${formatName}"`);
202
- }
203
- function i18nExtract(formatName, outFile, host, options, bundle, pathResolve = path.resolve) {
204
- formatName = formatName || "xlf";
205
- const ext = i18nGetExtension(formatName);
206
- const content = i18nSerialize(bundle, formatName, options);
207
- const dstFile = outFile || `messages.${ext}`;
208
- const dstPath = pathResolve(options.outDir || options.basePath, dstFile);
209
- host.writeFile(dstPath, content, false, void 0, []);
210
- return [dstPath];
211
- }
212
- function i18nSerialize(bundle, formatName, options) {
213
- const format = formatName.toLowerCase();
214
- let serializer;
215
- switch (format) {
216
- case "xmb":
217
- serializer = new Xmb();
218
- break;
219
- case "xliff2":
220
- case "xlf2":
221
- serializer = new Xliff2();
222
- break;
223
- case "xlf":
224
- case "xliff":
225
- default:
226
- serializer = new Xliff();
227
- }
228
- return bundle.write(serializer, getPathNormalizer(options.basePath));
229
- }
230
- function getPathNormalizer(basePath) {
231
- return (sourcePath) => {
232
- sourcePath = basePath ? path.relative(basePath, sourcePath) : sourcePath;
233
- return sourcePath.split(path.sep).join("/");
234
- };
235
- }
236
-
237
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
238
- import ts2 from "typescript";
239
-
240
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version_helpers.mjs
241
- function toNumbers(value) {
242
- const suffixIndex = value.lastIndexOf("-");
243
- return value.slice(0, suffixIndex === -1 ? value.length : suffixIndex).split(".").map((segment) => {
244
- const parsed = parseInt(segment, 10);
245
- if (isNaN(parsed)) {
246
- throw Error(`Unable to parse version string ${value}.`);
247
- }
248
- return parsed;
249
- });
250
- }
251
- function compareNumbers(a, b) {
252
- const max = Math.max(a.length, b.length);
253
- const min = Math.min(a.length, b.length);
254
- for (let i = 0; i < min; i++) {
255
- if (a[i] > b[i])
256
- return 1;
257
- if (a[i] < b[i])
258
- return -1;
259
- }
260
- if (min !== max) {
261
- const longestArray = a.length === max ? a : b;
262
- const comparisonResult = a.length === max ? 1 : -1;
263
- for (let i = min; i < max; i++) {
264
- if (longestArray[i] > 0) {
265
- return comparisonResult;
266
- }
267
- }
268
- }
269
- return 0;
270
- }
271
- function compareVersions(v1, v2) {
272
- return compareNumbers(toNumbers(v1), toNumbers(v2));
273
- }
274
-
275
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
276
- var MIN_TS_VERSION = "5.2.0";
277
- var MAX_TS_VERSION = "5.5.0";
278
- var tsVersion = ts2.version;
279
- function checkVersion(version, minVersion, maxVersion) {
280
- if (compareVersions(version, minVersion) < 0 || compareVersions(version, maxVersion) >= 0) {
281
- throw new Error(`The Angular Compiler requires TypeScript >=${minVersion} and <${maxVersion} but ${version} was found instead.`);
282
- }
283
- }
284
- function verifySupportedTypeScriptVersion() {
285
- checkVersion(tsVersion, MIN_TS_VERSION, MAX_TS_VERSION);
286
- }
287
-
288
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
289
- import { R3Identifiers as R3Identifiers5 } from "@angular/compiler";
290
- import ts38 from "typescript";
291
-
292
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
293
- var CycleAnalyzer = class {
294
- constructor(importGraph) {
295
- this.importGraph = importGraph;
296
- this.cachedResults = null;
297
- }
298
- wouldCreateCycle(from, to) {
299
- if (this.cachedResults === null || this.cachedResults.from !== from) {
300
- this.cachedResults = new CycleResults(from, this.importGraph);
301
- }
302
- return this.cachedResults.wouldBeCyclic(to) ? new Cycle(this.importGraph, from, to) : null;
303
- }
304
- recordSyntheticImport(from, to) {
305
- this.cachedResults = null;
306
- this.importGraph.addSyntheticImport(from, to);
307
- }
308
- };
309
- var NgCyclicResult = Symbol("NgCyclicResult");
310
- var CycleResults = class {
311
- constructor(from, importGraph) {
312
- this.from = from;
313
- this.importGraph = importGraph;
314
- this.cyclic = {};
315
- this.acyclic = {};
316
- }
317
- wouldBeCyclic(sf) {
318
- const cached = this.getCachedResult(sf);
319
- if (cached !== null) {
320
- return cached;
321
- }
322
- if (sf === this.from) {
323
- return true;
324
- }
325
- this.markAcyclic(sf);
326
- const imports = this.importGraph.importsOf(sf);
327
- for (const imported of imports) {
328
- if (this.wouldBeCyclic(imported)) {
329
- this.markCyclic(sf);
330
- return true;
331
- }
332
- }
333
- return false;
334
- }
335
- getCachedResult(sf) {
336
- const result = sf[NgCyclicResult];
337
- if (result === this.cyclic) {
338
- return true;
339
- } else if (result === this.acyclic) {
340
- return false;
341
- } else {
342
- return null;
343
- }
344
- }
345
- markCyclic(sf) {
346
- sf[NgCyclicResult] = this.cyclic;
347
- }
348
- markAcyclic(sf) {
349
- sf[NgCyclicResult] = this.acyclic;
350
- }
351
- };
352
- var Cycle = class {
353
- constructor(importGraph, from, to) {
354
- this.importGraph = importGraph;
355
- this.from = from;
356
- this.to = to;
357
- }
358
- getPath() {
359
- return [this.from, ...this.importGraph.findPath(this.to, this.from)];
360
- }
361
- };
362
-
363
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/imports.mjs
364
- import ts3 from "typescript";
365
- var ImportGraph = class {
366
- constructor(checker, perf) {
367
- this.checker = checker;
368
- this.perf = perf;
369
- this.imports = /* @__PURE__ */ new Map();
370
- }
371
- importsOf(sf) {
372
- if (!this.imports.has(sf)) {
373
- this.imports.set(sf, this.scanImports(sf));
374
- }
375
- return this.imports.get(sf);
376
- }
377
- findPath(start, end) {
378
- if (start === end) {
379
- return [start];
380
- }
381
- const found = /* @__PURE__ */ new Set([start]);
382
- const queue = [new Found(start, null)];
383
- while (queue.length > 0) {
384
- const current = queue.shift();
385
- const imports = this.importsOf(current.sourceFile);
386
- for (const importedFile of imports) {
387
- if (!found.has(importedFile)) {
388
- const next = new Found(importedFile, current);
389
- if (next.sourceFile === end) {
390
- return next.toPath();
391
- }
392
- found.add(importedFile);
393
- queue.push(next);
394
- }
395
- }
396
- }
397
- return null;
398
- }
399
- addSyntheticImport(sf, imported) {
400
- if (isLocalFile(imported)) {
401
- this.importsOf(sf).add(imported);
402
- }
403
- }
404
- scanImports(sf) {
405
- return this.perf.inPhase(PerfPhase.CycleDetection, () => {
406
- const imports = /* @__PURE__ */ new Set();
407
- for (const stmt of sf.statements) {
408
- if (!ts3.isImportDeclaration(stmt) && !ts3.isExportDeclaration(stmt) || stmt.moduleSpecifier === void 0) {
409
- continue;
410
- }
411
- if (ts3.isImportDeclaration(stmt) && stmt.importClause !== void 0 && isTypeOnlyImportClause(stmt.importClause)) {
412
- continue;
413
- }
414
- const symbol = this.checker.getSymbolAtLocation(stmt.moduleSpecifier);
415
- if (symbol === void 0 || symbol.valueDeclaration === void 0) {
416
- continue;
417
- }
418
- const moduleFile = symbol.valueDeclaration;
419
- if (ts3.isSourceFile(moduleFile) && isLocalFile(moduleFile)) {
420
- imports.add(moduleFile);
421
- }
422
- }
423
- return imports;
424
- });
425
- }
426
- };
427
- function isLocalFile(sf) {
428
- return !sf.isDeclarationFile;
429
- }
430
- function isTypeOnlyImportClause(node) {
431
- if (node.isTypeOnly) {
432
- return true;
433
- }
434
- if (node.namedBindings !== void 0 && ts3.isNamedImports(node.namedBindings) && node.namedBindings.elements.every((specifier) => specifier.isTypeOnly)) {
435
- return true;
436
- }
437
- return false;
438
- }
439
- var Found = class {
440
- constructor(sourceFile, parent) {
441
- this.sourceFile = sourceFile;
442
- this.parent = parent;
443
- }
444
- toPath() {
445
- const array = [];
446
- let current = this;
447
- while (current !== null) {
448
- array.push(current.sourceFile);
449
- current = current.parent;
450
- }
451
- return array.reverse();
452
- }
453
- };
454
-
455
183
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/extractor.mjs
456
- import ts10 from "typescript";
184
+ import ts9 from "typescript";
457
185
 
458
186
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/class_extractor.mjs
459
- import ts6 from "typescript";
187
+ import ts4 from "typescript";
460
188
 
461
189
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/filters.mjs
462
190
  function isAngularPrivateName(name) {
@@ -466,7 +194,7 @@ function isAngularPrivateName(name) {
466
194
  }
467
195
 
468
196
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/function_extractor.mjs
469
- import ts5 from "typescript";
197
+ import ts3 from "typescript";
470
198
 
471
199
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/generics_extractor.mjs
472
200
  function extractGenerics(declaration) {
@@ -482,41 +210,41 @@ function extractGenerics(declaration) {
482
210
  }
483
211
 
484
212
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/jsdoc_extractor.mjs
485
- import ts4 from "typescript";
213
+ import ts2 from "typescript";
486
214
  var decoratorExpression = /@(?=(Injectable|Component|Directive|Pipe|NgModule|Input|Output|HostBinding|HostListener|Inject|Optional|Self|Host|SkipSelf))/g;
487
215
  function extractJsDocTags(node) {
488
216
  const escapedNode = getEscapedNode(node);
489
- return ts4.getJSDocTags(escapedNode).map((t) => {
217
+ return ts2.getJSDocTags(escapedNode).map((t) => {
490
218
  var _a;
491
219
  return {
492
220
  name: t.tagName.getText(),
493
- comment: unescapeAngularDecorators((_a = ts4.getTextOfJSDocComment(t.comment)) != null ? _a : "")
221
+ comment: unescapeAngularDecorators((_a = ts2.getTextOfJSDocComment(t.comment)) != null ? _a : "")
494
222
  };
495
223
  });
496
224
  }
497
225
  function extractJsDocDescription(node) {
498
226
  var _a, _b;
499
227
  const escapedNode = getEscapedNode(node);
500
- const commentOrTag = ts4.getJSDocCommentsAndTags(escapedNode).find((d) => {
501
- return ts4.isJSDoc(d) || ts4.isJSDocParameterTag(d);
228
+ const commentOrTag = ts2.getJSDocCommentsAndTags(escapedNode).find((d) => {
229
+ return ts2.isJSDoc(d) || ts2.isJSDocParameterTag(d);
502
230
  });
503
231
  const comment = (_a = commentOrTag == null ? void 0 : commentOrTag.comment) != null ? _a : "";
504
- const description = typeof comment === "string" ? comment : (_b = ts4.getTextOfJSDocComment(comment)) != null ? _b : "";
232
+ const description = typeof comment === "string" ? comment : (_b = ts2.getTextOfJSDocComment(comment)) != null ? _b : "";
505
233
  return unescapeAngularDecorators(description);
506
234
  }
507
235
  function extractRawJsDoc(node) {
508
236
  var _a, _b;
509
- const comment = (_b = (_a = ts4.getJSDocCommentsAndTags(node).find(ts4.isJSDoc)) == null ? void 0 : _a.getFullText()) != null ? _b : "";
237
+ const comment = (_b = (_a = ts2.getJSDocCommentsAndTags(node).find(ts2.isJSDoc)) == null ? void 0 : _a.getFullText()) != null ? _b : "";
510
238
  return unescapeAngularDecorators(comment);
511
239
  }
512
240
  function getEscapedNode(node) {
513
- if (ts4.isParameter(node)) {
241
+ if (ts2.isParameter(node)) {
514
242
  return node;
515
243
  }
516
244
  const rawComment = extractRawJsDoc(node);
517
245
  const escaped = escapeAngularDecorators(rawComment);
518
- const file = ts4.createSourceFile("x.ts", `${escaped}class X {}`, ts4.ScriptTarget.ES2020, true);
519
- return file.statements.find((s) => ts4.isClassDeclaration(s));
246
+ const file = ts2.createSourceFile("x.ts", `${escaped}class X {}`, ts2.ScriptTarget.ES2020, true);
247
+ return file.statements.find((s) => ts2.isClassDeclaration(s));
520
248
  }
521
249
  function escapeAngularDecorators(comment) {
522
250
  return comment.replace(decoratorExpression, "_NG_AT_");
@@ -541,9 +269,9 @@ var FunctionExtractor = class {
541
269
  const signature = this.typeChecker.getSignatureFromDeclaration(this.declaration);
542
270
  const returnType = signature ? this.typeChecker.typeToString(this.typeChecker.getReturnTypeOfSignature(signature)) : "unknown";
543
271
  return {
544
- params: this.extractAllParams(this.declaration.parameters),
272
+ params: extractAllParams(this.declaration.parameters, this.typeChecker),
545
273
  name: this.name,
546
- isNewType: ts5.isConstructSignatureDeclaration(this.declaration),
274
+ isNewType: ts3.isConstructSignatureDeclaration(this.declaration),
547
275
  returnType,
548
276
  entryType: EntryType.Function,
549
277
  generics: extractGenerics(this.declaration),
@@ -552,15 +280,6 @@ var FunctionExtractor = class {
552
280
  rawComment: extractRawJsDoc(this.declaration)
553
281
  };
554
282
  }
555
- extractAllParams(params) {
556
- return params.map((param) => ({
557
- name: param.name.getText(),
558
- description: extractJsDocDescription(param),
559
- type: extractResolvedTypeString(param, this.typeChecker),
560
- isOptional: !!(param.questionToken || param.initializer),
561
- isRestParam: !!param.dotDotDotToken
562
- }));
563
- }
564
283
  getOverloads() {
565
284
  var _a, _b, _c, _d;
566
285
  const overloads = [];
@@ -571,7 +290,7 @@ var FunctionExtractor = class {
571
290
  const overloadDeclaration = (_c = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _c[i];
572
291
  if ((overloadDeclaration == null ? void 0 : overloadDeclaration.pos) === this.declaration.pos)
573
292
  continue;
574
- if (overloadDeclaration && ts5.isFunctionDeclaration(overloadDeclaration) && ((_d = overloadDeclaration.modifiers) == null ? void 0 : _d.some((mod) => mod.kind === ts5.SyntaxKind.ExportKeyword))) {
293
+ if (overloadDeclaration && ts3.isFunctionDeclaration(overloadDeclaration) && ((_d = overloadDeclaration.modifiers) == null ? void 0 : _d.some((mod) => mod.kind === ts3.SyntaxKind.ExportKeyword))) {
575
294
  overloads.push(overloadDeclaration);
576
295
  }
577
296
  }
@@ -579,12 +298,21 @@ var FunctionExtractor = class {
579
298
  return overloads;
580
299
  }
581
300
  getSymbol() {
582
- return this.typeChecker.getSymbolsInScope(this.declaration, ts5.SymbolFlags.Function).find((s) => {
301
+ return this.typeChecker.getSymbolsInScope(this.declaration, ts3.SymbolFlags.Function).find((s) => {
583
302
  var _a;
584
303
  return s.name === ((_a = this.declaration.name) == null ? void 0 : _a.getText());
585
304
  });
586
305
  }
587
306
  };
307
+ function extractAllParams(params, typeChecker) {
308
+ return params.map((param) => ({
309
+ name: param.name.getText(),
310
+ description: extractJsDocDescription(param),
311
+ type: extractResolvedTypeString(param, typeChecker),
312
+ isOptional: !!(param.questionToken || param.initializer),
313
+ isRestParam: !!param.dotDotDotToken
314
+ }));
315
+ }
588
316
 
589
317
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/class_extractor.mjs
590
318
  var ClassExtractor = class {
@@ -596,7 +324,7 @@ var ClassExtractor = class {
596
324
  return {
597
325
  name: this.declaration.name.text,
598
326
  isAbstract: this.isAbstract(),
599
- entryType: ts6.isInterfaceDeclaration(this.declaration) ? EntryType.Interface : EntryType.UndecoratedClass,
327
+ entryType: ts4.isInterfaceDeclaration(this.declaration) ? EntryType.Interface : EntryType.UndecoratedClass,
600
328
  members: this.extractSignatures().concat(this.extractAllClassMembers()),
601
329
  generics: extractGenerics(this.declaration),
602
330
  description: extractJsDocDescription(this.declaration),
@@ -621,7 +349,7 @@ var ClassExtractor = class {
621
349
  return this.extractMethod(memberDeclaration);
622
350
  } else if (this.isProperty(memberDeclaration)) {
623
351
  return this.extractClassProperty(memberDeclaration);
624
- } else if (ts6.isAccessor(memberDeclaration)) {
352
+ } else if (ts4.isAccessor(memberDeclaration)) {
625
353
  return this.extractGetterSetter(memberDeclaration);
626
354
  }
627
355
  return void 0;
@@ -638,7 +366,7 @@ var ClassExtractor = class {
638
366
  };
639
367
  }
640
368
  extractSignature(signature) {
641
- const functionExtractor = new FunctionExtractor(ts6.isConstructSignatureDeclaration(signature) ? "new" : "", signature, this.typeChecker);
369
+ const functionExtractor = new FunctionExtractor(ts4.isConstructSignatureDeclaration(signature) ? "new" : "", signature, this.typeChecker);
642
370
  return {
643
371
  ...functionExtractor.extract(),
644
372
  memberType: MemberType.Method,
@@ -658,7 +386,7 @@ var ClassExtractor = class {
658
386
  extractGetterSetter(accessor) {
659
387
  return {
660
388
  ...this.extractClassProperty(accessor),
661
- memberType: ts6.isGetAccessor(accessor) ? MemberType.Getter : MemberType.Setter
389
+ memberType: ts4.isGetAccessor(accessor) ? MemberType.Getter : MemberType.Setter
662
390
  };
663
391
  }
664
392
  getMemberTags(member) {
@@ -715,13 +443,13 @@ var ClassExtractor = class {
715
443
  }
716
444
  getTagForMemberModifier(mod) {
717
445
  switch (mod.kind) {
718
- case ts6.SyntaxKind.StaticKeyword:
446
+ case ts4.SyntaxKind.StaticKeyword:
719
447
  return MemberTags.Static;
720
- case ts6.SyntaxKind.ReadonlyKeyword:
448
+ case ts4.SyntaxKind.ReadonlyKeyword:
721
449
  return MemberTags.Readonly;
722
- case ts6.SyntaxKind.ProtectedKeyword:
450
+ case ts4.SyntaxKind.ProtectedKeyword:
723
451
  return MemberTags.Protected;
724
- case ts6.SyntaxKind.AbstractKeyword:
452
+ case ts4.SyntaxKind.AbstractKeyword:
725
453
  return MemberTags.Abstract;
726
454
  default:
727
455
  return void 0;
@@ -729,27 +457,27 @@ var ClassExtractor = class {
729
457
  }
730
458
  isMemberExcluded(member) {
731
459
  var _a;
732
- return !member.name || !this.isDocumentableMember(member) || !!((_a = member.modifiers) == null ? void 0 : _a.some((mod) => mod.kind === ts6.SyntaxKind.PrivateKeyword)) || member.name.getText() === "prototype" || isAngularPrivateName(member.name.getText());
460
+ return !member.name || !this.isDocumentableMember(member) || !!((_a = member.modifiers) == null ? void 0 : _a.some((mod) => mod.kind === ts4.SyntaxKind.PrivateKeyword)) || member.name.getText() === "prototype" || isAngularPrivateName(member.name.getText());
733
461
  }
734
462
  isDocumentableMember(member) {
735
- return this.isMethod(member) || this.isProperty(member) || ts6.isAccessor(member);
463
+ return this.isMethod(member) || this.isProperty(member) || ts4.isAccessor(member);
736
464
  }
737
465
  isProperty(member) {
738
- return ts6.isPropertyDeclaration(member) || ts6.isPropertySignature(member);
466
+ return ts4.isPropertyDeclaration(member) || ts4.isPropertySignature(member);
739
467
  }
740
468
  isMethod(member) {
741
- return ts6.isMethodDeclaration(member) || ts6.isMethodSignature(member);
469
+ return ts4.isMethodDeclaration(member) || ts4.isMethodSignature(member);
742
470
  }
743
471
  isDocumentableSignature(signature) {
744
- return ts6.isConstructSignatureDeclaration(signature) || ts6.isCallSignatureDeclaration(signature);
472
+ return ts4.isConstructSignatureDeclaration(signature) || ts4.isCallSignatureDeclaration(signature);
745
473
  }
746
474
  isAbstract() {
747
475
  var _a;
748
476
  const modifiers = (_a = this.declaration.modifiers) != null ? _a : [];
749
- return modifiers.some((mod) => mod.kind === ts6.SyntaxKind.AbstractKeyword);
477
+ return modifiers.some((mod) => mod.kind === ts4.SyntaxKind.AbstractKeyword);
750
478
  }
751
479
  isImplementationForOverload(method) {
752
- if (method.kind === ts6.SyntaxKind.MethodSignature)
480
+ if (method.kind === ts4.SyntaxKind.MethodSignature)
753
481
  return false;
754
482
  const signature = this.typeChecker.getSignatureFromDeclaration(method);
755
483
  return signature && this.typeChecker.isImplementationOfOverload(signature.declaration);
@@ -848,7 +576,7 @@ function extractInterface(declaration, typeChecker) {
848
576
  }
849
577
 
850
578
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/constant_extractor.mjs
851
- import ts7 from "typescript";
579
+ import ts5 from "typescript";
852
580
  var LITERAL_AS_ENUM_TAG = "object-literal-as-enum";
853
581
  function extractConstant(declaration, typeChecker) {
854
582
  const resolvedType = typeChecker.getBaseTypeOfLiteralType(typeChecker.getTypeAtLocation(declaration));
@@ -880,17 +608,17 @@ function isSyntheticAngularConstant(declaration) {
880
608
  }
881
609
  function extractLiteralPropertiesAsEnumMembers(declaration) {
882
610
  let initializer = declaration.initializer;
883
- while (initializer && (ts7.isAsExpression(initializer) || ts7.isParenthesizedExpression(initializer))) {
611
+ while (initializer && (ts5.isAsExpression(initializer) || ts5.isParenthesizedExpression(initializer))) {
884
612
  initializer = initializer.expression;
885
613
  }
886
- if (initializer === void 0 || !ts7.isObjectLiteralExpression(initializer)) {
887
- throw new Error(`Declaration tagged with "${LITERAL_AS_ENUM_TAG}" must be initialized to an object literal, but received ${initializer ? ts7.SyntaxKind[initializer.kind] : "undefined"}`);
614
+ if (initializer === void 0 || !ts5.isObjectLiteralExpression(initializer)) {
615
+ throw new Error(`Declaration tagged with "${LITERAL_AS_ENUM_TAG}" must be initialized to an object literal, but received ${initializer ? ts5.SyntaxKind[initializer.kind] : "undefined"}`);
888
616
  }
889
617
  return initializer.properties.map((prop) => {
890
- if (!ts7.isPropertyAssignment(prop) || !ts7.isIdentifier(prop.name)) {
618
+ if (!ts5.isPropertyAssignment(prop) || !ts5.isIdentifier(prop.name)) {
891
619
  throw new Error(`Property in declaration tagged with "${LITERAL_AS_ENUM_TAG}" must be a property assignment with a static name`);
892
620
  }
893
- if (!ts7.isNumericLiteral(prop.initializer) && !ts7.isStringLiteralLike(prop.initializer)) {
621
+ if (!ts5.isNumericLiteral(prop.initializer) && !ts5.isStringLiteralLike(prop.initializer)) {
894
622
  throw new Error(`Property in declaration tagged with "${LITERAL_AS_ENUM_TAG}" must be initialized to a number or string literal`);
895
623
  }
896
624
  return {
@@ -906,7 +634,7 @@ function extractLiteralPropertiesAsEnumMembers(declaration) {
906
634
  }
907
635
 
908
636
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/decorator_extractor.mjs
909
- import ts8 from "typescript";
637
+ import ts6 from "typescript";
910
638
  function extractorDecorator(declaration, typeChecker) {
911
639
  const documentedNode = getDecoratorJsDocNode(declaration);
912
640
  const decoratorType = getDecoratorType(declaration);
@@ -927,7 +655,7 @@ function isDecoratorDeclaration(declaration) {
927
655
  return !!getDecoratorType(declaration);
928
656
  }
929
657
  function isDecoratorOptionsInterface(declaration) {
930
- return declaration.getSourceFile().statements.some((s) => ts8.isVariableStatement(s) && s.declarationList.declarations.some((d) => isDecoratorDeclaration(d) && d.name.getText() === declaration.name.getText()));
658
+ return declaration.getSourceFile().statements.some((s) => ts6.isVariableStatement(s) && s.declarationList.declarations.some((d) => isDecoratorDeclaration(d) && d.name.getText() === declaration.name.getText()));
931
659
  }
932
660
  function getDecoratorType(declaration) {
933
661
  var _a, _b;
@@ -944,19 +672,19 @@ function getDecoratorOptions(declaration, typeChecker) {
944
672
  var _a, _b;
945
673
  const name = declaration.name.getText();
946
674
  const optionsDeclaration = declaration.getSourceFile().statements.find((node) => {
947
- return (ts8.isInterfaceDeclaration(node) || ts8.isTypeAliasDeclaration(node)) && node.name.getText() === name;
675
+ return (ts6.isInterfaceDeclaration(node) || ts6.isTypeAliasDeclaration(node)) && node.name.getText() === name;
948
676
  });
949
677
  if (!optionsDeclaration) {
950
678
  throw new Error(`Decorator "${name}" has no corresponding options interface.`);
951
679
  }
952
680
  let optionsInterface;
953
- if (ts8.isTypeAliasDeclaration(optionsDeclaration)) {
681
+ if (ts6.isTypeAliasDeclaration(optionsDeclaration)) {
954
682
  const aliasedType = typeChecker.getTypeAtLocation(optionsDeclaration.type);
955
- optionsInterface = ((_b = (_a = aliasedType.getSymbol()) == null ? void 0 : _a.getDeclarations()) != null ? _b : []).find((d) => ts8.isInterfaceDeclaration(d));
683
+ optionsInterface = ((_b = (_a = aliasedType.getSymbol()) == null ? void 0 : _a.getDeclarations()) != null ? _b : []).find((d) => ts6.isInterfaceDeclaration(d));
956
684
  } else {
957
685
  optionsInterface = optionsDeclaration;
958
686
  }
959
- if (!optionsInterface || !ts8.isInterfaceDeclaration(optionsInterface)) {
687
+ if (!optionsInterface || !ts6.isInterfaceDeclaration(optionsInterface)) {
960
688
  throw new Error(`Options for decorator "${name}" is not an interface.`);
961
689
  }
962
690
  return extractInterface(optionsInterface, typeChecker).members;
@@ -964,127 +692,548 @@ function getDecoratorOptions(declaration, typeChecker) {
964
692
  function getDecoratorJsDocNode(declaration) {
965
693
  const name = declaration.name.getText();
966
694
  const decoratorInterface = declaration.getSourceFile().statements.find((s) => {
967
- return ts8.isInterfaceDeclaration(s) && s.name.getText() === `${name}Decorator`;
695
+ return ts6.isInterfaceDeclaration(s) && s.name.getText() === `${name}Decorator`;
968
696
  });
969
- if (!decoratorInterface || !ts8.isInterfaceDeclaration(decoratorInterface)) {
697
+ if (!decoratorInterface || !ts6.isInterfaceDeclaration(decoratorInterface)) {
970
698
  throw new Error(`No interface "${name}Decorator" found.`);
971
699
  }
972
700
  const callSignature = decoratorInterface.members.find((node) => {
973
- return ts8.isCallSignatureDeclaration(node) && extractRawJsDoc(node);
701
+ return ts6.isCallSignatureDeclaration(node) && extractRawJsDoc(node);
974
702
  });
975
- if (!callSignature || !ts8.isCallSignatureDeclaration(callSignature)) {
703
+ if (!callSignature || !ts6.isCallSignatureDeclaration(callSignature)) {
976
704
  throw new Error(`No call signature with JsDoc on "${name}Decorator"`);
977
705
  }
978
- return callSignature;
706
+ return callSignature;
707
+ }
708
+
709
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/enum_extractor.mjs
710
+ import ts7 from "typescript";
711
+ function extractEnum(declaration, typeChecker) {
712
+ return {
713
+ name: declaration.name.getText(),
714
+ entryType: EntryType.Enum,
715
+ members: extractEnumMembers(declaration, typeChecker),
716
+ rawComment: extractRawJsDoc(declaration),
717
+ description: extractJsDocDescription(declaration),
718
+ jsdocTags: extractJsDocTags(declaration)
719
+ };
720
+ }
721
+ function extractEnumMembers(declaration, checker) {
722
+ return declaration.members.map((member) => ({
723
+ name: member.name.getText(),
724
+ type: extractResolvedTypeString(member, checker),
725
+ value: getEnumMemberValue(member),
726
+ memberType: MemberType.EnumItem,
727
+ jsdocTags: extractJsDocTags(member),
728
+ description: extractJsDocDescription(member),
729
+ memberTags: []
730
+ }));
731
+ }
732
+ function getEnumMemberValue(memberNode) {
733
+ var _a;
734
+ const literal = memberNode.getChildren().find((n2) => {
735
+ return ts7.isNumericLiteral(n2) || ts7.isStringLiteral(n2) || ts7.isPrefixUnaryExpression(n2) && n2.operator === ts7.SyntaxKind.MinusToken && ts7.isNumericLiteral(n2.operand);
736
+ });
737
+ return (_a = literal == null ? void 0 : literal.getText()) != null ? _a : "";
738
+ }
739
+
740
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/initializer_api_function_extractor.mjs
741
+ import ts8 from "typescript";
742
+ var initializerApiTag = "initializerApiFunction";
743
+ function isInitializerApiFunction(node, typeChecker) {
744
+ if (ts8.isFunctionDeclaration(node) && node.name !== void 0 && node.body === void 0) {
745
+ const implementation = findImplementationOfFunction(node, typeChecker);
746
+ if (implementation !== void 0) {
747
+ node = implementation;
748
+ }
749
+ }
750
+ if (!ts8.isFunctionDeclaration(node) && !ts8.isVariableDeclaration(node)) {
751
+ return false;
752
+ }
753
+ let tagContainer = ts8.isFunctionDeclaration(node) ? node : getContainerVariableStatement(node);
754
+ if (tagContainer === null) {
755
+ return false;
756
+ }
757
+ const tags = ts8.getJSDocTags(tagContainer);
758
+ return tags.some((t) => t.tagName.text === initializerApiTag);
759
+ }
760
+ function extractInitializerApiFunction(node, typeChecker) {
761
+ var _a;
762
+ if (node.name === void 0 || !ts8.isIdentifier(node.name)) {
763
+ throw new Error(`Initializer API: Expected literal variable name.`);
764
+ }
765
+ const container = ts8.isFunctionDeclaration(node) ? node : getContainerVariableStatement(node);
766
+ if (container === null) {
767
+ throw new Error("Initializer API: Could not find container AST node of variable.");
768
+ }
769
+ const name = node.name.text;
770
+ const type = typeChecker.getTypeAtLocation(node);
771
+ const callFunction = extractFunctionWithOverloads(name, type.getCallSignatures(), typeChecker);
772
+ const subFunctions = [];
773
+ for (const property of type.getProperties()) {
774
+ const subName = property.getName();
775
+ const subDecl = (_a = property.getDeclarations()) == null ? void 0 : _a[0];
776
+ if (subDecl === void 0 || !ts8.isPropertySignature(subDecl)) {
777
+ throw new Error(`Initializer API: Could not resolve declaration of sub-property: ${name}.${subName}`);
778
+ }
779
+ const subType = typeChecker.getTypeAtLocation(subDecl);
780
+ subFunctions.push(extractFunctionWithOverloads(subName, subType.getCallSignatures(), typeChecker));
781
+ }
782
+ let jsdocTags;
783
+ let description;
784
+ let rawComment;
785
+ if (ts8.isFunctionDeclaration(node)) {
786
+ const implementation = findImplementationOfFunction(node, typeChecker);
787
+ if (implementation === void 0) {
788
+ throw new Error(`Initializer API: Could not find implementation of function: ${name}`);
789
+ }
790
+ callFunction.implementation = {
791
+ name,
792
+ entryType: EntryType.Function,
793
+ isNewType: false,
794
+ description: extractJsDocDescription(implementation),
795
+ generics: extractGenerics(implementation),
796
+ jsdocTags: extractJsDocTags(implementation),
797
+ params: extractAllParams(implementation.parameters, typeChecker),
798
+ rawComment: extractRawJsDoc(implementation),
799
+ returnType: typeChecker.typeToString(typeChecker.getReturnTypeOfSignature(typeChecker.getSignatureFromDeclaration(implementation)))
800
+ };
801
+ jsdocTags = callFunction.implementation.jsdocTags;
802
+ description = callFunction.implementation.description;
803
+ rawComment = callFunction.implementation.description;
804
+ } else {
805
+ jsdocTags = extractJsDocTags(container);
806
+ description = extractJsDocDescription(container);
807
+ rawComment = extractRawJsDoc(container);
808
+ }
809
+ const metadataTag = jsdocTags.find((t) => t.name === initializerApiTag);
810
+ if (metadataTag === void 0) {
811
+ throw new Error(`Initializer API: Detected initializer API function does not have "@initializerApiFunction" tag: ${name}`);
812
+ }
813
+ let parsedMetadata = void 0;
814
+ if (metadataTag.comment.trim() !== "") {
815
+ try {
816
+ parsedMetadata = JSON.parse(metadataTag.comment);
817
+ } catch (e) {
818
+ throw new Error(`Could not parse initializer API function metadata: ${e}`);
819
+ }
820
+ }
821
+ return {
822
+ entryType: EntryType.InitializerApiFunction,
823
+ name,
824
+ description,
825
+ jsdocTags,
826
+ rawComment,
827
+ callFunction,
828
+ subFunctions,
829
+ __docsMetadata__: parsedMetadata
830
+ };
831
+ }
832
+ function getContainerVariableStatement(node) {
833
+ if (!ts8.isVariableDeclarationList(node.parent)) {
834
+ return null;
835
+ }
836
+ if (!ts8.isVariableStatement(node.parent.parent)) {
837
+ return null;
838
+ }
839
+ return node.parent.parent;
840
+ }
841
+ function filterSignatureDeclarations(signatures) {
842
+ const result = [];
843
+ for (const signature of signatures) {
844
+ const decl = signature.getDeclaration();
845
+ if (ts8.isFunctionDeclaration(decl) || ts8.isCallSignatureDeclaration(decl)) {
846
+ result.push(decl);
847
+ }
848
+ }
849
+ return result;
850
+ }
851
+ function extractFunctionWithOverloads(name, signatures, typeChecker) {
852
+ return {
853
+ name,
854
+ signatures: filterSignatureDeclarations(signatures).map((s) => ({
855
+ name,
856
+ entryType: EntryType.Function,
857
+ description: extractJsDocDescription(s),
858
+ generics: extractGenerics(s),
859
+ isNewType: false,
860
+ jsdocTags: extractJsDocTags(s),
861
+ params: extractAllParams(s.parameters, typeChecker),
862
+ rawComment: extractRawJsDoc(s),
863
+ returnType: typeChecker.typeToString(typeChecker.getReturnTypeOfSignature(typeChecker.getSignatureFromDeclaration(s)))
864
+ })),
865
+ implementation: null
866
+ };
867
+ }
868
+ function findImplementationOfFunction(node, typeChecker) {
869
+ var _a;
870
+ if (node.body !== void 0 || node.name === void 0) {
871
+ return node;
872
+ }
873
+ const symbol = typeChecker.getSymbolAtLocation(node.name);
874
+ return (_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a.find((s) => ts8.isFunctionDeclaration(s) && s.body !== void 0);
875
+ }
876
+
877
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/type_alias_extractor.mjs
878
+ function extractTypeAlias(declaration) {
879
+ return {
880
+ name: declaration.name.getText(),
881
+ type: declaration.type.getText(),
882
+ entryType: EntryType.TypeAlias,
883
+ rawComment: extractRawJsDoc(declaration),
884
+ description: extractJsDocDescription(declaration),
885
+ jsdocTags: extractJsDocTags(declaration)
886
+ };
887
+ }
888
+
889
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/extractor.mjs
890
+ var DocsExtractor = class {
891
+ constructor(typeChecker, metadataReader) {
892
+ this.typeChecker = typeChecker;
893
+ this.metadataReader = metadataReader;
894
+ }
895
+ extractAll(sourceFile) {
896
+ const entries = [];
897
+ const exportedDeclarations = this.getExportedDeclarations(sourceFile);
898
+ for (const [exportName, node] of exportedDeclarations) {
899
+ if (isAngularPrivateName(exportName)) {
900
+ continue;
901
+ }
902
+ const entry = this.extractDeclaration(node);
903
+ if (entry && !isIgnoredDocEntry(entry)) {
904
+ entries.push({ ...entry, name: exportName });
905
+ }
906
+ }
907
+ return entries;
908
+ }
909
+ extractDeclaration(node) {
910
+ if (isNamedClassDeclaration(node)) {
911
+ return extractClass(node, this.metadataReader, this.typeChecker);
912
+ }
913
+ if (isInitializerApiFunction(node, this.typeChecker)) {
914
+ return extractInitializerApiFunction(node, this.typeChecker);
915
+ }
916
+ if (ts9.isInterfaceDeclaration(node) && !isIgnoredInterface(node)) {
917
+ return extractInterface(node, this.typeChecker);
918
+ }
919
+ if (ts9.isFunctionDeclaration(node)) {
920
+ const functionExtractor = new FunctionExtractor(node.name.getText(), node, this.typeChecker);
921
+ return functionExtractor.extract();
922
+ }
923
+ if (ts9.isVariableDeclaration(node) && !isSyntheticAngularConstant(node)) {
924
+ return isDecoratorDeclaration(node) ? extractorDecorator(node, this.typeChecker) : extractConstant(node, this.typeChecker);
925
+ }
926
+ if (ts9.isTypeAliasDeclaration(node)) {
927
+ return extractTypeAlias(node);
928
+ }
929
+ if (ts9.isEnumDeclaration(node)) {
930
+ return extractEnum(node, this.typeChecker);
931
+ }
932
+ return null;
933
+ }
934
+ getExportedDeclarations(sourceFile) {
935
+ var _a;
936
+ const reflector = new TypeScriptReflectionHost(this.typeChecker);
937
+ const exportedDeclarationMap = reflector.getExportsOfModule(sourceFile);
938
+ let exportedDeclarations = Array.from((_a = exportedDeclarationMap == null ? void 0 : exportedDeclarationMap.entries()) != null ? _a : []).map(([exportName, declaration]) => [exportName, declaration.node]);
939
+ const declarationCount = exportedDeclarations.length;
940
+ for (let i = 0; i < declarationCount; i++) {
941
+ const [exportName, declaration] = exportedDeclarations[i];
942
+ if (ts9.isFunctionDeclaration(declaration)) {
943
+ const extractor = new FunctionExtractor(exportName, declaration, this.typeChecker);
944
+ const overloads = extractor.getOverloads().map((overload) => [exportName, overload]);
945
+ exportedDeclarations.push(...overloads);
946
+ }
947
+ }
948
+ return exportedDeclarations.sort(([a, declarationA], [b, declarationB]) => declarationA.pos - declarationB.pos);
949
+ }
950
+ };
951
+ function isIgnoredInterface(node) {
952
+ return node.name.getText().endsWith("Decorator") || isDecoratorOptionsInterface(node);
953
+ }
954
+ function isIgnoredDocEntry(entry) {
955
+ const isDocsPrivate = entry.jsdocTags.find((e) => e.name === "docsPrivate");
956
+ if (isDocsPrivate !== void 0 && isDocsPrivate.comment === "") {
957
+ throw new Error(`Docs extraction: Entry "${entry.name}" is marked as "@docsPrivate" but without reasoning.`);
958
+ }
959
+ return isDocsPrivate !== void 0;
960
+ }
961
+
962
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
963
+ import { HtmlParser, MessageBundle } from "@angular/compiler";
964
+ import ts41 from "typescript";
965
+
966
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
967
+ import { Xliff, Xliff2, Xmb } from "@angular/compiler";
968
+ import * as path from "path";
969
+ function i18nGetExtension(formatName) {
970
+ const format = formatName.toLowerCase();
971
+ switch (format) {
972
+ case "xmb":
973
+ return "xmb";
974
+ case "xlf":
975
+ case "xlif":
976
+ case "xliff":
977
+ case "xlf2":
978
+ case "xliff2":
979
+ return "xlf";
980
+ }
981
+ throw new Error(`Unsupported format "${formatName}"`);
982
+ }
983
+ function i18nExtract(formatName, outFile, host, options, bundle, pathResolve = path.resolve) {
984
+ formatName = formatName || "xlf";
985
+ const ext = i18nGetExtension(formatName);
986
+ const content = i18nSerialize(bundle, formatName, options);
987
+ const dstFile = outFile || `messages.${ext}`;
988
+ const dstPath = pathResolve(options.outDir || options.basePath, dstFile);
989
+ host.writeFile(dstPath, content, false, void 0, []);
990
+ return [dstPath];
991
+ }
992
+ function i18nSerialize(bundle, formatName, options) {
993
+ const format = formatName.toLowerCase();
994
+ let serializer;
995
+ switch (format) {
996
+ case "xmb":
997
+ serializer = new Xmb();
998
+ break;
999
+ case "xliff2":
1000
+ case "xlf2":
1001
+ serializer = new Xliff2();
1002
+ break;
1003
+ case "xlf":
1004
+ case "xliff":
1005
+ default:
1006
+ serializer = new Xliff();
1007
+ }
1008
+ return bundle.write(serializer, getPathNormalizer(options.basePath));
1009
+ }
1010
+ function getPathNormalizer(basePath) {
1011
+ return (sourcePath) => {
1012
+ sourcePath = basePath ? path.relative(basePath, sourcePath) : sourcePath;
1013
+ return sourcePath.split(path.sep).join("/");
1014
+ };
1015
+ }
1016
+
1017
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
1018
+ import ts10 from "typescript";
1019
+
1020
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version_helpers.mjs
1021
+ function toNumbers(value) {
1022
+ const suffixIndex = value.lastIndexOf("-");
1023
+ return value.slice(0, suffixIndex === -1 ? value.length : suffixIndex).split(".").map((segment) => {
1024
+ const parsed = parseInt(segment, 10);
1025
+ if (isNaN(parsed)) {
1026
+ throw Error(`Unable to parse version string ${value}.`);
1027
+ }
1028
+ return parsed;
1029
+ });
1030
+ }
1031
+ function compareNumbers(a, b) {
1032
+ const max = Math.max(a.length, b.length);
1033
+ const min = Math.min(a.length, b.length);
1034
+ for (let i = 0; i < min; i++) {
1035
+ if (a[i] > b[i])
1036
+ return 1;
1037
+ if (a[i] < b[i])
1038
+ return -1;
1039
+ }
1040
+ if (min !== max) {
1041
+ const longestArray = a.length === max ? a : b;
1042
+ const comparisonResult = a.length === max ? 1 : -1;
1043
+ for (let i = min; i < max; i++) {
1044
+ if (longestArray[i] > 0) {
1045
+ return comparisonResult;
1046
+ }
1047
+ }
1048
+ }
1049
+ return 0;
979
1050
  }
980
-
981
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/enum_extractor.mjs
982
- import ts9 from "typescript";
983
- function extractEnum(declaration, typeChecker) {
984
- return {
985
- name: declaration.name.getText(),
986
- entryType: EntryType.Enum,
987
- members: extractEnumMembers(declaration, typeChecker),
988
- rawComment: extractRawJsDoc(declaration),
989
- description: extractJsDocDescription(declaration),
990
- jsdocTags: extractJsDocTags(declaration)
991
- };
1051
+ function compareVersions(v1, v2) {
1052
+ return compareNumbers(toNumbers(v1), toNumbers(v2));
992
1053
  }
993
- function extractEnumMembers(declaration, checker) {
994
- return declaration.members.map((member) => ({
995
- name: member.name.getText(),
996
- type: extractResolvedTypeString(member, checker),
997
- value: getEnumMemberValue(member),
998
- memberType: MemberType.EnumItem,
999
- jsdocTags: extractJsDocTags(member),
1000
- description: extractJsDocDescription(member),
1001
- memberTags: []
1002
- }));
1054
+
1055
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
1056
+ var MIN_TS_VERSION = "5.2.0";
1057
+ var MAX_TS_VERSION = "5.5.0";
1058
+ var tsVersion = ts10.version;
1059
+ function checkVersion(version, minVersion, maxVersion) {
1060
+ if (compareVersions(version, minVersion) < 0 || compareVersions(version, maxVersion) >= 0) {
1061
+ throw new Error(`The Angular Compiler requires TypeScript >=${minVersion} and <${maxVersion} but ${version} was found instead.`);
1062
+ }
1003
1063
  }
1004
- function getEnumMemberValue(memberNode) {
1005
- var _a;
1006
- const literal = memberNode.getChildren().find((n) => {
1007
- return ts9.isNumericLiteral(n) || ts9.isStringLiteral(n) || ts9.isPrefixUnaryExpression(n) && n.operator === ts9.SyntaxKind.MinusToken && ts9.isNumericLiteral(n.operand);
1008
- });
1009
- return (_a = literal == null ? void 0 : literal.getText()) != null ? _a : "";
1064
+ function verifySupportedTypeScriptVersion() {
1065
+ checkVersion(tsVersion, MIN_TS_VERSION, MAX_TS_VERSION);
1010
1066
  }
1011
1067
 
1012
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/type_alias_extractor.mjs
1013
- function extractTypeAlias(declaration) {
1014
- return {
1015
- name: declaration.name.getText(),
1016
- type: declaration.type.getText(),
1017
- entryType: EntryType.TypeAlias,
1018
- rawComment: extractRawJsDoc(declaration),
1019
- description: extractJsDocDescription(declaration),
1020
- jsdocTags: extractJsDocTags(declaration)
1021
- };
1022
- }
1068
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
1069
+ import { R3Identifiers as R3Identifiers5 } from "@angular/compiler";
1070
+ import ts39 from "typescript";
1023
1071
 
1024
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/extractor.mjs
1025
- var DocsExtractor = class {
1026
- constructor(typeChecker, metadataReader) {
1027
- this.typeChecker = typeChecker;
1028
- this.metadataReader = metadataReader;
1072
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
1073
+ var CycleAnalyzer = class {
1074
+ constructor(importGraph) {
1075
+ this.importGraph = importGraph;
1076
+ this.cachedResults = null;
1029
1077
  }
1030
- extractAll(sourceFile) {
1031
- const entries = [];
1032
- const exportedDeclarations = this.getExportedDeclarations(sourceFile);
1033
- for (const [exportName, node] of exportedDeclarations) {
1034
- if (isAngularPrivateName(exportName))
1035
- continue;
1036
- const entry = this.extractDeclaration(node);
1037
- if (entry) {
1038
- entries.push({ ...entry, name: exportName });
1039
- }
1078
+ wouldCreateCycle(from, to) {
1079
+ if (this.cachedResults === null || this.cachedResults.from !== from) {
1080
+ this.cachedResults = new CycleResults(from, this.importGraph);
1040
1081
  }
1041
- return entries;
1082
+ return this.cachedResults.wouldBeCyclic(to) ? new Cycle(this.importGraph, from, to) : null;
1042
1083
  }
1043
- extractDeclaration(node) {
1044
- if (isNamedClassDeclaration(node)) {
1045
- return extractClass(node, this.metadataReader, this.typeChecker);
1084
+ recordSyntheticImport(from, to) {
1085
+ this.cachedResults = null;
1086
+ this.importGraph.addSyntheticImport(from, to);
1087
+ }
1088
+ };
1089
+ var NgCyclicResult = Symbol("NgCyclicResult");
1090
+ var CycleResults = class {
1091
+ constructor(from, importGraph) {
1092
+ this.from = from;
1093
+ this.importGraph = importGraph;
1094
+ this.cyclic = {};
1095
+ this.acyclic = {};
1096
+ }
1097
+ wouldBeCyclic(sf) {
1098
+ const cached = this.getCachedResult(sf);
1099
+ if (cached !== null) {
1100
+ return cached;
1046
1101
  }
1047
- if (ts10.isInterfaceDeclaration(node) && !isIgnoredInterface(node)) {
1048
- return extractInterface(node, this.typeChecker);
1102
+ if (sf === this.from) {
1103
+ return true;
1049
1104
  }
1050
- if (ts10.isFunctionDeclaration(node)) {
1051
- const functionExtractor = new FunctionExtractor(node.name.getText(), node, this.typeChecker);
1052
- return functionExtractor.extract();
1105
+ this.markAcyclic(sf);
1106
+ const imports = this.importGraph.importsOf(sf);
1107
+ for (const imported of imports) {
1108
+ if (this.wouldBeCyclic(imported)) {
1109
+ this.markCyclic(sf);
1110
+ return true;
1111
+ }
1053
1112
  }
1054
- if (ts10.isVariableDeclaration(node) && !isSyntheticAngularConstant(node)) {
1055
- return isDecoratorDeclaration(node) ? extractorDecorator(node, this.typeChecker) : extractConstant(node, this.typeChecker);
1113
+ return false;
1114
+ }
1115
+ getCachedResult(sf) {
1116
+ const result = sf[NgCyclicResult];
1117
+ if (result === this.cyclic) {
1118
+ return true;
1119
+ } else if (result === this.acyclic) {
1120
+ return false;
1121
+ } else {
1122
+ return null;
1056
1123
  }
1057
- if (ts10.isTypeAliasDeclaration(node)) {
1058
- return extractTypeAlias(node);
1124
+ }
1125
+ markCyclic(sf) {
1126
+ sf[NgCyclicResult] = this.cyclic;
1127
+ }
1128
+ markAcyclic(sf) {
1129
+ sf[NgCyclicResult] = this.acyclic;
1130
+ }
1131
+ };
1132
+ var Cycle = class {
1133
+ constructor(importGraph, from, to) {
1134
+ this.importGraph = importGraph;
1135
+ this.from = from;
1136
+ this.to = to;
1137
+ }
1138
+ getPath() {
1139
+ return [this.from, ...this.importGraph.findPath(this.to, this.from)];
1140
+ }
1141
+ };
1142
+
1143
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/imports.mjs
1144
+ import ts11 from "typescript";
1145
+ var ImportGraph = class {
1146
+ constructor(checker, perf) {
1147
+ this.checker = checker;
1148
+ this.perf = perf;
1149
+ this.imports = /* @__PURE__ */ new Map();
1150
+ }
1151
+ importsOf(sf) {
1152
+ if (!this.imports.has(sf)) {
1153
+ this.imports.set(sf, this.scanImports(sf));
1059
1154
  }
1060
- if (ts10.isEnumDeclaration(node)) {
1061
- return extractEnum(node, this.typeChecker);
1155
+ return this.imports.get(sf);
1156
+ }
1157
+ findPath(start, end) {
1158
+ if (start === end) {
1159
+ return [start];
1160
+ }
1161
+ const found = /* @__PURE__ */ new Set([start]);
1162
+ const queue = [new Found(start, null)];
1163
+ while (queue.length > 0) {
1164
+ const current = queue.shift();
1165
+ const imports = this.importsOf(current.sourceFile);
1166
+ for (const importedFile of imports) {
1167
+ if (!found.has(importedFile)) {
1168
+ const next = new Found(importedFile, current);
1169
+ if (next.sourceFile === end) {
1170
+ return next.toPath();
1171
+ }
1172
+ found.add(importedFile);
1173
+ queue.push(next);
1174
+ }
1175
+ }
1062
1176
  }
1063
1177
  return null;
1064
1178
  }
1065
- getExportedDeclarations(sourceFile) {
1066
- var _a;
1067
- const reflector = new TypeScriptReflectionHost(this.typeChecker);
1068
- const exportedDeclarationMap = reflector.getExportsOfModule(sourceFile);
1069
- let exportedDeclarations = Array.from((_a = exportedDeclarationMap == null ? void 0 : exportedDeclarationMap.entries()) != null ? _a : []).map(([exportName, declaration]) => [exportName, declaration.node]);
1070
- const declarationCount = exportedDeclarations.length;
1071
- for (let i = 0; i < declarationCount; i++) {
1072
- const [exportName, declaration] = exportedDeclarations[i];
1073
- if (ts10.isFunctionDeclaration(declaration)) {
1074
- const extractor = new FunctionExtractor(exportName, declaration, this.typeChecker);
1075
- const overloads = extractor.getOverloads().map((overload) => [exportName, overload]);
1076
- exportedDeclarations.push(...overloads);
1077
- }
1179
+ addSyntheticImport(sf, imported) {
1180
+ if (isLocalFile(imported)) {
1181
+ this.importsOf(sf).add(imported);
1078
1182
  }
1079
- return exportedDeclarations.sort(([a, declarationA], [b, declarationB]) => declarationA.pos - declarationB.pos);
1183
+ }
1184
+ scanImports(sf) {
1185
+ return this.perf.inPhase(PerfPhase.CycleDetection, () => {
1186
+ const imports = /* @__PURE__ */ new Set();
1187
+ for (const stmt of sf.statements) {
1188
+ if (!ts11.isImportDeclaration(stmt) && !ts11.isExportDeclaration(stmt) || stmt.moduleSpecifier === void 0) {
1189
+ continue;
1190
+ }
1191
+ if (ts11.isImportDeclaration(stmt) && stmt.importClause !== void 0 && isTypeOnlyImportClause(stmt.importClause)) {
1192
+ continue;
1193
+ }
1194
+ const symbol = this.checker.getSymbolAtLocation(stmt.moduleSpecifier);
1195
+ if (symbol === void 0 || symbol.valueDeclaration === void 0) {
1196
+ continue;
1197
+ }
1198
+ const moduleFile = symbol.valueDeclaration;
1199
+ if (ts11.isSourceFile(moduleFile) && isLocalFile(moduleFile)) {
1200
+ imports.add(moduleFile);
1201
+ }
1202
+ }
1203
+ return imports;
1204
+ });
1080
1205
  }
1081
1206
  };
1082
- function isIgnoredInterface(node) {
1083
- return node.name.getText().endsWith("Decorator") || isDecoratorOptionsInterface(node);
1207
+ function isLocalFile(sf) {
1208
+ return !sf.isDeclarationFile;
1209
+ }
1210
+ function isTypeOnlyImportClause(node) {
1211
+ if (node.isTypeOnly) {
1212
+ return true;
1213
+ }
1214
+ if (node.namedBindings !== void 0 && ts11.isNamedImports(node.namedBindings) && node.namedBindings.elements.every((specifier) => specifier.isTypeOnly)) {
1215
+ return true;
1216
+ }
1217
+ return false;
1084
1218
  }
1219
+ var Found = class {
1220
+ constructor(sourceFile, parent) {
1221
+ this.sourceFile = sourceFile;
1222
+ this.parent = parent;
1223
+ }
1224
+ toPath() {
1225
+ const array = [];
1226
+ let current = this;
1227
+ while (current !== null) {
1228
+ array.push(current.sourceFile);
1229
+ current = current.parent;
1230
+ }
1231
+ return array.reverse();
1232
+ }
1233
+ };
1085
1234
 
1086
1235
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/generator.mjs
1087
- import ts11 from "typescript";
1236
+ import ts12 from "typescript";
1088
1237
  var FlatIndexGenerator = class {
1089
1238
  constructor(entryPoint, relativeFlatIndexPath, moduleName) {
1090
1239
  this.entryPoint = entryPoint;
@@ -1100,7 +1249,7 @@ var FlatIndexGenerator = class {
1100
1249
 
1101
1250
  export * from '${relativeEntryPoint}';
1102
1251
  `;
1103
- const genFile = ts11.createSourceFile(this.flatIndexPath, contents, ts11.ScriptTarget.ES2015, true, ts11.ScriptKind.TS);
1252
+ const genFile = ts12.createSourceFile(this.flatIndexPath, contents, ts12.ScriptTarget.ES2015, true, ts12.ScriptKind.TS);
1104
1253
  if (this.moduleName !== null) {
1105
1254
  genFile.moduleName = this.moduleName;
1106
1255
  }
@@ -1125,7 +1274,7 @@ function findFlatIndexEntryPoint(rootFiles) {
1125
1274
  }
1126
1275
 
1127
1276
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/private_export_checker.mjs
1128
- import ts12 from "typescript";
1277
+ import ts13 from "typescript";
1129
1278
  function checkForPrivateExports(entryPoint, checker, refGraph) {
1130
1279
  const diagnostics = [];
1131
1280
  const topLevelExports = /* @__PURE__ */ new Set();
@@ -1135,7 +1284,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
1135
1284
  }
1136
1285
  const exportedSymbols = checker.getExportsOfModule(moduleSymbol);
1137
1286
  exportedSymbols.forEach((symbol) => {
1138
- if (symbol.flags & ts12.SymbolFlags.Alias) {
1287
+ if (symbol.flags & ts13.SymbolFlags.Alias) {
1139
1288
  symbol = checker.getAliasedSymbol(symbol);
1140
1289
  }
1141
1290
  const decl = symbol.valueDeclaration;
@@ -1159,7 +1308,7 @@ function checkForPrivateExports(entryPoint, checker, refGraph) {
1159
1308
  visibleVia = transitivePath.map((seg) => getNameOfDeclaration(seg)).join(" -> ");
1160
1309
  }
1161
1310
  const diagnostic = {
1162
- category: ts12.DiagnosticCategory.Error,
1311
+ category: ts13.DiagnosticCategory.Error,
1163
1312
  code: ngErrorCode(ErrorCode.SYMBOL_NOT_EXPORTED),
1164
1313
  file: transitiveReference.getSourceFile(),
1165
1314
  ...getPosOfDeclaration(transitiveReference),
@@ -1179,7 +1328,7 @@ function getPosOfDeclaration(decl) {
1179
1328
  };
1180
1329
  }
1181
1330
  function getIdentifierOfDeclaration(decl) {
1182
- if ((ts12.isClassDeclaration(decl) || ts12.isVariableDeclaration(decl) || ts12.isFunctionDeclaration(decl)) && decl.name !== void 0 && ts12.isIdentifier(decl.name)) {
1331
+ if ((ts13.isClassDeclaration(decl) || ts13.isVariableDeclaration(decl) || ts13.isFunctionDeclaration(decl)) && decl.name !== void 0 && ts13.isIdentifier(decl.name)) {
1183
1332
  return decl.name;
1184
1333
  } else {
1185
1334
  return null;
@@ -1191,13 +1340,13 @@ function getNameOfDeclaration(decl) {
1191
1340
  }
1192
1341
  function getDescriptorOfDeclaration(decl) {
1193
1342
  switch (decl.kind) {
1194
- case ts12.SyntaxKind.ClassDeclaration:
1343
+ case ts13.SyntaxKind.ClassDeclaration:
1195
1344
  return "class";
1196
- case ts12.SyntaxKind.FunctionDeclaration:
1345
+ case ts13.SyntaxKind.FunctionDeclaration:
1197
1346
  return "function";
1198
- case ts12.SyntaxKind.VariableDeclaration:
1347
+ case ts13.SyntaxKind.VariableDeclaration:
1199
1348
  return "variable";
1200
- case ts12.SyntaxKind.EnumDeclaration:
1349
+ case ts13.SyntaxKind.EnumDeclaration:
1201
1350
  return "enum";
1202
1351
  default:
1203
1352
  return "declaration";
@@ -1267,10 +1416,10 @@ var UpdateMode;
1267
1416
  })(UpdateMode || (UpdateMode = {}));
1268
1417
 
1269
1418
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
1270
- import ts14 from "typescript";
1419
+ import ts15 from "typescript";
1271
1420
 
1272
1421
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
1273
- import ts13 from "typescript";
1422
+ import ts14 from "typescript";
1274
1423
 
1275
1424
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
1276
1425
  var NgExtension = Symbol("NgExtension");
@@ -1401,10 +1550,10 @@ var ShimAdapter = class {
1401
1550
  }
1402
1551
  const prefix = match[1];
1403
1552
  let baseFileName = absoluteFrom(prefix + ".ts");
1404
- let inputFile = this.delegate.getSourceFile(baseFileName, ts13.ScriptTarget.Latest);
1553
+ let inputFile = this.delegate.getSourceFile(baseFileName, ts14.ScriptTarget.Latest);
1405
1554
  if (inputFile === void 0) {
1406
1555
  baseFileName = absoluteFrom(prefix + ".tsx");
1407
- inputFile = this.delegate.getSourceFile(baseFileName, ts13.ScriptTarget.Latest);
1556
+ inputFile = this.delegate.getSourceFile(baseFileName, ts14.ScriptTarget.Latest);
1408
1557
  }
1409
1558
  if (inputFile === void 0 || isShim(inputFile)) {
1410
1559
  return void 0;
@@ -1565,7 +1714,7 @@ var TsCreateProgramDriver = class {
1565
1714
  this.sfMap.clear();
1566
1715
  }
1567
1716
  for (const [filePath, { newText, originalFile }] of contents.entries()) {
1568
- const sf = ts14.createSourceFile(filePath, newText, ts14.ScriptTarget.Latest, true);
1717
+ const sf = ts15.createSourceFile(filePath, newText, ts15.ScriptTarget.Latest, true);
1569
1718
  if (originalFile !== null) {
1570
1719
  sf[NgOriginalFile] = originalFile;
1571
1720
  }
@@ -1574,7 +1723,7 @@ var TsCreateProgramDriver = class {
1574
1723
  const host = new UpdatedProgramHost(this.sfMap, this.originalProgram, this.originalHost, this.shimExtensionPrefixes);
1575
1724
  const oldProgram = this.program;
1576
1725
  retagAllTsFiles(oldProgram);
1577
- this.program = ts14.createProgram({
1726
+ this.program = ts15.createProgram({
1578
1727
  host,
1579
1728
  rootNames: this.program.getRootFileNames(),
1580
1729
  options: this.options,
@@ -2337,7 +2486,7 @@ var NgModuleIndexImpl = class {
2337
2486
  };
2338
2487
 
2339
2488
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/resource/src/loader.mjs
2340
- import ts15 from "typescript";
2489
+ import ts16 from "typescript";
2341
2490
  var CSS_PREPROCESSOR_EXT = /(\.scss|\.sass|\.less|\.styl)$/;
2342
2491
  var RESOURCE_MARKER = ".$ngresource$";
2343
2492
  var RESOURCE_MARKER_TS = RESOURCE_MARKER + ".ts";
@@ -2447,7 +2596,7 @@ var AdapterResourceLoader = class {
2447
2596
  return this.adapter.rootDirs.map((rootDir) => join(rootDir, segment));
2448
2597
  }
2449
2598
  getResolvedCandidateLocations(url, fromFile) {
2450
- const failedLookup = ts15.resolveModuleName(url + RESOURCE_MARKER, fromFile, this.options, this.lookupResolutionHost);
2599
+ const failedLookup = ts16.resolveModuleName(url + RESOURCE_MARKER, fromFile, this.options, this.lookupResolutionHost);
2451
2600
  if (failedLookup.failedLookupLocations === void 0) {
2452
2601
  throw new Error(`Internal error: expected to find failedLookupLocations during resolution of resource '${url}' in context of ${fromFile}`);
2453
2602
  }
@@ -2582,7 +2731,7 @@ var StandaloneComponentScopeReader = class {
2582
2731
  import { CssSelector as CssSelector2, DomElementSchemaRegistry as DomElementSchemaRegistry2, ExternalExpr as ExternalExpr2, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
2583
2732
 
2584
2733
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/diagnostic.mjs
2585
- import ts16 from "typescript";
2734
+ import ts17 from "typescript";
2586
2735
  function makeTemplateDiagnostic(templateId, mapping, span, category, code, messageText, relatedMessages) {
2587
2736
  var _a;
2588
2737
  if (mapping.type === "direct") {
@@ -2591,7 +2740,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
2591
2740
  relatedInformation = [];
2592
2741
  for (const relatedMessage of relatedMessages) {
2593
2742
  relatedInformation.push({
2594
- category: ts16.DiagnosticCategory.Message,
2743
+ category: ts17.DiagnosticCategory.Message,
2595
2744
  code: 0,
2596
2745
  file: relatedMessage.sourceFile,
2597
2746
  start: relatedMessage.start,
@@ -2620,7 +2769,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
2620
2769
  if (relatedMessages !== void 0) {
2621
2770
  for (const relatedMessage of relatedMessages) {
2622
2771
  relatedInformation.push({
2623
- category: ts16.DiagnosticCategory.Message,
2772
+ category: ts17.DiagnosticCategory.Message,
2624
2773
  code: 0,
2625
2774
  file: relatedMessage.sourceFile,
2626
2775
  start: relatedMessage.start,
@@ -2650,7 +2799,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
2650
2799
  };
2651
2800
  }
2652
2801
  relatedInformation.push({
2653
- category: ts16.DiagnosticCategory.Message,
2802
+ category: ts17.DiagnosticCategory.Message,
2654
2803
  code: 0,
2655
2804
  file: componentSf,
2656
2805
  start: mapping.node.getStart(),
@@ -2685,7 +2834,7 @@ function parseTemplateAsSourceFile(fileName, template) {
2685
2834
  if (parseTemplateAsSourceFileForTest !== null) {
2686
2835
  return parseTemplateAsSourceFileForTest(fileName, template);
2687
2836
  }
2688
- return ts16.createSourceFile(fileName, template, ts16.ScriptTarget.Latest, false, ts16.ScriptKind.JSX);
2837
+ return ts17.createSourceFile(fileName, template, ts17.ScriptTarget.Latest, false, ts17.ScriptKind.JSX);
2689
2838
  }
2690
2839
 
2691
2840
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/id.mjs
@@ -2707,15 +2856,15 @@ function allocateTemplateId(sf) {
2707
2856
 
2708
2857
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
2709
2858
  import { EmptyExpr, ImplicitReceiver as ImplicitReceiver2, PropertyRead as PropertyRead2, PropertyWrite as PropertyWrite2, SafePropertyRead, TmplAstReference as TmplAstReference2, TmplAstTextAttribute } from "@angular/compiler";
2710
- import ts18 from "typescript";
2859
+ import ts19 from "typescript";
2711
2860
 
2712
2861
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/comments.mjs
2713
2862
  import { AbsoluteSourceSpan as AbsoluteSourceSpan2 } from "@angular/compiler";
2714
- import ts17 from "typescript";
2863
+ import ts18 from "typescript";
2715
2864
  var parseSpanComment = /^(\d+),(\d+)$/;
2716
2865
  function readSpanComment(node, sourceFile = node.getSourceFile()) {
2717
- return ts17.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
2718
- if (kind !== ts17.SyntaxKind.MultiLineCommentTrivia) {
2866
+ return ts18.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
2867
+ if (kind !== ts18.SyntaxKind.MultiLineCommentTrivia) {
2719
2868
  return null;
2720
2869
  }
2721
2870
  const commentText = sourceFile.text.substring(pos + 2, end - 2);
@@ -2739,25 +2888,25 @@ var ExpressionIdentifier;
2739
2888
  ExpressionIdentifier2["VARIABLE_AS_EXPRESSION"] = "VAE";
2740
2889
  })(ExpressionIdentifier || (ExpressionIdentifier = {}));
2741
2890
  function addExpressionIdentifier(node, identifier) {
2742
- ts17.addSyntheticTrailingComment(
2891
+ ts18.addSyntheticTrailingComment(
2743
2892
  node,
2744
- ts17.SyntaxKind.MultiLineCommentTrivia,
2893
+ ts18.SyntaxKind.MultiLineCommentTrivia,
2745
2894
  `${CommentTriviaType.EXPRESSION_TYPE_IDENTIFIER}:${identifier}`,
2746
2895
  false
2747
2896
  );
2748
2897
  }
2749
2898
  var IGNORE_FOR_DIAGNOSTICS_MARKER = `${CommentTriviaType.DIAGNOSTIC}:ignore`;
2750
2899
  function markIgnoreDiagnostics(node) {
2751
- ts17.addSyntheticTrailingComment(
2900
+ ts18.addSyntheticTrailingComment(
2752
2901
  node,
2753
- ts17.SyntaxKind.MultiLineCommentTrivia,
2902
+ ts18.SyntaxKind.MultiLineCommentTrivia,
2754
2903
  IGNORE_FOR_DIAGNOSTICS_MARKER,
2755
2904
  false
2756
2905
  );
2757
2906
  }
2758
2907
  function hasIgnoreForDiagnosticsMarker(node, sourceFile) {
2759
- return ts17.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
2760
- if (kind !== ts17.SyntaxKind.MultiLineCommentTrivia) {
2908
+ return ts18.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
2909
+ if (kind !== ts18.SyntaxKind.MultiLineCommentTrivia) {
2761
2910
  return null;
2762
2911
  }
2763
2912
  const commentText = sourceFile.text.substring(pos + 2, end - 2);
@@ -2831,8 +2980,8 @@ function findAllMatchingNodes(tcb, opts) {
2831
2980
  return results;
2832
2981
  }
2833
2982
  function hasExpressionIdentifier(sourceFile, node, identifier) {
2834
- return ts17.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
2835
- if (kind !== ts17.SyntaxKind.MultiLineCommentTrivia) {
2983
+ return ts18.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
2984
+ if (kind !== ts18.SyntaxKind.MultiLineCommentTrivia) {
2836
2985
  return false;
2837
2986
  }
2838
2987
  const commentText = sourceFile.text.substring(pos + 2, end - 2);
@@ -2850,7 +2999,7 @@ var CompletionEngine = class {
2850
2999
  this.templateContextCache = /* @__PURE__ */ new Map();
2851
3000
  this.expressionCompletionCache = /* @__PURE__ */ new Map();
2852
3001
  const globalRead = findFirstMatchingNode(this.tcb, {
2853
- filter: ts18.isPropertyAccessExpression,
3002
+ filter: ts19.isPropertyAccessExpression,
2854
3003
  withExpressionIdentifier: ExpressionIdentifier.COMPONENT_COMPLETION
2855
3004
  });
2856
3005
  if (globalRead !== null) {
@@ -2874,7 +3023,7 @@ var CompletionEngine = class {
2874
3023
  let nodeContext = null;
2875
3024
  if (node instanceof EmptyExpr) {
2876
3025
  const nodeLocation = findFirstMatchingNode(this.tcb, {
2877
- filter: ts18.isIdentifier,
3026
+ filter: ts19.isIdentifier,
2878
3027
  withSpan: node.sourceSpan
2879
3028
  });
2880
3029
  if (nodeLocation !== null) {
@@ -2887,7 +3036,7 @@ var CompletionEngine = class {
2887
3036
  }
2888
3037
  if (node instanceof PropertyRead2 && node.receiver instanceof ImplicitReceiver2) {
2889
3038
  const nodeLocation = findFirstMatchingNode(this.tcb, {
2890
- filter: ts18.isPropertyAccessExpression,
3039
+ filter: ts19.isPropertyAccessExpression,
2891
3040
  withSpan: node.sourceSpan
2892
3041
  });
2893
3042
  if (nodeLocation) {
@@ -2911,21 +3060,21 @@ var CompletionEngine = class {
2911
3060
  let tsExpr = null;
2912
3061
  if (expr instanceof PropertyRead2 || expr instanceof PropertyWrite2) {
2913
3062
  tsExpr = findFirstMatchingNode(this.tcb, {
2914
- filter: ts18.isPropertyAccessExpression,
3063
+ filter: ts19.isPropertyAccessExpression,
2915
3064
  withSpan: expr.nameSpan
2916
3065
  });
2917
3066
  } else if (expr instanceof SafePropertyRead) {
2918
3067
  const ternaryExpr = findFirstMatchingNode(this.tcb, {
2919
- filter: ts18.isParenthesizedExpression,
3068
+ filter: ts19.isParenthesizedExpression,
2920
3069
  withSpan: expr.sourceSpan
2921
3070
  });
2922
- if (ternaryExpr === null || !ts18.isConditionalExpression(ternaryExpr.expression)) {
3071
+ if (ternaryExpr === null || !ts19.isConditionalExpression(ternaryExpr.expression)) {
2923
3072
  return null;
2924
3073
  }
2925
3074
  const whenTrue = ternaryExpr.expression.whenTrue;
2926
- if (ts18.isPropertyAccessExpression(whenTrue)) {
3075
+ if (ts19.isPropertyAccessExpression(whenTrue)) {
2927
3076
  tsExpr = whenTrue;
2928
- } else if (ts18.isCallExpression(whenTrue) && ts18.isPropertyAccessExpression(whenTrue.expression)) {
3077
+ } else if (ts19.isCallExpression(whenTrue) && ts19.isPropertyAccessExpression(whenTrue.expression)) {
2929
3078
  tsExpr = whenTrue.expression;
2930
3079
  }
2931
3080
  }
@@ -2947,15 +3096,15 @@ var CompletionEngine = class {
2947
3096
  let tsExpr = null;
2948
3097
  if (expr instanceof TmplAstTextAttribute) {
2949
3098
  const strNode = findFirstMatchingNode(this.tcb, {
2950
- filter: ts18.isParenthesizedExpression,
3099
+ filter: ts19.isParenthesizedExpression,
2951
3100
  withSpan: expr.sourceSpan
2952
3101
  });
2953
- if (strNode !== null && ts18.isStringLiteral(strNode.expression)) {
3102
+ if (strNode !== null && ts19.isStringLiteral(strNode.expression)) {
2954
3103
  tsExpr = strNode.expression;
2955
3104
  }
2956
3105
  } else {
2957
3106
  tsExpr = findFirstMatchingNode(this.tcb, {
2958
- filter: (n) => ts18.isStringLiteral(n) || ts18.isNumericLiteral(n),
3107
+ filter: (n2) => ts19.isStringLiteral(n2) || ts19.isNumericLiteral(n2),
2959
3108
  withSpan: expr.sourceSpan
2960
3109
  });
2961
3110
  }
@@ -2963,7 +3112,7 @@ var CompletionEngine = class {
2963
3112
  return null;
2964
3113
  }
2965
3114
  let positionInShimFile = tsExpr.getEnd();
2966
- if (ts18.isStringLiteral(tsExpr)) {
3115
+ if (ts19.isStringLiteral(tsExpr)) {
2967
3116
  positionInShimFile -= 1;
2968
3117
  }
2969
3118
  const res = {
@@ -2997,12 +3146,1022 @@ var CompletionEngine = class {
2997
3146
  }
2998
3147
  };
2999
3148
 
3149
+ // node_modules/magic-string/dist/magic-string.es.mjs
3150
+ import { encode } from "@jridgewell/sourcemap-codec";
3151
+ var BitSet = class {
3152
+ constructor(arg) {
3153
+ this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
3154
+ }
3155
+ add(n2) {
3156
+ this.bits[n2 >> 5] |= 1 << (n2 & 31);
3157
+ }
3158
+ has(n2) {
3159
+ return !!(this.bits[n2 >> 5] & 1 << (n2 & 31));
3160
+ }
3161
+ };
3162
+ var Chunk = class {
3163
+ constructor(start, end, content) {
3164
+ this.start = start;
3165
+ this.end = end;
3166
+ this.original = content;
3167
+ this.intro = "";
3168
+ this.outro = "";
3169
+ this.content = content;
3170
+ this.storeName = false;
3171
+ this.edited = false;
3172
+ {
3173
+ this.previous = null;
3174
+ this.next = null;
3175
+ }
3176
+ }
3177
+ appendLeft(content) {
3178
+ this.outro += content;
3179
+ }
3180
+ appendRight(content) {
3181
+ this.intro = this.intro + content;
3182
+ }
3183
+ clone() {
3184
+ const chunk = new Chunk(this.start, this.end, this.original);
3185
+ chunk.intro = this.intro;
3186
+ chunk.outro = this.outro;
3187
+ chunk.content = this.content;
3188
+ chunk.storeName = this.storeName;
3189
+ chunk.edited = this.edited;
3190
+ return chunk;
3191
+ }
3192
+ contains(index) {
3193
+ return this.start < index && index < this.end;
3194
+ }
3195
+ eachNext(fn) {
3196
+ let chunk = this;
3197
+ while (chunk) {
3198
+ fn(chunk);
3199
+ chunk = chunk.next;
3200
+ }
3201
+ }
3202
+ eachPrevious(fn) {
3203
+ let chunk = this;
3204
+ while (chunk) {
3205
+ fn(chunk);
3206
+ chunk = chunk.previous;
3207
+ }
3208
+ }
3209
+ edit(content, storeName, contentOnly) {
3210
+ this.content = content;
3211
+ if (!contentOnly) {
3212
+ this.intro = "";
3213
+ this.outro = "";
3214
+ }
3215
+ this.storeName = storeName;
3216
+ this.edited = true;
3217
+ return this;
3218
+ }
3219
+ prependLeft(content) {
3220
+ this.outro = content + this.outro;
3221
+ }
3222
+ prependRight(content) {
3223
+ this.intro = content + this.intro;
3224
+ }
3225
+ reset() {
3226
+ this.intro = "";
3227
+ this.outro = "";
3228
+ if (this.edited) {
3229
+ this.content = this.original;
3230
+ this.storeName = false;
3231
+ this.edited = false;
3232
+ }
3233
+ }
3234
+ split(index) {
3235
+ const sliceIndex = index - this.start;
3236
+ const originalBefore = this.original.slice(0, sliceIndex);
3237
+ const originalAfter = this.original.slice(sliceIndex);
3238
+ this.original = originalBefore;
3239
+ const newChunk = new Chunk(index, this.end, originalAfter);
3240
+ newChunk.outro = this.outro;
3241
+ this.outro = "";
3242
+ this.end = index;
3243
+ if (this.edited) {
3244
+ newChunk.edit("", false);
3245
+ this.content = "";
3246
+ } else {
3247
+ this.content = originalBefore;
3248
+ }
3249
+ newChunk.next = this.next;
3250
+ if (newChunk.next)
3251
+ newChunk.next.previous = newChunk;
3252
+ newChunk.previous = this;
3253
+ this.next = newChunk;
3254
+ return newChunk;
3255
+ }
3256
+ toString() {
3257
+ return this.intro + this.content + this.outro;
3258
+ }
3259
+ trimEnd(rx) {
3260
+ this.outro = this.outro.replace(rx, "");
3261
+ if (this.outro.length)
3262
+ return true;
3263
+ const trimmed = this.content.replace(rx, "");
3264
+ if (trimmed.length) {
3265
+ if (trimmed !== this.content) {
3266
+ this.split(this.start + trimmed.length).edit("", void 0, true);
3267
+ if (this.edited) {
3268
+ this.edit(trimmed, this.storeName, true);
3269
+ }
3270
+ }
3271
+ return true;
3272
+ } else {
3273
+ this.edit("", void 0, true);
3274
+ this.intro = this.intro.replace(rx, "");
3275
+ if (this.intro.length)
3276
+ return true;
3277
+ }
3278
+ }
3279
+ trimStart(rx) {
3280
+ this.intro = this.intro.replace(rx, "");
3281
+ if (this.intro.length)
3282
+ return true;
3283
+ const trimmed = this.content.replace(rx, "");
3284
+ if (trimmed.length) {
3285
+ if (trimmed !== this.content) {
3286
+ const newChunk = this.split(this.end - trimmed.length);
3287
+ if (this.edited) {
3288
+ newChunk.edit(trimmed, this.storeName, true);
3289
+ }
3290
+ this.edit("", void 0, true);
3291
+ }
3292
+ return true;
3293
+ } else {
3294
+ this.edit("", void 0, true);
3295
+ this.outro = this.outro.replace(rx, "");
3296
+ if (this.outro.length)
3297
+ return true;
3298
+ }
3299
+ }
3300
+ };
3301
+ function getBtoa() {
3302
+ if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") {
3303
+ return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
3304
+ } else if (typeof Buffer === "function") {
3305
+ return (str) => Buffer.from(str, "utf-8").toString("base64");
3306
+ } else {
3307
+ return () => {
3308
+ throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
3309
+ };
3310
+ }
3311
+ }
3312
+ var btoa = /* @__PURE__ */ getBtoa();
3313
+ var SourceMap = class {
3314
+ constructor(properties) {
3315
+ this.version = 3;
3316
+ this.file = properties.file;
3317
+ this.sources = properties.sources;
3318
+ this.sourcesContent = properties.sourcesContent;
3319
+ this.names = properties.names;
3320
+ this.mappings = encode(properties.mappings);
3321
+ if (typeof properties.x_google_ignoreList !== "undefined") {
3322
+ this.x_google_ignoreList = properties.x_google_ignoreList;
3323
+ }
3324
+ }
3325
+ toString() {
3326
+ return JSON.stringify(this);
3327
+ }
3328
+ toUrl() {
3329
+ return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
3330
+ }
3331
+ };
3332
+ function guessIndent(code) {
3333
+ const lines = code.split("\n");
3334
+ const tabbed = lines.filter((line) => /^\t+/.test(line));
3335
+ const spaced = lines.filter((line) => /^ {2,}/.test(line));
3336
+ if (tabbed.length === 0 && spaced.length === 0) {
3337
+ return null;
3338
+ }
3339
+ if (tabbed.length >= spaced.length) {
3340
+ return " ";
3341
+ }
3342
+ const min = spaced.reduce((previous, current) => {
3343
+ const numSpaces = /^ +/.exec(current)[0].length;
3344
+ return Math.min(numSpaces, previous);
3345
+ }, Infinity);
3346
+ return new Array(min + 1).join(" ");
3347
+ }
3348
+ function getRelativePath(from, to) {
3349
+ const fromParts = from.split(/[/\\]/);
3350
+ const toParts = to.split(/[/\\]/);
3351
+ fromParts.pop();
3352
+ while (fromParts[0] === toParts[0]) {
3353
+ fromParts.shift();
3354
+ toParts.shift();
3355
+ }
3356
+ if (fromParts.length) {
3357
+ let i = fromParts.length;
3358
+ while (i--)
3359
+ fromParts[i] = "..";
3360
+ }
3361
+ return fromParts.concat(toParts).join("/");
3362
+ }
3363
+ var toString = Object.prototype.toString;
3364
+ function isObject(thing) {
3365
+ return toString.call(thing) === "[object Object]";
3366
+ }
3367
+ function getLocator(source) {
3368
+ const originalLines = source.split("\n");
3369
+ const lineOffsets = [];
3370
+ for (let i = 0, pos = 0; i < originalLines.length; i++) {
3371
+ lineOffsets.push(pos);
3372
+ pos += originalLines[i].length + 1;
3373
+ }
3374
+ return function locate(index) {
3375
+ let i = 0;
3376
+ let j = lineOffsets.length;
3377
+ while (i < j) {
3378
+ const m = i + j >> 1;
3379
+ if (index < lineOffsets[m]) {
3380
+ j = m;
3381
+ } else {
3382
+ i = m + 1;
3383
+ }
3384
+ }
3385
+ const line = i - 1;
3386
+ const column = index - lineOffsets[line];
3387
+ return { line, column };
3388
+ };
3389
+ }
3390
+ var wordRegex = /\w/;
3391
+ var Mappings = class {
3392
+ constructor(hires) {
3393
+ this.hires = hires;
3394
+ this.generatedCodeLine = 0;
3395
+ this.generatedCodeColumn = 0;
3396
+ this.raw = [];
3397
+ this.rawSegments = this.raw[this.generatedCodeLine] = [];
3398
+ this.pending = null;
3399
+ }
3400
+ addEdit(sourceIndex, content, loc, nameIndex) {
3401
+ if (content.length) {
3402
+ const contentLengthMinusOne = content.length - 1;
3403
+ let contentLineEnd = content.indexOf("\n", 0);
3404
+ let previousContentLineEnd = -1;
3405
+ while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
3406
+ const segment2 = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
3407
+ if (nameIndex >= 0) {
3408
+ segment2.push(nameIndex);
3409
+ }
3410
+ this.rawSegments.push(segment2);
3411
+ this.generatedCodeLine += 1;
3412
+ this.raw[this.generatedCodeLine] = this.rawSegments = [];
3413
+ this.generatedCodeColumn = 0;
3414
+ previousContentLineEnd = contentLineEnd;
3415
+ contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
3416
+ }
3417
+ const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
3418
+ if (nameIndex >= 0) {
3419
+ segment.push(nameIndex);
3420
+ }
3421
+ this.rawSegments.push(segment);
3422
+ this.advance(content.slice(previousContentLineEnd + 1));
3423
+ } else if (this.pending) {
3424
+ this.rawSegments.push(this.pending);
3425
+ this.advance(content);
3426
+ }
3427
+ this.pending = null;
3428
+ }
3429
+ addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
3430
+ let originalCharIndex = chunk.start;
3431
+ let first = true;
3432
+ let charInHiresBoundary = false;
3433
+ while (originalCharIndex < chunk.end) {
3434
+ if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
3435
+ const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
3436
+ if (this.hires === "boundary") {
3437
+ if (wordRegex.test(original[originalCharIndex])) {
3438
+ if (!charInHiresBoundary) {
3439
+ this.rawSegments.push(segment);
3440
+ charInHiresBoundary = true;
3441
+ }
3442
+ } else {
3443
+ this.rawSegments.push(segment);
3444
+ charInHiresBoundary = false;
3445
+ }
3446
+ } else {
3447
+ this.rawSegments.push(segment);
3448
+ }
3449
+ }
3450
+ if (original[originalCharIndex] === "\n") {
3451
+ loc.line += 1;
3452
+ loc.column = 0;
3453
+ this.generatedCodeLine += 1;
3454
+ this.raw[this.generatedCodeLine] = this.rawSegments = [];
3455
+ this.generatedCodeColumn = 0;
3456
+ first = true;
3457
+ } else {
3458
+ loc.column += 1;
3459
+ this.generatedCodeColumn += 1;
3460
+ first = false;
3461
+ }
3462
+ originalCharIndex += 1;
3463
+ }
3464
+ this.pending = null;
3465
+ }
3466
+ advance(str) {
3467
+ if (!str)
3468
+ return;
3469
+ const lines = str.split("\n");
3470
+ if (lines.length > 1) {
3471
+ for (let i = 0; i < lines.length - 1; i++) {
3472
+ this.generatedCodeLine++;
3473
+ this.raw[this.generatedCodeLine] = this.rawSegments = [];
3474
+ }
3475
+ this.generatedCodeColumn = 0;
3476
+ }
3477
+ this.generatedCodeColumn += lines[lines.length - 1].length;
3478
+ }
3479
+ };
3480
+ var n = "\n";
3481
+ var warned = {
3482
+ insertLeft: false,
3483
+ insertRight: false,
3484
+ storeName: false
3485
+ };
3486
+ var MagicString = class {
3487
+ constructor(string, options = {}) {
3488
+ const chunk = new Chunk(0, string.length, string);
3489
+ Object.defineProperties(this, {
3490
+ original: { writable: true, value: string },
3491
+ outro: { writable: true, value: "" },
3492
+ intro: { writable: true, value: "" },
3493
+ firstChunk: { writable: true, value: chunk },
3494
+ lastChunk: { writable: true, value: chunk },
3495
+ lastSearchedChunk: { writable: true, value: chunk },
3496
+ byStart: { writable: true, value: {} },
3497
+ byEnd: { writable: true, value: {} },
3498
+ filename: { writable: true, value: options.filename },
3499
+ indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
3500
+ sourcemapLocations: { writable: true, value: new BitSet() },
3501
+ storedNames: { writable: true, value: {} },
3502
+ indentStr: { writable: true, value: void 0 },
3503
+ ignoreList: { writable: true, value: options.ignoreList }
3504
+ });
3505
+ this.byStart[0] = chunk;
3506
+ this.byEnd[string.length] = chunk;
3507
+ }
3508
+ addSourcemapLocation(char) {
3509
+ this.sourcemapLocations.add(char);
3510
+ }
3511
+ append(content) {
3512
+ if (typeof content !== "string")
3513
+ throw new TypeError("outro content must be a string");
3514
+ this.outro += content;
3515
+ return this;
3516
+ }
3517
+ appendLeft(index, content) {
3518
+ if (typeof content !== "string")
3519
+ throw new TypeError("inserted content must be a string");
3520
+ this._split(index);
3521
+ const chunk = this.byEnd[index];
3522
+ if (chunk) {
3523
+ chunk.appendLeft(content);
3524
+ } else {
3525
+ this.intro += content;
3526
+ }
3527
+ return this;
3528
+ }
3529
+ appendRight(index, content) {
3530
+ if (typeof content !== "string")
3531
+ throw new TypeError("inserted content must be a string");
3532
+ this._split(index);
3533
+ const chunk = this.byStart[index];
3534
+ if (chunk) {
3535
+ chunk.appendRight(content);
3536
+ } else {
3537
+ this.outro += content;
3538
+ }
3539
+ return this;
3540
+ }
3541
+ clone() {
3542
+ const cloned = new MagicString(this.original, { filename: this.filename });
3543
+ let originalChunk = this.firstChunk;
3544
+ let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
3545
+ while (originalChunk) {
3546
+ cloned.byStart[clonedChunk.start] = clonedChunk;
3547
+ cloned.byEnd[clonedChunk.end] = clonedChunk;
3548
+ const nextOriginalChunk = originalChunk.next;
3549
+ const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
3550
+ if (nextClonedChunk) {
3551
+ clonedChunk.next = nextClonedChunk;
3552
+ nextClonedChunk.previous = clonedChunk;
3553
+ clonedChunk = nextClonedChunk;
3554
+ }
3555
+ originalChunk = nextOriginalChunk;
3556
+ }
3557
+ cloned.lastChunk = clonedChunk;
3558
+ if (this.indentExclusionRanges) {
3559
+ cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
3560
+ }
3561
+ cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
3562
+ cloned.intro = this.intro;
3563
+ cloned.outro = this.outro;
3564
+ return cloned;
3565
+ }
3566
+ generateDecodedMap(options) {
3567
+ options = options || {};
3568
+ const sourceIndex = 0;
3569
+ const names = Object.keys(this.storedNames);
3570
+ const mappings = new Mappings(options.hires);
3571
+ const locate = getLocator(this.original);
3572
+ if (this.intro) {
3573
+ mappings.advance(this.intro);
3574
+ }
3575
+ this.firstChunk.eachNext((chunk) => {
3576
+ const loc = locate(chunk.start);
3577
+ if (chunk.intro.length)
3578
+ mappings.advance(chunk.intro);
3579
+ if (chunk.edited) {
3580
+ mappings.addEdit(
3581
+ sourceIndex,
3582
+ chunk.content,
3583
+ loc,
3584
+ chunk.storeName ? names.indexOf(chunk.original) : -1
3585
+ );
3586
+ } else {
3587
+ mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
3588
+ }
3589
+ if (chunk.outro.length)
3590
+ mappings.advance(chunk.outro);
3591
+ });
3592
+ return {
3593
+ file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
3594
+ sources: [
3595
+ options.source ? getRelativePath(options.file || "", options.source) : options.file || ""
3596
+ ],
3597
+ sourcesContent: options.includeContent ? [this.original] : void 0,
3598
+ names,
3599
+ mappings: mappings.raw,
3600
+ x_google_ignoreList: this.ignoreList ? [sourceIndex] : void 0
3601
+ };
3602
+ }
3603
+ generateMap(options) {
3604
+ return new SourceMap(this.generateDecodedMap(options));
3605
+ }
3606
+ _ensureindentStr() {
3607
+ if (this.indentStr === void 0) {
3608
+ this.indentStr = guessIndent(this.original);
3609
+ }
3610
+ }
3611
+ _getRawIndentString() {
3612
+ this._ensureindentStr();
3613
+ return this.indentStr;
3614
+ }
3615
+ getIndentString() {
3616
+ this._ensureindentStr();
3617
+ return this.indentStr === null ? " " : this.indentStr;
3618
+ }
3619
+ indent(indentStr, options) {
3620
+ const pattern = /^[^\r\n]/gm;
3621
+ if (isObject(indentStr)) {
3622
+ options = indentStr;
3623
+ indentStr = void 0;
3624
+ }
3625
+ if (indentStr === void 0) {
3626
+ this._ensureindentStr();
3627
+ indentStr = this.indentStr || " ";
3628
+ }
3629
+ if (indentStr === "")
3630
+ return this;
3631
+ options = options || {};
3632
+ const isExcluded = {};
3633
+ if (options.exclude) {
3634
+ const exclusions = typeof options.exclude[0] === "number" ? [options.exclude] : options.exclude;
3635
+ exclusions.forEach((exclusion) => {
3636
+ for (let i = exclusion[0]; i < exclusion[1]; i += 1) {
3637
+ isExcluded[i] = true;
3638
+ }
3639
+ });
3640
+ }
3641
+ let shouldIndentNextCharacter = options.indentStart !== false;
3642
+ const replacer = (match) => {
3643
+ if (shouldIndentNextCharacter)
3644
+ return `${indentStr}${match}`;
3645
+ shouldIndentNextCharacter = true;
3646
+ return match;
3647
+ };
3648
+ this.intro = this.intro.replace(pattern, replacer);
3649
+ let charIndex = 0;
3650
+ let chunk = this.firstChunk;
3651
+ while (chunk) {
3652
+ const end = chunk.end;
3653
+ if (chunk.edited) {
3654
+ if (!isExcluded[charIndex]) {
3655
+ chunk.content = chunk.content.replace(pattern, replacer);
3656
+ if (chunk.content.length) {
3657
+ shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n";
3658
+ }
3659
+ }
3660
+ } else {
3661
+ charIndex = chunk.start;
3662
+ while (charIndex < end) {
3663
+ if (!isExcluded[charIndex]) {
3664
+ const char = this.original[charIndex];
3665
+ if (char === "\n") {
3666
+ shouldIndentNextCharacter = true;
3667
+ } else if (char !== "\r" && shouldIndentNextCharacter) {
3668
+ shouldIndentNextCharacter = false;
3669
+ if (charIndex === chunk.start) {
3670
+ chunk.prependRight(indentStr);
3671
+ } else {
3672
+ this._splitChunk(chunk, charIndex);
3673
+ chunk = chunk.next;
3674
+ chunk.prependRight(indentStr);
3675
+ }
3676
+ }
3677
+ }
3678
+ charIndex += 1;
3679
+ }
3680
+ }
3681
+ charIndex = chunk.end;
3682
+ chunk = chunk.next;
3683
+ }
3684
+ this.outro = this.outro.replace(pattern, replacer);
3685
+ return this;
3686
+ }
3687
+ insert() {
3688
+ throw new Error(
3689
+ "magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)"
3690
+ );
3691
+ }
3692
+ insertLeft(index, content) {
3693
+ if (!warned.insertLeft) {
3694
+ console.warn(
3695
+ "magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
3696
+ );
3697
+ warned.insertLeft = true;
3698
+ }
3699
+ return this.appendLeft(index, content);
3700
+ }
3701
+ insertRight(index, content) {
3702
+ if (!warned.insertRight) {
3703
+ console.warn(
3704
+ "magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
3705
+ );
3706
+ warned.insertRight = true;
3707
+ }
3708
+ return this.prependRight(index, content);
3709
+ }
3710
+ move(start, end, index) {
3711
+ if (index >= start && index <= end)
3712
+ throw new Error("Cannot move a selection inside itself");
3713
+ this._split(start);
3714
+ this._split(end);
3715
+ this._split(index);
3716
+ const first = this.byStart[start];
3717
+ const last = this.byEnd[end];
3718
+ const oldLeft = first.previous;
3719
+ const oldRight = last.next;
3720
+ const newRight = this.byStart[index];
3721
+ if (!newRight && last === this.lastChunk)
3722
+ return this;
3723
+ const newLeft = newRight ? newRight.previous : this.lastChunk;
3724
+ if (oldLeft)
3725
+ oldLeft.next = oldRight;
3726
+ if (oldRight)
3727
+ oldRight.previous = oldLeft;
3728
+ if (newLeft)
3729
+ newLeft.next = first;
3730
+ if (newRight)
3731
+ newRight.previous = last;
3732
+ if (!first.previous)
3733
+ this.firstChunk = last.next;
3734
+ if (!last.next) {
3735
+ this.lastChunk = first.previous;
3736
+ this.lastChunk.next = null;
3737
+ }
3738
+ first.previous = newLeft;
3739
+ last.next = newRight || null;
3740
+ if (!newLeft)
3741
+ this.firstChunk = first;
3742
+ if (!newRight)
3743
+ this.lastChunk = last;
3744
+ return this;
3745
+ }
3746
+ overwrite(start, end, content, options) {
3747
+ options = options || {};
3748
+ return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
3749
+ }
3750
+ update(start, end, content, options) {
3751
+ if (typeof content !== "string")
3752
+ throw new TypeError("replacement content must be a string");
3753
+ while (start < 0)
3754
+ start += this.original.length;
3755
+ while (end < 0)
3756
+ end += this.original.length;
3757
+ if (end > this.original.length)
3758
+ throw new Error("end is out of bounds");
3759
+ if (start === end)
3760
+ throw new Error(
3761
+ "Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead"
3762
+ );
3763
+ this._split(start);
3764
+ this._split(end);
3765
+ if (options === true) {
3766
+ if (!warned.storeName) {
3767
+ console.warn(
3768
+ "The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
3769
+ );
3770
+ warned.storeName = true;
3771
+ }
3772
+ options = { storeName: true };
3773
+ }
3774
+ const storeName = options !== void 0 ? options.storeName : false;
3775
+ const overwrite = options !== void 0 ? options.overwrite : false;
3776
+ if (storeName) {
3777
+ const original = this.original.slice(start, end);
3778
+ Object.defineProperty(this.storedNames, original, {
3779
+ writable: true,
3780
+ value: true,
3781
+ enumerable: true
3782
+ });
3783
+ }
3784
+ const first = this.byStart[start];
3785
+ const last = this.byEnd[end];
3786
+ if (first) {
3787
+ let chunk = first;
3788
+ while (chunk !== last) {
3789
+ if (chunk.next !== this.byStart[chunk.end]) {
3790
+ throw new Error("Cannot overwrite across a split point");
3791
+ }
3792
+ chunk = chunk.next;
3793
+ chunk.edit("", false);
3794
+ }
3795
+ first.edit(content, storeName, !overwrite);
3796
+ } else {
3797
+ const newChunk = new Chunk(start, end, "").edit(content, storeName);
3798
+ last.next = newChunk;
3799
+ newChunk.previous = last;
3800
+ }
3801
+ return this;
3802
+ }
3803
+ prepend(content) {
3804
+ if (typeof content !== "string")
3805
+ throw new TypeError("outro content must be a string");
3806
+ this.intro = content + this.intro;
3807
+ return this;
3808
+ }
3809
+ prependLeft(index, content) {
3810
+ if (typeof content !== "string")
3811
+ throw new TypeError("inserted content must be a string");
3812
+ this._split(index);
3813
+ const chunk = this.byEnd[index];
3814
+ if (chunk) {
3815
+ chunk.prependLeft(content);
3816
+ } else {
3817
+ this.intro = content + this.intro;
3818
+ }
3819
+ return this;
3820
+ }
3821
+ prependRight(index, content) {
3822
+ if (typeof content !== "string")
3823
+ throw new TypeError("inserted content must be a string");
3824
+ this._split(index);
3825
+ const chunk = this.byStart[index];
3826
+ if (chunk) {
3827
+ chunk.prependRight(content);
3828
+ } else {
3829
+ this.outro = content + this.outro;
3830
+ }
3831
+ return this;
3832
+ }
3833
+ remove(start, end) {
3834
+ while (start < 0)
3835
+ start += this.original.length;
3836
+ while (end < 0)
3837
+ end += this.original.length;
3838
+ if (start === end)
3839
+ return this;
3840
+ if (start < 0 || end > this.original.length)
3841
+ throw new Error("Character is out of bounds");
3842
+ if (start > end)
3843
+ throw new Error("end must be greater than start");
3844
+ this._split(start);
3845
+ this._split(end);
3846
+ let chunk = this.byStart[start];
3847
+ while (chunk) {
3848
+ chunk.intro = "";
3849
+ chunk.outro = "";
3850
+ chunk.edit("");
3851
+ chunk = end > chunk.end ? this.byStart[chunk.end] : null;
3852
+ }
3853
+ return this;
3854
+ }
3855
+ reset(start, end) {
3856
+ while (start < 0)
3857
+ start += this.original.length;
3858
+ while (end < 0)
3859
+ end += this.original.length;
3860
+ if (start === end)
3861
+ return this;
3862
+ if (start < 0 || end > this.original.length)
3863
+ throw new Error("Character is out of bounds");
3864
+ if (start > end)
3865
+ throw new Error("end must be greater than start");
3866
+ this._split(start);
3867
+ this._split(end);
3868
+ let chunk = this.byStart[start];
3869
+ while (chunk) {
3870
+ chunk.reset();
3871
+ chunk = end > chunk.end ? this.byStart[chunk.end] : null;
3872
+ }
3873
+ return this;
3874
+ }
3875
+ lastChar() {
3876
+ if (this.outro.length)
3877
+ return this.outro[this.outro.length - 1];
3878
+ let chunk = this.lastChunk;
3879
+ do {
3880
+ if (chunk.outro.length)
3881
+ return chunk.outro[chunk.outro.length - 1];
3882
+ if (chunk.content.length)
3883
+ return chunk.content[chunk.content.length - 1];
3884
+ if (chunk.intro.length)
3885
+ return chunk.intro[chunk.intro.length - 1];
3886
+ } while (chunk = chunk.previous);
3887
+ if (this.intro.length)
3888
+ return this.intro[this.intro.length - 1];
3889
+ return "";
3890
+ }
3891
+ lastLine() {
3892
+ let lineIndex = this.outro.lastIndexOf(n);
3893
+ if (lineIndex !== -1)
3894
+ return this.outro.substr(lineIndex + 1);
3895
+ let lineStr = this.outro;
3896
+ let chunk = this.lastChunk;
3897
+ do {
3898
+ if (chunk.outro.length > 0) {
3899
+ lineIndex = chunk.outro.lastIndexOf(n);
3900
+ if (lineIndex !== -1)
3901
+ return chunk.outro.substr(lineIndex + 1) + lineStr;
3902
+ lineStr = chunk.outro + lineStr;
3903
+ }
3904
+ if (chunk.content.length > 0) {
3905
+ lineIndex = chunk.content.lastIndexOf(n);
3906
+ if (lineIndex !== -1)
3907
+ return chunk.content.substr(lineIndex + 1) + lineStr;
3908
+ lineStr = chunk.content + lineStr;
3909
+ }
3910
+ if (chunk.intro.length > 0) {
3911
+ lineIndex = chunk.intro.lastIndexOf(n);
3912
+ if (lineIndex !== -1)
3913
+ return chunk.intro.substr(lineIndex + 1) + lineStr;
3914
+ lineStr = chunk.intro + lineStr;
3915
+ }
3916
+ } while (chunk = chunk.previous);
3917
+ lineIndex = this.intro.lastIndexOf(n);
3918
+ if (lineIndex !== -1)
3919
+ return this.intro.substr(lineIndex + 1) + lineStr;
3920
+ return this.intro + lineStr;
3921
+ }
3922
+ slice(start = 0, end = this.original.length) {
3923
+ while (start < 0)
3924
+ start += this.original.length;
3925
+ while (end < 0)
3926
+ end += this.original.length;
3927
+ let result = "";
3928
+ let chunk = this.firstChunk;
3929
+ while (chunk && (chunk.start > start || chunk.end <= start)) {
3930
+ if (chunk.start < end && chunk.end >= end) {
3931
+ return result;
3932
+ }
3933
+ chunk = chunk.next;
3934
+ }
3935
+ if (chunk && chunk.edited && chunk.start !== start)
3936
+ throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
3937
+ const startChunk = chunk;
3938
+ while (chunk) {
3939
+ if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
3940
+ result += chunk.intro;
3941
+ }
3942
+ const containsEnd = chunk.start < end && chunk.end >= end;
3943
+ if (containsEnd && chunk.edited && chunk.end !== end)
3944
+ throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
3945
+ const sliceStart = startChunk === chunk ? start - chunk.start : 0;
3946
+ const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
3947
+ result += chunk.content.slice(sliceStart, sliceEnd);
3948
+ if (chunk.outro && (!containsEnd || chunk.end === end)) {
3949
+ result += chunk.outro;
3950
+ }
3951
+ if (containsEnd) {
3952
+ break;
3953
+ }
3954
+ chunk = chunk.next;
3955
+ }
3956
+ return result;
3957
+ }
3958
+ snip(start, end) {
3959
+ const clone = this.clone();
3960
+ clone.remove(0, start);
3961
+ clone.remove(end, clone.original.length);
3962
+ return clone;
3963
+ }
3964
+ _split(index) {
3965
+ if (this.byStart[index] || this.byEnd[index])
3966
+ return;
3967
+ let chunk = this.lastSearchedChunk;
3968
+ const searchForward = index > chunk.end;
3969
+ while (chunk) {
3970
+ if (chunk.contains(index))
3971
+ return this._splitChunk(chunk, index);
3972
+ chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
3973
+ }
3974
+ }
3975
+ _splitChunk(chunk, index) {
3976
+ if (chunk.edited && chunk.content.length) {
3977
+ const loc = getLocator(this.original)(index);
3978
+ throw new Error(
3979
+ `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} \u2013 "${chunk.original}")`
3980
+ );
3981
+ }
3982
+ const newChunk = chunk.split(index);
3983
+ this.byEnd[index] = chunk;
3984
+ this.byStart[index] = newChunk;
3985
+ this.byEnd[newChunk.end] = newChunk;
3986
+ if (chunk === this.lastChunk)
3987
+ this.lastChunk = newChunk;
3988
+ this.lastSearchedChunk = chunk;
3989
+ return true;
3990
+ }
3991
+ toString() {
3992
+ let str = this.intro;
3993
+ let chunk = this.firstChunk;
3994
+ while (chunk) {
3995
+ str += chunk.toString();
3996
+ chunk = chunk.next;
3997
+ }
3998
+ return str + this.outro;
3999
+ }
4000
+ isEmpty() {
4001
+ let chunk = this.firstChunk;
4002
+ do {
4003
+ if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim())
4004
+ return false;
4005
+ } while (chunk = chunk.next);
4006
+ return true;
4007
+ }
4008
+ length() {
4009
+ let chunk = this.firstChunk;
4010
+ let length = 0;
4011
+ do {
4012
+ length += chunk.intro.length + chunk.content.length + chunk.outro.length;
4013
+ } while (chunk = chunk.next);
4014
+ return length;
4015
+ }
4016
+ trimLines() {
4017
+ return this.trim("[\\r\\n]");
4018
+ }
4019
+ trim(charType) {
4020
+ return this.trimStart(charType).trimEnd(charType);
4021
+ }
4022
+ trimEndAborted(charType) {
4023
+ const rx = new RegExp((charType || "\\s") + "+$");
4024
+ this.outro = this.outro.replace(rx, "");
4025
+ if (this.outro.length)
4026
+ return true;
4027
+ let chunk = this.lastChunk;
4028
+ do {
4029
+ const end = chunk.end;
4030
+ const aborted = chunk.trimEnd(rx);
4031
+ if (chunk.end !== end) {
4032
+ if (this.lastChunk === chunk) {
4033
+ this.lastChunk = chunk.next;
4034
+ }
4035
+ this.byEnd[chunk.end] = chunk;
4036
+ this.byStart[chunk.next.start] = chunk.next;
4037
+ this.byEnd[chunk.next.end] = chunk.next;
4038
+ }
4039
+ if (aborted)
4040
+ return true;
4041
+ chunk = chunk.previous;
4042
+ } while (chunk);
4043
+ return false;
4044
+ }
4045
+ trimEnd(charType) {
4046
+ this.trimEndAborted(charType);
4047
+ return this;
4048
+ }
4049
+ trimStartAborted(charType) {
4050
+ const rx = new RegExp("^" + (charType || "\\s") + "+");
4051
+ this.intro = this.intro.replace(rx, "");
4052
+ if (this.intro.length)
4053
+ return true;
4054
+ let chunk = this.firstChunk;
4055
+ do {
4056
+ const end = chunk.end;
4057
+ const aborted = chunk.trimStart(rx);
4058
+ if (chunk.end !== end) {
4059
+ if (chunk === this.lastChunk)
4060
+ this.lastChunk = chunk.next;
4061
+ this.byEnd[chunk.end] = chunk;
4062
+ this.byStart[chunk.next.start] = chunk.next;
4063
+ this.byEnd[chunk.next.end] = chunk.next;
4064
+ }
4065
+ if (aborted)
4066
+ return true;
4067
+ chunk = chunk.next;
4068
+ } while (chunk);
4069
+ return false;
4070
+ }
4071
+ trimStart(charType) {
4072
+ this.trimStartAborted(charType);
4073
+ return this;
4074
+ }
4075
+ hasChanged() {
4076
+ return this.original !== this.toString();
4077
+ }
4078
+ _replaceRegexp(searchValue, replacement) {
4079
+ function getReplacement(match, str) {
4080
+ if (typeof replacement === "string") {
4081
+ return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
4082
+ if (i === "$")
4083
+ return "$";
4084
+ if (i === "&")
4085
+ return match[0];
4086
+ const num = +i;
4087
+ if (num < match.length)
4088
+ return match[+i];
4089
+ return `$${i}`;
4090
+ });
4091
+ } else {
4092
+ return replacement(...match, match.index, str, match.groups);
4093
+ }
4094
+ }
4095
+ function matchAll(re, str) {
4096
+ let match;
4097
+ const matches = [];
4098
+ while (match = re.exec(str)) {
4099
+ matches.push(match);
4100
+ }
4101
+ return matches;
4102
+ }
4103
+ if (searchValue.global) {
4104
+ const matches = matchAll(searchValue, this.original);
4105
+ matches.forEach((match) => {
4106
+ if (match.index != null)
4107
+ this.overwrite(
4108
+ match.index,
4109
+ match.index + match[0].length,
4110
+ getReplacement(match, this.original)
4111
+ );
4112
+ });
4113
+ } else {
4114
+ const match = this.original.match(searchValue);
4115
+ if (match && match.index != null)
4116
+ this.overwrite(
4117
+ match.index,
4118
+ match.index + match[0].length,
4119
+ getReplacement(match, this.original)
4120
+ );
4121
+ }
4122
+ return this;
4123
+ }
4124
+ _replaceString(string, replacement) {
4125
+ const { original } = this;
4126
+ const index = original.indexOf(string);
4127
+ if (index !== -1) {
4128
+ this.overwrite(index, index + string.length, replacement);
4129
+ }
4130
+ return this;
4131
+ }
4132
+ replace(searchValue, replacement) {
4133
+ if (typeof searchValue === "string") {
4134
+ return this._replaceString(searchValue, replacement);
4135
+ }
4136
+ return this._replaceRegexp(searchValue, replacement);
4137
+ }
4138
+ _replaceAllString(string, replacement) {
4139
+ const { original } = this;
4140
+ const stringLength = string.length;
4141
+ for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
4142
+ this.overwrite(index, index + stringLength, replacement);
4143
+ }
4144
+ return this;
4145
+ }
4146
+ replaceAll(searchValue, replacement) {
4147
+ if (typeof searchValue === "string") {
4148
+ return this._replaceAllString(searchValue, replacement);
4149
+ }
4150
+ if (!searchValue.global) {
4151
+ throw new TypeError(
4152
+ "MagicString.prototype.replaceAll called with a non-global RegExp argument"
4153
+ );
4154
+ }
4155
+ return this._replaceRegexp(searchValue, replacement);
4156
+ }
4157
+ };
4158
+
3000
4159
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
3001
- import ts31 from "typescript";
4160
+ import ts32 from "typescript";
3002
4161
 
3003
4162
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/dom.mjs
3004
4163
  import { DomElementSchemaRegistry } from "@angular/compiler";
3005
- import ts19 from "typescript";
4164
+ import ts20 from "typescript";
3006
4165
  var REGISTRY = new DomElementSchemaRegistry();
3007
4166
  var REMOVE_XHTML_REGEX = /^:xhtml:/;
3008
4167
  var RegistryDomSchemaChecker = class {
@@ -3027,7 +4186,7 @@ var RegistryDomSchemaChecker = class {
3027
4186
  } else {
3028
4187
  errorMsg += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
3029
4188
  }
3030
- const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan, ts19.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ELEMENT), errorMsg);
4189
+ const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan, ts20.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ELEMENT), errorMsg);
3031
4190
  this._diagnostics.push(diag);
3032
4191
  }
3033
4192
  }
@@ -3047,14 +4206,14 @@ var RegistryDomSchemaChecker = class {
3047
4206
  2. If '${element.name}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas2} of this component to suppress this message.
3048
4207
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
3049
4208
  }
3050
- const diag = makeTemplateDiagnostic(id, mapping, span, ts19.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ATTRIBUTE), errorMsg);
4209
+ const diag = makeTemplateDiagnostic(id, mapping, span, ts20.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ATTRIBUTE), errorMsg);
3051
4210
  this._diagnostics.push(diag);
3052
4211
  }
3053
4212
  }
3054
4213
  };
3055
4214
 
3056
4215
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
3057
- import ts24 from "typescript";
4216
+ import ts25 from "typescript";
3058
4217
 
3059
4218
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/reference_emit_environment.mjs
3060
4219
  import { ExpressionType, ExternalExpr, TypeModifier } from "@angular/compiler";
@@ -3076,7 +4235,7 @@ var ReferenceEmitEnvironment = class {
3076
4235
  }
3077
4236
  referenceExternalSymbol(moduleName, name) {
3078
4237
  const external = new ExternalExpr({ moduleName, name });
3079
- return translateExpression(external, this.importManager);
4238
+ return translateExpression(this.contextFile, external, this.importManager);
3080
4239
  }
3081
4240
  referenceExternalType(moduleName, name, typeParams) {
3082
4241
  const external = new ExternalExpr({ moduleName, name });
@@ -3088,105 +4247,98 @@ var ReferenceEmitEnvironment = class {
3088
4247
  };
3089
4248
 
3090
4249
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/ts_util.mjs
3091
- import ts20 from "typescript";
4250
+ import ts21 from "typescript";
3092
4251
  var SAFE_TO_CAST_WITHOUT_PARENS = /* @__PURE__ */ new Set([
3093
- ts20.SyntaxKind.ParenthesizedExpression,
3094
- ts20.SyntaxKind.Identifier,
3095
- ts20.SyntaxKind.CallExpression,
3096
- ts20.SyntaxKind.NonNullExpression,
3097
- ts20.SyntaxKind.ElementAccessExpression,
3098
- ts20.SyntaxKind.PropertyAccessExpression,
3099
- ts20.SyntaxKind.ArrayLiteralExpression,
3100
- ts20.SyntaxKind.ObjectLiteralExpression,
3101
- ts20.SyntaxKind.StringLiteral,
3102
- ts20.SyntaxKind.NumericLiteral,
3103
- ts20.SyntaxKind.TrueKeyword,
3104
- ts20.SyntaxKind.FalseKeyword,
3105
- ts20.SyntaxKind.NullKeyword,
3106
- ts20.SyntaxKind.UndefinedKeyword
4252
+ ts21.SyntaxKind.ParenthesizedExpression,
4253
+ ts21.SyntaxKind.Identifier,
4254
+ ts21.SyntaxKind.CallExpression,
4255
+ ts21.SyntaxKind.NonNullExpression,
4256
+ ts21.SyntaxKind.ElementAccessExpression,
4257
+ ts21.SyntaxKind.PropertyAccessExpression,
4258
+ ts21.SyntaxKind.ArrayLiteralExpression,
4259
+ ts21.SyntaxKind.ObjectLiteralExpression,
4260
+ ts21.SyntaxKind.StringLiteral,
4261
+ ts21.SyntaxKind.NumericLiteral,
4262
+ ts21.SyntaxKind.TrueKeyword,
4263
+ ts21.SyntaxKind.FalseKeyword,
4264
+ ts21.SyntaxKind.NullKeyword,
4265
+ ts21.SyntaxKind.UndefinedKeyword
3107
4266
  ]);
3108
4267
  function tsCastToAny(expr) {
3109
4268
  if (!SAFE_TO_CAST_WITHOUT_PARENS.has(expr.kind)) {
3110
- expr = ts20.factory.createParenthesizedExpression(expr);
4269
+ expr = ts21.factory.createParenthesizedExpression(expr);
3111
4270
  }
3112
- return ts20.factory.createParenthesizedExpression(ts20.factory.createAsExpression(expr, ts20.factory.createKeywordTypeNode(ts20.SyntaxKind.AnyKeyword)));
4271
+ return ts21.factory.createParenthesizedExpression(ts21.factory.createAsExpression(expr, ts21.factory.createKeywordTypeNode(ts21.SyntaxKind.AnyKeyword)));
3113
4272
  }
3114
4273
  function tsCreateElement(tagName) {
3115
- const createElement = ts20.factory.createPropertyAccessExpression(
3116
- ts20.factory.createIdentifier("document"),
4274
+ const createElement = ts21.factory.createPropertyAccessExpression(
4275
+ ts21.factory.createIdentifier("document"),
3117
4276
  "createElement"
3118
4277
  );
3119
- return ts20.factory.createCallExpression(
4278
+ return ts21.factory.createCallExpression(
3120
4279
  createElement,
3121
4280
  void 0,
3122
- [ts20.factory.createStringLiteral(tagName)]
4281
+ [ts21.factory.createStringLiteral(tagName)]
3123
4282
  );
3124
4283
  }
3125
4284
  function tsDeclareVariable(id, type) {
3126
4285
  addExpressionIdentifier(type, ExpressionIdentifier.VARIABLE_AS_EXPRESSION);
3127
- const initializer = ts20.factory.createAsExpression(ts20.factory.createNonNullExpression(ts20.factory.createNull()), type);
3128
- const decl = ts20.factory.createVariableDeclaration(
4286
+ const initializer = ts21.factory.createAsExpression(ts21.factory.createNonNullExpression(ts21.factory.createNull()), type);
4287
+ const decl = ts21.factory.createVariableDeclaration(
3129
4288
  id,
3130
4289
  void 0,
3131
4290
  void 0,
3132
4291
  initializer
3133
4292
  );
3134
- return ts20.factory.createVariableStatement(
4293
+ return ts21.factory.createVariableStatement(
3135
4294
  void 0,
3136
4295
  [decl]
3137
4296
  );
3138
4297
  }
3139
4298
  function tsCreateTypeQueryForCoercedInput(typeName, coercedInputName) {
3140
- return ts20.factory.createTypeQueryNode(ts20.factory.createQualifiedName(typeName, `ngAcceptInputType_${coercedInputName}`));
4299
+ return ts21.factory.createTypeQueryNode(ts21.factory.createQualifiedName(typeName, `ngAcceptInputType_${coercedInputName}`));
3141
4300
  }
3142
4301
  function tsCreateVariable(id, initializer) {
3143
- const decl = ts20.factory.createVariableDeclaration(
4302
+ const decl = ts21.factory.createVariableDeclaration(
3144
4303
  id,
3145
4304
  void 0,
3146
4305
  void 0,
3147
4306
  initializer
3148
4307
  );
3149
- return ts20.factory.createVariableStatement(
4308
+ return ts21.factory.createVariableStatement(
3150
4309
  void 0,
3151
4310
  [decl]
3152
4311
  );
3153
4312
  }
3154
4313
  function tsCallMethod(receiver, methodName, args = []) {
3155
- const methodAccess = ts20.factory.createPropertyAccessExpression(receiver, methodName);
3156
- return ts20.factory.createCallExpression(
4314
+ const methodAccess = ts21.factory.createPropertyAccessExpression(receiver, methodName);
4315
+ return ts21.factory.createCallExpression(
3157
4316
  methodAccess,
3158
4317
  void 0,
3159
4318
  args
3160
4319
  );
3161
4320
  }
3162
4321
  function isAccessExpression(node) {
3163
- return ts20.isPropertyAccessExpression(node) || ts20.isElementAccessExpression(node);
4322
+ return ts21.isPropertyAccessExpression(node) || ts21.isElementAccessExpression(node);
3164
4323
  }
3165
4324
  function tsNumericExpression(value) {
3166
4325
  if (value < 0) {
3167
- const operand = ts20.factory.createNumericLiteral(Math.abs(value));
3168
- return ts20.factory.createPrefixUnaryExpression(ts20.SyntaxKind.MinusToken, operand);
3169
- }
3170
- return ts20.factory.createNumericLiteral(value);
3171
- }
3172
- function getImportString(imp) {
3173
- if (imp.qualifier === null) {
3174
- return `import from '${imp.specifier}';`;
3175
- } else {
3176
- return `import * as ${imp.qualifier.text} from '${imp.specifier}';`;
4326
+ const operand = ts21.factory.createNumericLiteral(Math.abs(value));
4327
+ return ts21.factory.createPrefixUnaryExpression(ts21.SyntaxKind.MinusToken, operand);
3177
4328
  }
4329
+ return ts21.factory.createNumericLiteral(value);
3178
4330
  }
3179
4331
 
3180
4332
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
3181
4333
  import { ExpressionType as ExpressionType2, R3Identifiers as R3Identifiers2, WrappedNodeExpr } from "@angular/compiler";
3182
- import ts23 from "typescript";
4334
+ import ts24 from "typescript";
3183
4335
 
3184
4336
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
3185
4337
  import { R3Identifiers } from "@angular/compiler";
3186
- import ts22 from "typescript";
4338
+ import ts23 from "typescript";
3187
4339
 
3188
4340
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
3189
- import ts21 from "typescript";
4341
+ import ts22 from "typescript";
3190
4342
  var TypeParameterEmitter = class {
3191
4343
  constructor(typeParameters, reflector) {
3192
4344
  this.typeParameters = typeParameters;
@@ -3223,11 +4375,11 @@ var TypeParameterEmitter = class {
3223
4375
  return this.typeParameters.map((typeParam) => {
3224
4376
  const constraint = typeParam.constraint !== void 0 ? emitter.emitType(typeParam.constraint) : void 0;
3225
4377
  const defaultType = typeParam.default !== void 0 ? emitter.emitType(typeParam.default) : void 0;
3226
- return ts21.factory.updateTypeParameterDeclaration(typeParam, typeParam.modifiers, typeParam.name, constraint, defaultType);
4378
+ return ts22.factory.updateTypeParameterDeclaration(typeParam, typeParam.modifiers, typeParam.name, constraint, defaultType);
3227
4379
  });
3228
4380
  }
3229
4381
  resolveTypeReference(type) {
3230
- const target = ts21.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
4382
+ const target = ts22.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
3231
4383
  const declaration = this.reflector.getDeclarationOfIdentifier(target);
3232
4384
  if (declaration === null || declaration.node === null) {
3233
4385
  return null;
@@ -3253,8 +4405,8 @@ var TypeParameterEmitter = class {
3253
4405
  if (typeNode === null) {
3254
4406
  return null;
3255
4407
  }
3256
- if (!ts21.isTypeReferenceNode(typeNode)) {
3257
- throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts21.SyntaxKind[typeNode.kind]}.`);
4408
+ if (!ts22.isTypeReferenceNode(typeNode)) {
4409
+ throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts22.SyntaxKind[typeNode.kind]}.`);
3258
4410
  }
3259
4411
  return typeNode;
3260
4412
  }
@@ -3264,8 +4416,8 @@ var TypeParameterEmitter = class {
3264
4416
  };
3265
4417
 
3266
4418
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
3267
- var TCB_FILE_IMPORT_GRAPH_PREPARE_MODULES = [
3268
- R3Identifiers.InputSignalBrandWriteType.moduleName
4419
+ var TCB_FILE_IMPORT_GRAPH_PREPARE_IDENTIFIERS = [
4420
+ R3Identifiers.InputSignalBrandWriteType
3269
4421
  ];
3270
4422
  var TcbInliningRequirement;
3271
4423
  (function(TcbInliningRequirement2) {
@@ -3299,14 +4451,14 @@ function getTemplateMapping(shimSf, position, resolver, isDiagnosticRequest) {
3299
4451
  }
3300
4452
  function findTypeCheckBlock(file, id, isDiagnosticRequest) {
3301
4453
  for (const stmt of file.statements) {
3302
- if (ts22.isFunctionDeclaration(stmt) && getTemplateId2(stmt, file, isDiagnosticRequest) === id) {
4454
+ if (ts23.isFunctionDeclaration(stmt) && getTemplateId2(stmt, file, isDiagnosticRequest) === id) {
3303
4455
  return stmt;
3304
4456
  }
3305
4457
  }
3306
4458
  return null;
3307
4459
  }
3308
4460
  function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
3309
- while (node !== void 0 && !ts22.isFunctionDeclaration(node)) {
4461
+ while (node !== void 0 && !ts23.isFunctionDeclaration(node)) {
3310
4462
  if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticsRequest) {
3311
4463
  return null;
3312
4464
  }
@@ -3323,7 +4475,7 @@ function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
3323
4475
  return null;
3324
4476
  }
3325
4477
  function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
3326
- while (!ts22.isFunctionDeclaration(node)) {
4478
+ while (!ts23.isFunctionDeclaration(node)) {
3327
4479
  if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticRequest) {
3328
4480
  return null;
3329
4481
  }
@@ -3333,8 +4485,8 @@ function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
3333
4485
  }
3334
4486
  }
3335
4487
  const start = node.getFullStart();
3336
- return ts22.forEachLeadingCommentRange(sourceFile.text, start, (pos, end, kind) => {
3337
- if (kind !== ts22.SyntaxKind.MultiLineCommentTrivia) {
4488
+ return ts23.forEachLeadingCommentRange(sourceFile.text, start, (pos, end, kind) => {
4489
+ if (kind !== ts23.SyntaxKind.MultiLineCommentTrivia) {
3338
4490
  return null;
3339
4491
  }
3340
4492
  const commentText = sourceFile.text.substring(pos + 2, end - 2);
@@ -3342,8 +4494,12 @@ function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
3342
4494
  }) || null;
3343
4495
  }
3344
4496
  function ensureTypeCheckFilePreparationImports(env) {
3345
- for (const moduleName of TCB_FILE_IMPORT_GRAPH_PREPARE_MODULES) {
3346
- env.importManager.generateNamespaceImport(moduleName);
4497
+ for (const identifier of TCB_FILE_IMPORT_GRAPH_PREPARE_IDENTIFIERS) {
4498
+ env.importManager.addImport({
4499
+ exportModuleSpecifier: identifier.moduleName,
4500
+ exportSymbolName: identifier.name,
4501
+ requestedFile: env.contextFile
4502
+ });
3347
4503
  }
3348
4504
  }
3349
4505
  function checkIfGenericTypeBoundsCanBeEmitted(node, reflector, env) {
@@ -3354,29 +4510,29 @@ function checkIfGenericTypeBoundsCanBeEmitted(node, reflector, env) {
3354
4510
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
3355
4511
  function generateTypeCtorDeclarationFn(env, meta, nodeTypeRef, typeParams) {
3356
4512
  const rawTypeArgs = typeParams !== void 0 ? generateGenericArgs(typeParams) : void 0;
3357
- const rawType = ts23.factory.createTypeReferenceNode(nodeTypeRef, rawTypeArgs);
4513
+ const rawType = ts24.factory.createTypeReferenceNode(nodeTypeRef, rawTypeArgs);
3358
4514
  const initParam = constructTypeCtorParameter(env, meta, rawType);
3359
4515
  const typeParameters = typeParametersWithDefaultTypes(typeParams);
3360
4516
  if (meta.body) {
3361
- const fnType = ts23.factory.createFunctionTypeNode(
4517
+ const fnType = ts24.factory.createFunctionTypeNode(
3362
4518
  typeParameters,
3363
4519
  [initParam],
3364
4520
  rawType
3365
4521
  );
3366
- const decl = ts23.factory.createVariableDeclaration(
4522
+ const decl = ts24.factory.createVariableDeclaration(
3367
4523
  meta.fnName,
3368
4524
  void 0,
3369
4525
  fnType,
3370
- ts23.factory.createNonNullExpression(ts23.factory.createNull())
4526
+ ts24.factory.createNonNullExpression(ts24.factory.createNull())
3371
4527
  );
3372
- const declList = ts23.factory.createVariableDeclarationList([decl], ts23.NodeFlags.Const);
3373
- return ts23.factory.createVariableStatement(
4528
+ const declList = ts24.factory.createVariableDeclarationList([decl], ts24.NodeFlags.Const);
4529
+ return ts24.factory.createVariableStatement(
3374
4530
  void 0,
3375
4531
  declList
3376
4532
  );
3377
4533
  } else {
3378
- return ts23.factory.createFunctionDeclaration(
3379
- [ts23.factory.createModifier(ts23.SyntaxKind.DeclareKeyword)],
4534
+ return ts24.factory.createFunctionDeclaration(
4535
+ [ts24.factory.createModifier(ts24.SyntaxKind.DeclareKeyword)],
3380
4536
  void 0,
3381
4537
  meta.fnName,
3382
4538
  typeParameters,
@@ -3388,16 +4544,16 @@ function generateTypeCtorDeclarationFn(env, meta, nodeTypeRef, typeParams) {
3388
4544
  }
3389
4545
  function generateInlineTypeCtor(env, node, meta) {
3390
4546
  const rawTypeArgs = node.typeParameters !== void 0 ? generateGenericArgs(node.typeParameters) : void 0;
3391
- const rawType = ts23.factory.createTypeReferenceNode(node.name, rawTypeArgs);
4547
+ const rawType = ts24.factory.createTypeReferenceNode(node.name, rawTypeArgs);
3392
4548
  const initParam = constructTypeCtorParameter(env, meta, rawType);
3393
4549
  let body = void 0;
3394
4550
  if (meta.body) {
3395
- body = ts23.factory.createBlock([
3396
- ts23.factory.createReturnStatement(ts23.factory.createNonNullExpression(ts23.factory.createNull()))
4551
+ body = ts24.factory.createBlock([
4552
+ ts24.factory.createReturnStatement(ts24.factory.createNonNullExpression(ts24.factory.createNull()))
3397
4553
  ]);
3398
4554
  }
3399
- return ts23.factory.createMethodDeclaration(
3400
- [ts23.factory.createModifier(ts23.SyntaxKind.StaticKeyword)],
4555
+ return ts24.factory.createMethodDeclaration(
4556
+ [ts24.factory.createModifier(ts24.SyntaxKind.StaticKeyword)],
3401
4557
  void 0,
3402
4558
  meta.fnName,
3403
4559
  void 0,
@@ -3414,12 +4570,12 @@ function constructTypeCtorParameter(env, meta, rawType) {
3414
4570
  const signalInputKeys = [];
3415
4571
  for (const { classPropertyName, transform, isSignal } of meta.fields.inputs) {
3416
4572
  if (isSignal) {
3417
- signalInputKeys.push(ts23.factory.createLiteralTypeNode(ts23.factory.createStringLiteral(classPropertyName)));
4573
+ signalInputKeys.push(ts24.factory.createLiteralTypeNode(ts24.factory.createStringLiteral(classPropertyName)));
3418
4574
  } else if (!meta.coercedInputFields.has(classPropertyName)) {
3419
- plainKeys.push(ts23.factory.createLiteralTypeNode(ts23.factory.createStringLiteral(classPropertyName)));
4575
+ plainKeys.push(ts24.factory.createLiteralTypeNode(ts24.factory.createStringLiteral(classPropertyName)));
3420
4576
  } else {
3421
4577
  const coercionType = transform != null ? transform.type.node : tsCreateTypeQueryForCoercedInput(rawType.typeName, classPropertyName);
3422
- coercedKeys.push(ts23.factory.createPropertySignature(
4578
+ coercedKeys.push(ts24.factory.createPropertySignature(
3423
4579
  void 0,
3424
4580
  classPropertyName,
3425
4581
  void 0,
@@ -3428,25 +4584,25 @@ function constructTypeCtorParameter(env, meta, rawType) {
3428
4584
  }
3429
4585
  }
3430
4586
  if (plainKeys.length > 0) {
3431
- const keyTypeUnion = ts23.factory.createUnionTypeNode(plainKeys);
3432
- initType = ts23.factory.createTypeReferenceNode("Pick", [rawType, keyTypeUnion]);
4587
+ const keyTypeUnion = ts24.factory.createUnionTypeNode(plainKeys);
4588
+ initType = ts24.factory.createTypeReferenceNode("Pick", [rawType, keyTypeUnion]);
3433
4589
  }
3434
4590
  if (coercedKeys.length > 0) {
3435
- const coercedLiteral = ts23.factory.createTypeLiteralNode(coercedKeys);
3436
- initType = initType !== null ? ts23.factory.createIntersectionTypeNode([initType, coercedLiteral]) : coercedLiteral;
4591
+ const coercedLiteral = ts24.factory.createTypeLiteralNode(coercedKeys);
4592
+ initType = initType !== null ? ts24.factory.createIntersectionTypeNode([initType, coercedLiteral]) : coercedLiteral;
3437
4593
  }
3438
4594
  if (signalInputKeys.length > 0) {
3439
- const keyTypeUnion = ts23.factory.createUnionTypeNode(signalInputKeys);
4595
+ const keyTypeUnion = ts24.factory.createUnionTypeNode(signalInputKeys);
3440
4596
  const unwrapDirectiveSignalInputsExpr = env.referenceExternalType(R3Identifiers2.UnwrapDirectiveSignalInputs.moduleName, R3Identifiers2.UnwrapDirectiveSignalInputs.name, [
3441
4597
  new ExpressionType2(new WrappedNodeExpr(rawType)),
3442
4598
  new ExpressionType2(new WrappedNodeExpr(keyTypeUnion))
3443
4599
  ]);
3444
- initType = initType !== null ? ts23.factory.createIntersectionTypeNode([initType, unwrapDirectiveSignalInputsExpr]) : unwrapDirectiveSignalInputsExpr;
4600
+ initType = initType !== null ? ts24.factory.createIntersectionTypeNode([initType, unwrapDirectiveSignalInputsExpr]) : unwrapDirectiveSignalInputsExpr;
3445
4601
  }
3446
4602
  if (initType === null) {
3447
- initType = ts23.factory.createTypeLiteralNode([]);
4603
+ initType = ts24.factory.createTypeLiteralNode([]);
3448
4604
  }
3449
- return ts23.factory.createParameterDeclaration(
4605
+ return ts24.factory.createParameterDeclaration(
3450
4606
  void 0,
3451
4607
  void 0,
3452
4608
  "init",
@@ -3456,7 +4612,7 @@ function constructTypeCtorParameter(env, meta, rawType) {
3456
4612
  );
3457
4613
  }
3458
4614
  function generateGenericArgs(params) {
3459
- return params.map((param) => ts23.factory.createTypeReferenceNode(param.name, void 0));
4615
+ return params.map((param) => ts24.factory.createTypeReferenceNode(param.name, void 0));
3460
4616
  }
3461
4617
  function requiresInlineTypeCtor(node, host, env) {
3462
4618
  return !checkIfGenericTypeBoundsCanBeEmitted(node, host, env);
@@ -3467,7 +4623,7 @@ function typeParametersWithDefaultTypes(params) {
3467
4623
  }
3468
4624
  return params.map((param) => {
3469
4625
  if (param.default === void 0) {
3470
- return ts23.factory.updateTypeParameterDeclaration(param, param.modifiers, param.name, param.constraint, ts23.factory.createKeywordTypeNode(ts23.SyntaxKind.AnyKeyword));
4626
+ return ts24.factory.updateTypeParameterDeclaration(param, param.modifiers, param.name, param.constraint, ts24.factory.createKeywordTypeNode(ts24.SyntaxKind.AnyKeyword));
3471
4627
  } else {
3472
4628
  return param;
3473
4629
  }
@@ -3496,13 +4652,13 @@ var Environment = class extends ReferenceEmitEnvironment {
3496
4652
  }
3497
4653
  if (requiresInlineTypeCtor(node, this.reflector, this)) {
3498
4654
  const ref = this.reference(dirRef);
3499
- const typeCtorExpr = ts24.factory.createPropertyAccessExpression(ref, "ngTypeCtor");
4655
+ const typeCtorExpr = ts25.factory.createPropertyAccessExpression(ref, "ngTypeCtor");
3500
4656
  this.typeCtors.set(node, typeCtorExpr);
3501
4657
  return typeCtorExpr;
3502
4658
  } else {
3503
4659
  const fnName = `_ctor${this.nextIds.typeCtor++}`;
3504
4660
  const nodeTypeRef = this.referenceType(dirRef);
3505
- if (!ts24.isTypeReferenceNode(nodeTypeRef)) {
4661
+ if (!ts25.isTypeReferenceNode(nodeTypeRef)) {
3506
4662
  throw new Error(`Expected TypeReferenceNode from reference to ${dirRef.debugName}`);
3507
4663
  }
3508
4664
  const meta = {
@@ -3517,7 +4673,7 @@ var Environment = class extends ReferenceEmitEnvironment {
3517
4673
  const typeParams = this.emitTypeParameters(node);
3518
4674
  const typeCtor = generateTypeCtorDeclarationFn(this, meta, nodeTypeRef.typeName, typeParams);
3519
4675
  this.typeCtorStatements.push(typeCtor);
3520
- const fnId = ts24.factory.createIdentifier(fnName);
4676
+ const fnId = ts25.factory.createIdentifier(fnName);
3521
4677
  this.typeCtors.set(node, fnId);
3522
4678
  return fnId;
3523
4679
  }
@@ -3527,7 +4683,7 @@ var Environment = class extends ReferenceEmitEnvironment {
3527
4683
  return this.pipeInsts.get(ref.node);
3528
4684
  }
3529
4685
  const pipeType = this.referenceType(ref);
3530
- const pipeInstId = ts24.factory.createIdentifier(`_pipe${this.nextIds.pipeInst++}`);
4686
+ const pipeInstId = ts25.factory.createIdentifier(`_pipe${this.nextIds.pipeInst++}`);
3531
4687
  this.pipeInstStatements.push(tsDeclareVariable(pipeInstId, pipeType));
3532
4688
  this.pipeInsts.set(ref.node, pipeInstId);
3533
4689
  return pipeInstId;
@@ -3535,7 +4691,7 @@ var Environment = class extends ReferenceEmitEnvironment {
3535
4691
  reference(ref) {
3536
4692
  const ngExpr = this.refEmitter.emit(ref, this.contextFile, ImportFlags.NoAliasing);
3537
4693
  assertSuccessfulReferenceEmit(ngExpr, this.contextFile, "class");
3538
- return translateExpression(ngExpr.expression, this.importManager);
4694
+ return translateExpression(this.contextFile, ngExpr.expression, this.importManager);
3539
4695
  }
3540
4696
  emitTypeParameters(declaration) {
3541
4697
  const emitter = new TypeParameterEmitter(declaration.typeParameters, this.reflector);
@@ -3551,7 +4707,7 @@ var Environment = class extends ReferenceEmitEnvironment {
3551
4707
 
3552
4708
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/oob.mjs
3553
4709
  import { AbsoluteSourceSpan as AbsoluteSourceSpan3, TmplAstElement as TmplAstElement2, TmplAstForLoopBlock, TmplAstForLoopBlockEmpty } from "@angular/compiler";
3554
- import ts25 from "typescript";
4710
+ import ts26 from "typescript";
3555
4711
  var OutOfBandDiagnosticRecorderImpl = class {
3556
4712
  constructor(resolver) {
3557
4713
  this.resolver = resolver;
@@ -3565,7 +4721,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
3565
4721
  const mapping = this.resolver.getSourceMapping(templateId);
3566
4722
  const value = ref.value.trim();
3567
4723
  const errorMsg = `No directive found with exportAs '${value}'.`;
3568
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
4724
+ this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan, ts26.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
3569
4725
  }
3570
4726
  missingPipe(templateId, ast) {
3571
4727
  if (this.recordedPipes.has(ast)) {
@@ -3577,7 +4733,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
3577
4733
  if (sourceSpan === null) {
3578
4734
  throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
3579
4735
  }
3580
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
4736
+ this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts26.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
3581
4737
  this.recordedPipes.add(ast);
3582
4738
  }
3583
4739
  deferredPipeUsedEagerly(templateId, ast) {
@@ -3590,7 +4746,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
3590
4746
  if (sourceSpan === null) {
3591
4747
  throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
3592
4748
  }
3593
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_PIPE_USED_EAGERLY), errorMsg));
4749
+ this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts26.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_PIPE_USED_EAGERLY), errorMsg));
3594
4750
  this.recordedPipes.add(ast);
3595
4751
  }
3596
4752
  deferredComponentUsedEagerly(templateId, element) {
@@ -3602,12 +4758,12 @@ var OutOfBandDiagnosticRecorderImpl = class {
3602
4758
  if (sourceSpan === null) {
3603
4759
  throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${element.name}'.`);
3604
4760
  }
3605
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_DIRECTIVE_USED_EAGERLY), errorMsg));
4761
+ this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts26.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_DIRECTIVE_USED_EAGERLY), errorMsg));
3606
4762
  }
3607
4763
  duplicateTemplateVar(templateId, variable, firstDecl) {
3608
4764
  const mapping = this.resolver.getSourceMapping(templateId);
3609
4765
  const errorMsg = `Cannot redeclare variable '${variable.name}' as it was previously declared elsewhere for the same template.`;
3610
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DUPLICATE_VARIABLE_DECLARATION), errorMsg, [{
4766
+ this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan, ts26.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DUPLICATE_VARIABLE_DECLARATION), errorMsg, [{
3611
4767
  text: `The variable '${firstDecl.name}' was first declared here.`,
3612
4768
  start: firstDecl.sourceSpan.start.offset,
3613
4769
  end: firstDecl.sourceSpan.end.offset,
@@ -3646,7 +4802,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
3646
4802
  const message = `This structural directive supports advanced type inference, but the current compiler configuration prevents its usage. The variable ${varIdentification} will have type 'any' as a result.
3647
4803
 
3648
4804
  Consider enabling the 'strictTemplates' option in your tsconfig.json for better type inference within this template.`;
3649
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan, ts25.DiagnosticCategory.Suggestion, ngErrorCode(ErrorCode.SUGGEST_SUBOPTIMAL_TYPE_INFERENCE), message));
4805
+ this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan, ts26.DiagnosticCategory.Suggestion, ngErrorCode(ErrorCode.SUGGEST_SUBOPTIMAL_TYPE_INFERENCE), message));
3650
4806
  }
3651
4807
  splitTwoWayBinding(templateId, input, output, inputConsumer, outputConsumer) {
3652
4808
  const mapping = this.resolver.getSourceMapping(templateId);
@@ -3680,11 +4836,11 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
3680
4836
  sourceFile: outputConsumer.name.getSourceFile()
3681
4837
  });
3682
4838
  }
3683
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SPLIT_TWO_WAY_BINDING), errorMsg, relatedMessages));
4839
+ this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan, ts26.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SPLIT_TWO_WAY_BINDING), errorMsg, relatedMessages));
3684
4840
  }
3685
4841
  missingRequiredInputs(templateId, element, directiveName, isComponent, inputAliases) {
3686
- const message = `Required input${inputAliases.length === 1 ? "" : "s"} ${inputAliases.map((n) => `'${n}'`).join(", ")} from ${isComponent ? "component" : "directive"} ${directiveName} must be specified.`;
3687
- this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), element.startSourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REQUIRED_INPUTS), message));
4842
+ const message = `Required input${inputAliases.length === 1 ? "" : "s"} ${inputAliases.map((n2) => `'${n2}'`).join(", ")} from ${isComponent ? "component" : "directive"} ${directiveName} must be specified.`;
4843
+ this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), element.startSourceSpan, ts26.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REQUIRED_INPUTS), message));
3688
4844
  }
3689
4845
  illegalForLoopTrackAccess(templateId, block, access) {
3690
4846
  const sourceSpan = this.resolver.toParseSourceSpan(templateId, access.sourceSpan);
@@ -3692,7 +4848,7 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
3692
4848
  throw new Error(`Assertion failure: no SourceLocation found for property read.`);
3693
4849
  }
3694
4850
  const message = `Cannot access '${access.name}' inside of a track expression. Only '${block.item.name}', '${block.contextVariables.$index.name}' and properties on the containing component are available to this expression.`;
3695
- this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.ILLEGAL_FOR_LOOP_TRACK_ACCESS), message));
4851
+ this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan, ts26.DiagnosticCategory.Error, ngErrorCode(ErrorCode.ILLEGAL_FOR_LOOP_TRACK_ACCESS), message));
3696
4852
  }
3697
4853
  inaccessibleDeferredTriggerElement(templateId, trigger) {
3698
4854
  let message;
@@ -3703,7 +4859,7 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
3703
4859
  Check that an element with #${trigger.reference} exists in the same template and it's accessible from the @defer block.
3704
4860
  Deferred blocks can only access triggers in same view, a parent embedded view or the root view of the @placeholder block.`;
3705
4861
  }
3706
- this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), trigger.sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT), message));
4862
+ this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), trigger.sourceSpan, ts26.DiagnosticCategory.Error, ngErrorCode(ErrorCode.INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT), message));
3707
4863
  }
3708
4864
  controlFlowPreventingContentProjection(templateId, category, projectionNode, componentName, slotSelector, controlFlowNode, preservesWhitespaces) {
3709
4865
  let blockName;
@@ -3737,7 +4893,7 @@ function makeInlineDiagnostic(templateId, code, node, messageText, relatedInform
3737
4893
  }
3738
4894
 
3739
4895
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/shim.mjs
3740
- import ts26 from "typescript";
4896
+ import ts27 from "typescript";
3741
4897
  var TypeCheckShimGenerator = class {
3742
4898
  constructor() {
3743
4899
  this.extensionPrefix = "ngtypecheck";
@@ -3747,7 +4903,7 @@ var TypeCheckShimGenerator = class {
3747
4903
  if (priorShimSf !== null) {
3748
4904
  return priorShimSf;
3749
4905
  }
3750
- return ts26.createSourceFile(genFilePath, "export const USED_FOR_NG_TYPE_CHECKING = true;", ts26.ScriptTarget.Latest, true, ts26.ScriptKind.TS);
4906
+ return ts27.createSourceFile(genFilePath, "export const USED_FOR_NG_TYPE_CHECKING = true;", ts27.ScriptTarget.Latest, true, ts27.ScriptKind.TS);
3751
4907
  }
3752
4908
  static shimFor(fileName) {
3753
4909
  return absoluteFrom(fileName.replace(/\.tsx?$/, ".ngtypecheck.ts"));
@@ -3756,16 +4912,16 @@ var TypeCheckShimGenerator = class {
3756
4912
 
3757
4913
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
3758
4914
  import { BindingPipe, Call as Call2, createCssSelectorFromNode, CssSelector, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver3, PropertyRead as PropertyRead4, PropertyWrite as PropertyWrite3, R3Identifiers as R3Identifiers3, SafeCall, SafePropertyRead as SafePropertyRead3, SelectorMatcher, ThisReceiver, TmplAstBoundAttribute, TmplAstBoundText, TmplAstDeferredBlock, TmplAstElement as TmplAstElement3, TmplAstForLoopBlock as TmplAstForLoopBlock2, TmplAstIcu, TmplAstIfBlock, TmplAstIfBlockBranch, TmplAstReference as TmplAstReference3, TmplAstSwitchBlock, TmplAstTemplate as TmplAstTemplate2, TmplAstText, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable, TransplantedType } from "@angular/compiler";
3759
- import ts29 from "typescript";
4915
+ import ts30 from "typescript";
3760
4916
 
3761
4917
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.mjs
3762
4918
  import { AbsoluteSourceSpan as AbsoluteSourceSpan4 } from "@angular/compiler";
3763
- import ts27 from "typescript";
4919
+ import ts28 from "typescript";
3764
4920
  function wrapForDiagnostics(expr) {
3765
- return ts27.factory.createParenthesizedExpression(expr);
4921
+ return ts28.factory.createParenthesizedExpression(expr);
3766
4922
  }
3767
4923
  function wrapForTypeChecker(expr) {
3768
- return ts27.factory.createParenthesizedExpression(expr);
4924
+ return ts28.factory.createParenthesizedExpression(expr);
3769
4925
  }
3770
4926
  function addParseSpanInfo(node, span) {
3771
4927
  let commentText;
@@ -3774,10 +4930,10 @@ function addParseSpanInfo(node, span) {
3774
4930
  } else {
3775
4931
  commentText = `${span.start.offset},${span.end.offset}`;
3776
4932
  }
3777
- ts27.addSyntheticTrailingComment(node, ts27.SyntaxKind.MultiLineCommentTrivia, commentText, false);
4933
+ ts28.addSyntheticTrailingComment(node, ts28.SyntaxKind.MultiLineCommentTrivia, commentText, false);
3778
4934
  }
3779
4935
  function addTemplateId(tcb, id) {
3780
- ts27.addSyntheticLeadingComment(tcb, ts27.SyntaxKind.MultiLineCommentTrivia, id, true);
4936
+ ts28.addSyntheticLeadingComment(tcb, ts28.SyntaxKind.MultiLineCommentTrivia, id, true);
3781
4937
  }
3782
4938
  function shouldReportDiagnostic(diagnostic) {
3783
4939
  const { code } = diagnostic;
@@ -3806,32 +4962,32 @@ function translateDiagnostic(diagnostic, resolver) {
3806
4962
 
3807
4963
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/expression.mjs
3808
4964
  import { ASTWithSource as ASTWithSource2, Call, EmptyExpr as EmptyExpr2, PropertyRead as PropertyRead3, SafeKeyedRead, SafePropertyRead as SafePropertyRead2 } from "@angular/compiler";
3809
- import ts28 from "typescript";
3810
- var NULL_AS_ANY = ts28.factory.createAsExpression(ts28.factory.createNull(), ts28.factory.createKeywordTypeNode(ts28.SyntaxKind.AnyKeyword));
3811
- var UNDEFINED = ts28.factory.createIdentifier("undefined");
4965
+ import ts29 from "typescript";
4966
+ var NULL_AS_ANY = ts29.factory.createAsExpression(ts29.factory.createNull(), ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
4967
+ var UNDEFINED = ts29.factory.createIdentifier("undefined");
3812
4968
  var UNARY_OPS = /* @__PURE__ */ new Map([
3813
- ["+", ts28.SyntaxKind.PlusToken],
3814
- ["-", ts28.SyntaxKind.MinusToken]
4969
+ ["+", ts29.SyntaxKind.PlusToken],
4970
+ ["-", ts29.SyntaxKind.MinusToken]
3815
4971
  ]);
3816
4972
  var BINARY_OPS = /* @__PURE__ */ new Map([
3817
- ["+", ts28.SyntaxKind.PlusToken],
3818
- ["-", ts28.SyntaxKind.MinusToken],
3819
- ["<", ts28.SyntaxKind.LessThanToken],
3820
- [">", ts28.SyntaxKind.GreaterThanToken],
3821
- ["<=", ts28.SyntaxKind.LessThanEqualsToken],
3822
- [">=", ts28.SyntaxKind.GreaterThanEqualsToken],
3823
- ["==", ts28.SyntaxKind.EqualsEqualsToken],
3824
- ["===", ts28.SyntaxKind.EqualsEqualsEqualsToken],
3825
- ["*", ts28.SyntaxKind.AsteriskToken],
3826
- ["/", ts28.SyntaxKind.SlashToken],
3827
- ["%", ts28.SyntaxKind.PercentToken],
3828
- ["!=", ts28.SyntaxKind.ExclamationEqualsToken],
3829
- ["!==", ts28.SyntaxKind.ExclamationEqualsEqualsToken],
3830
- ["||", ts28.SyntaxKind.BarBarToken],
3831
- ["&&", ts28.SyntaxKind.AmpersandAmpersandToken],
3832
- ["&", ts28.SyntaxKind.AmpersandToken],
3833
- ["|", ts28.SyntaxKind.BarToken],
3834
- ["??", ts28.SyntaxKind.QuestionQuestionToken]
4973
+ ["+", ts29.SyntaxKind.PlusToken],
4974
+ ["-", ts29.SyntaxKind.MinusToken],
4975
+ ["<", ts29.SyntaxKind.LessThanToken],
4976
+ [">", ts29.SyntaxKind.GreaterThanToken],
4977
+ ["<=", ts29.SyntaxKind.LessThanEqualsToken],
4978
+ [">=", ts29.SyntaxKind.GreaterThanEqualsToken],
4979
+ ["==", ts29.SyntaxKind.EqualsEqualsToken],
4980
+ ["===", ts29.SyntaxKind.EqualsEqualsEqualsToken],
4981
+ ["*", ts29.SyntaxKind.AsteriskToken],
4982
+ ["/", ts29.SyntaxKind.SlashToken],
4983
+ ["%", ts29.SyntaxKind.PercentToken],
4984
+ ["!=", ts29.SyntaxKind.ExclamationEqualsToken],
4985
+ ["!==", ts29.SyntaxKind.ExclamationEqualsEqualsToken],
4986
+ ["||", ts29.SyntaxKind.BarBarToken],
4987
+ ["&&", ts29.SyntaxKind.AmpersandAmpersandToken],
4988
+ ["&", ts29.SyntaxKind.AmpersandToken],
4989
+ ["|", ts29.SyntaxKind.BarToken],
4990
+ ["??", ts29.SyntaxKind.QuestionQuestionToken]
3835
4991
  ]);
3836
4992
  function astToTypescript(ast, maybeResolve, config) {
3837
4993
  const translator = new AstTranslator(maybeResolve, config);
@@ -3847,7 +5003,7 @@ var AstTranslator = class {
3847
5003
  ast = ast.ast;
3848
5004
  }
3849
5005
  if (ast instanceof EmptyExpr2) {
3850
- const res = ts28.factory.createIdentifier("undefined");
5006
+ const res = ts29.factory.createIdentifier("undefined");
3851
5007
  addParseSpanInfo(res, ast.sourceSpan);
3852
5008
  return res;
3853
5009
  }
@@ -3863,7 +5019,7 @@ var AstTranslator = class {
3863
5019
  if (op === void 0) {
3864
5020
  throw new Error(`Unsupported Unary.operator: ${ast.operator}`);
3865
5021
  }
3866
- const node = wrapForDiagnostics(ts28.factory.createPrefixUnaryExpression(op, expr));
5022
+ const node = wrapForDiagnostics(ts29.factory.createPrefixUnaryExpression(op, expr));
3867
5023
  addParseSpanInfo(node, ast.sourceSpan);
3868
5024
  return node;
3869
5025
  }
@@ -3874,13 +5030,13 @@ var AstTranslator = class {
3874
5030
  if (op === void 0) {
3875
5031
  throw new Error(`Unsupported Binary.operation: ${ast.operation}`);
3876
5032
  }
3877
- const node = ts28.factory.createBinaryExpression(lhs, op, rhs);
5033
+ const node = ts29.factory.createBinaryExpression(lhs, op, rhs);
3878
5034
  addParseSpanInfo(node, ast.sourceSpan);
3879
5035
  return node;
3880
5036
  }
3881
5037
  visitChain(ast) {
3882
5038
  const elements = ast.expressions.map((expr) => this.translate(expr));
3883
- const node = wrapForDiagnostics(ts28.factory.createCommaListExpression(elements));
5039
+ const node = wrapForDiagnostics(ts29.factory.createCommaListExpression(elements));
3884
5040
  addParseSpanInfo(node, ast.sourceSpan);
3885
5041
  return node;
3886
5042
  }
@@ -3888,7 +5044,7 @@ var AstTranslator = class {
3888
5044
  const condExpr = this.translate(ast.condition);
3889
5045
  const trueExpr = this.translate(ast.trueExp);
3890
5046
  const falseExpr = wrapForTypeChecker(this.translate(ast.falseExp));
3891
- const node = ts28.factory.createParenthesizedExpression(ts28.factory.createConditionalExpression(condExpr, void 0, trueExpr, void 0, falseExpr));
5047
+ const node = ts29.factory.createParenthesizedExpression(ts29.factory.createConditionalExpression(condExpr, void 0, trueExpr, void 0, falseExpr));
3892
5048
  addParseSpanInfo(node, ast.sourceSpan);
3893
5049
  return node;
3894
5050
  }
@@ -3899,26 +5055,26 @@ var AstTranslator = class {
3899
5055
  throw new Error("Method not implemented.");
3900
5056
  }
3901
5057
  visitInterpolation(ast) {
3902
- return ast.expressions.reduce((lhs, ast2) => ts28.factory.createBinaryExpression(lhs, ts28.SyntaxKind.PlusToken, wrapForTypeChecker(this.translate(ast2))), ts28.factory.createStringLiteral(""));
5058
+ return ast.expressions.reduce((lhs, ast2) => ts29.factory.createBinaryExpression(lhs, ts29.SyntaxKind.PlusToken, wrapForTypeChecker(this.translate(ast2))), ts29.factory.createStringLiteral(""));
3903
5059
  }
3904
5060
  visitKeyedRead(ast) {
3905
5061
  const receiver = wrapForDiagnostics(this.translate(ast.receiver));
3906
5062
  const key = this.translate(ast.key);
3907
- const node = ts28.factory.createElementAccessExpression(receiver, key);
5063
+ const node = ts29.factory.createElementAccessExpression(receiver, key);
3908
5064
  addParseSpanInfo(node, ast.sourceSpan);
3909
5065
  return node;
3910
5066
  }
3911
5067
  visitKeyedWrite(ast) {
3912
5068
  const receiver = wrapForDiagnostics(this.translate(ast.receiver));
3913
- const left = ts28.factory.createElementAccessExpression(receiver, this.translate(ast.key));
5069
+ const left = ts29.factory.createElementAccessExpression(receiver, this.translate(ast.key));
3914
5070
  const right = wrapForTypeChecker(this.translate(ast.value));
3915
- const node = wrapForDiagnostics(ts28.factory.createBinaryExpression(left, ts28.SyntaxKind.EqualsToken, right));
5071
+ const node = wrapForDiagnostics(ts29.factory.createBinaryExpression(left, ts29.SyntaxKind.EqualsToken, right));
3916
5072
  addParseSpanInfo(node, ast.sourceSpan);
3917
5073
  return node;
3918
5074
  }
3919
5075
  visitLiteralArray(ast) {
3920
5076
  const elements = ast.expressions.map((expr) => this.translate(expr));
3921
- const literal = ts28.factory.createArrayLiteralExpression(elements);
5077
+ const literal = ts29.factory.createArrayLiteralExpression(elements);
3922
5078
  const node = this.config.strictLiteralTypes ? literal : tsCastToAny(literal);
3923
5079
  addParseSpanInfo(node, ast.sourceSpan);
3924
5080
  return node;
@@ -3926,9 +5082,9 @@ var AstTranslator = class {
3926
5082
  visitLiteralMap(ast) {
3927
5083
  const properties = ast.keys.map(({ key }, idx) => {
3928
5084
  const value = this.translate(ast.values[idx]);
3929
- return ts28.factory.createPropertyAssignment(ts28.factory.createStringLiteral(key), value);
5085
+ return ts29.factory.createPropertyAssignment(ts29.factory.createStringLiteral(key), value);
3930
5086
  });
3931
- const literal = ts28.factory.createObjectLiteralExpression(properties, true);
5087
+ const literal = ts29.factory.createObjectLiteralExpression(properties, true);
3932
5088
  const node = this.config.strictLiteralTypes ? literal : tsCastToAny(literal);
3933
5089
  addParseSpanInfo(node, ast.sourceSpan);
3934
5090
  return node;
@@ -3936,15 +5092,15 @@ var AstTranslator = class {
3936
5092
  visitLiteralPrimitive(ast) {
3937
5093
  let node;
3938
5094
  if (ast.value === void 0) {
3939
- node = ts28.factory.createIdentifier("undefined");
5095
+ node = ts29.factory.createIdentifier("undefined");
3940
5096
  } else if (ast.value === null) {
3941
- node = ts28.factory.createNull();
5097
+ node = ts29.factory.createNull();
3942
5098
  } else if (typeof ast.value === "string") {
3943
- node = ts28.factory.createStringLiteral(ast.value);
5099
+ node = ts29.factory.createStringLiteral(ast.value);
3944
5100
  } else if (typeof ast.value === "number") {
3945
5101
  node = tsNumericExpression(ast.value);
3946
5102
  } else if (typeof ast.value === "boolean") {
3947
- node = ast.value ? ts28.factory.createTrue() : ts28.factory.createFalse();
5103
+ node = ast.value ? ts29.factory.createTrue() : ts29.factory.createFalse();
3948
5104
  } else {
3949
5105
  throw Error(`Unsupported AST value of type ${typeof ast.value}`);
3950
5106
  }
@@ -3953,7 +5109,7 @@ var AstTranslator = class {
3953
5109
  }
3954
5110
  visitNonNullAssert(ast) {
3955
5111
  const expr = wrapForDiagnostics(this.translate(ast.expression));
3956
- const node = ts28.factory.createNonNullExpression(expr);
5112
+ const node = ts29.factory.createNonNullExpression(expr);
3957
5113
  addParseSpanInfo(node, ast.sourceSpan);
3958
5114
  return node;
3959
5115
  }
@@ -3962,13 +5118,13 @@ var AstTranslator = class {
3962
5118
  }
3963
5119
  visitPrefixNot(ast) {
3964
5120
  const expression = wrapForDiagnostics(this.translate(ast.expression));
3965
- const node = ts28.factory.createLogicalNot(expression);
5121
+ const node = ts29.factory.createLogicalNot(expression);
3966
5122
  addParseSpanInfo(node, ast.sourceSpan);
3967
5123
  return node;
3968
5124
  }
3969
5125
  visitPropertyRead(ast) {
3970
5126
  const receiver = wrapForDiagnostics(this.translate(ast.receiver));
3971
- const name = ts28.factory.createPropertyAccessExpression(receiver, ast.name);
5127
+ const name = ts29.factory.createPropertyAccessExpression(receiver, ast.name);
3972
5128
  addParseSpanInfo(name, ast.nameSpan);
3973
5129
  const node = wrapForDiagnostics(name);
3974
5130
  addParseSpanInfo(node, ast.sourceSpan);
@@ -3976,12 +5132,12 @@ var AstTranslator = class {
3976
5132
  }
3977
5133
  visitPropertyWrite(ast) {
3978
5134
  const receiver = wrapForDiagnostics(this.translate(ast.receiver));
3979
- const left = ts28.factory.createPropertyAccessExpression(receiver, ast.name);
5135
+ const left = ts29.factory.createPropertyAccessExpression(receiver, ast.name);
3980
5136
  addParseSpanInfo(left, ast.nameSpan);
3981
5137
  const leftWithPath = wrapForDiagnostics(left);
3982
5138
  addParseSpanInfo(leftWithPath, ast.sourceSpan);
3983
5139
  const right = wrapForTypeChecker(this.translate(ast.value));
3984
- const node = wrapForDiagnostics(ts28.factory.createBinaryExpression(leftWithPath, ts28.SyntaxKind.EqualsToken, right));
5140
+ const node = wrapForDiagnostics(ts29.factory.createBinaryExpression(leftWithPath, ts29.SyntaxKind.EqualsToken, right));
3985
5141
  addParseSpanInfo(node, ast.sourceSpan);
3986
5142
  return node;
3987
5143
  }
@@ -3989,13 +5145,13 @@ var AstTranslator = class {
3989
5145
  let node;
3990
5146
  const receiver = wrapForDiagnostics(this.translate(ast.receiver));
3991
5147
  if (this.config.strictSafeNavigationTypes) {
3992
- const expr = ts28.factory.createPropertyAccessExpression(ts28.factory.createNonNullExpression(receiver), ast.name);
5148
+ const expr = ts29.factory.createPropertyAccessExpression(ts29.factory.createNonNullExpression(receiver), ast.name);
3993
5149
  addParseSpanInfo(expr, ast.nameSpan);
3994
- node = ts28.factory.createParenthesizedExpression(ts28.factory.createConditionalExpression(NULL_AS_ANY, void 0, expr, void 0, UNDEFINED));
5150
+ node = ts29.factory.createParenthesizedExpression(ts29.factory.createConditionalExpression(NULL_AS_ANY, void 0, expr, void 0, UNDEFINED));
3995
5151
  } else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
3996
- node = ts28.factory.createPropertyAccessExpression(tsCastToAny(receiver), ast.name);
5152
+ node = ts29.factory.createPropertyAccessExpression(tsCastToAny(receiver), ast.name);
3997
5153
  } else {
3998
- const expr = ts28.factory.createPropertyAccessExpression(ts28.factory.createNonNullExpression(receiver), ast.name);
5154
+ const expr = ts29.factory.createPropertyAccessExpression(ts29.factory.createNonNullExpression(receiver), ast.name);
3999
5155
  addParseSpanInfo(expr, ast.nameSpan);
4000
5156
  node = tsCastToAny(expr);
4001
5157
  }
@@ -4007,13 +5163,13 @@ var AstTranslator = class {
4007
5163
  const key = this.translate(ast.key);
4008
5164
  let node;
4009
5165
  if (this.config.strictSafeNavigationTypes) {
4010
- const expr = ts28.factory.createElementAccessExpression(ts28.factory.createNonNullExpression(receiver), key);
5166
+ const expr = ts29.factory.createElementAccessExpression(ts29.factory.createNonNullExpression(receiver), key);
4011
5167
  addParseSpanInfo(expr, ast.sourceSpan);
4012
- node = ts28.factory.createParenthesizedExpression(ts28.factory.createConditionalExpression(NULL_AS_ANY, void 0, expr, void 0, UNDEFINED));
5168
+ node = ts29.factory.createParenthesizedExpression(ts29.factory.createConditionalExpression(NULL_AS_ANY, void 0, expr, void 0, UNDEFINED));
4013
5169
  } else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
4014
- node = ts28.factory.createElementAccessExpression(tsCastToAny(receiver), key);
5170
+ node = ts29.factory.createElementAccessExpression(tsCastToAny(receiver), key);
4015
5171
  } else {
4016
- const expr = ts28.factory.createElementAccessExpression(ts28.factory.createNonNullExpression(receiver), key);
5172
+ const expr = ts29.factory.createElementAccessExpression(ts29.factory.createNonNullExpression(receiver), key);
4017
5173
  addParseSpanInfo(expr, ast.sourceSpan);
4018
5174
  node = tsCastToAny(expr);
4019
5175
  }
@@ -4030,7 +5186,7 @@ var AstTranslator = class {
4030
5186
  expr = resolved;
4031
5187
  } else {
4032
5188
  const propertyReceiver = wrapForDiagnostics(this.translate(receiver.receiver));
4033
- expr = ts28.factory.createPropertyAccessExpression(propertyReceiver, receiver.name);
5189
+ expr = ts29.factory.createPropertyAccessExpression(propertyReceiver, receiver.name);
4034
5190
  addParseSpanInfo(expr, receiver.nameSpan);
4035
5191
  }
4036
5192
  } else {
@@ -4040,7 +5196,7 @@ var AstTranslator = class {
4040
5196
  if (ast.receiver instanceof SafePropertyRead2 || ast.receiver instanceof SafeKeyedRead) {
4041
5197
  node = this.convertToSafeCall(ast, expr, args);
4042
5198
  } else {
4043
- node = ts28.factory.createCallExpression(expr, void 0, args);
5199
+ node = ts29.factory.createCallExpression(expr, void 0, args);
4044
5200
  }
4045
5201
  addParseSpanInfo(node, ast.sourceSpan);
4046
5202
  return node;
@@ -4054,13 +5210,13 @@ var AstTranslator = class {
4054
5210
  }
4055
5211
  convertToSafeCall(ast, expr, args) {
4056
5212
  if (this.config.strictSafeNavigationTypes) {
4057
- const call = ts28.factory.createCallExpression(ts28.factory.createNonNullExpression(expr), void 0, args);
4058
- return ts28.factory.createParenthesizedExpression(ts28.factory.createConditionalExpression(NULL_AS_ANY, void 0, call, void 0, UNDEFINED));
5213
+ const call = ts29.factory.createCallExpression(ts29.factory.createNonNullExpression(expr), void 0, args);
5214
+ return ts29.factory.createParenthesizedExpression(ts29.factory.createConditionalExpression(NULL_AS_ANY, void 0, call, void 0, UNDEFINED));
4059
5215
  }
4060
5216
  if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
4061
- return ts28.factory.createCallExpression(tsCastToAny(expr), void 0, args);
5217
+ return ts29.factory.createCallExpression(tsCastToAny(expr), void 0, args);
4062
5218
  }
4063
- return tsCastToAny(ts28.factory.createCallExpression(ts28.factory.createNonNullExpression(expr), void 0, args));
5219
+ return tsCastToAny(ts29.factory.createCallExpression(ts29.factory.createNonNullExpression(expr), void 0, args));
4064
5220
  }
4065
5221
  };
4066
5222
  var _VeSafeLhsInferenceBugDetector = class {
@@ -4148,7 +5304,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
4148
5304
  const tcb = new Context(env, domSchemaChecker, oobRecorder, meta.id, meta.boundTarget, meta.pipes, meta.schemas, meta.isStandalone, meta.preserveWhitespaces);
4149
5305
  const scope = Scope.forNodes(tcb, null, null, tcb.boundTarget.target.template, null);
4150
5306
  const ctxRawType = env.referenceType(ref);
4151
- if (!ts29.isTypeReferenceNode(ctxRawType)) {
5307
+ if (!ts30.isTypeReferenceNode(ctxRawType)) {
4152
5308
  throw new Error(`Expected TypeReferenceNode when referencing the ctx param for ${ref.debugName}`);
4153
5309
  }
4154
5310
  let typeParameters = void 0;
@@ -4160,25 +5316,25 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
4160
5316
  switch (genericContextBehavior) {
4161
5317
  case TcbGenericContextBehavior.UseEmitter:
4162
5318
  typeParameters = new TypeParameterEmitter(ref.node.typeParameters, env.reflector).emit((typeRef) => env.referenceType(typeRef));
4163
- typeArguments = typeParameters.map((param) => ts29.factory.createTypeReferenceNode(param.name));
5319
+ typeArguments = typeParameters.map((param) => ts30.factory.createTypeReferenceNode(param.name));
4164
5320
  break;
4165
5321
  case TcbGenericContextBehavior.CopyClassNodes:
4166
5322
  typeParameters = [...ref.node.typeParameters];
4167
- typeArguments = typeParameters.map((param) => ts29.factory.createTypeReferenceNode(param.name));
5323
+ typeArguments = typeParameters.map((param) => ts30.factory.createTypeReferenceNode(param.name));
4168
5324
  break;
4169
5325
  case TcbGenericContextBehavior.FallbackToAny:
4170
- typeArguments = ref.node.typeParameters.map(() => ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
5326
+ typeArguments = ref.node.typeParameters.map(() => ts30.factory.createKeywordTypeNode(ts30.SyntaxKind.AnyKeyword));
4171
5327
  break;
4172
5328
  }
4173
5329
  }
4174
5330
  const paramList = [tcbThisParam(ctxRawType.typeName, typeArguments)];
4175
5331
  const scopeStatements = scope.render();
4176
- const innerBody = ts29.factory.createBlock([
5332
+ const innerBody = ts30.factory.createBlock([
4177
5333
  ...env.getPreludeStatements(),
4178
5334
  ...scopeStatements
4179
5335
  ]);
4180
- const body = ts29.factory.createBlock([ts29.factory.createIfStatement(ts29.factory.createTrue(), innerBody, void 0)]);
4181
- const fnDecl = ts29.factory.createFunctionDeclaration(
5336
+ const body = ts30.factory.createBlock([ts30.factory.createIfStatement(ts30.factory.createTrue(), innerBody, void 0)]);
5337
+ const fnDecl = ts30.factory.createFunctionDeclaration(
4182
5338
  void 0,
4183
5339
  void 0,
4184
5340
  name,
@@ -4227,7 +5383,7 @@ var TcbTemplateVariableOp = class extends TcbOp {
4227
5383
  execute() {
4228
5384
  const ctx = this.scope.resolve(this.template);
4229
5385
  const id = this.tcb.allocateId();
4230
- const initializer = ts29.factory.createPropertyAccessExpression(
5386
+ const initializer = ts30.factory.createPropertyAccessExpression(
4231
5387
  ctx,
4232
5388
  this.variable.value || "$implicit"
4233
5389
  );
@@ -4253,7 +5409,7 @@ var TcbTemplateContextOp = class extends TcbOp {
4253
5409
  }
4254
5410
  execute() {
4255
5411
  const ctx = this.tcb.allocateId();
4256
- const type = ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword);
5412
+ const type = ts30.factory.createKeywordTypeNode(ts30.SyntaxKind.AnyKeyword);
4257
5413
  this.scope.addStatement(tsDeclareVariable(ctx, type));
4258
5414
  return ctx;
4259
5415
  }
@@ -4306,16 +5462,16 @@ var TcbTemplateBodyOp = class extends TcbOp {
4306
5462
  }
4307
5463
  let guard = null;
4308
5464
  if (directiveGuards.length > 0) {
4309
- guard = directiveGuards.reduce((expr, dirGuard) => ts29.factory.createBinaryExpression(expr, ts29.SyntaxKind.AmpersandAmpersandToken, dirGuard), directiveGuards.pop());
5465
+ guard = directiveGuards.reduce((expr, dirGuard) => ts30.factory.createBinaryExpression(expr, ts30.SyntaxKind.AmpersandAmpersandToken, dirGuard), directiveGuards.pop());
4310
5466
  }
4311
5467
  const tmplScope = Scope.forNodes(this.tcb, this.scope, this.template, this.template.children, guard);
4312
5468
  const statements = tmplScope.render();
4313
5469
  if (statements.length === 0) {
4314
5470
  return null;
4315
5471
  }
4316
- let tmplBlock = ts29.factory.createBlock(statements);
5472
+ let tmplBlock = ts30.factory.createBlock(statements);
4317
5473
  if (guard !== null) {
4318
- tmplBlock = ts29.factory.createIfStatement(guard, tmplBlock);
5474
+ tmplBlock = ts30.factory.createIfStatement(guard, tmplBlock);
4319
5475
  }
4320
5476
  this.scope.addStatement(tmplBlock);
4321
5477
  return null;
@@ -4333,7 +5489,7 @@ var TcbExpressionOp = class extends TcbOp {
4333
5489
  }
4334
5490
  execute() {
4335
5491
  const expr = tcbExpression(this.expression, this.tcb, this.scope);
4336
- this.scope.addStatement(ts29.factory.createExpressionStatement(expr));
5492
+ this.scope.addStatement(ts30.factory.createExpressionStatement(expr));
4337
5493
  return null;
4338
5494
  }
4339
5495
  };
@@ -4355,11 +5511,11 @@ var TcbDirectiveTypeOpBase = class extends TcbOp {
4355
5511
  if (this.dir.isGeneric === false || dirRef.node.typeParameters === void 0) {
4356
5512
  type = rawType;
4357
5513
  } else {
4358
- if (!ts29.isTypeReferenceNode(rawType)) {
5514
+ if (!ts30.isTypeReferenceNode(rawType)) {
4359
5515
  throw new Error(`Expected TypeReferenceNode when referencing the type for ${this.dir.ref.debugName}`);
4360
5516
  }
4361
- const typeArguments = dirRef.node.typeParameters.map(() => ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
4362
- type = ts29.factory.createTypeReferenceNode(rawType.typeName, typeArguments);
5517
+ const typeArguments = dirRef.node.typeParameters.map(() => ts30.factory.createKeywordTypeNode(ts30.SyntaxKind.AnyKeyword));
5518
+ type = ts30.factory.createTypeReferenceNode(rawType.typeName, typeArguments);
4363
5519
  }
4364
5520
  const id = this.tcb.allocateId();
4365
5521
  addExpressionIdentifier(id, ExpressionIdentifier.DIRECTIVE);
@@ -4400,11 +5556,11 @@ var TcbReferenceOp = class extends TcbOp {
4400
5556
  const id = this.tcb.allocateId();
4401
5557
  let initializer = this.target instanceof TmplAstTemplate2 || this.target instanceof TmplAstElement3 ? this.scope.resolve(this.target) : this.scope.resolve(this.host, this.target);
4402
5558
  if (this.target instanceof TmplAstElement3 && !this.tcb.env.config.checkTypeOfDomReferences || !this.tcb.env.config.checkTypeOfNonDomReferences) {
4403
- initializer = ts29.factory.createAsExpression(initializer, ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
5559
+ initializer = ts30.factory.createAsExpression(initializer, ts30.factory.createKeywordTypeNode(ts30.SyntaxKind.AnyKeyword));
4404
5560
  } else if (this.target instanceof TmplAstTemplate2) {
4405
- initializer = ts29.factory.createAsExpression(initializer, ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
4406
- initializer = ts29.factory.createAsExpression(initializer, this.tcb.env.referenceExternalType("@angular/core", "TemplateRef", [DYNAMIC_TYPE]));
4407
- initializer = ts29.factory.createParenthesizedExpression(initializer);
5561
+ initializer = ts30.factory.createAsExpression(initializer, ts30.factory.createKeywordTypeNode(ts30.SyntaxKind.AnyKeyword));
5562
+ initializer = ts30.factory.createAsExpression(initializer, this.tcb.env.referenceExternalType("@angular/core", "TemplateRef", [DYNAMIC_TYPE]));
5563
+ initializer = ts30.factory.createParenthesizedExpression(initializer);
4408
5564
  }
4409
5565
  addParseSpanInfo(initializer, this.node.sourceSpan);
4410
5566
  addParseSpanInfo(id, this.node.keySpan);
@@ -4503,7 +5659,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
4503
5659
  type = this.tcb.env.referenceTransplantedType(new TransplantedType(transformType));
4504
5660
  } else {
4505
5661
  const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
4506
- if (!ts29.isTypeReferenceNode(dirTypeRef)) {
5662
+ if (!ts30.isTypeReferenceNode(dirTypeRef)) {
4507
5663
  throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
4508
5664
  }
4509
5665
  type = tsCreateTypeQueryForCoercedInput(dirTypeRef.typeName, fieldName);
@@ -4519,10 +5675,10 @@ var TcbDirectiveInputsOp = class extends TcbOp {
4519
5675
  }
4520
5676
  const id = this.tcb.allocateId();
4521
5677
  const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
4522
- if (!ts29.isTypeReferenceNode(dirTypeRef)) {
5678
+ if (!ts30.isTypeReferenceNode(dirTypeRef)) {
4523
5679
  throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
4524
5680
  }
4525
- const type = ts29.factory.createIndexedAccessTypeNode(ts29.factory.createTypeQueryNode(dirId), ts29.factory.createLiteralTypeNode(ts29.factory.createStringLiteral(fieldName)));
5681
+ const type = ts30.factory.createIndexedAccessTypeNode(ts30.factory.createTypeQueryNode(dirId), ts30.factory.createLiteralTypeNode(ts30.factory.createStringLiteral(fieldName)));
4526
5682
  const temp = tsDeclareVariable(id, type);
4527
5683
  this.scope.addStatement(temp);
4528
5684
  target = id;
@@ -4530,14 +5686,14 @@ var TcbDirectiveInputsOp = class extends TcbOp {
4530
5686
  if (dirId === null) {
4531
5687
  dirId = this.scope.resolve(this.node, this.dir);
4532
5688
  }
4533
- target = this.dir.stringLiteralInputFields.has(fieldName) ? ts29.factory.createElementAccessExpression(dirId, ts29.factory.createStringLiteral(fieldName)) : ts29.factory.createPropertyAccessExpression(dirId, ts29.factory.createIdentifier(fieldName));
5689
+ target = this.dir.stringLiteralInputFields.has(fieldName) ? ts30.factory.createElementAccessExpression(dirId, ts30.factory.createStringLiteral(fieldName)) : ts30.factory.createPropertyAccessExpression(dirId, ts30.factory.createIdentifier(fieldName));
4534
5690
  }
4535
5691
  if (isSignal) {
4536
5692
  const inputSignalBrandWriteSymbol = this.tcb.env.referenceExternalSymbol(R3Identifiers3.InputSignalBrandWriteType.moduleName, R3Identifiers3.InputSignalBrandWriteType.name);
4537
- if (!ts29.isIdentifier(inputSignalBrandWriteSymbol) && !ts29.isPropertyAccessExpression(inputSignalBrandWriteSymbol)) {
5693
+ if (!ts30.isIdentifier(inputSignalBrandWriteSymbol) && !ts30.isPropertyAccessExpression(inputSignalBrandWriteSymbol)) {
4538
5694
  throw new Error(`Expected identifier or property access for reference to ${R3Identifiers3.InputSignalBrandWriteType.name}`);
4539
5695
  }
4540
- target = ts29.factory.createElementAccessExpression(target, inputSignalBrandWriteSymbol);
5696
+ target = ts30.factory.createElementAccessExpression(target, inputSignalBrandWriteSymbol);
4541
5697
  }
4542
5698
  if (attr.attribute.keySpan !== void 0) {
4543
5699
  addParseSpanInfo(target, attr.attribute.keySpan);
@@ -4545,13 +5701,13 @@ var TcbDirectiveInputsOp = class extends TcbOp {
4545
5701
  if (isTwoWayBinding && this.tcb.env.config.allowSignalsInTwoWayBindings) {
4546
5702
  assignment = unwrapWritableSignal(assignment, this.tcb);
4547
5703
  }
4548
- assignment = ts29.factory.createBinaryExpression(target, ts29.SyntaxKind.EqualsToken, assignment);
5704
+ assignment = ts30.factory.createBinaryExpression(target, ts30.SyntaxKind.EqualsToken, assignment);
4549
5705
  }
4550
5706
  addParseSpanInfo(assignment, attr.attribute.sourceSpan);
4551
5707
  if (!this.tcb.env.config.checkTypeOfAttributes && attr.attribute instanceof TmplAstTextAttribute2) {
4552
5708
  markIgnoreDiagnostics(assignment);
4553
5709
  }
4554
- this.scope.addStatement(ts29.factory.createExpressionStatement(assignment));
5710
+ this.scope.addStatement(ts30.factory.createExpressionStatement(assignment));
4555
5711
  }
4556
5712
  this.checkRequiredInputs(seenRequiredInputs);
4557
5713
  return null;
@@ -4582,7 +5738,7 @@ var TcbDirectiveCtorCircularFallbackOp = class extends TcbOp {
4582
5738
  execute() {
4583
5739
  const id = this.tcb.allocateId();
4584
5740
  const typeCtor = this.tcb.env.typeCtorFor(this.dir);
4585
- const circularPlaceholder = ts29.factory.createCallExpression(typeCtor, void 0, [ts29.factory.createNonNullExpression(ts29.factory.createNull())]);
5741
+ const circularPlaceholder = ts30.factory.createCallExpression(typeCtor, void 0, [ts30.factory.createNonNullExpression(ts30.factory.createNull())]);
4586
5742
  this.scope.addStatement(tsCreateVariable(id, circularPlaceholder));
4587
5743
  return id;
4588
5744
  }
@@ -4624,7 +5780,7 @@ var TcbControlFlowContentProjectionOp = class extends TcbOp {
4624
5780
  this.ngContentSelectors = ngContentSelectors;
4625
5781
  this.componentName = componentName;
4626
5782
  this.optional = false;
4627
- this.category = tcb.env.config.controlFlowPreventingContentProjection === "error" ? ts29.DiagnosticCategory.Error : ts29.DiagnosticCategory.Warning;
5783
+ this.category = tcb.env.config.controlFlowPreventingContentProjection === "error" ? ts30.DiagnosticCategory.Error : ts30.DiagnosticCategory.Warning;
4628
5784
  }
4629
5785
  execute() {
4630
5786
  const controlFlowToCheck = this.findPotentialControlFlowNodes();
@@ -4723,15 +5879,15 @@ var TcbUnclaimedInputsOp = class extends TcbOp {
4723
5879
  elId = this.scope.resolve(this.element);
4724
5880
  }
4725
5881
  const propertyName = (_a = ATTR_TO_PROP.get(binding.name)) != null ? _a : binding.name;
4726
- const prop = ts29.factory.createElementAccessExpression(elId, ts29.factory.createStringLiteral(propertyName));
4727
- const stmt = ts29.factory.createBinaryExpression(prop, ts29.SyntaxKind.EqualsToken, wrapForDiagnostics(expr));
5882
+ const prop = ts30.factory.createElementAccessExpression(elId, ts30.factory.createStringLiteral(propertyName));
5883
+ const stmt = ts30.factory.createBinaryExpression(prop, ts30.SyntaxKind.EqualsToken, wrapForDiagnostics(expr));
4728
5884
  addParseSpanInfo(stmt, binding.sourceSpan);
4729
- this.scope.addStatement(ts29.factory.createExpressionStatement(stmt));
5885
+ this.scope.addStatement(ts30.factory.createExpressionStatement(stmt));
4730
5886
  } else {
4731
- this.scope.addStatement(ts29.factory.createExpressionStatement(expr));
5887
+ this.scope.addStatement(ts30.factory.createExpressionStatement(expr));
4732
5888
  }
4733
5889
  } else {
4734
- this.scope.addStatement(ts29.factory.createExpressionStatement(expr));
5890
+ this.scope.addStatement(ts30.factory.createExpressionStatement(expr));
4735
5891
  }
4736
5892
  }
4737
5893
  return null;
@@ -4763,18 +5919,18 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
4763
5919
  if (dirId === null) {
4764
5920
  dirId = this.scope.resolve(this.node, this.dir);
4765
5921
  }
4766
- const outputField = ts29.factory.createElementAccessExpression(dirId, ts29.factory.createStringLiteral(field));
5922
+ const outputField = ts30.factory.createElementAccessExpression(dirId, ts30.factory.createStringLiteral(field));
4767
5923
  addParseSpanInfo(outputField, output.keySpan);
4768
5924
  if (this.tcb.env.config.checkTypeOfOutputEvents) {
4769
5925
  const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
4770
- const subscribeFn = ts29.factory.createPropertyAccessExpression(outputField, "subscribe");
4771
- const call = ts29.factory.createCallExpression(subscribeFn, void 0, [handler]);
5926
+ const subscribeFn = ts30.factory.createPropertyAccessExpression(outputField, "subscribe");
5927
+ const call = ts30.factory.createCallExpression(subscribeFn, void 0, [handler]);
4772
5928
  addParseSpanInfo(call, output.sourceSpan);
4773
- this.scope.addStatement(ts29.factory.createExpressionStatement(call));
5929
+ this.scope.addStatement(ts30.factory.createExpressionStatement(call));
4774
5930
  } else {
4775
- this.scope.addStatement(ts29.factory.createExpressionStatement(outputField));
5931
+ this.scope.addStatement(ts30.factory.createExpressionStatement(outputField));
4776
5932
  const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
4777
- this.scope.addStatement(ts29.factory.createExpressionStatement(handler));
5933
+ this.scope.addStatement(ts30.factory.createExpressionStatement(handler));
4778
5934
  }
4779
5935
  }
4780
5936
  return null;
@@ -4806,24 +5962,24 @@ var TcbUnclaimedOutputsOp = class extends TcbOp {
4806
5962
  if (output.type === 1) {
4807
5963
  const eventType = this.tcb.env.config.checkTypeOfAnimationEvents ? this.tcb.env.referenceExternalType("@angular/animations", "AnimationEvent") : 1;
4808
5964
  const handler = tcbCreateEventHandler(output, this.tcb, this.scope, eventType);
4809
- this.scope.addStatement(ts29.factory.createExpressionStatement(handler));
5965
+ this.scope.addStatement(ts30.factory.createExpressionStatement(handler));
4810
5966
  } else if (this.tcb.env.config.checkTypeOfDomEvents) {
4811
5967
  const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
4812
5968
  if (elId === null) {
4813
5969
  elId = this.scope.resolve(this.element);
4814
5970
  }
4815
- const propertyAccess = ts29.factory.createPropertyAccessExpression(elId, "addEventListener");
5971
+ const propertyAccess = ts30.factory.createPropertyAccessExpression(elId, "addEventListener");
4816
5972
  addParseSpanInfo(propertyAccess, output.keySpan);
4817
- const call = ts29.factory.createCallExpression(
5973
+ const call = ts30.factory.createCallExpression(
4818
5974
  propertyAccess,
4819
5975
  void 0,
4820
- [ts29.factory.createStringLiteral(output.name), handler]
5976
+ [ts30.factory.createStringLiteral(output.name), handler]
4821
5977
  );
4822
5978
  addParseSpanInfo(call, output.sourceSpan);
4823
- this.scope.addStatement(ts29.factory.createExpressionStatement(call));
5979
+ this.scope.addStatement(ts30.factory.createExpressionStatement(call));
4824
5980
  } else {
4825
5981
  const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
4826
- this.scope.addStatement(ts29.factory.createExpressionStatement(handler));
5982
+ this.scope.addStatement(ts30.factory.createExpressionStatement(handler));
4827
5983
  }
4828
5984
  }
4829
5985
  return null;
@@ -4836,11 +5992,11 @@ var TcbComponentContextCompletionOp = class extends TcbOp {
4836
5992
  this.optional = false;
4837
5993
  }
4838
5994
  execute() {
4839
- const ctx = ts29.factory.createThis();
4840
- const ctxDot = ts29.factory.createPropertyAccessExpression(ctx, "");
5995
+ const ctx = ts30.factory.createThis();
5996
+ const ctxDot = ts30.factory.createPropertyAccessExpression(ctx, "");
4841
5997
  markIgnoreDiagnostics(ctxDot);
4842
5998
  addExpressionIdentifier(ctxDot, ExpressionIdentifier.COMPONENT_COMPLETION);
4843
- this.scope.addStatement(ts29.factory.createExpressionStatement(ctxDot));
5999
+ this.scope.addStatement(ts30.factory.createExpressionStatement(ctxDot));
4844
6000
  return null;
4845
6001
  }
4846
6002
  };
@@ -4905,14 +6061,14 @@ var TcbIfOp = class extends TcbOp {
4905
6061
  }
4906
6062
  if (branch.expression === null) {
4907
6063
  const branchScope = Scope.forNodes(this.tcb, this.scope, null, branch.children, this.generateBranchGuard(index));
4908
- return ts29.factory.createBlock(branchScope.render());
6064
+ return ts30.factory.createBlock(branchScope.render());
4909
6065
  }
4910
6066
  const expressionScope = Scope.forNodes(this.tcb, this.scope, branch, [], null);
4911
6067
  expressionScope.render().forEach((stmt) => this.scope.addStatement(stmt));
4912
6068
  this.expressionScopes.set(branch, expressionScope);
4913
6069
  const expression = branch.expressionAlias === null ? tcbExpression(branch.expression, this.tcb, expressionScope) : expressionScope.resolve(branch.expressionAlias);
4914
6070
  const bodyScope = Scope.forNodes(this.tcb, expressionScope, null, branch.children, this.generateBranchGuard(index));
4915
- return ts29.factory.createIfStatement(expression, ts29.factory.createBlock(bodyScope.render()), this.generateBranch(index + 1));
6071
+ return ts30.factory.createIfStatement(expression, ts30.factory.createBlock(bodyScope.render()), this.generateBranch(index + 1));
4916
6072
  }
4917
6073
  generateBranchGuard(index) {
4918
6074
  let guard = null;
@@ -4932,8 +6088,8 @@ var TcbIfOp = class extends TcbOp {
4932
6088
  } else {
4933
6089
  expression = expressionScope.resolve(branch.expressionAlias);
4934
6090
  }
4935
- const comparisonExpression = i === index ? expression : ts29.factory.createPrefixUnaryExpression(ts29.SyntaxKind.ExclamationToken, ts29.factory.createParenthesizedExpression(expression));
4936
- guard = guard === null ? comparisonExpression : ts29.factory.createBinaryExpression(guard, ts29.SyntaxKind.AmpersandAmpersandToken, comparisonExpression);
6091
+ const comparisonExpression = i === index ? expression : ts30.factory.createPrefixUnaryExpression(ts30.SyntaxKind.ExclamationToken, ts30.factory.createParenthesizedExpression(expression));
6092
+ guard = guard === null ? comparisonExpression : ts30.factory.createBinaryExpression(guard, ts30.SyntaxKind.AmpersandAmpersandToken, comparisonExpression);
4937
6093
  }
4938
6094
  return guard;
4939
6095
  }
@@ -4951,7 +6107,7 @@ var TcbSwitchOp = class extends TcbOp {
4951
6107
  execute() {
4952
6108
  const comparisonExpression = tcbExpression(this.block.expression, this.tcb, this.scope);
4953
6109
  markIgnoreDiagnostics(comparisonExpression);
4954
- const expression = ts29.factory.createParenthesizedExpression(comparisonExpression);
6110
+ const expression = ts30.factory.createParenthesizedExpression(comparisonExpression);
4955
6111
  const root = this.generateCase(0, expression, null);
4956
6112
  if (root !== void 0) {
4957
6113
  this.scope.addStatement(root);
@@ -4962,7 +6118,7 @@ var TcbSwitchOp = class extends TcbOp {
4962
6118
  if (index >= this.block.cases.length) {
4963
6119
  if (defaultCase !== null) {
4964
6120
  const defaultScope = Scope.forNodes(this.tcb, this.scope, null, defaultCase.children, this.generateGuard(defaultCase, switchValue));
4965
- return ts29.factory.createBlock(defaultScope.render());
6121
+ return ts30.factory.createBlock(defaultScope.render());
4966
6122
  }
4967
6123
  return void 0;
4968
6124
  }
@@ -4972,13 +6128,13 @@ var TcbSwitchOp = class extends TcbOp {
4972
6128
  }
4973
6129
  const caseScope = Scope.forNodes(this.tcb, this.scope, null, current.children, this.generateGuard(current, switchValue));
4974
6130
  const caseValue = tcbExpression(current.expression, this.tcb, caseScope);
4975
- return ts29.factory.createIfStatement(ts29.factory.createBinaryExpression(switchValue, ts29.SyntaxKind.EqualsEqualsEqualsToken, caseValue), ts29.factory.createBlock(caseScope.render()), this.generateCase(index + 1, switchValue, defaultCase));
6131
+ return ts30.factory.createIfStatement(ts30.factory.createBinaryExpression(switchValue, ts30.SyntaxKind.EqualsEqualsEqualsToken, caseValue), ts30.factory.createBlock(caseScope.render()), this.generateCase(index + 1, switchValue, defaultCase));
4976
6132
  }
4977
6133
  generateGuard(node, switchValue) {
4978
6134
  if (node.expression !== null) {
4979
6135
  const expression = tcbExpression(node.expression, this.tcb, this.scope);
4980
6136
  markIgnoreDiagnostics(expression);
4981
- return ts29.factory.createBinaryExpression(switchValue, ts29.SyntaxKind.EqualsEqualsEqualsToken, expression);
6137
+ return ts30.factory.createBinaryExpression(switchValue, ts30.SyntaxKind.EqualsEqualsEqualsToken, expression);
4982
6138
  }
4983
6139
  let guard = null;
4984
6140
  for (const current of this.block.cases) {
@@ -4987,11 +6143,11 @@ var TcbSwitchOp = class extends TcbOp {
4987
6143
  }
4988
6144
  const expression = tcbExpression(current.expression, this.tcb, this.scope);
4989
6145
  markIgnoreDiagnostics(expression);
4990
- const comparison = ts29.factory.createBinaryExpression(switchValue, ts29.SyntaxKind.ExclamationEqualsEqualsToken, expression);
6146
+ const comparison = ts30.factory.createBinaryExpression(switchValue, ts30.SyntaxKind.ExclamationEqualsEqualsToken, expression);
4991
6147
  if (guard === null) {
4992
6148
  guard = comparison;
4993
6149
  } else {
4994
- guard = ts29.factory.createBinaryExpression(guard, ts29.SyntaxKind.AmpersandAmpersandToken, comparison);
6150
+ guard = ts30.factory.createBinaryExpression(guard, ts30.SyntaxKind.AmpersandAmpersandToken, comparison);
4995
6151
  }
4996
6152
  }
4997
6153
  return guard;
@@ -5010,23 +6166,23 @@ var TcbForOfOp = class extends TcbOp {
5010
6166
  execute() {
5011
6167
  const loopScope = Scope.forNodes(this.tcb, this.scope, this.block, this.block.children, null);
5012
6168
  const initializerId = loopScope.resolve(this.block.item);
5013
- if (!ts29.isIdentifier(initializerId)) {
6169
+ if (!ts30.isIdentifier(initializerId)) {
5014
6170
  throw new Error(`Could not resolve for loop variable ${this.block.item.name} to an identifier`);
5015
6171
  }
5016
- const initializer = ts29.factory.createVariableDeclarationList([ts29.factory.createVariableDeclaration(initializerId)], ts29.NodeFlags.Const);
6172
+ const initializer = ts30.factory.createVariableDeclarationList([ts30.factory.createVariableDeclaration(initializerId)], ts30.NodeFlags.Const);
5017
6173
  addParseSpanInfo(initializer, this.block.item.keySpan);
5018
- const expression = ts29.factory.createNonNullExpression(tcbExpression(this.block.expression, this.tcb, loopScope));
6174
+ const expression = ts30.factory.createNonNullExpression(tcbExpression(this.block.expression, this.tcb, loopScope));
5019
6175
  const trackTranslator = new TcbForLoopTrackTranslator(this.tcb, loopScope, this.block);
5020
6176
  const trackExpression = trackTranslator.translate(this.block.trackBy);
5021
6177
  const statements = [
5022
6178
  ...loopScope.render(),
5023
- ts29.factory.createExpressionStatement(trackExpression)
6179
+ ts30.factory.createExpressionStatement(trackExpression)
5024
6180
  ];
5025
- this.scope.addStatement(ts29.factory.createForOfStatement(void 0, initializer, expression, ts29.factory.createBlock(statements)));
6181
+ this.scope.addStatement(ts30.factory.createForOfStatement(void 0, initializer, expression, ts30.factory.createBlock(statements)));
5026
6182
  return null;
5027
6183
  }
5028
6184
  };
5029
- var INFER_TYPE_FOR_CIRCULAR_OP_EXPR = ts29.factory.createNonNullExpression(ts29.factory.createNull());
6185
+ var INFER_TYPE_FOR_CIRCULAR_OP_EXPR = ts30.factory.createNonNullExpression(ts30.factory.createNull());
5030
6186
  var Context = class {
5031
6187
  constructor(env, domSchemaChecker, oobRecorder, id, boundTarget, pipes, schemas, hostIsStandalone, hostPreserveWhitespaces) {
5032
6188
  this.env = env;
@@ -5041,7 +6197,7 @@ var Context = class {
5041
6197
  this.nextId = 1;
5042
6198
  }
5043
6199
  allocateId() {
5044
- return ts29.factory.createIdentifier(`_t${this.nextId++}`);
6200
+ return ts30.factory.createIdentifier(`_t${this.nextId++}`);
5045
6201
  }
5046
6202
  getPipeByName(name) {
5047
6203
  if (!this.pipes.has(name)) {
@@ -5092,7 +6248,7 @@ var _Scope = class {
5092
6248
  if (!this.forLoopContextVariableTypes.has(name)) {
5093
6249
  throw new Error(`Unrecognized for loop context variable ${name}`);
5094
6250
  }
5095
- const type = ts29.factory.createKeywordTypeNode(this.forLoopContextVariableTypes.get(name));
6251
+ const type = ts30.factory.createKeywordTypeNode(this.forLoopContextVariableTypes.get(name));
5096
6252
  this.registerVariable(scope, variable, new TcbBlockImplicitVariableOp(tcb, scope, type, variable));
5097
6253
  }
5098
6254
  }
@@ -5109,16 +6265,16 @@ var _Scope = class {
5109
6265
  const res = this.resolveLocal(node, directive);
5110
6266
  if (res !== null) {
5111
6267
  let clone;
5112
- if (ts29.isIdentifier(res)) {
5113
- clone = ts29.factory.createIdentifier(res.text);
5114
- } else if (ts29.isNonNullExpression(res)) {
5115
- clone = ts29.factory.createNonNullExpression(res.expression);
6268
+ if (ts30.isIdentifier(res)) {
6269
+ clone = ts30.factory.createIdentifier(res.text);
6270
+ } else if (ts30.isNonNullExpression(res)) {
6271
+ clone = ts30.factory.createNonNullExpression(res.expression);
5116
6272
  } else {
5117
6273
  throw new Error(`Could not resolve ${node} to an Identifier or a NonNullExpression`);
5118
6274
  }
5119
- ts29.setOriginalNode(clone, res);
6275
+ ts30.setOriginalNode(clone, res);
5120
6276
  clone.parent = clone.parent;
5121
- return ts29.setSyntheticTrailingComments(clone, []);
6277
+ return ts30.setSyntheticTrailingComments(clone, []);
5122
6278
  } else if (this.parent !== null) {
5123
6279
  return this.parent.resolve(node, directive);
5124
6280
  } else {
@@ -5145,7 +6301,7 @@ var _Scope = class {
5145
6301
  } else if (parentGuards === null) {
5146
6302
  return this.guard;
5147
6303
  } else {
5148
- return ts29.factory.createBinaryExpression(parentGuards, ts29.SyntaxKind.AmpersandAmpersandToken, this.guard);
6304
+ return ts30.factory.createBinaryExpression(parentGuards, ts30.SyntaxKind.AmpersandAmpersandToken, this.guard);
5149
6305
  }
5150
6306
  }
5151
6307
  resolveLocal(ref, directive) {
@@ -5393,21 +6549,21 @@ var _Scope = class {
5393
6549
  var Scope = _Scope;
5394
6550
  (() => {
5395
6551
  _Scope.forLoopContextVariableTypes = /* @__PURE__ */ new Map([
5396
- ["$first", ts29.SyntaxKind.BooleanKeyword],
5397
- ["$last", ts29.SyntaxKind.BooleanKeyword],
5398
- ["$even", ts29.SyntaxKind.BooleanKeyword],
5399
- ["$odd", ts29.SyntaxKind.BooleanKeyword],
5400
- ["$index", ts29.SyntaxKind.NumberKeyword],
5401
- ["$count", ts29.SyntaxKind.NumberKeyword]
6552
+ ["$first", ts30.SyntaxKind.BooleanKeyword],
6553
+ ["$last", ts30.SyntaxKind.BooleanKeyword],
6554
+ ["$even", ts30.SyntaxKind.BooleanKeyword],
6555
+ ["$odd", ts30.SyntaxKind.BooleanKeyword],
6556
+ ["$index", ts30.SyntaxKind.NumberKeyword],
6557
+ ["$count", ts30.SyntaxKind.NumberKeyword]
5402
6558
  ]);
5403
6559
  })();
5404
6560
  function tcbThisParam(name, typeArguments) {
5405
- return ts29.factory.createParameterDeclaration(
6561
+ return ts30.factory.createParameterDeclaration(
5406
6562
  void 0,
5407
6563
  void 0,
5408
6564
  "this",
5409
6565
  void 0,
5410
- ts29.factory.createTypeReferenceNode(name, typeArguments),
6566
+ ts30.factory.createTypeReferenceNode(name, typeArguments),
5411
6567
  void 0
5412
6568
  );
5413
6569
  }
@@ -5432,11 +6588,11 @@ var TcbExpressionTranslator = class {
5432
6588
  return null;
5433
6589
  }
5434
6590
  const expr = this.translate(ast.value);
5435
- const result = ts29.factory.createParenthesizedExpression(ts29.factory.createBinaryExpression(target, ts29.SyntaxKind.EqualsToken, expr));
6591
+ const result = ts30.factory.createParenthesizedExpression(ts30.factory.createBinaryExpression(target, ts30.SyntaxKind.EqualsToken, expr));
5436
6592
  addParseSpanInfo(result, ast.sourceSpan);
5437
6593
  return result;
5438
6594
  } else if (ast instanceof ImplicitReceiver3) {
5439
- return ts29.factory.createThis();
6595
+ return ts30.factory.createThis();
5440
6596
  } else if (ast instanceof BindingPipe) {
5441
6597
  const expr = this.translate(ast.exp);
5442
6598
  const pipeMeta = this.tcb.getPipeByName(ast.name);
@@ -5451,12 +6607,12 @@ var TcbExpressionTranslator = class {
5451
6607
  pipe = this.tcb.env.pipeInst(pipeMeta.ref);
5452
6608
  }
5453
6609
  const args = ast.args.map((arg) => this.translate(arg));
5454
- let methodAccess = ts29.factory.createPropertyAccessExpression(pipe, "transform");
6610
+ let methodAccess = ts30.factory.createPropertyAccessExpression(pipe, "transform");
5455
6611
  addParseSpanInfo(methodAccess, ast.nameSpan);
5456
6612
  if (!this.tcb.env.config.checkTypeOfPipes) {
5457
- methodAccess = ts29.factory.createAsExpression(methodAccess, ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
6613
+ methodAccess = ts30.factory.createAsExpression(methodAccess, ts30.factory.createKeywordTypeNode(ts30.SyntaxKind.AnyKeyword));
5458
6614
  }
5459
- const result = ts29.factory.createCallExpression(
6615
+ const result = ts30.factory.createCallExpression(
5460
6616
  methodAccess,
5461
6617
  void 0,
5462
6618
  [expr, ...args]
@@ -5466,8 +6622,8 @@ var TcbExpressionTranslator = class {
5466
6622
  } else if ((ast instanceof Call2 || ast instanceof SafeCall) && (ast.receiver instanceof PropertyRead4 || ast.receiver instanceof SafePropertyRead3)) {
5467
6623
  if (ast.receiver.receiver instanceof ImplicitReceiver3 && !(ast.receiver.receiver instanceof ThisReceiver) && ast.receiver.name === "$any" && ast.args.length === 1) {
5468
6624
  const expr = this.translate(ast.args[0]);
5469
- const exprAsAny = ts29.factory.createAsExpression(expr, ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
5470
- const result = ts29.factory.createParenthesizedExpression(exprAsAny);
6625
+ const exprAsAny = ts30.factory.createAsExpression(expr, ts30.factory.createKeywordTypeNode(ts30.SyntaxKind.AnyKeyword));
6626
+ const result = ts30.factory.createParenthesizedExpression(exprAsAny);
5471
6627
  addParseSpanInfo(result, ast.sourceSpan);
5472
6628
  return result;
5473
6629
  }
@@ -5478,7 +6634,7 @@ var TcbExpressionTranslator = class {
5478
6634
  const method = wrapForDiagnostics(receiver);
5479
6635
  addParseSpanInfo(method, ast.receiver.nameSpan);
5480
6636
  const args = ast.args.map((arg) => this.translate(arg));
5481
- const node = ts29.factory.createCallExpression(method, void 0, args);
6637
+ const node = ts30.factory.createCallExpression(method, void 0, args);
5482
6638
  addParseSpanInfo(node, ast.sourceSpan);
5483
6639
  return node;
5484
6640
  } else {
@@ -5498,23 +6654,23 @@ var TcbExpressionTranslator = class {
5498
6654
  function tcbCallTypeCtor(dir, tcb, inputs) {
5499
6655
  const typeCtor = tcb.env.typeCtorFor(dir);
5500
6656
  const members = inputs.map((input) => {
5501
- const propertyName = ts29.factory.createStringLiteral(input.field);
6657
+ const propertyName = ts30.factory.createStringLiteral(input.field);
5502
6658
  if (input.type === "binding") {
5503
6659
  let expr = widenBinding(input.expression, tcb);
5504
6660
  if (input.isTwoWayBinding && tcb.env.config.allowSignalsInTwoWayBindings) {
5505
6661
  expr = unwrapWritableSignal(expr, tcb);
5506
6662
  }
5507
- const assignment = ts29.factory.createPropertyAssignment(propertyName, wrapForDiagnostics(expr));
6663
+ const assignment = ts30.factory.createPropertyAssignment(propertyName, wrapForDiagnostics(expr));
5508
6664
  addParseSpanInfo(assignment, input.sourceSpan);
5509
6665
  return assignment;
5510
6666
  } else {
5511
- return ts29.factory.createPropertyAssignment(propertyName, NULL_AS_ANY);
6667
+ return ts30.factory.createPropertyAssignment(propertyName, NULL_AS_ANY);
5512
6668
  }
5513
6669
  });
5514
- return ts29.factory.createCallExpression(
6670
+ return ts30.factory.createCallExpression(
5515
6671
  typeCtor,
5516
6672
  void 0,
5517
- [ts29.factory.createObjectLiteralExpression(members)]
6673
+ [ts30.factory.createObjectLiteralExpression(members)]
5518
6674
  );
5519
6675
  }
5520
6676
  function getBoundAttributes(directive, node) {
@@ -5551,17 +6707,17 @@ function translateInput(attr, tcb, scope) {
5551
6707
  if (attr instanceof TmplAstBoundAttribute) {
5552
6708
  return tcbExpression(attr.value, tcb, scope);
5553
6709
  } else {
5554
- return ts29.factory.createStringLiteral(attr.value);
6710
+ return ts30.factory.createStringLiteral(attr.value);
5555
6711
  }
5556
6712
  }
5557
6713
  function widenBinding(expr, tcb) {
5558
6714
  if (!tcb.env.config.checkTypeOfInputBindings) {
5559
6715
  return tsCastToAny(expr);
5560
6716
  } else if (!tcb.env.config.strictNullInputBindings) {
5561
- if (ts29.isObjectLiteralExpression(expr) || ts29.isArrayLiteralExpression(expr)) {
6717
+ if (ts30.isObjectLiteralExpression(expr) || ts30.isArrayLiteralExpression(expr)) {
5562
6718
  return expr;
5563
6719
  } else {
5564
- return ts29.factory.createNonNullExpression(expr);
6720
+ return ts30.factory.createNonNullExpression(expr);
5565
6721
  }
5566
6722
  } else {
5567
6723
  return expr;
@@ -5569,7 +6725,7 @@ function widenBinding(expr, tcb) {
5569
6725
  }
5570
6726
  function unwrapWritableSignal(expression, tcb) {
5571
6727
  const unwrapRef = tcb.env.referenceExternalSymbol(R3Identifiers3.unwrapWritableSignal.moduleName, R3Identifiers3.unwrapWritableSignal.name);
5572
- return ts29.factory.createCallExpression(unwrapRef, void 0, [expression]);
6728
+ return ts30.factory.createCallExpression(unwrapRef, void 0, [expression]);
5573
6729
  }
5574
6730
  var EVENT_PARAMETER = "$event";
5575
6731
  function tcbCreateEventHandler(event, tcb, scope, eventType) {
@@ -5578,16 +6734,16 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
5578
6734
  if (eventType === 0) {
5579
6735
  eventParamType = void 0;
5580
6736
  } else if (eventType === 1) {
5581
- eventParamType = ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword);
6737
+ eventParamType = ts30.factory.createKeywordTypeNode(ts30.SyntaxKind.AnyKeyword);
5582
6738
  } else {
5583
6739
  eventParamType = eventType;
5584
6740
  }
5585
6741
  const guards = scope.guards();
5586
- let body = ts29.factory.createExpressionStatement(handler);
6742
+ let body = ts30.factory.createExpressionStatement(handler);
5587
6743
  if (guards !== null) {
5588
- body = ts29.factory.createIfStatement(guards, body);
6744
+ body = ts30.factory.createIfStatement(guards, body);
5589
6745
  }
5590
- const eventParam = ts29.factory.createParameterDeclaration(
6746
+ const eventParam = ts30.factory.createParameterDeclaration(
5591
6747
  void 0,
5592
6748
  void 0,
5593
6749
  EVENT_PARAMETER,
@@ -5595,13 +6751,13 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
5595
6751
  eventParamType
5596
6752
  );
5597
6753
  addExpressionIdentifier(eventParam, ExpressionIdentifier.EVENT_PARAMETER);
5598
- return ts29.factory.createArrowFunction(
6754
+ return ts30.factory.createArrowFunction(
5599
6755
  void 0,
5600
6756
  void 0,
5601
6757
  [eventParam],
5602
- ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword),
6758
+ ts30.factory.createKeywordTypeNode(ts30.SyntaxKind.AnyKeyword),
5603
6759
  void 0,
5604
- ts29.factory.createBlock([body])
6760
+ ts30.factory.createBlock([body])
5605
6761
  );
5606
6762
  }
5607
6763
  function tcbEventHandlerExpression(ast, tcb, scope) {
@@ -5630,7 +6786,7 @@ function isSplitTwoWayBinding(inputName, output, inputs, tcb) {
5630
6786
  var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
5631
6787
  resolve(ast) {
5632
6788
  if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver3 && !(ast.receiver instanceof ThisReceiver) && ast.name === EVENT_PARAMETER) {
5633
- const event = ts29.factory.createIdentifier(EVENT_PARAMETER);
6789
+ const event = ts30.factory.createIdentifier(EVENT_PARAMETER);
5634
6790
  addParseSpanInfo(event, ast.nameSpan);
5635
6791
  return event;
5636
6792
  }
@@ -5654,33 +6810,44 @@ var TcbForLoopTrackTranslator = class extends TcbExpressionTranslator {
5654
6810
  };
5655
6811
 
5656
6812
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_file.mjs
5657
- import ts30 from "typescript";
6813
+ import ts31 from "typescript";
5658
6814
  var TypeCheckFile = class extends Environment {
5659
6815
  constructor(fileName, config, refEmitter, reflector, compilerHost) {
5660
- super(config, new ImportManager(new NoopImportRewriter(), "i"), refEmitter, reflector, ts30.createSourceFile(compilerHost.getCanonicalFileName(fileName), "", ts30.ScriptTarget.Latest, true));
6816
+ super(config, new ImportManager({
6817
+ forceGenerateNamespacesForNewImports: true,
6818
+ shouldUseSingleQuotes: () => true
6819
+ }), refEmitter, reflector, ts31.createSourceFile(compilerHost.getCanonicalFileName(fileName), "", ts31.ScriptTarget.Latest, true));
5661
6820
  this.fileName = fileName;
5662
6821
  this.nextTcbId = 1;
5663
6822
  this.tcbStatements = [];
5664
6823
  }
5665
6824
  addTypeCheckBlock(ref, meta, domSchemaChecker, oobRecorder, genericContextBehavior) {
5666
- const fnId = ts30.factory.createIdentifier(`_tcb${this.nextTcbId++}`);
6825
+ const fnId = ts31.factory.createIdentifier(`_tcb${this.nextTcbId++}`);
5667
6826
  const fn = generateTypeCheckBlock(this, ref, fnId, meta, domSchemaChecker, oobRecorder, genericContextBehavior);
5668
6827
  this.tcbStatements.push(fn);
5669
6828
  }
5670
6829
  render(removeComments) {
5671
6830
  ensureTypeCheckFilePreparationImports(this);
5672
- let source = this.importManager.getAllImports(this.contextFile.fileName).map(getImportString).join("\n") + "\n\n";
5673
- const printer = ts30.createPrinter({ removeComments });
6831
+ const importChanges = this.importManager.finalize();
6832
+ if (importChanges.updatedImports.size > 0) {
6833
+ throw new Error("AssertionError: Expected no imports to be updated for a new type check file.");
6834
+ }
6835
+ const printer = ts31.createPrinter({ removeComments });
6836
+ let source = "";
6837
+ const newImports = importChanges.newImports.get(this.contextFile.fileName);
6838
+ if (newImports !== void 0) {
6839
+ source += newImports.map((i) => printer.printNode(ts31.EmitHint.Unspecified, i, this.contextFile)).join("\n");
6840
+ }
5674
6841
  source += "\n";
5675
6842
  for (const stmt of this.pipeInstStatements) {
5676
- source += printer.printNode(ts30.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
6843
+ source += printer.printNode(ts31.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
5677
6844
  }
5678
6845
  for (const stmt of this.typeCtorStatements) {
5679
- source += printer.printNode(ts30.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
6846
+ source += printer.printNode(ts31.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
5680
6847
  }
5681
6848
  source += "\n";
5682
6849
  for (const stmt of this.tcbStatements) {
5683
- source += printer.printNode(ts30.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
6850
+ source += printer.printNode(ts31.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
5684
6851
  }
5685
6852
  source += "\nexport const IS_A_MODULE = true;\n";
5686
6853
  return source;
@@ -5793,18 +6960,44 @@ var TypeCheckContextImpl = class {
5793
6960
  if (!this.opMap.has(sf)) {
5794
6961
  return null;
5795
6962
  }
5796
- const importManager = new ImportManager(new NoopImportRewriter(), "_i");
5797
- const ops = this.opMap.get(sf).sort(orderOps);
5798
- const textParts = splitStringAtPoints(sf.text, ops.map((op) => op.splitPoint));
5799
- const printer = ts31.createPrinter({ omitTrailingSemicolon: true });
5800
- let code = textParts[0];
5801
- ops.forEach((op, idx) => {
5802
- const text = op.execute(importManager, sf, this.refEmitter, printer);
5803
- code += "\n\n" + text + textParts[idx + 1];
6963
+ const printer = ts32.createPrinter({ omitTrailingSemicolon: true });
6964
+ const importManager = new ImportManager({
6965
+ forceGenerateNamespacesForNewImports: true,
6966
+ shouldUseSingleQuotes: () => true
6967
+ });
6968
+ const updates = this.opMap.get(sf).map((op) => {
6969
+ return {
6970
+ pos: op.splitPoint,
6971
+ text: op.execute(importManager, sf, this.refEmitter, printer)
6972
+ };
5804
6973
  });
5805
- let imports = importManager.getAllImports(sf.fileName).map(getImportString).join("\n");
5806
- code = imports + "\n" + code;
5807
- return code;
6974
+ const { newImports, updatedImports } = importManager.finalize();
6975
+ if (newImports.has(sf.fileName)) {
6976
+ newImports.get(sf.fileName).forEach((newImport) => {
6977
+ updates.push({
6978
+ pos: 0,
6979
+ text: printer.printNode(ts32.EmitHint.Unspecified, newImport, sf)
6980
+ });
6981
+ });
6982
+ }
6983
+ for (const [oldBindings, newBindings] of updatedImports.entries()) {
6984
+ if (oldBindings.getSourceFile() !== sf) {
6985
+ throw new Error("Unexpected updates to unrelated source files.");
6986
+ }
6987
+ updates.push({
6988
+ pos: oldBindings.getStart(),
6989
+ deletePos: oldBindings.getEnd(),
6990
+ text: printer.printNode(ts32.EmitHint.Unspecified, newBindings, sf)
6991
+ });
6992
+ }
6993
+ const result = new MagicString(sf.text, { filename: sf.fileName });
6994
+ for (const update of updates) {
6995
+ if (update.deletePos !== void 0) {
6996
+ result.remove(update.pos, update.deletePos);
6997
+ }
6998
+ result.appendLeft(update.pos, update.text);
6999
+ }
7000
+ return result.toString();
5808
7001
  }
5809
7002
  finalize() {
5810
7003
  const updates = /* @__PURE__ */ new Map();
@@ -5877,7 +7070,7 @@ var TypeCheckContextImpl = class {
5877
7070
  if (span.start.offset === span.end.offset) {
5878
7071
  span.end.offset++;
5879
7072
  }
5880
- return makeTemplateDiagnostic(templateId, sourceMapping, span, ts31.DiagnosticCategory.Error, ngErrorCode(ErrorCode.TEMPLATE_PARSE_ERROR), error.msg);
7073
+ return makeTemplateDiagnostic(templateId, sourceMapping, span, ts32.DiagnosticCategory.Error, ngErrorCode(ErrorCode.TEMPLATE_PARSE_ERROR), error.msg);
5881
7074
  });
5882
7075
  }
5883
7076
  };
@@ -5895,9 +7088,9 @@ var InlineTcbOp = class {
5895
7088
  }
5896
7089
  execute(im, sf, refEmitter, printer) {
5897
7090
  const env = new Environment(this.config, im, refEmitter, this.reflector, sf);
5898
- const fnName = ts31.factory.createIdentifier(`_tcb_${this.ref.node.pos}`);
7091
+ const fnName = ts32.factory.createIdentifier(`_tcb_${this.ref.node.pos}`);
5899
7092
  const fn = generateTypeCheckBlock(env, this.ref, fnName, this.meta, this.domSchemaChecker, this.oobRecorder, TcbGenericContextBehavior.CopyClassNodes);
5900
- return printer.printNode(ts31.EmitHint.Unspecified, fn, sf);
7093
+ return printer.printNode(ts32.EmitHint.Unspecified, fn, sf);
5901
7094
  }
5902
7095
  };
5903
7096
  var TypeCtorOp = class {
@@ -5912,23 +7105,9 @@ var TypeCtorOp = class {
5912
7105
  execute(im, sf, refEmitter, printer) {
5913
7106
  const emitEnv = new ReferenceEmitEnvironment(im, refEmitter, this.reflector, sf);
5914
7107
  const tcb = generateInlineTypeCtor(emitEnv, this.ref.node, this.meta);
5915
- return printer.printNode(ts31.EmitHint.Unspecified, tcb, sf);
7108
+ return printer.printNode(ts32.EmitHint.Unspecified, tcb, sf);
5916
7109
  }
5917
7110
  };
5918
- function orderOps(op1, op2) {
5919
- return op1.splitPoint - op2.splitPoint;
5920
- }
5921
- function splitStringAtPoints(str, points) {
5922
- const splits = [];
5923
- let start = 0;
5924
- for (let i = 0; i < points.length; i++) {
5925
- const point = points[i];
5926
- splits.push(str.substring(start, point));
5927
- start = point;
5928
- }
5929
- splits.push(str.substring(start));
5930
- return splits;
5931
- }
5932
7111
 
5933
7112
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
5934
7113
  import { ParseLocation, ParseSourceSpan } from "@angular/compiler";
@@ -6027,7 +7206,7 @@ var TemplateSourceManager = class {
6027
7206
 
6028
7207
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.mjs
6029
7208
  import { AST, ASTWithSource as ASTWithSource3, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, PropertyWrite as PropertyWrite4, R3Identifiers as R3Identifiers4, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as TmplAstBoundAttribute2, TmplAstBoundEvent, TmplAstElement as TmplAstElement4, TmplAstReference as TmplAstReference4, TmplAstTemplate as TmplAstTemplate3, TmplAstTextAttribute as TmplAstTextAttribute3, TmplAstVariable as TmplAstVariable2 } from "@angular/compiler";
6030
- import ts32 from "typescript";
7209
+ import ts33 from "typescript";
6031
7210
  var SymbolBuilder = class {
6032
7211
  constructor(tcbPath, tcbIsShim, typeCheckBlock, templateData, componentScopeReader, getTypeChecker) {
6033
7212
  this.tcbPath = tcbPath;
@@ -6071,7 +7250,7 @@ var SymbolBuilder = class {
6071
7250
  getSymbolOfElement(element) {
6072
7251
  var _a;
6073
7252
  const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
6074
- const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: ts32.isVariableDeclaration });
7253
+ const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: ts33.isVariableDeclaration });
6075
7254
  if (node === null) {
6076
7255
  return null;
6077
7256
  }
@@ -6091,12 +7270,12 @@ var SymbolBuilder = class {
6091
7270
  var _a;
6092
7271
  const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
6093
7272
  const tcbSourceFile = this.typeCheckBlock.getSourceFile();
6094
- const isDirectiveDeclaration = (node) => (ts32.isTypeNode(node) || ts32.isIdentifier(node)) && ts32.isVariableDeclaration(node.parent) && hasExpressionIdentifier(tcbSourceFile, node, ExpressionIdentifier.DIRECTIVE);
7273
+ const isDirectiveDeclaration = (node) => (ts33.isTypeNode(node) || ts33.isIdentifier(node)) && ts33.isVariableDeclaration(node.parent) && hasExpressionIdentifier(tcbSourceFile, node, ExpressionIdentifier.DIRECTIVE);
6095
7274
  const nodes = findAllMatchingNodes(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: isDirectiveDeclaration });
6096
7275
  const symbols = [];
6097
7276
  for (const node of nodes) {
6098
7277
  const symbol = this.getSymbolOfTsNode(node.parent);
6099
- if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts32.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
7278
+ if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts33.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
6100
7279
  continue;
6101
7280
  }
6102
7281
  const meta = this.getDirectiveMeta(element, symbol.tsSymbol.valueDeclaration);
@@ -6127,7 +7306,7 @@ var SymbolBuilder = class {
6127
7306
  if (!isHostDirectiveMetaForGlobalMode(current)) {
6128
7307
  throw new Error("Impossible state: typecheck code path in local compilation mode.");
6129
7308
  }
6130
- if (!ts32.isClassDeclaration(current.directive.node)) {
7309
+ if (!ts33.isClassDeclaration(current.directive.node)) {
6131
7310
  continue;
6132
7311
  }
6133
7312
  const symbol = this.getSymbolOfTsNode(current.directive.node);
@@ -6196,21 +7375,21 @@ var SymbolBuilder = class {
6196
7375
  }
6197
7376
  expectedAccess = bindingPropertyNames[0].classPropertyName;
6198
7377
  }
6199
- function filter(n) {
6200
- if (!isAccessExpression(n)) {
7378
+ function filter(n2) {
7379
+ if (!isAccessExpression(n2)) {
6201
7380
  return false;
6202
7381
  }
6203
- if (ts32.isPropertyAccessExpression(n)) {
6204
- return n.name.getText() === expectedAccess;
7382
+ if (ts33.isPropertyAccessExpression(n2)) {
7383
+ return n2.name.getText() === expectedAccess;
6205
7384
  } else {
6206
- return ts32.isStringLiteral(n.argumentExpression) && n.argumentExpression.text === expectedAccess;
7385
+ return ts33.isStringLiteral(n2.argumentExpression) && n2.argumentExpression.text === expectedAccess;
6207
7386
  }
6208
7387
  }
6209
7388
  const outputFieldAccesses = findAllMatchingNodes(this.typeCheckBlock, { withSpan: eventBinding.keySpan, filter });
6210
7389
  const bindings = [];
6211
7390
  for (const outputFieldAccess of outputFieldAccesses) {
6212
7391
  if (consumer instanceof TmplAstTemplate3 || consumer instanceof TmplAstElement4) {
6213
- if (!ts32.isPropertyAccessExpression(outputFieldAccess)) {
7392
+ if (!ts33.isPropertyAccessExpression(outputFieldAccess)) {
6214
7393
  continue;
6215
7394
  }
6216
7395
  const addEventListener = outputFieldAccess.name;
@@ -6233,7 +7412,7 @@ var SymbolBuilder = class {
6233
7412
  }
6234
7413
  });
6235
7414
  } else {
6236
- if (!ts32.isElementAccessExpression(outputFieldAccess)) {
7415
+ if (!ts33.isElementAccessExpression(outputFieldAccess)) {
6237
7416
  continue;
6238
7417
  }
6239
7418
  const tsSymbol = this.getTypeChecker().getSymbolAtLocation(outputFieldAccess.argumentExpression);
@@ -6319,7 +7498,7 @@ var SymbolBuilder = class {
6319
7498
  return null;
6320
7499
  }
6321
7500
  const [declaration] = tsSymbol.declarations;
6322
- if (!ts32.isVariableDeclaration(declaration) || !hasExpressionIdentifier(
7501
+ if (!ts33.isVariableDeclaration(declaration) || !hasExpressionIdentifier(
6323
7502
  declaration.getSourceFile(),
6324
7503
  (_a = declaration.type) != null ? _a : declaration.name,
6325
7504
  ExpressionIdentifier.DIRECTIVE
@@ -6327,7 +7506,7 @@ var SymbolBuilder = class {
6327
7506
  return null;
6328
7507
  }
6329
7508
  const symbol = this.getSymbolOfTsNode(declaration);
6330
- if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts32.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
7509
+ if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts33.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
6331
7510
  return null;
6332
7511
  }
6333
7512
  const ref = new Reference(symbol.tsSymbol.valueDeclaration);
@@ -6347,12 +7526,12 @@ var SymbolBuilder = class {
6347
7526
  };
6348
7527
  }
6349
7528
  getSymbolOfVariable(variable) {
6350
- const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter: ts32.isVariableDeclaration });
7529
+ const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter: ts33.isVariableDeclaration });
6351
7530
  if (node === null) {
6352
7531
  return null;
6353
7532
  }
6354
7533
  let nodeValueSymbol = null;
6355
- if (ts32.isForOfStatement(node.parent.parent)) {
7534
+ if (ts33.isForOfStatement(node.parent.parent)) {
6356
7535
  nodeValueSymbol = this.getSymbolOfTsNode(node);
6357
7536
  } else if (node.initializer !== void 0) {
6358
7537
  nodeValueSymbol = this.getSymbolOfTsNode(node.initializer);
@@ -6375,11 +7554,11 @@ var SymbolBuilder = class {
6375
7554
  }
6376
7555
  getSymbolOfReference(ref) {
6377
7556
  const target = this.templateData.boundTarget.getReferenceTarget(ref);
6378
- let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter: ts32.isVariableDeclaration });
7557
+ let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter: ts33.isVariableDeclaration });
6379
7558
  if (node === null || target === null || node.initializer === void 0) {
6380
7559
  return null;
6381
7560
  }
6382
- const originalDeclaration = ts32.isParenthesizedExpression(node.initializer) && ts32.isAsExpression(node.initializer.expression) ? this.getTypeChecker().getSymbolAtLocation(node.name) : this.getTypeChecker().getSymbolAtLocation(node.initializer);
7561
+ const originalDeclaration = ts33.isParenthesizedExpression(node.initializer) && ts33.isAsExpression(node.initializer.expression) ? this.getTypeChecker().getSymbolAtLocation(node.name) : this.getTypeChecker().getSymbolAtLocation(node.initializer);
6383
7562
  if (originalDeclaration === void 0 || originalDeclaration.valueDeclaration === void 0) {
6384
7563
  return null;
6385
7564
  }
@@ -6403,7 +7582,7 @@ var SymbolBuilder = class {
6403
7582
  referenceVarLocation: referenceVarTcbLocation
6404
7583
  };
6405
7584
  } else {
6406
- if (!ts32.isClassDeclaration(target.directive.ref.node)) {
7585
+ if (!ts33.isClassDeclaration(target.directive.ref.node)) {
6407
7586
  return null;
6408
7587
  }
6409
7588
  return {
@@ -6418,7 +7597,7 @@ var SymbolBuilder = class {
6418
7597
  }
6419
7598
  }
6420
7599
  getSymbolOfPipe(expression) {
6421
- const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter: ts32.isPropertyAccessExpression });
7600
+ const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter: ts33.isPropertyAccessExpression });
6422
7601
  if (methodAccess === null) {
6423
7602
  return null;
6424
7603
  }
@@ -6458,7 +7637,7 @@ var SymbolBuilder = class {
6458
7637
  }
6459
7638
  let node = null;
6460
7639
  if (expression instanceof PropertyRead5) {
6461
- node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: ts32.isPropertyAccessExpression });
7640
+ node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: ts33.isPropertyAccessExpression });
6462
7641
  }
6463
7642
  if (node === null) {
6464
7643
  node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: anyNodeFilter });
@@ -6466,10 +7645,10 @@ var SymbolBuilder = class {
6466
7645
  if (node === null) {
6467
7646
  return null;
6468
7647
  }
6469
- while (ts32.isParenthesizedExpression(node)) {
7648
+ while (ts33.isParenthesizedExpression(node)) {
6470
7649
  node = node.expression;
6471
7650
  }
6472
- if (expression instanceof SafePropertyRead4 && ts32.isConditionalExpression(node)) {
7651
+ if (expression instanceof SafePropertyRead4 && ts33.isConditionalExpression(node)) {
6473
7652
  const whenTrueSymbol = this.getSymbolOfTsNode(node.whenTrue);
6474
7653
  if (whenTrueSymbol === null) {
6475
7654
  return null;
@@ -6486,11 +7665,11 @@ var SymbolBuilder = class {
6486
7665
  }
6487
7666
  getSymbolOfTsNode(node) {
6488
7667
  var _a;
6489
- while (ts32.isParenthesizedExpression(node)) {
7668
+ while (ts33.isParenthesizedExpression(node)) {
6490
7669
  node = node.expression;
6491
7670
  }
6492
7671
  let tsSymbol;
6493
- if (ts32.isPropertyAccessExpression(node)) {
7672
+ if (ts33.isPropertyAccessExpression(node)) {
6494
7673
  tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.name);
6495
7674
  } else {
6496
7675
  tsSymbol = this.getTypeChecker().getSymbolAtLocation(node);
@@ -6508,33 +7687,33 @@ var SymbolBuilder = class {
6508
7687
  };
6509
7688
  }
6510
7689
  getTcbPositionForNode(node) {
6511
- if (ts32.isTypeReferenceNode(node)) {
7690
+ if (ts33.isTypeReferenceNode(node)) {
6512
7691
  return this.getTcbPositionForNode(node.typeName);
6513
- } else if (ts32.isQualifiedName(node)) {
7692
+ } else if (ts33.isQualifiedName(node)) {
6514
7693
  return node.right.getStart();
6515
- } else if (ts32.isPropertyAccessExpression(node)) {
7694
+ } else if (ts33.isPropertyAccessExpression(node)) {
6516
7695
  return node.name.getStart();
6517
- } else if (ts32.isElementAccessExpression(node)) {
7696
+ } else if (ts33.isElementAccessExpression(node)) {
6518
7697
  return node.argumentExpression.getStart();
6519
7698
  } else {
6520
7699
  return node.getStart();
6521
7700
  }
6522
7701
  }
6523
7702
  };
6524
- function anyNodeFilter(n) {
7703
+ function anyNodeFilter(n2) {
6525
7704
  return true;
6526
7705
  }
6527
7706
  function sourceSpanEqual(a, b) {
6528
7707
  return a.start.offset === b.start.offset && a.end.offset === b.end.offset;
6529
7708
  }
6530
7709
  function unwrapSignalInputWriteTAccessor(expr) {
6531
- if (!ts32.isElementAccessExpression(expr) || !ts32.isPropertyAccessExpression(expr.argumentExpression)) {
7710
+ if (!ts33.isElementAccessExpression(expr) || !ts33.isPropertyAccessExpression(expr.argumentExpression)) {
6532
7711
  return null;
6533
7712
  }
6534
- if (!ts32.isIdentifier(expr.argumentExpression.name) || expr.argumentExpression.name.text !== R3Identifiers4.InputSignalBrandWriteType.name) {
7713
+ if (!ts33.isIdentifier(expr.argumentExpression.name) || expr.argumentExpression.name.text !== R3Identifiers4.InputSignalBrandWriteType.name) {
6535
7714
  return null;
6536
7715
  }
6537
- if (!ts32.isPropertyAccessExpression(expr.expression) && !ts32.isElementAccessExpression(expr.expression)) {
7716
+ if (!ts33.isPropertyAccessExpression(expr.expression) && !ts33.isElementAccessExpression(expr.expression)) {
6538
7717
  throw new Error("Unexpected expression for signal input write type.");
6539
7718
  }
6540
7719
  return {
@@ -7248,7 +8427,7 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
7248
8427
  import { Interpolation, PropertyRead as PropertyRead6 } from "@angular/compiler";
7249
8428
 
7250
8429
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/symbol_util.mjs
7251
- import ts33 from "typescript";
8430
+ import ts34 from "typescript";
7252
8431
  var SIGNAL_FNS = /* @__PURE__ */ new Set([
7253
8432
  "WritableSignal",
7254
8433
  "Signal",
@@ -7263,7 +8442,7 @@ function isSignalSymbol(symbol) {
7263
8442
  const declarations = symbol.getDeclarations();
7264
8443
  return declarations !== void 0 && declarations.some((decl) => {
7265
8444
  const fileName = decl.getSourceFile().fileName;
7266
- return (ts33.isInterfaceDeclaration(decl) || ts33.isTypeAliasDeclaration(decl)) && SIGNAL_FNS.has(decl.name.text) && (fileName.includes("@angular/core") || fileName.includes("angular2/rc/packages/core"));
8445
+ return (ts34.isInterfaceDeclaration(decl) || ts34.isTypeAliasDeclaration(decl)) && SIGNAL_FNS.has(decl.name.text) && (fileName.includes("@angular/core") || fileName.includes("angular2/rc/packages/core"));
7267
8446
  });
7268
8447
  }
7269
8448
 
@@ -7541,7 +8720,7 @@ var factory4 = {
7541
8720
 
7542
8721
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.mjs
7543
8722
  import { Binary } from "@angular/compiler";
7544
- import ts34 from "typescript";
8723
+ import ts35 from "typescript";
7545
8724
  var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
7546
8725
  constructor() {
7547
8726
  super(...arguments);
@@ -7555,7 +8734,7 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
7555
8734
  return [];
7556
8735
  }
7557
8736
  const typeLeft = symbolLeft.tsType;
7558
- if (typeLeft.flags & (ts34.TypeFlags.Any | ts34.TypeFlags.Unknown)) {
8737
+ if (typeLeft.flags & (ts35.TypeFlags.Any | ts35.TypeFlags.Unknown)) {
7559
8738
  return [];
7560
8739
  }
7561
8740
  if (typeLeft.getNonNullableType() !== typeLeft)
@@ -7586,7 +8765,7 @@ var factory5 = {
7586
8765
 
7587
8766
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/optional_chain_not_nullable/index.mjs
7588
8767
  import { SafeCall as SafeCall2, SafeKeyedRead as SafeKeyedRead2, SafePropertyRead as SafePropertyRead5 } from "@angular/compiler";
7589
- import ts35 from "typescript";
8768
+ import ts36 from "typescript";
7590
8769
  var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
7591
8770
  constructor() {
7592
8771
  super(...arguments);
@@ -7600,7 +8779,7 @@ var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
7600
8779
  return [];
7601
8780
  }
7602
8781
  const typeLeft = symbolLeft.tsType;
7603
- if (typeLeft.flags & (ts35.TypeFlags.Any | ts35.TypeFlags.Unknown)) {
8782
+ if (typeLeft.flags & (ts36.TypeFlags.Any | ts36.TypeFlags.Unknown)) {
7604
8783
  return [];
7605
8784
  }
7606
8785
  if (typeLeft.getNonNullableType() !== typeLeft)
@@ -7694,7 +8873,7 @@ var factory8 = {
7694
8873
  };
7695
8874
 
7696
8875
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
7697
- import ts36 from "typescript";
8876
+ import ts37 from "typescript";
7698
8877
 
7699
8878
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/api/src/public_options.mjs
7700
8879
  var DiagnosticCategoryLabel;
@@ -7743,9 +8922,9 @@ var ExtendedTemplateCheckerImpl = class {
7743
8922
  function diagnosticLabelToCategory(label) {
7744
8923
  switch (label) {
7745
8924
  case DiagnosticCategoryLabel.Warning:
7746
- return ts36.DiagnosticCategory.Warning;
8925
+ return ts37.DiagnosticCategory.Warning;
7747
8926
  case DiagnosticCategoryLabel.Error:
7748
- return ts36.DiagnosticCategory.Error;
8927
+ return ts37.DiagnosticCategory.Error;
7749
8928
  case DiagnosticCategoryLabel.Suppress:
7750
8929
  return null;
7751
8930
  default:
@@ -7775,7 +8954,7 @@ var SUPPORTED_DIAGNOSTIC_NAMES = /* @__PURE__ */ new Set([
7775
8954
 
7776
8955
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.mjs
7777
8956
  import { ASTWithSource as ASTWithSource5, ImplicitReceiver as ImplicitReceiver4, RecursiveAstVisitor as RecursiveAstVisitor3, TmplAstBoundEvent as TmplAstBoundEvent3, TmplAstRecursiveVisitor as TmplAstRecursiveVisitor2, TmplAstVariable as TmplAstVariable3 } from "@angular/compiler";
7778
- import ts37 from "typescript";
8957
+ import ts38 from "typescript";
7779
8958
  var TemplateSemanticsCheckerImpl = class {
7780
8959
  constructor(templateTypeChecker) {
7781
8960
  this.templateTypeChecker = templateTypeChecker;
@@ -7843,7 +9022,7 @@ var ExpressionsSemanticsVisitor = class extends RecursiveAstVisitor3 {
7843
9022
  }
7844
9023
  makeIllegalTemplateVarDiagnostic(target, expressionNode, errorMessage) {
7845
9024
  var _a, _b;
7846
- return this.templateTypeChecker.makeTemplateDiagnostic(this.component, expressionNode.handlerSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMessage, [{
9025
+ return this.templateTypeChecker.makeTemplateDiagnostic(this.component, expressionNode.handlerSpan, ts38.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMessage, [{
7847
9026
  text: `The variable ${target.name} is declared here.`,
7848
9027
  start: ((_a = target.valueSpan) == null ? void 0 : _a.start.offset) || target.sourceSpan.start.offset,
7849
9028
  end: ((_b = target.valueSpan) == null ? void 0 : _b.end.offset) || target.sourceSpan.end.offset,
@@ -7976,7 +9155,7 @@ var NgCompiler = class {
7976
9155
  this.currentProgram = inputProgram;
7977
9156
  this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
7978
9157
  this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
7979
- const moduleResolutionCache = ts38.createModuleResolutionCache(
9158
+ const moduleResolutionCache = ts39.createModuleResolutionCache(
7980
9159
  this.adapter.getCurrentDirectory(),
7981
9160
  this.adapter.getCanonicalFileName.bind(this.adapter)
7982
9161
  );
@@ -8020,7 +9199,7 @@ var NgCompiler = class {
8020
9199
  }
8021
9200
  for (const clazz of classesToUpdate) {
8022
9201
  this.compilation.traitCompiler.updateResources(clazz);
8023
- if (!ts38.isClassDeclaration(clazz)) {
9202
+ if (!ts39.isClassDeclaration(clazz)) {
8024
9203
  continue;
8025
9204
  }
8026
9205
  this.compilation.templateTypeChecker.invalidateClass(clazz);
@@ -8514,18 +9693,18 @@ function isAngularCorePackage(program) {
8514
9693
  return false;
8515
9694
  }
8516
9695
  return r3Symbols.statements.some((stmt) => {
8517
- if (!ts38.isVariableStatement(stmt)) {
9696
+ if (!ts39.isVariableStatement(stmt)) {
8518
9697
  return false;
8519
9698
  }
8520
- const modifiers = ts38.getModifiers(stmt);
8521
- if (modifiers === void 0 || !modifiers.some((mod) => mod.kind === ts38.SyntaxKind.ExportKeyword)) {
9699
+ const modifiers = ts39.getModifiers(stmt);
9700
+ if (modifiers === void 0 || !modifiers.some((mod) => mod.kind === ts39.SyntaxKind.ExportKeyword)) {
8522
9701
  return false;
8523
9702
  }
8524
9703
  return stmt.declarationList.declarations.some((decl) => {
8525
- if (!ts38.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
9704
+ if (!ts39.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
8526
9705
  return false;
8527
9706
  }
8528
- if (decl.initializer === void 0 || decl.initializer.kind !== ts38.SyntaxKind.TrueKeyword) {
9707
+ if (decl.initializer === void 0 || decl.initializer.kind !== ts39.SyntaxKind.TrueKeyword) {
8529
9708
  return false;
8530
9709
  }
8531
9710
  return true;
@@ -8539,7 +9718,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
8539
9718
  var _a, _b, _c;
8540
9719
  if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
8541
9720
  yield makeConfigDiagnostic({
8542
- category: ts38.DiagnosticCategory.Error,
9721
+ category: ts39.DiagnosticCategory.Error,
8543
9722
  code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
8544
9723
  messageText: `
8545
9724
  Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
@@ -8558,7 +9737,7 @@ https://angular.io/guide/template-typecheck
8558
9737
  }
8559
9738
  if (options.extendedDiagnostics && options.strictTemplates === false) {
8560
9739
  yield makeConfigDiagnostic({
8561
- category: ts38.DiagnosticCategory.Error,
9740
+ category: ts39.DiagnosticCategory.Error,
8562
9741
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
8563
9742
  messageText: `
8564
9743
  Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
@@ -8575,7 +9754,7 @@ One of the following actions is required:
8575
9754
  const defaultCategory = (_a = options.extendedDiagnostics) == null ? void 0 : _a.defaultCategory;
8576
9755
  if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
8577
9756
  yield makeConfigDiagnostic({
8578
- category: ts38.DiagnosticCategory.Error,
9757
+ category: ts39.DiagnosticCategory.Error,
8579
9758
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
8580
9759
  messageText: `
8581
9760
  Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
@@ -8588,7 +9767,7 @@ ${allowedCategoryLabels.join("\n")}
8588
9767
  for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
8589
9768
  if (!SUPPORTED_DIAGNOSTIC_NAMES.has(checkName)) {
8590
9769
  yield makeConfigDiagnostic({
8591
- category: ts38.DiagnosticCategory.Error,
9770
+ category: ts39.DiagnosticCategory.Error,
8592
9771
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
8593
9772
  messageText: `
8594
9773
  Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
@@ -8600,7 +9779,7 @@ ${Array.from(SUPPORTED_DIAGNOSTIC_NAMES).join("\n")}
8600
9779
  }
8601
9780
  if (!allowedCategoryLabels.includes(category)) {
8602
9781
  yield makeConfigDiagnostic({
8603
- category: ts38.DiagnosticCategory.Error,
9782
+ category: ts39.DiagnosticCategory.Error,
8604
9783
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
8605
9784
  messageText: `
8606
9785
  Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
@@ -8630,7 +9809,7 @@ var ReferenceGraphAdapter = class {
8630
9809
  for (const { node } of references) {
8631
9810
  let sourceFile = node.getSourceFile();
8632
9811
  if (sourceFile === void 0) {
8633
- sourceFile = ts38.getOriginalNode(node).getSourceFile();
9812
+ sourceFile = ts39.getOriginalNode(node).getSourceFile();
8634
9813
  }
8635
9814
  if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
8636
9815
  this.graph.add(source, node);
@@ -8669,7 +9848,7 @@ function versionMapFromProgram(program, driver) {
8669
9848
  }
8670
9849
 
8671
9850
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
8672
- import ts39 from "typescript";
9851
+ import ts40 from "typescript";
8673
9852
  var DelegatingCompilerHost2 = class {
8674
9853
  get jsDocParsingMode() {
8675
9854
  return this.delegate.jsDocParsingMode;
@@ -8754,7 +9933,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
8754
9933
  entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
8755
9934
  if (entryPoint === null) {
8756
9935
  diagnostics.push({
8757
- category: ts39.DiagnosticCategory.Error,
9936
+ category: ts40.DiagnosticCategory.Error,
8758
9937
  code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
8759
9938
  file: void 0,
8760
9939
  start: void 0,
@@ -8797,10 +9976,10 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
8797
9976
  return this.fileNameToModuleName !== void 0 ? this : null;
8798
9977
  }
8799
9978
  createCachedResolveModuleNamesFunction() {
8800
- const moduleResolutionCache = ts39.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
9979
+ const moduleResolutionCache = ts40.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
8801
9980
  return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
8802
9981
  return moduleNames.map((moduleName) => {
8803
- const module = ts39.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
9982
+ const module = ts40.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
8804
9983
  return module.resolvedModule;
8805
9984
  });
8806
9985
  };
@@ -8824,7 +10003,7 @@ var NgtscProgram = class {
8824
10003
  if (reuseProgram !== void 0) {
8825
10004
  retagAllTsFiles(reuseProgram);
8826
10005
  }
8827
- this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts40.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
10006
+ this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts41.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
8828
10007
  perfRecorder.phase(PerfPhase.Unaccounted);
8829
10008
  perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
8830
10009
  this.host.postProgramCreationCleanup();
@@ -9040,16 +10219,16 @@ function createProgram({ rootNames, options, host, oldProgram }) {
9040
10219
  }
9041
10220
 
9042
10221
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
9043
- import ts42 from "typescript";
10222
+ import ts43 from "typescript";
9044
10223
 
9045
10224
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
9046
- import ts41 from "typescript";
10225
+ import ts42 from "typescript";
9047
10226
  function createMessageDiagnostic(messageText) {
9048
10227
  return {
9049
10228
  file: void 0,
9050
10229
  start: void 0,
9051
10230
  length: void 0,
9052
- category: ts41.DiagnosticCategory.Message,
10231
+ category: ts42.DiagnosticCategory.Message,
9053
10232
  messageText,
9054
10233
  code: DEFAULT_ERROR_CODE,
9055
10234
  source: SOURCE
@@ -9058,13 +10237,13 @@ function createMessageDiagnostic(messageText) {
9058
10237
 
9059
10238
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
9060
10239
  var defaultFormatHost = {
9061
- getCurrentDirectory: () => ts42.sys.getCurrentDirectory(),
10240
+ getCurrentDirectory: () => ts43.sys.getCurrentDirectory(),
9062
10241
  getCanonicalFileName: (fileName) => fileName,
9063
- getNewLine: () => ts42.sys.newLine
10242
+ getNewLine: () => ts43.sys.newLine
9064
10243
  };
9065
10244
  function formatDiagnostics(diags, host = defaultFormatHost) {
9066
10245
  if (diags && diags.length) {
9067
- return diags.map((diagnostic) => replaceTsWithNgInErrors(ts42.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
10246
+ return diags.map((diagnostic) => replaceTsWithNgInErrors(ts43.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
9068
10247
  } else {
9069
10248
  return "";
9070
10249
  }
@@ -9081,7 +10260,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
9081
10260
  var _a;
9082
10261
  try {
9083
10262
  const fs = getFileSystem();
9084
- const readConfigFile = (configFile) => ts42.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
10263
+ const readConfigFile = (configFile) => ts43.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
9085
10264
  const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
9086
10265
  const { config: config2, error: error2 } = readConfigFile(configFile);
9087
10266
  if (error2) {
@@ -9116,7 +10295,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
9116
10295
  ...existingOptions
9117
10296
  };
9118
10297
  const parseConfigHost = createParseConfigHost(host, fs);
9119
- const { options, errors, fileNames: rootNames, projectReferences } = ts42.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
10298
+ const { options, errors, fileNames: rootNames, projectReferences } = ts43.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
9120
10299
  let emitFlags = EmitFlags.Default;
9121
10300
  if (!(options["skipMetadataEmit"] || options["flatModuleOutFile"])) {
9122
10301
  emitFlags |= EmitFlags.Metadata;
@@ -9127,7 +10306,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
9127
10306
  return { project: projectFile, rootNames, projectReferences, options, errors, emitFlags };
9128
10307
  } catch (e) {
9129
10308
  const errors = [{
9130
- category: ts42.DiagnosticCategory.Error,
10309
+ category: ts43.DiagnosticCategory.Error,
9131
10310
  messageText: (_a = e.stack) != null ? _a : e.message,
9132
10311
  file: void 0,
9133
10312
  start: void 0,
@@ -9141,7 +10320,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
9141
10320
  function createParseConfigHost(host, fs = getFileSystem()) {
9142
10321
  return {
9143
10322
  fileExists: host.exists.bind(host),
9144
- readDirectory: ts42.sys.readDirectory,
10323
+ readDirectory: ts43.sys.readDirectory,
9145
10324
  readFile: host.readFile.bind(host),
9146
10325
  useCaseSensitiveFileNames: fs.isCaseSensitive()
9147
10326
  };
@@ -9161,7 +10340,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
9161
10340
  }
9162
10341
  } else {
9163
10342
  const parseConfigHost = createParseConfigHost(host, fs);
9164
- const { resolvedModule } = ts42.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts42.ModuleResolutionKind.Node10, resolveJsonModule: true }, parseConfigHost);
10343
+ const { resolvedModule } = ts43.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts43.ModuleResolutionKind.Node10, resolveJsonModule: true }, parseConfigHost);
9165
10344
  if (resolvedModule) {
9166
10345
  return absoluteFrom(resolvedModule.resolvedFileName);
9167
10346
  }
@@ -9171,7 +10350,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
9171
10350
  function exitCodeFromResult(diags) {
9172
10351
  if (!diags)
9173
10352
  return 0;
9174
- if (diags.every((diag) => diag.category !== ts42.DiagnosticCategory.Error)) {
10353
+ if (diags.every((diag) => diag.category !== ts43.DiagnosticCategory.Error)) {
9175
10354
  return 0;
9176
10355
  }
9177
10356
  return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
@@ -9204,7 +10383,7 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
9204
10383
  } catch (e) {
9205
10384
  program = void 0;
9206
10385
  allDiagnostics.push({
9207
- category: ts42.DiagnosticCategory.Error,
10386
+ category: ts43.DiagnosticCategory.Error,
9208
10387
  messageText: (_a = e.stack) != null ? _a : e.message,
9209
10388
  code: UNKNOWN_ERROR_CODE,
9210
10389
  file: void 0,
@@ -9231,7 +10410,7 @@ function defaultGatherDiagnostics(program) {
9231
10410
  return allDiagnostics;
9232
10411
  }
9233
10412
  function hasErrors(diags) {
9234
- return diags.some((d) => d.category === ts42.DiagnosticCategory.Error);
10413
+ return diags.some((d) => d.category === ts43.DiagnosticCategory.Error);
9235
10414
  }
9236
10415
 
9237
10416
  export {
@@ -9245,6 +10424,7 @@ export {
9245
10424
  MemberType,
9246
10425
  DecoratorType,
9247
10426
  MemberTags,
10427
+ DocsExtractor,
9248
10428
  untagAllTsFiles,
9249
10429
  TsCreateProgramDriver,
9250
10430
  PatchedProgramIncrementalBuildStrategy,
@@ -9276,4 +10456,4 @@ export {
9276
10456
  * Use of this source code is governed by an MIT-style license that can be
9277
10457
  * found in the LICENSE file at https://angular.io/license
9278
10458
  */
9279
- //# sourceMappingURL=chunk-VH6EDOMC.js.map
10459
+ //# sourceMappingURL=chunk-LHQ7WPU2.js.map