@angular/core 17.0.6 → 17.0.8

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 (71) hide show
  1. package/esm2022/primitives/signals/src/signal.mjs +2 -9
  2. package/esm2022/src/application/application_config.mjs +21 -0
  3. package/esm2022/src/application/application_init.mjs +188 -0
  4. package/esm2022/src/application/application_module.mjs +29 -0
  5. package/esm2022/src/application/application_ref.mjs +505 -0
  6. package/esm2022/src/application/application_tokens.mjs +121 -0
  7. package/esm2022/src/application/create_application.mjs +102 -0
  8. package/esm2022/src/change_detection/flags.mjs +16 -0
  9. package/esm2022/src/change_detection/scheduling/ng_zone_scheduling.mjs +164 -0
  10. package/esm2022/src/change_detection/scheduling/zoneless_scheduling.mjs +13 -0
  11. package/esm2022/src/core.mjs +10 -7
  12. package/esm2022/src/core_private_export.mjs +8 -4
  13. package/esm2022/src/core_reactivity_export_internal.mjs +2 -2
  14. package/esm2022/src/core_render3_private_export.mjs +2 -2
  15. package/esm2022/src/error_handler.mjs +15 -1
  16. package/esm2022/src/event_emitter.mjs +1 -2
  17. package/esm2022/src/hydration/annotate.mjs +1 -1
  18. package/esm2022/src/hydration/api.mjs +2 -2
  19. package/esm2022/src/hydration/cleanup.mjs +1 -1
  20. package/esm2022/src/image_performance_warning.mjs +2 -2
  21. package/esm2022/src/linker/query_list.mjs +8 -6
  22. package/esm2022/src/metadata/do_bootstrap.mjs +1 -1
  23. package/esm2022/src/pending_tasks.mjs +57 -0
  24. package/esm2022/src/platform/platform.mjs +135 -0
  25. package/esm2022/src/platform/platform_core_providers.mjs +15 -0
  26. package/esm2022/src/platform/platform_ref.mjs +179 -0
  27. package/esm2022/src/render3/after_render_hooks.mjs +2 -2
  28. package/esm2022/src/render3/component_ref.mjs +13 -9
  29. package/esm2022/src/render3/instructions/change_detection.mjs +2 -4
  30. package/esm2022/src/render3/instructions/mark_view_dirty.mjs +3 -2
  31. package/esm2022/src/render3/instructions/shared.mjs +3 -2
  32. package/esm2022/src/render3/interfaces/view.mjs +1 -1
  33. package/esm2022/src/render3/list_reconciliation.mjs +58 -24
  34. package/esm2022/src/render3/util/change_detection_utils.mjs +3 -1
  35. package/esm2022/src/render3/util/misc_utils.mjs +2 -2
  36. package/esm2022/src/render3/util/view_utils.mjs +18 -5
  37. package/esm2022/src/render3/view_ref.mjs +8 -1
  38. package/esm2022/src/transfer_state.mjs +2 -2
  39. package/esm2022/src/util/performance.mjs +2 -2
  40. package/esm2022/src/version.mjs +6 -5
  41. package/esm2022/src/zone/ng_zone.mjs +10 -61
  42. package/esm2022/testing/src/component_fixture.mjs +20 -36
  43. package/esm2022/testing/src/logger.mjs +3 -3
  44. package/esm2022/testing/src/test_bed.mjs +5 -6
  45. package/fesm2022/core.mjs +1409 -1340
  46. package/fesm2022/core.mjs.map +1 -1
  47. package/fesm2022/primitives/signals.mjs +2 -9
  48. package/fesm2022/primitives/signals.mjs.map +1 -1
  49. package/fesm2022/rxjs-interop.mjs +1 -1
  50. package/fesm2022/testing.mjs +46 -64
  51. package/fesm2022/testing.mjs.map +1 -1
  52. package/index.d.ts +50 -35
  53. package/package.json +1 -1
  54. package/primitives/signals/index.d.ts +1 -1
  55. package/rxjs-interop/index.d.ts +1 -1
  56. package/schematics/migrations/block-template-entities/bundle.js +863 -673
  57. package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
  58. package/schematics/migrations/compiler-options/bundle.js +13 -13
  59. package/schematics/migrations/transfer-state/bundle.js +13 -13
  60. package/schematics/ng-generate/control-flow-migration/bundle.js +1175 -782
  61. package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
  62. package/schematics/ng-generate/standalone-migration/bundle.js +1168 -933
  63. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  64. package/testing/index.d.ts +6 -10
  65. package/esm2022/src/application_config.mjs +0 -21
  66. package/esm2022/src/application_init.mjs +0 -188
  67. package/esm2022/src/application_module.mjs +0 -29
  68. package/esm2022/src/application_ref.mjs +0 -997
  69. package/esm2022/src/application_tokens.mjs +0 -121
  70. package/esm2022/src/initial_render_pending_tasks.mjs +0 -49
  71. package/esm2022/src/platform_core_providers.mjs +0 -15
package/fesm2022/core.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Angular v17.0.6
2
+ * @license Angular v17.0.8
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import { setActiveConsumer as setActiveConsumer$1, consumerDestroy as consumerDestroy$1, SIGNAL as SIGNAL$1, createComputed as createComputed$1, createSignal as createSignal$1, signalSetFn as signalSetFn$1, signalUpdateFn as signalUpdateFn$1, REACTIVE_NODE as REACTIVE_NODE$1, consumerBeforeComputation as consumerBeforeComputation$1, consumerAfterComputation as consumerAfterComputation$1, consumerPollProducersForChange as consumerPollProducersForChange$1, getActiveConsumer as getActiveConsumer$1, createWatch as createWatch$1, setThrowInvalidWriteToSignalError as setThrowInvalidWriteToSignalError$1 } from '@angular/core/primitives/signals';
8
- import { Subject, Subscription, Observable, merge as merge$1, BehaviorSubject, of } from 'rxjs';
9
- import { share, switchMap, distinctUntilChanged, first } from 'rxjs/operators';
8
+ import { Subject, Subscription, BehaviorSubject } from 'rxjs';
9
+ import { map, first } from 'rxjs/operators';
10
10
 
11
11
  function getClosureSafeProperty(objWithPropertyToExtract) {
12
12
  for (let key in objWithPropertyToExtract) {
@@ -2565,6 +2565,15 @@ const profiler = function (event, instance, hookOrListener) {
2565
2565
  const SVG_NAMESPACE = 'svg';
2566
2566
  const MATH_ML_NAMESPACE = 'math';
2567
2567
 
2568
+ // TODO(atscott): flip default internally ASAP and externally for v18 (#52928)
2569
+ let _ensureDirtyViewsAreAlwaysReachable = false;
2570
+ function getEnsureDirtyViewsAreAlwaysReachable() {
2571
+ return _ensureDirtyViewsAreAlwaysReachable;
2572
+ }
2573
+ function setEnsureDirtyViewsAreAlwaysReachable(v) {
2574
+ _ensureDirtyViewsAreAlwaysReachable = v;
2575
+ }
2576
+
2568
2577
  /**
2569
2578
  * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)
2570
2579
  * in same location in `LView`. This is because we don't want to pre-allocate space for it
@@ -2731,10 +2740,21 @@ function requiresRefreshOrTraversal(lView) {
2731
2740
  * parents above.
2732
2741
  */
2733
2742
  function updateAncestorTraversalFlagsOnAttach(lView) {
2734
- if (!requiresRefreshOrTraversal(lView)) {
2735
- return;
2743
+ // TODO(atscott): Simplify if...else cases once getEnsureDirtyViewsAreAlwaysReachable is always
2744
+ // `true`. When we attach a view that's marked `Dirty`, we should ensure that it is reached during
2745
+ // the next CD traversal so we add the `RefreshView` flag and mark ancestors accordingly.
2746
+ if (requiresRefreshOrTraversal(lView)) {
2747
+ markAncestorsForTraversal(lView);
2748
+ }
2749
+ else if (lView[FLAGS] & 64 /* LViewFlags.Dirty */) {
2750
+ if (getEnsureDirtyViewsAreAlwaysReachable()) {
2751
+ lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;
2752
+ markAncestorsForTraversal(lView);
2753
+ }
2754
+ else {
2755
+ lView[ENVIRONMENT].changeDetectionScheduler?.notify();
2756
+ }
2736
2757
  }
2737
- markAncestorsForTraversal(lView);
2738
2758
  }
2739
2759
  /**
2740
2760
  * Ensures views above the given `lView` are traversed during change detection even when they are
@@ -2744,6 +2764,7 @@ function updateAncestorTraversalFlagsOnAttach(lView) {
2744
2764
  * flag is already `true` or the `lView` is detached.
2745
2765
  */
2746
2766
  function markAncestorsForTraversal(lView) {
2767
+ lView[ENVIRONMENT].changeDetectionScheduler?.notify();
2747
2768
  let parent = lView[PARENT];
2748
2769
  while (parent !== null) {
2749
2770
  // We stop adding markers to the ancestors once we reach one that already has the marker. This
@@ -9841,6 +9862,12 @@ function getSanitizer() {
9841
9862
  return lView && lView[ENVIRONMENT].sanitizer;
9842
9863
  }
9843
9864
 
9865
+ /**
9866
+ * Injectable that is notified when an `LView` is made aware of changes to application state.
9867
+ */
9868
+ class ChangeDetectionScheduler {
9869
+ }
9870
+
9844
9871
  /**
9845
9872
  * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
9846
9873
  *
@@ -10411,24 +10438,6 @@ class Sanitizer {
10411
10438
  }); }
10412
10439
  }
10413
10440
 
10414
- /**
10415
- * @description Represents the version of Angular
10416
- *
10417
- * @publicApi
10418
- */
10419
- class Version {
10420
- constructor(full) {
10421
- this.full = full;
10422
- this.major = full.split('.')[0];
10423
- this.minor = full.split('.')[1];
10424
- this.patch = full.split('.').slice(2).join('.');
10425
- }
10426
- }
10427
- /**
10428
- * @publicApi
10429
- */
10430
- const VERSION = new Version('17.0.6');
10431
-
10432
10441
  // This default value is when checking the hierarchy for a token.
10433
10442
  //
10434
10443
  // It means both:
@@ -11762,6 +11771,19 @@ class ErrorHandler {
11762
11771
  return e || null;
11763
11772
  }
11764
11773
  }
11774
+ /**
11775
+ * `InjectionToken` used to configure how to call the `ErrorHandler`.
11776
+ *
11777
+ * `NgZone` is provided by default today so the default (and only) implementation for this
11778
+ * is calling `ErrorHandler.handleError` outside of the Angular zone.
11779
+ */
11780
+ const INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'internal error handler' : '', {
11781
+ providedIn: 'root',
11782
+ factory: () => {
11783
+ const userErrorHandler = inject(ErrorHandler);
11784
+ return userErrorHandler.handleError.bind(undefined);
11785
+ }
11786
+ });
11765
11787
 
11766
11788
  /**
11767
11789
  * Internal token that specifies whether DOM reuse logic
@@ -12030,7 +12052,8 @@ function processHostBindingOpCodes(tView, lView) {
12030
12052
  function createLView(parentLView, tView, context, flags, host, tHostNode, environment, renderer, injector, embeddedViewInjector, hydrationInfo) {
12031
12053
  const lView = tView.blueprint.slice();
12032
12054
  lView[HOST] = host;
12033
- lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 128 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */;
12055
+ lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 128 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */ |
12056
+ 64 /* LViewFlags.Dirty */;
12034
12057
  if (embeddedViewInjector !== null ||
12035
12058
  (parentLView && (parentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */))) {
12036
12059
  lView[FLAGS] |= 2048 /* LViewFlags.HasEmbeddedViewInjector */;
@@ -13306,9 +13329,6 @@ function detectChangesInternal(lView, notifyErrorHandler = true) {
13306
13329
  afterRenderEventManager?.begin();
13307
13330
  }
13308
13331
  try {
13309
- const tView = lView[TVIEW];
13310
- const context = lView[CONTEXT];
13311
- refreshView(tView, lView, tView.template, context);
13312
13332
  detectChangesInViewWhileDirty(lView);
13313
13333
  }
13314
13334
  catch (error) {
@@ -13329,6 +13349,7 @@ function detectChangesInternal(lView, notifyErrorHandler = true) {
13329
13349
  }
13330
13350
  }
13331
13351
  function detectChangesInViewWhileDirty(lView) {
13352
+ detectChangesInView(lView, 0 /* ChangeDetectionMode.Global */);
13332
13353
  let retries = 0;
13333
13354
  // If after running change detection, this view still needs to be refreshed or there are
13334
13355
  // descendants views that need to be refreshed due to re-dirtying during the change detection
@@ -13641,6 +13662,7 @@ function detectChangesInChildComponents(hostLView, components, mode) {
13641
13662
  * @returns the root LView
13642
13663
  */
13643
13664
  function markViewDirty(lView) {
13665
+ lView[ENVIRONMENT].changeDetectionScheduler?.notify();
13644
13666
  while (lView) {
13645
13667
  lView[FLAGS] |= 64 /* LViewFlags.Dirty */;
13646
13668
  const parent = getLViewParent(lView);
@@ -13900,6 +13922,12 @@ class ViewRef$1 {
13900
13922
  * See {@link ChangeDetectorRef#detach} for more information.
13901
13923
  */
13902
13924
  detectChanges() {
13925
+ // Add `RefreshView` flag to ensure this view is refreshed if not already dirty.
13926
+ // `RefreshView` flag is used intentionally over `Dirty` because it gets cleared before
13927
+ // executing any of the actual refresh code while the `Dirty` flag doesn't get cleared
13928
+ // until the end of the refresh. Using `RefreshView` prevents creating a potential difference
13929
+ // in the state of the LViewFlags during template execution.
13930
+ this._lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;
13903
13931
  detectChangesInternal(this._lView, this.notifyErrorHandler);
13904
13932
  }
13905
13933
  /**
@@ -13928,6 +13956,7 @@ class ViewRef$1 {
13928
13956
  throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached to a ViewContainer!');
13929
13957
  }
13930
13958
  this._appRef = appRef;
13959
+ updateAncestorTraversalFlagsOnAttach(this._lView);
13931
13960
  }
13932
13961
  }
13933
13962
 
@@ -14269,10 +14298,9 @@ function performanceMarkFeature(feature) {
14269
14298
  return;
14270
14299
  }
14271
14300
  markedFeatures.add(feature);
14272
- performance?.mark?.('mark_use_counter', { detail: { feature } });
14301
+ performance?.mark?.('mark_feature_usage', { detail: { feature } });
14273
14302
  }
14274
14303
 
14275
- /// <reference types="rxjs" />
14276
14304
  class EventEmitter_ extends Subject {
14277
14305
  constructor(isAsync = false) {
14278
14306
  super();
@@ -14771,63 +14799,6 @@ class NoopNgZone {
14771
14799
  return fn.apply(applyThis, applyArgs);
14772
14800
  }
14773
14801
  }
14774
- /**
14775
- * Token used to drive ApplicationRef.isStable
14776
- *
14777
- * TODO: This should be moved entirely to NgZone (as a breaking change) so it can be tree-shakeable
14778
- * for `NoopNgZone` which is always just an `Observable` of `true`. Additionally, we should consider
14779
- * whether the property on `NgZone` should be `Observable` or `Signal`.
14780
- */
14781
- const ZONE_IS_STABLE_OBSERVABLE = new InjectionToken(ngDevMode ? 'isStable Observable' : '', {
14782
- providedIn: 'root',
14783
- // TODO(atscott): Replace this with a suitable default like `new
14784
- // BehaviorSubject(true).asObservable`. Again, long term this won't exist on ApplicationRef at
14785
- // all but until we can remove it, we need a default value zoneless.
14786
- factory: isStableFactory,
14787
- });
14788
- function isStableFactory() {
14789
- const zone = inject(NgZone);
14790
- let _stable = true;
14791
- const isCurrentlyStable = new Observable((observer) => {
14792
- _stable = zone.isStable && !zone.hasPendingMacrotasks && !zone.hasPendingMicrotasks;
14793
- zone.runOutsideAngular(() => {
14794
- observer.next(_stable);
14795
- observer.complete();
14796
- });
14797
- });
14798
- const isStable = new Observable((observer) => {
14799
- // Create the subscription to onStable outside the Angular Zone so that
14800
- // the callback is run outside the Angular Zone.
14801
- let stableSub;
14802
- zone.runOutsideAngular(() => {
14803
- stableSub = zone.onStable.subscribe(() => {
14804
- NgZone.assertNotInAngularZone();
14805
- // Check whether there are no pending macro/micro tasks in the next tick
14806
- // to allow for NgZone to update the state.
14807
- queueMicrotask(() => {
14808
- if (!_stable && !zone.hasPendingMacrotasks && !zone.hasPendingMicrotasks) {
14809
- _stable = true;
14810
- observer.next(true);
14811
- }
14812
- });
14813
- });
14814
- });
14815
- const unstableSub = zone.onUnstable.subscribe(() => {
14816
- NgZone.assertInAngularZone();
14817
- if (_stable) {
14818
- _stable = false;
14819
- zone.runOutsideAngular(() => {
14820
- observer.next(false);
14821
- });
14822
- }
14823
- });
14824
- return () => {
14825
- stableSub.unsubscribe();
14826
- unstableSub.unsubscribe();
14827
- };
14828
- });
14829
- return merge$1(isCurrentlyStable, isStable.pipe(share()));
14830
- }
14831
14802
  function shouldBeIgnoredByZone(applyArgs) {
14832
14803
  if (!Array.isArray(applyArgs)) {
14833
14804
  return false;
@@ -14840,8 +14811,15 @@ function shouldBeIgnoredByZone(applyArgs) {
14840
14811
  // Prevent triggering change detection when the __ignore_ng_zone__ flag is detected.
14841
14812
  return applyArgs[0].data?.['__ignore_ng_zone__'] === true;
14842
14813
  }
14843
-
14844
- // Public API for Zone
14814
+ function getNgZone(ngZoneToUse = 'zone.js', options) {
14815
+ if (ngZoneToUse === 'noop') {
14816
+ return new NoopNgZone();
14817
+ }
14818
+ if (ngZoneToUse === 'zone.js') {
14819
+ return new NgZone(options);
14820
+ }
14821
+ return ngZoneToUse;
14822
+ }
14845
14823
 
14846
14824
  /**
14847
14825
  * The phase to run an `afterRender` or `afterNextRender` callback in.
@@ -15460,12 +15438,14 @@ class ComponentFactory extends ComponentFactory$1 {
15460
15438
  }
15461
15439
  const sanitizer = rootViewInjector.get(Sanitizer, null);
15462
15440
  const afterRenderEventManager = rootViewInjector.get(AfterRenderEventManager, null);
15441
+ const changeDetectionScheduler = rootViewInjector.get(ChangeDetectionScheduler, null);
15463
15442
  const environment = {
15464
15443
  rendererFactory,
15465
15444
  sanitizer,
15466
15445
  // We don't use inline effects (yet).
15467
15446
  inlineEffectRunner: null,
15468
15447
  afterRenderEventManager,
15448
+ changeDetectionScheduler,
15469
15449
  };
15470
15450
  const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
15471
15451
  // Determine a tag name used for creating host elements when this component is created
@@ -15474,12 +15454,13 @@ class ComponentFactory extends ComponentFactory$1 {
15474
15454
  const hostRNode = rootSelectorOrNode ?
15475
15455
  locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation, rootViewInjector) :
15476
15456
  createElementNode(hostRenderer, elementName, getNamespace(elementName));
15477
- // Signal components use the granular "RefreshView" for change detection
15478
- const signalFlags = (4096 /* LViewFlags.SignalView */ | 512 /* LViewFlags.IsRoot */);
15479
- // Non-signal components use the traditional "CheckAlways or OnPush/Dirty" change detection
15480
- const nonSignalFlags = this.componentDef.onPush ? 64 /* LViewFlags.Dirty */ | 512 /* LViewFlags.IsRoot */ :
15481
- 16 /* LViewFlags.CheckAlways */ | 512 /* LViewFlags.IsRoot */;
15482
- const rootFlags = this.componentDef.signals ? signalFlags : nonSignalFlags;
15457
+ let rootFlags = 512 /* LViewFlags.IsRoot */;
15458
+ if (this.componentDef.signals) {
15459
+ rootFlags |= 4096 /* LViewFlags.SignalView */;
15460
+ }
15461
+ else if (!this.componentDef.onPush) {
15462
+ rootFlags |= 16 /* LViewFlags.CheckAlways */;
15463
+ }
15483
15464
  let hydrationInfo = null;
15484
15465
  if (hostRNode !== null) {
15485
15466
  hydrationInfo = retrieveHydrationInfo(hostRNode, rootViewInjector, true /* isRootView */);
@@ -15686,7 +15667,8 @@ function createRootComponent(componentView, rootComponentDef, rootDirectives, ho
15686
15667
  /** Sets the static attributes on a root component. */
15687
15668
  function setRootNodeAttributes(hostRenderer, componentDef, hostRNode, rootSelectorOrNode) {
15688
15669
  if (rootSelectorOrNode) {
15689
- setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
15670
+ // The placeholder will be replaced with the actual version at build time.
15671
+ setUpAttributes(hostRenderer, hostRNode, ['ng-version', '17.0.8']);
15690
15672
  }
15691
15673
  else {
15692
15674
  // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
@@ -19586,7 +19568,7 @@ function reconcile(liveCollection, newCollection, trackByFn) {
19586
19568
  }
19587
19569
  // Fallback to the slow path: we need to learn more about the content of the live and new
19588
19570
  // collections.
19589
- detachedItems ??= new MultiMap();
19571
+ detachedItems ??= new UniqueValueMultiKeyMap();
19590
19572
  liveKeysInTheFuture ??=
19591
19573
  initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
19592
19574
  // Check if I'm inserting a previously detached item: if so, attach it here
@@ -19634,7 +19616,7 @@ function reconcile(liveCollection, newCollection, trackByFn) {
19634
19616
  newIterationResult = newCollectionIterator.next();
19635
19617
  }
19636
19618
  else {
19637
- detachedItems ??= new MultiMap();
19619
+ detachedItems ??= new UniqueValueMultiKeyMap();
19638
19620
  liveKeysInTheFuture ??=
19639
19621
  initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
19640
19622
  // Check if I'm inserting a previously detached item: if so, attach it here
@@ -19700,40 +19682,73 @@ function initLiveItemsInTheFuture(liveCollection, start, end, trackByFn) {
19700
19682
  }
19701
19683
  return keys;
19702
19684
  }
19703
- class MultiMap {
19685
+ /**
19686
+ * A specific, partial implementation of the Map interface with the following characteristics:
19687
+ * - allows multiple values for a given key;
19688
+ * - maintain FIFO order for multiple values corresponding to a given key;
19689
+ * - assumes that all values are unique.
19690
+ *
19691
+ * The implementation aims at having the minimal overhead for cases where keys are _not_ duplicated
19692
+ * (the most common case in the list reconciliation algorithm). To achieve this, the first value for
19693
+ * a given key is stored in a regular map. Then, when more values are set for a given key, we
19694
+ * maintain a form of linked list in a separate map. To maintain this linked list we assume that all
19695
+ * values (in the entire collection) are unique.
19696
+ */
19697
+ class UniqueValueMultiKeyMap {
19704
19698
  constructor() {
19705
- this.map = new Map();
19699
+ // A map from a key to the first value corresponding to this key.
19700
+ this.kvMap = new Map();
19701
+ // A map that acts as a linked list of values - each value maps to the next value in this "linked
19702
+ // list" (this only works if values are unique). Allocated lazily to avoid memory consumption when
19703
+ // there are no duplicated values.
19704
+ this._vMap = undefined;
19706
19705
  }
19707
19706
  has(key) {
19708
- const listOfKeys = this.map.get(key);
19709
- return listOfKeys !== undefined && listOfKeys.length > 0;
19707
+ return this.kvMap.has(key);
19710
19708
  }
19711
19709
  delete(key) {
19712
- const listOfKeys = this.map.get(key);
19713
- if (listOfKeys !== undefined) {
19714
- listOfKeys.shift();
19715
- return true;
19710
+ if (!this.has(key))
19711
+ return false;
19712
+ const value = this.kvMap.get(key);
19713
+ if (this._vMap !== undefined && this._vMap.has(value)) {
19714
+ this.kvMap.set(key, this._vMap.get(value));
19715
+ this._vMap.delete(value);
19716
19716
  }
19717
- return false;
19717
+ else {
19718
+ this.kvMap.delete(key);
19719
+ }
19720
+ return true;
19718
19721
  }
19719
19722
  get(key) {
19720
- const listOfKeys = this.map.get(key);
19721
- return listOfKeys !== undefined && listOfKeys.length > 0 ? listOfKeys[0] : undefined;
19723
+ return this.kvMap.get(key);
19722
19724
  }
19723
19725
  set(key, value) {
19724
- // if value is array, they we always store it as [value].
19725
- if (!this.map.has(key)) {
19726
- this.map.set(key, [value]);
19727
- return;
19726
+ if (this.kvMap.has(key)) {
19727
+ let prevValue = this.kvMap.get(key);
19728
+ ngDevMode &&
19729
+ assertNotSame(prevValue, value, `Detected a duplicated value ${value} for the key ${key}`);
19730
+ if (this._vMap === undefined) {
19731
+ this._vMap = new Map();
19732
+ }
19733
+ const vMap = this._vMap;
19734
+ while (vMap.has(prevValue)) {
19735
+ prevValue = vMap.get(prevValue);
19736
+ }
19737
+ vMap.set(prevValue, value);
19738
+ }
19739
+ else {
19740
+ this.kvMap.set(key, value);
19728
19741
  }
19729
- // THINK: this allows duplicate values, but I guess this is fine?
19730
- // Is the existing key an array or not?
19731
- this.map.get(key)?.push(value);
19732
19742
  }
19733
19743
  forEach(cb) {
19734
- for (const [key, values] of this.map) {
19735
- for (const value of values) {
19736
- cb(value, key);
19744
+ for (let [key, value] of this.kvMap) {
19745
+ cb(value, key);
19746
+ if (this._vMap !== undefined) {
19747
+ const vMap = this._vMap;
19748
+ while (vMap.has(value)) {
19749
+ value = vMap.get(value);
19750
+ cb(value, key);
19751
+ }
19737
19752
  }
19738
19753
  }
19739
19754
  }
@@ -20708,6 +20723,8 @@ function invokeAllTriggerCleanupFns(lDetails) {
20708
20723
  invokeTriggerCleanupFns(0 /* TriggerType.Regular */, lDetails);
20709
20724
  }
20710
20725
 
20726
+ // Public API for Zone
20727
+
20711
20728
  /**
20712
20729
  * Calculates a data slot index for defer block info (either static or
20713
20730
  * instance-specific), given an index of a defer instruction.
@@ -27875,7 +27892,7 @@ class QueryList {
27875
27892
  * Returns `Observable` of `QueryList` notifying the subscriber of changes.
27876
27893
  */
27877
27894
  get changes() {
27878
- return this._changes || (this._changes = new EventEmitter());
27895
+ return this._changes ??= new EventEmitter();
27879
27896
  }
27880
27897
  /**
27881
27898
  * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change
@@ -27887,7 +27904,7 @@ class QueryList {
27887
27904
  this.dirty = true;
27888
27905
  this._results = [];
27889
27906
  this._changesDetected = false;
27890
- this._changes = null;
27907
+ this._changes = undefined;
27891
27908
  this.length = 0;
27892
27909
  this.first = undefined;
27893
27910
  this.last = undefined;
@@ -27978,7 +27995,7 @@ class QueryList {
27978
27995
  * Triggers a change event by emitting on the `changes` {@link EventEmitter}.
27979
27996
  */
27980
27997
  notifyOnChanges() {
27981
- if (this._changes && (this._changesDetected || !this._emitDistinctChangesOnly))
27998
+ if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly))
27982
27999
  this._changes.emit(this);
27983
28000
  }
27984
28001
  /** internal */
@@ -27987,8 +28004,10 @@ class QueryList {
27987
28004
  }
27988
28005
  /** internal */
27989
28006
  destroy() {
27990
- this.changes.complete();
27991
- this.changes.unsubscribe();
28007
+ if (this._changes !== undefined) {
28008
+ this._changes.complete();
28009
+ this._changes.unsubscribe();
28010
+ }
27992
28011
  }
27993
28012
  }
27994
28013
 
@@ -29908,6 +29927,25 @@ const NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, un
29908
29927
  * to be used by the decorator versions of these annotations.
29909
29928
  */
29910
29929
 
29930
+ /**
29931
+ * @description Represents the version of Angular
29932
+ *
29933
+ * @publicApi
29934
+ */
29935
+ class Version {
29936
+ constructor(full) {
29937
+ this.full = full;
29938
+ const parts = full.split('.');
29939
+ this.major = parts[0];
29940
+ this.minor = parts[1];
29941
+ this.patch = parts.slice(2).join('.');
29942
+ }
29943
+ }
29944
+ /**
29945
+ * @publicApi
29946
+ */
29947
+ const VERSION = new Version('17.0.8');
29948
+
29911
29949
  /*
29912
29950
  * This file exists to support compilation of @angular/core in Ivy mode.
29913
29951
  *
@@ -29928,190 +29966,6 @@ const NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, un
29928
29966
  */
29929
29967
  const ITS_JUST_ANGULAR = true;
29930
29968
 
29931
- /**
29932
- * A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide
29933
- * one or more initialization functions.
29934
- *
29935
- * The provided functions are injected at application startup and executed during
29936
- * app initialization. If any of these functions returns a Promise or an Observable, initialization
29937
- * does not complete until the Promise is resolved or the Observable is completed.
29938
- *
29939
- * You can, for example, create a factory function that loads language data
29940
- * or an external configuration, and provide that function to the `APP_INITIALIZER` token.
29941
- * The function is executed during the application bootstrap process,
29942
- * and the needed data is available on startup.
29943
- *
29944
- * @see {@link ApplicationInitStatus}
29945
- *
29946
- * @usageNotes
29947
- *
29948
- * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
29949
- * and a function returning a promise.
29950
- * ### Example with NgModule-based application
29951
- * ```
29952
- * function initializeApp(): Promise<any> {
29953
- * return new Promise((resolve, reject) => {
29954
- * // Do some asynchronous stuff
29955
- * resolve();
29956
- * });
29957
- * }
29958
- *
29959
- * @NgModule({
29960
- * imports: [BrowserModule],
29961
- * declarations: [AppComponent],
29962
- * bootstrap: [AppComponent],
29963
- * providers: [{
29964
- * provide: APP_INITIALIZER,
29965
- * useFactory: () => initializeApp,
29966
- * multi: true
29967
- * }]
29968
- * })
29969
- * export class AppModule {}
29970
- * ```
29971
- *
29972
- * ### Example with standalone application
29973
- * ```
29974
- * export function initializeApp(http: HttpClient) {
29975
- * return (): Promise<any> =>
29976
- * firstValueFrom(
29977
- * http
29978
- * .get("https://someUrl.com/api/user")
29979
- * .pipe(tap(user => { ... }))
29980
- * );
29981
- * }
29982
- *
29983
- * bootstrapApplication(App, {
29984
- * providers: [
29985
- * provideHttpClient(),
29986
- * {
29987
- * provide: APP_INITIALIZER,
29988
- * useFactory: initializeApp,
29989
- * multi: true,
29990
- * deps: [HttpClient],
29991
- * },
29992
- * ],
29993
- * });
29994
-
29995
- * ```
29996
- *
29997
- *
29998
- * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
29999
- * returning an observable, see an example below. Note: the `HttpClient` in this example is used for
30000
- * demo purposes to illustrate how the factory function can work with other providers available
30001
- * through DI.
30002
- *
30003
- * ### Example with NgModule-based application
30004
- * ```
30005
- * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
30006
- * return () => httpClient.get("https://someUrl.com/api/user")
30007
- * .pipe(
30008
- * tap(user => { ... })
30009
- * );
30010
- * }
30011
- *
30012
- * @NgModule({
30013
- * imports: [BrowserModule, HttpClientModule],
30014
- * declarations: [AppComponent],
30015
- * bootstrap: [AppComponent],
30016
- * providers: [{
30017
- * provide: APP_INITIALIZER,
30018
- * useFactory: initializeAppFactory,
30019
- * deps: [HttpClient],
30020
- * multi: true
30021
- * }]
30022
- * })
30023
- * export class AppModule {}
30024
- * ```
30025
- *
30026
- * ### Example with standalone application
30027
- * ```
30028
- * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
30029
- * return () => httpClient.get("https://someUrl.com/api/user")
30030
- * .pipe(
30031
- * tap(user => { ... })
30032
- * );
30033
- * }
30034
- *
30035
- * bootstrapApplication(App, {
30036
- * providers: [
30037
- * provideHttpClient(),
30038
- * {
30039
- * provide: APP_INITIALIZER,
30040
- * useFactory: initializeAppFactory,
30041
- * multi: true,
30042
- * deps: [HttpClient],
30043
- * },
30044
- * ],
30045
- * });
30046
- * ```
30047
- *
30048
- * @publicApi
30049
- */
30050
- const APP_INITIALIZER = new InjectionToken('Application Initializer');
30051
- /**
30052
- * A class that reflects the state of running {@link APP_INITIALIZER} functions.
30053
- *
30054
- * @publicApi
30055
- */
30056
- class ApplicationInitStatus {
30057
- constructor() {
30058
- this.initialized = false;
30059
- this.done = false;
30060
- this.donePromise = new Promise((res, rej) => {
30061
- this.resolve = res;
30062
- this.reject = rej;
30063
- });
30064
- this.appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];
30065
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {
30066
- throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' +
30067
- `(expected an array, but got ${typeof this.appInits}). ` +
30068
- 'Please check that the `APP_INITIALIZER` token is configured as a ' +
30069
- '`multi: true` provider.');
30070
- }
30071
- }
30072
- /** @internal */
30073
- runInitializers() {
30074
- if (this.initialized) {
30075
- return;
30076
- }
30077
- const asyncInitPromises = [];
30078
- for (const appInits of this.appInits) {
30079
- const initResult = appInits();
30080
- if (isPromise(initResult)) {
30081
- asyncInitPromises.push(initResult);
30082
- }
30083
- else if (isSubscribable(initResult)) {
30084
- const observableAsPromise = new Promise((resolve, reject) => {
30085
- initResult.subscribe({ complete: resolve, error: reject });
30086
- });
30087
- asyncInitPromises.push(observableAsPromise);
30088
- }
30089
- }
30090
- const complete = () => {
30091
- // @ts-expect-error overwriting a readonly
30092
- this.done = true;
30093
- this.resolve();
30094
- };
30095
- Promise.all(asyncInitPromises)
30096
- .then(() => {
30097
- complete();
30098
- })
30099
- .catch(e => {
30100
- this.reject(e);
30101
- });
30102
- if (asyncInitPromises.length === 0) {
30103
- complete();
30104
- }
30105
- this.initialized = true;
30106
- }
30107
- static { this.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); }; }
30108
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' }); }
30109
- }
30110
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
30111
- type: Injectable,
30112
- args: [{ providedIn: 'root' }]
30113
- }], () => [], null); })();
30114
-
30115
29969
  class Console {
30116
29970
  log(message) {
30117
29971
  // tslint:disable-next-line:no-console
@@ -30131,512 +29985,191 @@ class Console {
30131
29985
  }], null, null); })();
30132
29986
 
30133
29987
  /**
30134
- * Work out the locale from the potential global properties.
29988
+ * Combination of NgModuleFactory and ComponentFactories.
30135
29989
  *
30136
- * * Closure Compiler: use `goog.LOCALE`.
30137
- * * Ivy enabled: use `$localize.locale`
29990
+ * @publicApi
29991
+ *
29992
+ * @deprecated
29993
+ * Ivy JIT mode doesn't require accessing this symbol.
29994
+ * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
29995
+ * additional context.
30138
29996
  */
30139
- function getGlobalLocale() {
30140
- if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
30141
- typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
30142
- // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.
30143
- // * In order to preserve backwards compatibility, we use Angular default value over
30144
- // Closure Compiler's one.
30145
- return goog.LOCALE;
30146
- }
30147
- else {
30148
- // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE
30149
- // COMPILE-TIME INLINER.
30150
- //
30151
- // * During compile time inlining of translations the expression will be replaced
30152
- // with a string literal that is the current locale. Other forms of this expression are not
30153
- // guaranteed to be replaced.
30154
- //
30155
- // * During runtime translation evaluation, the developer is required to set `$localize.locale`
30156
- // if required, or just to provide their own `LOCALE_ID` provider.
30157
- return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;
29997
+ class ModuleWithComponentFactories {
29998
+ constructor(ngModuleFactory, componentFactories) {
29999
+ this.ngModuleFactory = ngModuleFactory;
30000
+ this.componentFactories = componentFactories;
30158
30001
  }
30159
30002
  }
30160
30003
  /**
30161
- * Provide this token to set the locale of your application.
30162
- * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
30163
- * DecimalPipe and PercentPipe) and by ICU expressions.
30164
- *
30165
- * See the [i18n guide](guide/i18n-common-locale-id) for more information.
30004
+ * Low-level service for running the angular compiler during runtime
30005
+ * to create {@link ComponentFactory}s, which
30006
+ * can later be used to create and render a Component instance.
30166
30007
  *
30167
- * @usageNotes
30168
- * ### Example
30008
+ * Each `@NgModule` provides an own `Compiler` to its injector,
30009
+ * that will use the directives/pipes of the ng module for compilation
30010
+ * of components.
30169
30011
  *
30170
- * ```typescript
30171
- * import { LOCALE_ID } from '@angular/core';
30172
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30173
- * import { AppModule } from './app/app.module';
30012
+ * @publicApi
30174
30013
  *
30175
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30176
- * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
30177
- * });
30178
- * ```
30014
+ * @deprecated
30015
+ * Ivy JIT mode doesn't require accessing this symbol.
30016
+ * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30017
+ * additional context.
30018
+ */
30019
+ class Compiler {
30020
+ /**
30021
+ * Compiles the given NgModule and all of its components. All templates of the components
30022
+ * have to be inlined.
30023
+ */
30024
+ compileModuleSync(moduleType) {
30025
+ return new NgModuleFactory(moduleType);
30026
+ }
30027
+ /**
30028
+ * Compiles the given NgModule and all of its components
30029
+ */
30030
+ compileModuleAsync(moduleType) {
30031
+ return Promise.resolve(this.compileModuleSync(moduleType));
30032
+ }
30033
+ /**
30034
+ * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
30035
+ */
30036
+ compileModuleAndAllComponentsSync(moduleType) {
30037
+ const ngModuleFactory = this.compileModuleSync(moduleType);
30038
+ const moduleDef = getNgModuleDef(moduleType);
30039
+ const componentFactories = maybeUnwrapFn(moduleDef.declarations)
30040
+ .reduce((factories, declaration) => {
30041
+ const componentDef = getComponentDef(declaration);
30042
+ componentDef && factories.push(new ComponentFactory(componentDef));
30043
+ return factories;
30044
+ }, []);
30045
+ return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
30046
+ }
30047
+ /**
30048
+ * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
30049
+ */
30050
+ compileModuleAndAllComponentsAsync(moduleType) {
30051
+ return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));
30052
+ }
30053
+ /**
30054
+ * Clears all caches.
30055
+ */
30056
+ clearCache() { }
30057
+ /**
30058
+ * Clears the cache for the given component/ngModule.
30059
+ */
30060
+ clearCacheFor(type) { }
30061
+ /**
30062
+ * Returns the id for a given NgModule, if one is defined and known to the compiler.
30063
+ */
30064
+ getModuleId(moduleType) {
30065
+ return undefined;
30066
+ }
30067
+ static { this.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); }; }
30068
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' }); }
30069
+ }
30070
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
30071
+ type: Injectable,
30072
+ args: [{ providedIn: 'root' }]
30073
+ }], null, null); })();
30074
+ /**
30075
+ * Token to provide CompilerOptions in the platform injector.
30179
30076
  *
30180
30077
  * @publicApi
30181
30078
  */
30182
- const LOCALE_ID = new InjectionToken('LocaleId', {
30183
- providedIn: 'root',
30184
- factory: () => inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale(),
30185
- });
30079
+ const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
30186
30080
  /**
30187
- * Provide this token to set the default currency code your application uses for
30188
- * CurrencyPipe when there is no currency code passed into it. This is only used by
30189
- * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
30190
- *
30191
- * See the [i18n guide](guide/i18n-common-locale-id) for more information.
30081
+ * A factory for creating a Compiler
30192
30082
  *
30193
- * <div class="alert is-helpful">
30083
+ * @publicApi
30194
30084
  *
30195
- * **Deprecation notice:**
30085
+ * @deprecated
30086
+ * Ivy JIT mode doesn't require accessing this symbol.
30087
+ * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30088
+ * additional context.
30089
+ */
30090
+ class CompilerFactory {
30091
+ }
30092
+
30093
+ /**
30094
+ * *Internal* service that keeps track of pending tasks happening in the system.
30196
30095
  *
30197
- * The default currency code is currently always `USD` but this is deprecated from v9.
30096
+ * This information is needed to make sure that the serialization on the server
30097
+ * is delayed until all tasks in the queue (such as an initial navigation or a
30098
+ * pending HTTP request) are completed.
30198
30099
  *
30199
- * **In v10 the default currency code will be taken from the current locale.**
30100
+ * Pending tasks continue to contribute to the stableness of `ApplicationRef`
30101
+ * throughout the lifetime of the application.
30102
+ */
30103
+ class PendingTasks {
30104
+ constructor() {
30105
+ this.taskId = 0;
30106
+ this.pendingTasks = new Set();
30107
+ this.hasPendingTasks = new BehaviorSubject(false);
30108
+ }
30109
+ get _hasPendingTasks() {
30110
+ return this.hasPendingTasks.value;
30111
+ }
30112
+ add() {
30113
+ if (!this._hasPendingTasks) {
30114
+ this.hasPendingTasks.next(true);
30115
+ }
30116
+ const taskId = this.taskId++;
30117
+ this.pendingTasks.add(taskId);
30118
+ return taskId;
30119
+ }
30120
+ remove(taskId) {
30121
+ this.pendingTasks.delete(taskId);
30122
+ if (this.pendingTasks.size === 0 && this._hasPendingTasks) {
30123
+ this.hasPendingTasks.next(false);
30124
+ }
30125
+ }
30126
+ ngOnDestroy() {
30127
+ this.pendingTasks.clear();
30128
+ if (this._hasPendingTasks) {
30129
+ this.hasPendingTasks.next(false);
30130
+ }
30131
+ }
30132
+ static { this.ɵfac = function PendingTasks_Factory(t) { return new (t || PendingTasks)(); }; }
30133
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PendingTasks, factory: PendingTasks.ɵfac, providedIn: 'root' }); }
30134
+ }
30135
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PendingTasks, [{
30136
+ type: Injectable,
30137
+ args: [{ providedIn: 'root' }]
30138
+ }], null, null); })();
30139
+
30140
+ /**
30141
+ * These are the data structures that our framework injector profiler will fill with data in order
30142
+ * to support DI debugging APIs.
30200
30143
  *
30201
- * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
30202
- * your application `NgModule`:
30144
+ * resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of
30145
+ * dependencies. Injector -> Token -> Dependencies This is used to support the
30146
+ * getDependenciesFromInjectable API, which takes in an injector and a token and returns it's
30147
+ * dependencies.
30203
30148
  *
30204
- * ```ts
30205
- * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
30206
- * ```
30149
+ * resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured
30150
+ * within it This is used to support the getInjectorProviders API, which takes in an injector and
30151
+ * returns the providers that it was configured with. Note that for the element injector case we
30152
+ * use the TNode instead of the LView as the DI resolver. This is because the registration of
30153
+ * providers happens only once per type of TNode. If an injector is created with an identical TNode,
30154
+ * the providers for that injector will not be reconfigured.
30207
30155
  *
30208
- * </div>
30156
+ * standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone
30157
+ * component that it is associated with. Used in the getInjectorProviders API, specificially in the
30158
+ * discovery of import paths for each provider. This is necessary because the imports array of a
30159
+ * standalone component is processed and configured in its standalone injector, but exists within
30160
+ * the component's definition. Because getInjectorProviders takes in an injector, if that injector
30161
+ * is the injector of a standalone component, we need to be able to discover the place where the
30162
+ * imports array is located (the component) in order to flatten the imports array within it to
30163
+ * discover all of it's providers.
30209
30164
  *
30210
- * @usageNotes
30211
- * ### Example
30212
30165
  *
30213
- * ```typescript
30214
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30215
- * import { AppModule } from './app/app.module';
30166
+ * All of these data structures are instantiated with WeakMaps. This will ensure that the presence
30167
+ * of any object in the keys of these maps does not prevent the garbage collector from collecting
30168
+ * those objects. Because of this property of WeakMaps, these data structures will never be the
30169
+ * source of a memory leak.
30216
30170
  *
30217
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30218
- * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
30219
- * });
30220
- * ```
30221
- *
30222
- * @publicApi
30223
- */
30224
- const DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode', {
30225
- providedIn: 'root',
30226
- factory: () => USD_CURRENCY_CODE,
30227
- });
30228
- /**
30229
- * Use this token at bootstrap to provide the content of your translation file (`xtb`,
30230
- * `xlf` or `xlf2`) when you want to translate your application in another language.
30231
- *
30232
- * See the [i18n guide](guide/i18n-common-merge) for more information.
30233
- *
30234
- * @usageNotes
30235
- * ### Example
30236
- *
30237
- * ```typescript
30238
- * import { TRANSLATIONS } from '@angular/core';
30239
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30240
- * import { AppModule } from './app/app.module';
30241
- *
30242
- * // content of your translation file
30243
- * const translations = '....';
30244
- *
30245
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30246
- * providers: [{provide: TRANSLATIONS, useValue: translations }]
30247
- * });
30248
- * ```
30249
- *
30250
- * @publicApi
30251
- */
30252
- const TRANSLATIONS = new InjectionToken('Translations');
30253
- /**
30254
- * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
30255
- * `xlf` or `xlf2`.
30256
- *
30257
- * See the [i18n guide](guide/i18n-common-merge) for more information.
30258
- *
30259
- * @usageNotes
30260
- * ### Example
30261
- *
30262
- * ```typescript
30263
- * import { TRANSLATIONS_FORMAT } from '@angular/core';
30264
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30265
- * import { AppModule } from './app/app.module';
30266
- *
30267
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30268
- * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
30269
- * });
30270
- * ```
30271
- *
30272
- * @publicApi
30273
- */
30274
- const TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
30275
- /**
30276
- * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
30277
- * that the compiler should use in case of missing translations:
30278
- * - Error: throw if you have missing translations.
30279
- * - Warning (default): show a warning in the console and/or shell.
30280
- * - Ignore: do nothing.
30281
- *
30282
- * See the [i18n guide](guide/i18n-common-merge#report-missing-translations) for more information.
30283
- *
30284
- * @usageNotes
30285
- * ### Example
30286
- * ```typescript
30287
- * import { MissingTranslationStrategy } from '@angular/core';
30288
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30289
- * import { AppModule } from './app/app.module';
30290
- *
30291
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30292
- * missingTranslation: MissingTranslationStrategy.Error
30293
- * });
30294
- * ```
30295
- *
30296
- * @publicApi
30297
- */
30298
- var MissingTranslationStrategy;
30299
- (function (MissingTranslationStrategy) {
30300
- MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
30301
- MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
30302
- MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore";
30303
- })(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
30304
-
30305
- // A delay in milliseconds before the scan is run after onLoad, to avoid any
30306
- // potential race conditions with other LCP-related functions. This delay
30307
- // happens outside of the main JavaScript execution and will only effect the timing
30308
- // on when the warning becomes visible in the console.
30309
- const SCAN_DELAY = 200;
30310
- const OVERSIZED_IMAGE_TOLERANCE = 1200;
30311
- class ImagePerformanceWarning {
30312
- constructor() {
30313
- // Map of full image URLs -> original `ngSrc` values.
30314
- this.window = null;
30315
- this.observer = null;
30316
- this.options = inject(IMAGE_CONFIG);
30317
- this.ngZone = inject(NgZone);
30318
- }
30319
- start() {
30320
- if (typeof PerformanceObserver === 'undefined' ||
30321
- (this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning)) {
30322
- return;
30323
- }
30324
- this.observer = this.initPerformanceObserver();
30325
- const doc = getDocument();
30326
- const win = doc.defaultView;
30327
- if (typeof win !== 'undefined') {
30328
- this.window = win;
30329
- // Wait to avoid race conditions where LCP image triggers
30330
- // load event before it's recorded by the performance observer
30331
- const waitToScan = () => {
30332
- setTimeout(this.scanImages.bind(this), SCAN_DELAY);
30333
- };
30334
- // Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in
30335
- // the scope of this functionality.
30336
- this.ngZone.runOutsideAngular(() => {
30337
- // Consider the case when the application is created and destroyed multiple times.
30338
- // Typically, applications are created instantly once the page is loaded, and the
30339
- // `window.load` listener is always triggered. However, the `window.load` event will never
30340
- // be fired if the page is loaded, and the application is created later. Checking for
30341
- // `readyState` is the easiest way to determine whether the page has been loaded or not.
30342
- if (doc.readyState === 'complete') {
30343
- waitToScan();
30344
- }
30345
- else {
30346
- this.window?.addEventListener('load', waitToScan, { once: true });
30347
- }
30348
- });
30349
- }
30350
- }
30351
- ngOnDestroy() {
30352
- this.observer?.disconnect();
30353
- }
30354
- initPerformanceObserver() {
30355
- if (typeof PerformanceObserver === 'undefined') {
30356
- return null;
30357
- }
30358
- const observer = new PerformanceObserver((entryList) => {
30359
- const entries = entryList.getEntries();
30360
- if (entries.length === 0)
30361
- return;
30362
- // We use the latest entry produced by the `PerformanceObserver` as the best
30363
- // signal on which element is actually an LCP one. As an example, the first image to load on
30364
- // a page, by virtue of being the only thing on the page so far, is often a LCP candidate
30365
- // and gets reported by PerformanceObserver, but isn't necessarily the LCP element.
30366
- const lcpElement = entries[entries.length - 1];
30367
- // Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.
30368
- // See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint
30369
- const imgSrc = lcpElement.element?.src ?? '';
30370
- // Exclude `data:` and `blob:` URLs, since they are fetched resources.
30371
- if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:'))
30372
- return;
30373
- this.lcpImageUrl = imgSrc;
30374
- });
30375
- observer.observe({ type: 'largest-contentful-paint', buffered: true });
30376
- return observer;
30377
- }
30378
- scanImages() {
30379
- const images = getDocument().querySelectorAll('img');
30380
- let lcpElementFound, lcpElementLoadedCorrectly = false;
30381
- images.forEach(image => {
30382
- if (!this.options?.disableImageSizeWarning) {
30383
- for (const image of images) {
30384
- // Image elements using the NgOptimizedImage directive are excluded,
30385
- // as that directive has its own version of this check.
30386
- if (!image.getAttribute('ng-img') && this.isOversized(image)) {
30387
- logOversizedImageWarning(image.src);
30388
- }
30389
- }
30390
- }
30391
- if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {
30392
- if (image.src === this.lcpImageUrl) {
30393
- lcpElementFound = true;
30394
- if (image.loading !== 'lazy' || image.getAttribute('ng-img')) {
30395
- // This variable is set to true and never goes back to false to account
30396
- // for the case where multiple images have the same src url, and some
30397
- // have lazy loading while others don't.
30398
- // Also ignore NgOptimizedImage because there's a different warning for that.
30399
- lcpElementLoadedCorrectly = true;
30400
- }
30401
- }
30402
- }
30403
- });
30404
- if (lcpElementFound && !lcpElementLoadedCorrectly && this.lcpImageUrl &&
30405
- !this.options?.disableImageLazyLoadWarning) {
30406
- logLazyLCPWarning(this.lcpImageUrl);
30407
- }
30408
- }
30409
- isOversized(image) {
30410
- if (!this.window) {
30411
- return false;
30412
- }
30413
- const computedStyle = this.window.getComputedStyle(image);
30414
- let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));
30415
- let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));
30416
- const boxSizing = computedStyle.getPropertyValue('box-sizing');
30417
- const objectFit = computedStyle.getPropertyValue('object-fit');
30418
- if (objectFit === `cover`) {
30419
- // Object fit cover may indicate a use case such as a sprite sheet where
30420
- // this warning does not apply.
30421
- return false;
30422
- }
30423
- if (boxSizing === 'border-box') {
30424
- const paddingTop = computedStyle.getPropertyValue('padding-top');
30425
- const paddingRight = computedStyle.getPropertyValue('padding-right');
30426
- const paddingBottom = computedStyle.getPropertyValue('padding-bottom');
30427
- const paddingLeft = computedStyle.getPropertyValue('padding-left');
30428
- renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
30429
- renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
30430
- }
30431
- const intrinsicWidth = image.naturalWidth;
30432
- const intrinsicHeight = image.naturalHeight;
30433
- const recommendedWidth = this.window.devicePixelRatio * renderedWidth;
30434
- const recommendedHeight = this.window.devicePixelRatio * renderedHeight;
30435
- const oversizedWidth = (intrinsicWidth - recommendedWidth) >= OVERSIZED_IMAGE_TOLERANCE;
30436
- const oversizedHeight = (intrinsicHeight - recommendedHeight) >= OVERSIZED_IMAGE_TOLERANCE;
30437
- return oversizedWidth || oversizedHeight;
30438
- }
30439
- static { this.ɵfac = function ImagePerformanceWarning_Factory(t) { return new (t || ImagePerformanceWarning)(); }; }
30440
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ImagePerformanceWarning, factory: ImagePerformanceWarning.ɵfac, providedIn: 'root' }); }
30441
- }
30442
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{
30443
- type: Injectable,
30444
- args: [{ providedIn: 'root' }]
30445
- }], null, null); })();
30446
- function logLazyLCPWarning(src) {
30447
- console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} is the Largest Contentful Paint (LCP) element ` +
30448
- `but was given a "loading" value of "lazy", which can negatively impact ` +
30449
- `application loading performance. This warning can be addressed by ` +
30450
- `changing the loading value of the LCP image to "eager", or by using the ` +
30451
- `NgOptimizedImage directive's prioritization utilities. For more ` +
30452
- `information about addressing or disabling this warning, see ` +
30453
- `https://angular.io/errors/NG0913`));
30454
- }
30455
- function logOversizedImageWarning(src) {
30456
- console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} has intrinsic file dimensions much larger than its ` +
30457
- `rendered size. This can negatively impact application loading performance. ` +
30458
- `For more information about addressing or disabling this warning, see ` +
30459
- `https://angular.io/errors/NG0913`));
30460
- }
30461
-
30462
- /**
30463
- * *Internal* service that keeps track of pending tasks happening in the system
30464
- * during the initial rendering. No tasks are tracked after an initial
30465
- * rendering.
30466
- *
30467
- * This information is needed to make sure that the serialization on the server
30468
- * is delayed until all tasks in the queue (such as an initial navigation or a
30469
- * pending HTTP request) are completed.
30470
- */
30471
- class InitialRenderPendingTasks {
30472
- constructor() {
30473
- this.taskId = 0;
30474
- this.pendingTasks = new Set();
30475
- this.hasPendingTasks = new BehaviorSubject(false);
30476
- }
30477
- add() {
30478
- this.hasPendingTasks.next(true);
30479
- const taskId = this.taskId++;
30480
- this.pendingTasks.add(taskId);
30481
- return taskId;
30482
- }
30483
- remove(taskId) {
30484
- this.pendingTasks.delete(taskId);
30485
- if (this.pendingTasks.size === 0) {
30486
- this.hasPendingTasks.next(false);
30487
- }
30488
- }
30489
- ngOnDestroy() {
30490
- this.pendingTasks.clear();
30491
- this.hasPendingTasks.next(false);
30492
- }
30493
- static { this.ɵfac = function InitialRenderPendingTasks_Factory(t) { return new (t || InitialRenderPendingTasks)(); }; }
30494
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: InitialRenderPendingTasks, factory: InitialRenderPendingTasks.ɵfac, providedIn: 'root' }); }
30495
- }
30496
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InitialRenderPendingTasks, [{
30497
- type: Injectable,
30498
- args: [{ providedIn: 'root' }]
30499
- }], null, null); })();
30500
-
30501
- /**
30502
- * Combination of NgModuleFactory and ComponentFactories.
30503
- *
30504
- * @publicApi
30505
- *
30506
- * @deprecated
30507
- * Ivy JIT mode doesn't require accessing this symbol.
30508
- * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30509
- * additional context.
30510
- */
30511
- class ModuleWithComponentFactories {
30512
- constructor(ngModuleFactory, componentFactories) {
30513
- this.ngModuleFactory = ngModuleFactory;
30514
- this.componentFactories = componentFactories;
30515
- }
30516
- }
30517
- /**
30518
- * Low-level service for running the angular compiler during runtime
30519
- * to create {@link ComponentFactory}s, which
30520
- * can later be used to create and render a Component instance.
30521
- *
30522
- * Each `@NgModule` provides an own `Compiler` to its injector,
30523
- * that will use the directives/pipes of the ng module for compilation
30524
- * of components.
30525
- *
30526
- * @publicApi
30527
- *
30528
- * @deprecated
30529
- * Ivy JIT mode doesn't require accessing this symbol.
30530
- * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30531
- * additional context.
30532
- */
30533
- class Compiler {
30534
- /**
30535
- * Compiles the given NgModule and all of its components. All templates of the components
30536
- * have to be inlined.
30537
- */
30538
- compileModuleSync(moduleType) {
30539
- return new NgModuleFactory(moduleType);
30540
- }
30541
- /**
30542
- * Compiles the given NgModule and all of its components
30543
- */
30544
- compileModuleAsync(moduleType) {
30545
- return Promise.resolve(this.compileModuleSync(moduleType));
30546
- }
30547
- /**
30548
- * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
30549
- */
30550
- compileModuleAndAllComponentsSync(moduleType) {
30551
- const ngModuleFactory = this.compileModuleSync(moduleType);
30552
- const moduleDef = getNgModuleDef(moduleType);
30553
- const componentFactories = maybeUnwrapFn(moduleDef.declarations)
30554
- .reduce((factories, declaration) => {
30555
- const componentDef = getComponentDef(declaration);
30556
- componentDef && factories.push(new ComponentFactory(componentDef));
30557
- return factories;
30558
- }, []);
30559
- return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
30560
- }
30561
- /**
30562
- * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
30563
- */
30564
- compileModuleAndAllComponentsAsync(moduleType) {
30565
- return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));
30566
- }
30567
- /**
30568
- * Clears all caches.
30569
- */
30570
- clearCache() { }
30571
- /**
30572
- * Clears the cache for the given component/ngModule.
30573
- */
30574
- clearCacheFor(type) { }
30575
- /**
30576
- * Returns the id for a given NgModule, if one is defined and known to the compiler.
30577
- */
30578
- getModuleId(moduleType) {
30579
- return undefined;
30580
- }
30581
- static { this.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); }; }
30582
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' }); }
30583
- }
30584
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
30585
- type: Injectable,
30586
- args: [{ providedIn: 'root' }]
30587
- }], null, null); })();
30588
- /**
30589
- * Token to provide CompilerOptions in the platform injector.
30590
- *
30591
- * @publicApi
30592
- */
30593
- const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
30594
- /**
30595
- * A factory for creating a Compiler
30596
- *
30597
- * @publicApi
30598
- *
30599
- * @deprecated
30600
- * Ivy JIT mode doesn't require accessing this symbol.
30601
- * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30602
- * additional context.
30603
- */
30604
- class CompilerFactory {
30605
- }
30606
-
30607
- /**
30608
- * These are the data structures that our framework injector profiler will fill with data in order
30609
- * to support DI debugging APIs.
30610
- *
30611
- * resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of
30612
- * dependencies. Injector -> Token -> Dependencies This is used to support the
30613
- * getDependenciesFromInjectable API, which takes in an injector and a token and returns it's
30614
- * dependencies.
30615
- *
30616
- * resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured
30617
- * within it This is used to support the getInjectorProviders API, which takes in an injector and
30618
- * returns the providers that it was configured with. Note that for the element injector case we
30619
- * use the TNode instead of the LView as the DI resolver. This is because the registration of
30620
- * providers happens only once per type of TNode. If an injector is created with an identical TNode,
30621
- * the providers for that injector will not be reconfigured.
30622
- *
30623
- * standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone
30624
- * component that it is associated with. Used in the getInjectorProviders API, specificially in the
30625
- * discovery of import paths for each provider. This is necessary because the imports array of a
30626
- * standalone component is processed and configured in its standalone injector, but exists within
30627
- * the component's definition. Because getInjectorProviders takes in an injector, if that injector
30628
- * is the injector of a standalone component, we need to be able to discover the place where the
30629
- * imports array is located (the component) in order to flatten the imports array within it to
30630
- * discover all of it's providers.
30631
- *
30632
- *
30633
- * All of these data structures are instantiated with WeakMaps. This will ensure that the presence
30634
- * of any object in the keys of these maps does not prevent the garbage collector from collecting
30635
- * those objects. Because of this property of WeakMaps, these data structures will never be the
30636
- * source of a memory leak.
30637
- *
30638
- * An example of this advantage: When components are destroyed, we don't need to do
30639
- * any additional work to remove that component from our mappings.
30171
+ * An example of this advantage: When components are destroyed, we don't need to do
30172
+ * any additional work to remove that component from our mappings.
30640
30173
  *
30641
30174
  */
30642
30175
  class DIDebugData {
@@ -30864,6 +30397,7 @@ function applyChanges(component) {
30864
30397
  */
30865
30398
  function detectChanges(component) {
30866
30399
  const view = getComponentViewByInstance(component);
30400
+ view[FLAGS] |= 1024 /* LViewFlags.RefreshView */;
30867
30401
  detectChangesInternal(view);
30868
30402
  }
30869
30403
 
@@ -31759,19 +31293,190 @@ function setTestabilityGetter(getter) {
31759
31293
  }
31760
31294
  let _testabilityGetter;
31761
31295
 
31762
- let _platformInjector = null;
31763
31296
  /**
31764
- * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
31765
- * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
31297
+ * A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide
31298
+ * one or more initialization functions.
31299
+ *
31300
+ * The provided functions are injected at application startup and executed during
31301
+ * app initialization. If any of these functions returns a Promise or an Observable, initialization
31302
+ * does not complete until the Promise is resolved or the Observable is completed.
31303
+ *
31304
+ * You can, for example, create a factory function that loads language data
31305
+ * or an external configuration, and provide that function to the `APP_INITIALIZER` token.
31306
+ * The function is executed during the application bootstrap process,
31307
+ * and the needed data is available on startup.
31308
+ *
31309
+ * @see {@link ApplicationInitStatus}
31310
+ *
31311
+ * @usageNotes
31312
+ *
31313
+ * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
31314
+ * and a function returning a promise.
31315
+ * ### Example with NgModule-based application
31316
+ * ```
31317
+ * function initializeApp(): Promise<any> {
31318
+ * return new Promise((resolve, reject) => {
31319
+ * // Do some asynchronous stuff
31320
+ * resolve();
31321
+ * });
31322
+ * }
31323
+ *
31324
+ * @NgModule({
31325
+ * imports: [BrowserModule],
31326
+ * declarations: [AppComponent],
31327
+ * bootstrap: [AppComponent],
31328
+ * providers: [{
31329
+ * provide: APP_INITIALIZER,
31330
+ * useFactory: () => initializeApp,
31331
+ * multi: true
31332
+ * }]
31333
+ * })
31334
+ * export class AppModule {}
31335
+ * ```
31336
+ *
31337
+ * ### Example with standalone application
31338
+ * ```
31339
+ * export function initializeApp(http: HttpClient) {
31340
+ * return (): Promise<any> =>
31341
+ * firstValueFrom(
31342
+ * http
31343
+ * .get("https://someUrl.com/api/user")
31344
+ * .pipe(tap(user => { ... }))
31345
+ * );
31346
+ * }
31347
+ *
31348
+ * bootstrapApplication(App, {
31349
+ * providers: [
31350
+ * provideHttpClient(),
31351
+ * {
31352
+ * provide: APP_INITIALIZER,
31353
+ * useFactory: initializeApp,
31354
+ * multi: true,
31355
+ * deps: [HttpClient],
31356
+ * },
31357
+ * ],
31358
+ * });
31359
+
31360
+ * ```
31361
+ *
31362
+ *
31363
+ * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
31364
+ * returning an observable, see an example below. Note: the `HttpClient` in this example is used for
31365
+ * demo purposes to illustrate how the factory function can work with other providers available
31366
+ * through DI.
31367
+ *
31368
+ * ### Example with NgModule-based application
31369
+ * ```
31370
+ * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
31371
+ * return () => httpClient.get("https://someUrl.com/api/user")
31372
+ * .pipe(
31373
+ * tap(user => { ... })
31374
+ * );
31375
+ * }
31376
+ *
31377
+ * @NgModule({
31378
+ * imports: [BrowserModule, HttpClientModule],
31379
+ * declarations: [AppComponent],
31380
+ * bootstrap: [AppComponent],
31381
+ * providers: [{
31382
+ * provide: APP_INITIALIZER,
31383
+ * useFactory: initializeAppFactory,
31384
+ * deps: [HttpClient],
31385
+ * multi: true
31386
+ * }]
31387
+ * })
31388
+ * export class AppModule {}
31389
+ * ```
31390
+ *
31391
+ * ### Example with standalone application
31392
+ * ```
31393
+ * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
31394
+ * return () => httpClient.get("https://someUrl.com/api/user")
31395
+ * .pipe(
31396
+ * tap(user => { ... })
31397
+ * );
31398
+ * }
31399
+ *
31400
+ * bootstrapApplication(App, {
31401
+ * providers: [
31402
+ * provideHttpClient(),
31403
+ * {
31404
+ * provide: APP_INITIALIZER,
31405
+ * useFactory: initializeAppFactory,
31406
+ * multi: true,
31407
+ * deps: [HttpClient],
31408
+ * },
31409
+ * ],
31410
+ * });
31411
+ * ```
31412
+ *
31413
+ * @publicApi
31766
31414
  */
31767
- const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
31415
+ const APP_INITIALIZER = new InjectionToken('Application Initializer');
31768
31416
  /**
31769
- * Internal token that allows to register extra callbacks that should be invoked during the
31770
- * `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the
31771
- * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
31772
- * entire class tree-shakeable.
31417
+ * A class that reflects the state of running {@link APP_INITIALIZER} functions.
31418
+ *
31419
+ * @publicApi
31773
31420
  */
31774
- const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
31421
+ class ApplicationInitStatus {
31422
+ constructor() {
31423
+ this.initialized = false;
31424
+ this.done = false;
31425
+ this.donePromise = new Promise((res, rej) => {
31426
+ this.resolve = res;
31427
+ this.reject = rej;
31428
+ });
31429
+ this.appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];
31430
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {
31431
+ throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' +
31432
+ `(expected an array, but got ${typeof this.appInits}). ` +
31433
+ 'Please check that the `APP_INITIALIZER` token is configured as a ' +
31434
+ '`multi: true` provider.');
31435
+ }
31436
+ }
31437
+ /** @internal */
31438
+ runInitializers() {
31439
+ if (this.initialized) {
31440
+ return;
31441
+ }
31442
+ const asyncInitPromises = [];
31443
+ for (const appInits of this.appInits) {
31444
+ const initResult = appInits();
31445
+ if (isPromise(initResult)) {
31446
+ asyncInitPromises.push(initResult);
31447
+ }
31448
+ else if (isSubscribable(initResult)) {
31449
+ const observableAsPromise = new Promise((resolve, reject) => {
31450
+ initResult.subscribe({ complete: resolve, error: reject });
31451
+ });
31452
+ asyncInitPromises.push(observableAsPromise);
31453
+ }
31454
+ }
31455
+ const complete = () => {
31456
+ // @ts-expect-error overwriting a readonly
31457
+ this.done = true;
31458
+ this.resolve();
31459
+ };
31460
+ Promise.all(asyncInitPromises)
31461
+ .then(() => {
31462
+ complete();
31463
+ })
31464
+ .catch(e => {
31465
+ this.reject(e);
31466
+ });
31467
+ if (asyncInitPromises.length === 0) {
31468
+ complete();
31469
+ }
31470
+ this.initialized = true;
31471
+ }
31472
+ static { this.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); }; }
31473
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' }); }
31474
+ }
31475
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
31476
+ type: Injectable,
31477
+ args: [{ providedIn: 'root' }]
31478
+ }], () => [], null); })();
31479
+
31775
31480
  /**
31776
31481
  * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
31777
31482
  * be called for every component that is bootstrapped.
@@ -31824,398 +31529,30 @@ function compileNgModuleFactory(injector, options, moduleType) {
31824
31529
  function publishDefaultGlobalUtils() {
31825
31530
  ngDevMode && publishDefaultGlobalUtils$1();
31826
31531
  }
31827
- /**
31828
- * Sets the error for an invalid write to a signal to be an Angular `RuntimeError`.
31829
- */
31830
- function publishSignalConfiguration() {
31831
- setThrowInvalidWriteToSignalError$1(() => {
31832
- throw new RuntimeError(600 /* RuntimeErrorCode.SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT */, ngDevMode &&
31833
- 'Writing to signals is not allowed in a `computed` or an `effect` by default. ' +
31834
- 'Use `allowSignalWrites` in the `CreateEffectOptions` to enable this inside effects.');
31835
- });
31836
- }
31837
- function isBoundToModule(cf) {
31838
- return cf.isBoundToModule;
31839
- }
31840
- /**
31841
- * A token for third-party components that can register themselves with NgProbe.
31842
- *
31843
- * @deprecated
31844
- * @publicApi
31845
- */
31846
- class NgProbeToken {
31847
- constructor(name, token) {
31848
- this.name = name;
31849
- this.token = token;
31850
- }
31851
- }
31852
- /**
31853
- * Creates a platform.
31854
- * Platforms must be created on launch using this function.
31855
- *
31856
- * @publicApi
31857
- */
31858
- function createPlatform(injector) {
31859
- if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
31860
- throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
31861
- 'There can be only one platform. Destroy the previous one to create a new one.');
31862
- }
31863
- publishDefaultGlobalUtils();
31864
- publishSignalConfiguration();
31865
- _platformInjector = injector;
31866
- const platform = injector.get(PlatformRef);
31867
- runPlatformInitializers(injector);
31868
- return platform;
31869
- }
31870
- /**
31871
- * The goal of this function is to bootstrap a platform injector,
31872
- * but avoid referencing `PlatformRef` class.
31873
- * This function is needed for bootstrapping a Standalone Component.
31874
- */
31875
- function createOrReusePlatformInjector(providers = []) {
31876
- // If a platform injector already exists, it means that the platform
31877
- // is already bootstrapped and no additional actions are required.
31878
- if (_platformInjector)
31879
- return _platformInjector;
31880
- publishDefaultGlobalUtils();
31881
- // Otherwise, setup a new platform injector and run platform initializers.
31882
- const injector = createPlatformInjector(providers);
31883
- _platformInjector = injector;
31884
- publishSignalConfiguration();
31885
- runPlatformInitializers(injector);
31886
- return injector;
31887
- }
31888
- function runPlatformInitializers(injector) {
31889
- const inits = injector.get(PLATFORM_INITIALIZER, null);
31890
- inits?.forEach((init) => init());
31891
- }
31892
- /**
31893
- * Internal create application API that implements the core application creation logic and optional
31894
- * bootstrap logic.
31895
- *
31896
- * Platforms (such as `platform-browser`) may require different set of application and platform
31897
- * providers for an application to function correctly. As a result, platforms may use this function
31898
- * internally and supply the necessary providers during the bootstrap, while exposing
31899
- * platform-specific APIs as a part of their public API.
31900
- *
31901
- * @returns A promise that returns an `ApplicationRef` instance once resolved.
31902
- */
31903
- function internalCreateApplication(config) {
31904
- try {
31905
- const { rootComponent, appProviders, platformProviders } = config;
31906
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {
31907
- assertStandaloneComponentType(rootComponent);
31908
- }
31909
- const platformInjector = createOrReusePlatformInjector(platformProviders);
31910
- // Create root application injector based on a set of providers configured at the platform
31911
- // bootstrap level as well as providers passed to the bootstrap call by a user.
31912
- const allAppProviders = [
31913
- provideZoneChangeDetection(),
31914
- ...(appProviders || []),
31915
- ];
31916
- const adapter = new EnvironmentNgModuleRefAdapter({
31917
- providers: allAppProviders,
31918
- parent: platformInjector,
31919
- debugName: (typeof ngDevMode === 'undefined' || ngDevMode) ? 'Environment Injector' : '',
31920
- // We skip environment initializers because we need to run them inside the NgZone, which
31921
- // happens after we get the NgZone instance from the Injector.
31922
- runEnvironmentInitializers: false,
31923
- });
31924
- const envInjector = adapter.injector;
31925
- const ngZone = envInjector.get(NgZone);
31926
- return ngZone.run(() => {
31927
- envInjector.resolveInjectorInitializers();
31928
- const exceptionHandler = envInjector.get(ErrorHandler, null);
31929
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && !exceptionHandler) {
31930
- throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No `ErrorHandler` found in the Dependency Injection tree.');
31931
- }
31932
- let onErrorSubscription;
31933
- ngZone.runOutsideAngular(() => {
31934
- onErrorSubscription = ngZone.onError.subscribe({
31935
- next: (error) => {
31936
- exceptionHandler.handleError(error);
31937
- }
31938
- });
31939
- });
31940
- // If the whole platform is destroyed, invoke the `destroy` method
31941
- // for all bootstrapped applications as well.
31942
- const destroyListener = () => envInjector.destroy();
31943
- const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS);
31944
- onPlatformDestroyListeners.add(destroyListener);
31945
- envInjector.onDestroy(() => {
31946
- onErrorSubscription.unsubscribe();
31947
- onPlatformDestroyListeners.delete(destroyListener);
31948
- });
31949
- return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
31950
- const initStatus = envInjector.get(ApplicationInitStatus);
31951
- initStatus.runInitializers();
31952
- return initStatus.donePromise.then(() => {
31953
- const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
31954
- setLocaleId(localeId || DEFAULT_LOCALE_ID);
31955
- const appRef = envInjector.get(ApplicationRef);
31956
- if (rootComponent !== undefined) {
31957
- appRef.bootstrap(rootComponent);
31958
- }
31959
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
31960
- const imagePerformanceService = envInjector.get(ImagePerformanceWarning);
31961
- imagePerformanceService.start();
31962
- }
31963
- return appRef;
31964
- });
31965
- });
31966
- });
31967
- }
31968
- catch (e) {
31969
- return Promise.reject(e);
31970
- }
31971
- }
31972
- /**
31973
- * Creates a factory for a platform. Can be used to provide or override `Providers` specific to
31974
- * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
31975
- * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
31976
- * to build up configurations that might be required by different libraries or parts of the
31977
- * application.
31978
- * @param name Identifies the new platform factory.
31979
- * @param providers A set of dependency providers for platforms created with the new factory.
31980
- *
31981
- * @publicApi
31982
- */
31983
- function createPlatformFactory(parentPlatformFactory, name, providers = []) {
31984
- const desc = `Platform: ${name}`;
31985
- const marker = new InjectionToken(desc);
31986
- return (extraProviders = []) => {
31987
- let platform = getPlatform();
31988
- if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
31989
- const platformProviders = [
31990
- ...providers,
31991
- ...extraProviders,
31992
- { provide: marker, useValue: true }
31993
- ];
31994
- if (parentPlatformFactory) {
31995
- parentPlatformFactory(platformProviders);
31996
- }
31997
- else {
31998
- createPlatform(createPlatformInjector(platformProviders, desc));
31999
- }
32000
- }
32001
- return assertPlatform(marker);
32002
- };
32003
- }
32004
- /**
32005
- * Checks that there is currently a platform that contains the given token as a provider.
32006
- *
32007
- * @publicApi
32008
- */
32009
- function assertPlatform(requiredToken) {
32010
- const platform = getPlatform();
32011
- if (!platform) {
32012
- throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
32013
- }
32014
- if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32015
- !platform.injector.get(requiredToken, null)) {
32016
- throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
32017
- }
32018
- return platform;
32019
- }
32020
- /**
32021
- * Helper function to create an instance of a platform injector (that maintains the 'platform'
32022
- * scope).
32023
- */
32024
- function createPlatformInjector(providers = [], name) {
32025
- return Injector.create({
32026
- name,
32027
- providers: [
32028
- { provide: INJECTOR_SCOPE, useValue: 'platform' },
32029
- { provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
32030
- ...providers
32031
- ],
32032
- });
32033
- }
32034
- /**
32035
- * Destroys the current Angular platform and all Angular applications on the page.
32036
- * Destroys all modules and listeners registered with the platform.
32037
- *
32038
- * @publicApi
32039
- */
32040
- function destroyPlatform() {
32041
- getPlatform()?.destroy();
32042
- }
32043
- /**
32044
- * Returns the current platform.
32045
- *
32046
- * @publicApi
32047
- */
32048
- function getPlatform() {
32049
- return _platformInjector?.get(PlatformRef) ?? null;
32050
- }
32051
- /**
32052
- * The Angular platform is the entry point for Angular on a web page.
32053
- * Each page has exactly one platform. Services (such as reflection) which are common
32054
- * to every Angular application running on the page are bound in its scope.
32055
- * A page's platform is initialized implicitly when a platform is created using a platform
32056
- * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.
32057
- *
32058
- * @publicApi
32059
- */
32060
- class PlatformRef {
32061
- /** @internal */
32062
- constructor(_injector) {
32063
- this._injector = _injector;
32064
- this._modules = [];
32065
- this._destroyListeners = [];
32066
- this._destroyed = false;
32067
- }
32068
- /**
32069
- * Creates an instance of an `@NgModule` for the given platform.
32070
- *
32071
- * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
32072
- * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
32073
- */
32074
- bootstrapModuleFactory(moduleFactory, options) {
32075
- // Note: We need to create the NgZone _before_ we instantiate the module,
32076
- // as instantiating the module creates some providers eagerly.
32077
- // So we create a mini parent injector that just contains the new NgZone and
32078
- // pass that as parent to the NgModuleFactory.
32079
- const ngZone = getNgZone(options?.ngZone, getNgZoneOptions({
32080
- eventCoalescing: options?.ngZoneEventCoalescing,
32081
- runCoalescing: options?.ngZoneRunCoalescing
32082
- }));
32083
- // Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are
32084
- // created within the Angular zone
32085
- // Do not try to replace ngZone.run with ApplicationRef#run because ApplicationRef would then be
32086
- // created outside of the Angular zone.
32087
- return ngZone.run(() => {
32088
- const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, internalProvideZoneChangeDetection(() => ngZone));
32089
- if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32090
- moduleRef.injector.get(PROVIDED_NG_ZONE, null) !== null) {
32091
- throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, '`bootstrapModule` does not support `provideZoneChangeDetection`. Use `BootstrapOptions` instead.');
32092
- }
32093
- const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
32094
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && exceptionHandler === null) {
32095
- throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No ErrorHandler. Is platform module (BrowserModule) included?');
32096
- }
32097
- ngZone.runOutsideAngular(() => {
32098
- const subscription = ngZone.onError.subscribe({
32099
- next: (error) => {
32100
- exceptionHandler.handleError(error);
32101
- }
32102
- });
32103
- moduleRef.onDestroy(() => {
32104
- remove(this._modules, moduleRef);
32105
- subscription.unsubscribe();
32106
- });
32107
- });
32108
- return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
32109
- const initStatus = moduleRef.injector.get(ApplicationInitStatus);
32110
- initStatus.runInitializers();
32111
- return initStatus.donePromise.then(() => {
32112
- // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy
32113
- const localeId = moduleRef.injector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
32114
- setLocaleId(localeId || DEFAULT_LOCALE_ID);
32115
- this._moduleDoBootstrap(moduleRef);
32116
- return moduleRef;
32117
- });
32118
- });
32119
- });
32120
- }
32121
- /**
32122
- * Creates an instance of an `@NgModule` for a given platform.
32123
- *
32124
- * @usageNotes
32125
- * ### Simple Example
32126
- *
32127
- * ```typescript
32128
- * @NgModule({
32129
- * imports: [BrowserModule]
32130
- * })
32131
- * class MyModule {}
32132
- *
32133
- * let moduleRef = platformBrowser().bootstrapModule(MyModule);
32134
- * ```
32135
- *
32136
- */
32137
- bootstrapModule(moduleType, compilerOptions = []) {
32138
- const options = optionsReducer({}, compilerOptions);
32139
- return compileNgModuleFactory(this.injector, options, moduleType)
32140
- .then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));
32141
- }
32142
- _moduleDoBootstrap(moduleRef) {
32143
- const appRef = moduleRef.injector.get(ApplicationRef);
32144
- if (moduleRef._bootstrapComponents.length > 0) {
32145
- moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));
32146
- }
32147
- else if (moduleRef.instance.ngDoBootstrap) {
32148
- moduleRef.instance.ngDoBootstrap(appRef);
32149
- }
32150
- else {
32151
- throw new RuntimeError(-403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
32152
- `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
32153
- `but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
32154
- `Please define one of these.`);
32155
- }
32156
- this._modules.push(moduleRef);
32157
- }
32158
- /**
32159
- * Registers a listener to be called when the platform is destroyed.
32160
- */
32161
- onDestroy(callback) {
32162
- this._destroyListeners.push(callback);
32163
- }
32164
- /**
32165
- * Retrieves the platform {@link Injector}, which is the parent injector for
32166
- * every Angular application on the page and provides singleton providers.
32167
- */
32168
- get injector() {
32169
- return this._injector;
32170
- }
32171
- /**
32172
- * Destroys the current Angular platform and all Angular applications on the page.
32173
- * Destroys all modules and listeners registered with the platform.
32174
- */
32175
- destroy() {
32176
- if (this._destroyed) {
32177
- throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
32178
- }
32179
- this._modules.slice().forEach(module => module.destroy());
32180
- this._destroyListeners.forEach(listener => listener());
32181
- const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
32182
- if (destroyListeners) {
32183
- destroyListeners.forEach(listener => listener());
32184
- destroyListeners.clear();
32185
- }
32186
- this._destroyed = true;
32187
- }
32188
- /**
32189
- * Indicates whether this instance was destroyed.
32190
- */
32191
- get destroyed() {
32192
- return this._destroyed;
32193
- }
32194
- static { this.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); }; }
32195
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' }); }
32196
- }
32197
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
32198
- type: Injectable,
32199
- args: [{ providedIn: 'platform' }]
32200
- }], () => [{ type: Injector }], null); })();
32201
- // Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->
32202
- // `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in
32203
- // a set of default options returned.
32204
- function getNgZoneOptions(options) {
32205
- return {
32206
- enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
32207
- shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,
32208
- shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false,
32209
- };
31532
+ /**
31533
+ * Sets the error for an invalid write to a signal to be an Angular `RuntimeError`.
31534
+ */
31535
+ function publishSignalConfiguration() {
31536
+ setThrowInvalidWriteToSignalError$1(() => {
31537
+ throw new RuntimeError(600 /* RuntimeErrorCode.SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT */, ngDevMode &&
31538
+ 'Writing to signals is not allowed in a `computed` or an `effect` by default. ' +
31539
+ 'Use `allowSignalWrites` in the `CreateEffectOptions` to enable this inside effects.');
31540
+ });
32210
31541
  }
32211
- function getNgZone(ngZoneToUse = 'zone.js', options) {
32212
- if (ngZoneToUse === 'noop') {
32213
- return new NoopNgZone();
32214
- }
32215
- if (ngZoneToUse === 'zone.js') {
32216
- return new NgZone(options);
31542
+ function isBoundToModule(cf) {
31543
+ return cf.isBoundToModule;
31544
+ }
31545
+ /**
31546
+ * A token for third-party components that can register themselves with NgProbe.
31547
+ *
31548
+ * @deprecated
31549
+ * @publicApi
31550
+ */
31551
+ class NgProbeToken {
31552
+ constructor(name, token) {
31553
+ this.name = name;
31554
+ this.token = token;
32217
31555
  }
32218
- return ngZoneToUse;
32219
31556
  }
32220
31557
  function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {
32221
31558
  try {
@@ -32343,7 +31680,6 @@ class ApplicationRef {
32343
31680
  /** @internal */
32344
31681
  this._views = [];
32345
31682
  this.internalErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);
32346
- this.zoneIsStable = inject(ZONE_IS_STABLE_OBSERVABLE);
32347
31683
  /**
32348
31684
  * Get a list of component types registered to this application.
32349
31685
  * This list is populated even before the component is created.
@@ -32356,8 +31692,7 @@ class ApplicationRef {
32356
31692
  /**
32357
31693
  * Returns an Observable that indicates when the application is stable or unstable.
32358
31694
  */
32359
- this.isStable = inject(InitialRenderPendingTasks)
32360
- .hasPendingTasks.pipe(switchMap(hasPendingTasks => hasPendingTasks ? of(false) : this.zoneIsStable), distinctUntilChanged(), share());
31695
+ this.isStable = inject(PendingTasks).hasPendingTasks.pipe(map(pending => !pending));
32361
31696
  this._injector = inject(EnvironmentInjector);
32362
31697
  }
32363
31698
  /**
@@ -32536,179 +31871,682 @@ class ApplicationRef {
32536
31871
  }
32537
31872
  }
32538
31873
  /**
32539
- * Registers a listener to be called when an instance is destroyed.
32540
- *
32541
- * @param callback A callback function to add as a listener.
32542
- * @returns A function which unregisters a listener.
31874
+ * Registers a listener to be called when an instance is destroyed.
31875
+ *
31876
+ * @param callback A callback function to add as a listener.
31877
+ * @returns A function which unregisters a listener.
31878
+ */
31879
+ onDestroy(callback) {
31880
+ (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
31881
+ this._destroyListeners.push(callback);
31882
+ return () => remove(this._destroyListeners, callback);
31883
+ }
31884
+ /**
31885
+ * Destroys an Angular application represented by this `ApplicationRef`. Calling this function
31886
+ * will destroy the associated environment injectors as well as all the bootstrapped components
31887
+ * with their views.
31888
+ */
31889
+ destroy() {
31890
+ if (this._destroyed) {
31891
+ throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');
31892
+ }
31893
+ const injector = this._injector;
31894
+ // Check that this injector instance supports destroy operation.
31895
+ if (injector.destroy && !injector.destroyed) {
31896
+ // Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle
31897
+ // hook, which invokes the remaining cleanup actions.
31898
+ injector.destroy();
31899
+ }
31900
+ }
31901
+ /**
31902
+ * Returns the number of attached views.
31903
+ */
31904
+ get viewCount() {
31905
+ return this._views.length;
31906
+ }
31907
+ warnIfDestroyed() {
31908
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._destroyed) {
31909
+ console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
31910
+ }
31911
+ }
31912
+ static { this.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(); }; }
31913
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' }); }
31914
+ }
31915
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
31916
+ type: Injectable,
31917
+ args: [{ providedIn: 'root' }]
31918
+ }], null, null); })();
31919
+ function remove(list, el) {
31920
+ const index = list.indexOf(el);
31921
+ if (index > -1) {
31922
+ list.splice(index, 1);
31923
+ }
31924
+ }
31925
+ function _lastDefined(args) {
31926
+ for (let i = args.length - 1; i >= 0; i--) {
31927
+ if (args[i] !== undefined) {
31928
+ return args[i];
31929
+ }
31930
+ }
31931
+ return undefined;
31932
+ }
31933
+ let whenStableStore;
31934
+ /**
31935
+ * Returns a Promise that resolves when the application becomes stable after this method is called
31936
+ * the first time.
31937
+ */
31938
+ function whenStable(applicationRef) {
31939
+ whenStableStore ??= new WeakMap();
31940
+ const cachedWhenStable = whenStableStore.get(applicationRef);
31941
+ if (cachedWhenStable) {
31942
+ return cachedWhenStable;
31943
+ }
31944
+ const whenStablePromise = applicationRef.isStable.pipe(first((isStable) => isStable)).toPromise().then(() => void 0);
31945
+ whenStableStore.set(applicationRef, whenStablePromise);
31946
+ // Be a good citizen and clean the store `onDestroy` even though we are using `WeakMap`.
31947
+ applicationRef.onDestroy(() => whenStableStore?.delete(applicationRef));
31948
+ return whenStablePromise;
31949
+ }
31950
+
31951
+ class NgZoneChangeDetectionScheduler {
31952
+ constructor() {
31953
+ this.zone = inject(NgZone);
31954
+ this.applicationRef = inject(ApplicationRef);
31955
+ }
31956
+ initialize() {
31957
+ if (this._onMicrotaskEmptySubscription) {
31958
+ return;
31959
+ }
31960
+ this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({
31961
+ next: () => {
31962
+ this.zone.run(() => {
31963
+ this.applicationRef.tick();
31964
+ });
31965
+ }
31966
+ });
31967
+ }
31968
+ ngOnDestroy() {
31969
+ this._onMicrotaskEmptySubscription?.unsubscribe();
31970
+ }
31971
+ static { this.ɵfac = function NgZoneChangeDetectionScheduler_Factory(t) { return new (t || NgZoneChangeDetectionScheduler)(); }; }
31972
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: NgZoneChangeDetectionScheduler, factory: NgZoneChangeDetectionScheduler.ɵfac, providedIn: 'root' }); }
31973
+ }
31974
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{
31975
+ type: Injectable,
31976
+ args: [{ providedIn: 'root' }]
31977
+ }], null, null); })();
31978
+ /**
31979
+ * Internal token used to verify that `provideZoneChangeDetection` is not used
31980
+ * with the bootstrapModule API.
31981
+ */
31982
+ const PROVIDED_NG_ZONE = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'provideZoneChangeDetection token' : '');
31983
+ function internalProvideZoneChangeDetection(ngZoneFactory) {
31984
+ return [
31985
+ { provide: NgZone, useFactory: ngZoneFactory },
31986
+ {
31987
+ provide: ENVIRONMENT_INITIALIZER,
31988
+ multi: true,
31989
+ useFactory: () => {
31990
+ const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, { optional: true });
31991
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
31992
+ ngZoneChangeDetectionScheduler === null) {
31993
+ throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, `A required Injectable was not found in the dependency injection tree. ` +
31994
+ 'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');
31995
+ }
31996
+ return () => ngZoneChangeDetectionScheduler.initialize();
31997
+ },
31998
+ },
31999
+ {
32000
+ provide: ENVIRONMENT_INITIALIZER,
32001
+ multi: true,
32002
+ useFactory: () => {
32003
+ const service = inject(ZoneStablePendingTask);
32004
+ return () => {
32005
+ service.initialize();
32006
+ };
32007
+ }
32008
+ },
32009
+ { provide: INTERNAL_APPLICATION_ERROR_HANDLER, useFactory: ngZoneApplicationErrorHandlerFactory },
32010
+ ];
32011
+ }
32012
+ function ngZoneApplicationErrorHandlerFactory() {
32013
+ const zone = inject(NgZone);
32014
+ const userErrorHandler = inject(ErrorHandler);
32015
+ return (e) => zone.runOutsideAngular(() => userErrorHandler.handleError(e));
32016
+ }
32017
+ /**
32018
+ * Provides `NgZone`-based change detection for the application bootstrapped using
32019
+ * `bootstrapApplication`.
32020
+ *
32021
+ * `NgZone` is already provided in applications by default. This provider allows you to configure
32022
+ * options like `eventCoalescing` in the `NgZone`.
32023
+ * This provider is not available for `platformBrowser().bootstrapModule`, which uses
32024
+ * `BootstrapOptions` instead.
32025
+ *
32026
+ * @usageNotes
32027
+ * ```typescript
32028
+ * bootstrapApplication(MyApp, {providers: [
32029
+ * provideZoneChangeDetection({eventCoalescing: true}),
32030
+ * ]});
32031
+ * ```
32032
+ *
32033
+ * @publicApi
32034
+ * @see {@link bootstrapApplication}
32035
+ * @see {@link NgZoneOptions}
32036
+ */
32037
+ function provideZoneChangeDetection(options) {
32038
+ const zoneProviders = internalProvideZoneChangeDetection(() => new NgZone(getNgZoneOptions(options)));
32039
+ return makeEnvironmentProviders([
32040
+ (typeof ngDevMode === 'undefined' || ngDevMode) ? { provide: PROVIDED_NG_ZONE, useValue: true } :
32041
+ [],
32042
+ zoneProviders,
32043
+ ]);
32044
+ }
32045
+ // Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->
32046
+ // `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in
32047
+ // a set of default options returned.
32048
+ function getNgZoneOptions(options) {
32049
+ return {
32050
+ enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
32051
+ shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,
32052
+ shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false,
32053
+ };
32054
+ }
32055
+ class ZoneStablePendingTask {
32056
+ constructor() {
32057
+ this.subscription = new Subscription();
32058
+ this.initialized = false;
32059
+ this.zone = inject(NgZone);
32060
+ this.pendingTasks = inject(PendingTasks);
32061
+ }
32062
+ initialize() {
32063
+ if (this.initialized) {
32064
+ return;
32065
+ }
32066
+ this.initialized = true;
32067
+ let task = null;
32068
+ if (!this.zone.isStable && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {
32069
+ task = this.pendingTasks.add();
32070
+ }
32071
+ this.zone.runOutsideAngular(() => {
32072
+ this.subscription.add(this.zone.onStable.subscribe(() => {
32073
+ NgZone.assertNotInAngularZone();
32074
+ // Check whether there are no pending macro/micro tasks in the next tick
32075
+ // to allow for NgZone to update the state.
32076
+ queueMicrotask(() => {
32077
+ if (task !== null && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {
32078
+ this.pendingTasks.remove(task);
32079
+ task = null;
32080
+ }
32081
+ });
32082
+ }));
32083
+ });
32084
+ this.subscription.add(this.zone.onUnstable.subscribe(() => {
32085
+ NgZone.assertInAngularZone();
32086
+ task ??= this.pendingTasks.add();
32087
+ }));
32088
+ }
32089
+ ngOnDestroy() {
32090
+ this.subscription.unsubscribe();
32091
+ }
32092
+ static { this.ɵfac = function ZoneStablePendingTask_Factory(t) { return new (t || ZoneStablePendingTask)(); }; }
32093
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ZoneStablePendingTask, factory: ZoneStablePendingTask.ɵfac, providedIn: 'root' }); }
32094
+ }
32095
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ZoneStablePendingTask, [{
32096
+ type: Injectable,
32097
+ args: [{ providedIn: 'root' }]
32098
+ }], null, null); })();
32099
+
32100
+ /**
32101
+ * Work out the locale from the potential global properties.
32102
+ *
32103
+ * * Closure Compiler: use `goog.LOCALE`.
32104
+ * * Ivy enabled: use `$localize.locale`
32105
+ */
32106
+ function getGlobalLocale() {
32107
+ if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
32108
+ typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
32109
+ // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.
32110
+ // * In order to preserve backwards compatibility, we use Angular default value over
32111
+ // Closure Compiler's one.
32112
+ return goog.LOCALE;
32113
+ }
32114
+ else {
32115
+ // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE
32116
+ // COMPILE-TIME INLINER.
32117
+ //
32118
+ // * During compile time inlining of translations the expression will be replaced
32119
+ // with a string literal that is the current locale. Other forms of this expression are not
32120
+ // guaranteed to be replaced.
32121
+ //
32122
+ // * During runtime translation evaluation, the developer is required to set `$localize.locale`
32123
+ // if required, or just to provide their own `LOCALE_ID` provider.
32124
+ return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;
32125
+ }
32126
+ }
32127
+ /**
32128
+ * Provide this token to set the locale of your application.
32129
+ * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
32130
+ * DecimalPipe and PercentPipe) and by ICU expressions.
32131
+ *
32132
+ * See the [i18n guide](guide/i18n-common-locale-id) for more information.
32133
+ *
32134
+ * @usageNotes
32135
+ * ### Example
32136
+ *
32137
+ * ```typescript
32138
+ * import { LOCALE_ID } from '@angular/core';
32139
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32140
+ * import { AppModule } from './app/app.module';
32141
+ *
32142
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32143
+ * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
32144
+ * });
32145
+ * ```
32146
+ *
32147
+ * @publicApi
32148
+ */
32149
+ const LOCALE_ID = new InjectionToken('LocaleId', {
32150
+ providedIn: 'root',
32151
+ factory: () => inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale(),
32152
+ });
32153
+ /**
32154
+ * Provide this token to set the default currency code your application uses for
32155
+ * CurrencyPipe when there is no currency code passed into it. This is only used by
32156
+ * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
32157
+ *
32158
+ * See the [i18n guide](guide/i18n-common-locale-id) for more information.
32159
+ *
32160
+ * <div class="alert is-helpful">
32161
+ *
32162
+ * **Deprecation notice:**
32163
+ *
32164
+ * The default currency code is currently always `USD` but this is deprecated from v9.
32165
+ *
32166
+ * **In v10 the default currency code will be taken from the current locale.**
32167
+ *
32168
+ * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
32169
+ * your application `NgModule`:
32170
+ *
32171
+ * ```ts
32172
+ * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
32173
+ * ```
32174
+ *
32175
+ * </div>
32176
+ *
32177
+ * @usageNotes
32178
+ * ### Example
32179
+ *
32180
+ * ```typescript
32181
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32182
+ * import { AppModule } from './app/app.module';
32183
+ *
32184
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32185
+ * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
32186
+ * });
32187
+ * ```
32188
+ *
32189
+ * @publicApi
32190
+ */
32191
+ const DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode', {
32192
+ providedIn: 'root',
32193
+ factory: () => USD_CURRENCY_CODE,
32194
+ });
32195
+ /**
32196
+ * Use this token at bootstrap to provide the content of your translation file (`xtb`,
32197
+ * `xlf` or `xlf2`) when you want to translate your application in another language.
32198
+ *
32199
+ * See the [i18n guide](guide/i18n-common-merge) for more information.
32200
+ *
32201
+ * @usageNotes
32202
+ * ### Example
32203
+ *
32204
+ * ```typescript
32205
+ * import { TRANSLATIONS } from '@angular/core';
32206
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32207
+ * import { AppModule } from './app/app.module';
32208
+ *
32209
+ * // content of your translation file
32210
+ * const translations = '....';
32211
+ *
32212
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32213
+ * providers: [{provide: TRANSLATIONS, useValue: translations }]
32214
+ * });
32215
+ * ```
32216
+ *
32217
+ * @publicApi
32218
+ */
32219
+ const TRANSLATIONS = new InjectionToken('Translations');
32220
+ /**
32221
+ * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
32222
+ * `xlf` or `xlf2`.
32223
+ *
32224
+ * See the [i18n guide](guide/i18n-common-merge) for more information.
32225
+ *
32226
+ * @usageNotes
32227
+ * ### Example
32228
+ *
32229
+ * ```typescript
32230
+ * import { TRANSLATIONS_FORMAT } from '@angular/core';
32231
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32232
+ * import { AppModule } from './app/app.module';
32233
+ *
32234
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32235
+ * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
32236
+ * });
32237
+ * ```
32238
+ *
32239
+ * @publicApi
32240
+ */
32241
+ const TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
32242
+ /**
32243
+ * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
32244
+ * that the compiler should use in case of missing translations:
32245
+ * - Error: throw if you have missing translations.
32246
+ * - Warning (default): show a warning in the console and/or shell.
32247
+ * - Ignore: do nothing.
32248
+ *
32249
+ * See the [i18n guide](guide/i18n-common-merge#report-missing-translations) for more information.
32250
+ *
32251
+ * @usageNotes
32252
+ * ### Example
32253
+ * ```typescript
32254
+ * import { MissingTranslationStrategy } from '@angular/core';
32255
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32256
+ * import { AppModule } from './app/app.module';
32257
+ *
32258
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32259
+ * missingTranslation: MissingTranslationStrategy.Error
32260
+ * });
32261
+ * ```
32262
+ *
32263
+ * @publicApi
32264
+ */
32265
+ var MissingTranslationStrategy;
32266
+ (function (MissingTranslationStrategy) {
32267
+ MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
32268
+ MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
32269
+ MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore";
32270
+ })(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
32271
+
32272
+ /**
32273
+ * Internal token that allows to register extra callbacks that should be invoked during the
32274
+ * `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the
32275
+ * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
32276
+ * entire class tree-shakeable.
32277
+ */
32278
+ const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
32279
+ /**
32280
+ * The Angular platform is the entry point for Angular on a web page.
32281
+ * Each page has exactly one platform. Services (such as reflection) which are common
32282
+ * to every Angular application running on the page are bound in its scope.
32283
+ * A page's platform is initialized implicitly when a platform is created using a platform
32284
+ * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.
32285
+ *
32286
+ * @publicApi
32287
+ */
32288
+ class PlatformRef {
32289
+ /** @internal */
32290
+ constructor(_injector) {
32291
+ this._injector = _injector;
32292
+ this._modules = [];
32293
+ this._destroyListeners = [];
32294
+ this._destroyed = false;
32295
+ }
32296
+ /**
32297
+ * Creates an instance of an `@NgModule` for the given platform.
32298
+ *
32299
+ * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
32300
+ * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
32301
+ */
32302
+ bootstrapModuleFactory(moduleFactory, options) {
32303
+ // Note: We need to create the NgZone _before_ we instantiate the module,
32304
+ // as instantiating the module creates some providers eagerly.
32305
+ // So we create a mini parent injector that just contains the new NgZone and
32306
+ // pass that as parent to the NgModuleFactory.
32307
+ const ngZone = getNgZone(options?.ngZone, getNgZoneOptions({
32308
+ eventCoalescing: options?.ngZoneEventCoalescing,
32309
+ runCoalescing: options?.ngZoneRunCoalescing
32310
+ }));
32311
+ // Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are
32312
+ // created within the Angular zone
32313
+ // Do not try to replace ngZone.run with ApplicationRef#run because ApplicationRef would then be
32314
+ // created outside of the Angular zone.
32315
+ return ngZone.run(() => {
32316
+ const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, internalProvideZoneChangeDetection(() => ngZone));
32317
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32318
+ moduleRef.injector.get(PROVIDED_NG_ZONE, null) !== null) {
32319
+ throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, '`bootstrapModule` does not support `provideZoneChangeDetection`. Use `BootstrapOptions` instead.');
32320
+ }
32321
+ const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
32322
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && exceptionHandler === null) {
32323
+ throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No ErrorHandler. Is platform module (BrowserModule) included?');
32324
+ }
32325
+ ngZone.runOutsideAngular(() => {
32326
+ const subscription = ngZone.onError.subscribe({
32327
+ next: (error) => {
32328
+ exceptionHandler.handleError(error);
32329
+ }
32330
+ });
32331
+ moduleRef.onDestroy(() => {
32332
+ remove(this._modules, moduleRef);
32333
+ subscription.unsubscribe();
32334
+ });
32335
+ });
32336
+ return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
32337
+ const initStatus = moduleRef.injector.get(ApplicationInitStatus);
32338
+ initStatus.runInitializers();
32339
+ return initStatus.donePromise.then(() => {
32340
+ // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy
32341
+ const localeId = moduleRef.injector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
32342
+ setLocaleId(localeId || DEFAULT_LOCALE_ID);
32343
+ this._moduleDoBootstrap(moduleRef);
32344
+ return moduleRef;
32345
+ });
32346
+ });
32347
+ });
32348
+ }
32349
+ /**
32350
+ * Creates an instance of an `@NgModule` for a given platform.
32351
+ *
32352
+ * @usageNotes
32353
+ * ### Simple Example
32354
+ *
32355
+ * ```typescript
32356
+ * @NgModule({
32357
+ * imports: [BrowserModule]
32358
+ * })
32359
+ * class MyModule {}
32360
+ *
32361
+ * let moduleRef = platformBrowser().bootstrapModule(MyModule);
32362
+ * ```
32363
+ *
32364
+ */
32365
+ bootstrapModule(moduleType, compilerOptions = []) {
32366
+ const options = optionsReducer({}, compilerOptions);
32367
+ return compileNgModuleFactory(this.injector, options, moduleType)
32368
+ .then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));
32369
+ }
32370
+ _moduleDoBootstrap(moduleRef) {
32371
+ const appRef = moduleRef.injector.get(ApplicationRef);
32372
+ if (moduleRef._bootstrapComponents.length > 0) {
32373
+ moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));
32374
+ }
32375
+ else if (moduleRef.instance.ngDoBootstrap) {
32376
+ moduleRef.instance.ngDoBootstrap(appRef);
32377
+ }
32378
+ else {
32379
+ throw new RuntimeError(-403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
32380
+ `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
32381
+ `but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
32382
+ `Please define one of these.`);
32383
+ }
32384
+ this._modules.push(moduleRef);
32385
+ }
32386
+ /**
32387
+ * Registers a listener to be called when the platform is destroyed.
32543
32388
  */
32544
32389
  onDestroy(callback) {
32545
- (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
32546
32390
  this._destroyListeners.push(callback);
32547
- return () => remove(this._destroyListeners, callback);
32548
32391
  }
32549
32392
  /**
32550
- * Destroys an Angular application represented by this `ApplicationRef`. Calling this function
32551
- * will destroy the associated environment injectors as well as all the bootstrapped components
32552
- * with their views.
32393
+ * Retrieves the platform {@link Injector}, which is the parent injector for
32394
+ * every Angular application on the page and provides singleton providers.
32395
+ */
32396
+ get injector() {
32397
+ return this._injector;
32398
+ }
32399
+ /**
32400
+ * Destroys the current Angular platform and all Angular applications on the page.
32401
+ * Destroys all modules and listeners registered with the platform.
32553
32402
  */
32554
32403
  destroy() {
32555
32404
  if (this._destroyed) {
32556
- throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');
32405
+ throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
32557
32406
  }
32558
- const injector = this._injector;
32559
- // Check that this injector instance supports destroy operation.
32560
- if (injector.destroy && !injector.destroyed) {
32561
- // Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle
32562
- // hook, which invokes the remaining cleanup actions.
32563
- injector.destroy();
32407
+ this._modules.slice().forEach(module => module.destroy());
32408
+ this._destroyListeners.forEach(listener => listener());
32409
+ const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
32410
+ if (destroyListeners) {
32411
+ destroyListeners.forEach(listener => listener());
32412
+ destroyListeners.clear();
32564
32413
  }
32414
+ this._destroyed = true;
32565
32415
  }
32566
32416
  /**
32567
- * Returns the number of attached views.
32417
+ * Indicates whether this instance was destroyed.
32568
32418
  */
32569
- get viewCount() {
32570
- return this._views.length;
32571
- }
32572
- warnIfDestroyed() {
32573
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._destroyed) {
32574
- console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
32575
- }
32419
+ get destroyed() {
32420
+ return this._destroyed;
32576
32421
  }
32577
- static { this.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(); }; }
32578
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' }); }
32422
+ static { this.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); }; }
32423
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' }); }
32579
32424
  }
32580
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
32425
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
32581
32426
  type: Injectable,
32582
- args: [{ providedIn: 'root' }]
32583
- }], null, null); })();
32584
- function remove(list, el) {
32585
- const index = list.indexOf(el);
32586
- if (index > -1) {
32587
- list.splice(index, 1);
32427
+ args: [{ providedIn: 'platform' }]
32428
+ }], () => [{ type: Injector }], null); })();
32429
+
32430
+ let _platformInjector = null;
32431
+ /**
32432
+ * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
32433
+ * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
32434
+ */
32435
+ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
32436
+ /**
32437
+ * Creates a platform.
32438
+ * Platforms must be created on launch using this function.
32439
+ *
32440
+ * @publicApi
32441
+ */
32442
+ function createPlatform(injector) {
32443
+ if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
32444
+ throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
32445
+ 'There can be only one platform. Destroy the previous one to create a new one.');
32588
32446
  }
32447
+ publishDefaultGlobalUtils();
32448
+ publishSignalConfiguration();
32449
+ _platformInjector = injector;
32450
+ const platform = injector.get(PlatformRef);
32451
+ runPlatformInitializers(injector);
32452
+ return platform;
32589
32453
  }
32590
- function _lastDefined(args) {
32591
- for (let i = args.length - 1; i >= 0; i--) {
32592
- if (args[i] !== undefined) {
32593
- return args[i];
32454
+ /**
32455
+ * Creates a factory for a platform. Can be used to provide or override `Providers` specific to
32456
+ * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
32457
+ * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
32458
+ * to build up configurations that might be required by different libraries or parts of the
32459
+ * application.
32460
+ * @param name Identifies the new platform factory.
32461
+ * @param providers A set of dependency providers for platforms created with the new factory.
32462
+ *
32463
+ * @publicApi
32464
+ */
32465
+ function createPlatformFactory(parentPlatformFactory, name, providers = []) {
32466
+ const desc = `Platform: ${name}`;
32467
+ const marker = new InjectionToken(desc);
32468
+ return (extraProviders = []) => {
32469
+ let platform = getPlatform();
32470
+ if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
32471
+ const platformProviders = [...providers, ...extraProviders, { provide: marker, useValue: true }];
32472
+ if (parentPlatformFactory) {
32473
+ parentPlatformFactory(platformProviders);
32474
+ }
32475
+ else {
32476
+ createPlatform(createPlatformInjector(platformProviders, desc));
32477
+ }
32594
32478
  }
32595
- }
32596
- return undefined;
32479
+ return assertPlatform(marker);
32480
+ };
32597
32481
  }
32598
32482
  /**
32599
- * `InjectionToken` used to configure how to call the `ErrorHandler`.
32600
- *
32601
- * `NgZone` is provided by default today so the default (and only) implementation for this
32602
- * is calling `ErrorHandler.handleError` outside of the Angular zone.
32483
+ * Helper function to create an instance of a platform injector (that maintains the 'platform'
32484
+ * scope).
32603
32485
  */
32604
- const INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'internal error handler' : '', {
32605
- providedIn: 'root',
32606
- factory: () => {
32607
- const userErrorHandler = inject(ErrorHandler);
32608
- return userErrorHandler.handleError.bind(undefined);
32609
- }
32610
- });
32611
- function ngZoneApplicationErrorHandlerFactory() {
32612
- const zone = inject(NgZone);
32613
- const userErrorHandler = inject(ErrorHandler);
32614
- return (e) => zone.runOutsideAngular(() => userErrorHandler.handleError(e));
32486
+ function createPlatformInjector(providers = [], name) {
32487
+ return Injector.create({
32488
+ name,
32489
+ providers: [
32490
+ { provide: INJECTOR_SCOPE, useValue: 'platform' },
32491
+ { provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
32492
+ ...providers
32493
+ ],
32494
+ });
32615
32495
  }
32616
- class NgZoneChangeDetectionScheduler {
32617
- constructor() {
32618
- this.zone = inject(NgZone);
32619
- this.applicationRef = inject(ApplicationRef);
32620
- }
32621
- initialize() {
32622
- if (this._onMicrotaskEmptySubscription) {
32623
- return;
32624
- }
32625
- this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({
32626
- next: () => {
32627
- this.zone.run(() => {
32628
- this.applicationRef.tick();
32629
- });
32630
- }
32631
- });
32496
+ /**
32497
+ * Checks that there is currently a platform that contains the given token as a provider.
32498
+ *
32499
+ * @publicApi
32500
+ */
32501
+ function assertPlatform(requiredToken) {
32502
+ const platform = getPlatform();
32503
+ if (!platform) {
32504
+ throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
32632
32505
  }
32633
- ngOnDestroy() {
32634
- this._onMicrotaskEmptySubscription?.unsubscribe();
32506
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32507
+ !platform.injector.get(requiredToken, null)) {
32508
+ throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
32635
32509
  }
32636
- static { this.ɵfac = function NgZoneChangeDetectionScheduler_Factory(t) { return new (t || NgZoneChangeDetectionScheduler)(); }; }
32637
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: NgZoneChangeDetectionScheduler, factory: NgZoneChangeDetectionScheduler.ɵfac, providedIn: 'root' }); }
32510
+ return platform;
32638
32511
  }
32639
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{
32640
- type: Injectable,
32641
- args: [{ providedIn: 'root' }]
32642
- }], null, null); })();
32643
32512
  /**
32644
- * Internal token used to verify that `provideZoneChangeDetection` is not used
32645
- * with the bootstrapModule API.
32513
+ * Returns the current platform.
32514
+ *
32515
+ * @publicApi
32646
32516
  */
32647
- const PROVIDED_NG_ZONE = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'provideZoneChangeDetection token' : '');
32648
- function internalProvideZoneChangeDetection(ngZoneFactory) {
32649
- return [
32650
- { provide: NgZone, useFactory: ngZoneFactory },
32651
- {
32652
- provide: ENVIRONMENT_INITIALIZER,
32653
- multi: true,
32654
- useFactory: () => {
32655
- const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, { optional: true });
32656
- if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32657
- ngZoneChangeDetectionScheduler === null) {
32658
- throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, `A required Injectable was not found in the dependency injection tree. ` +
32659
- 'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');
32660
- }
32661
- return () => ngZoneChangeDetectionScheduler.initialize();
32662
- },
32663
- },
32664
- { provide: INTERNAL_APPLICATION_ERROR_HANDLER, useFactory: ngZoneApplicationErrorHandlerFactory },
32665
- { provide: ZONE_IS_STABLE_OBSERVABLE, useFactory: isStableFactory },
32666
- ];
32517
+ function getPlatform() {
32518
+ return _platformInjector?.get(PlatformRef) ?? null;
32667
32519
  }
32668
32520
  /**
32669
- * Provides `NgZone`-based change detection for the application bootstrapped using
32670
- * `bootstrapApplication`.
32671
- *
32672
- * `NgZone` is already provided in applications by default. This provider allows you to configure
32673
- * options like `eventCoalescing` in the `NgZone`.
32674
- * This provider is not available for `platformBrowser().bootstrapModule`, which uses
32675
- * `BootstrapOptions` instead.
32676
- *
32677
- * @usageNotes
32678
- * ```typescript
32679
- * bootstrapApplication(MyApp, {providers: [
32680
- * provideZoneChangeDetection({eventCoalescing: true}),
32681
- * ]});
32682
- * ```
32521
+ * Destroys the current Angular platform and all Angular applications on the page.
32522
+ * Destroys all modules and listeners registered with the platform.
32683
32523
  *
32684
32524
  * @publicApi
32685
- * @see {@link bootstrapApplication}
32686
- * @see {@link NgZoneOptions}
32687
32525
  */
32688
- function provideZoneChangeDetection(options) {
32689
- const zoneProviders = internalProvideZoneChangeDetection(() => new NgZone(getNgZoneOptions(options)));
32690
- return makeEnvironmentProviders([
32691
- (typeof ngDevMode === 'undefined' || ngDevMode) ? { provide: PROVIDED_NG_ZONE, useValue: true } :
32692
- [],
32693
- zoneProviders,
32694
- ]);
32526
+ function destroyPlatform() {
32527
+ getPlatform()?.destroy();
32695
32528
  }
32696
- let whenStableStore;
32697
32529
  /**
32698
- * Returns a Promise that resolves when the application becomes stable after this method is called
32699
- * the first time.
32530
+ * The goal of this function is to bootstrap a platform injector,
32531
+ * but avoid referencing `PlatformRef` class.
32532
+ * This function is needed for bootstrapping a Standalone Component.
32700
32533
  */
32701
- function whenStable(applicationRef) {
32702
- whenStableStore ??= new WeakMap();
32703
- const cachedWhenStable = whenStableStore.get(applicationRef);
32704
- if (cachedWhenStable) {
32705
- return cachedWhenStable;
32706
- }
32707
- const whenStablePromise = applicationRef.isStable.pipe(first((isStable) => isStable)).toPromise().then(() => void 0);
32708
- whenStableStore.set(applicationRef, whenStablePromise);
32709
- // Be a good citizen and clean the store `onDestroy` even though we are using `WeakMap`.
32710
- applicationRef.onDestroy(() => whenStableStore?.delete(applicationRef));
32711
- return whenStablePromise;
32534
+ function createOrReusePlatformInjector(providers = []) {
32535
+ // If a platform injector already exists, it means that the platform
32536
+ // is already bootstrapped and no additional actions are required.
32537
+ if (_platformInjector)
32538
+ return _platformInjector;
32539
+ publishDefaultGlobalUtils();
32540
+ // Otherwise, setup a new platform injector and run platform initializers.
32541
+ const injector = createPlatformInjector(providers);
32542
+ _platformInjector = injector;
32543
+ publishSignalConfiguration();
32544
+ runPlatformInitializers(injector);
32545
+ return injector;
32546
+ }
32547
+ function runPlatformInitializers(injector) {
32548
+ const inits = injector.get(PLATFORM_INITIALIZER, null);
32549
+ inits?.forEach((init) => init());
32712
32550
  }
32713
32551
 
32714
32552
  /**
@@ -33868,14 +33706,7 @@ function signalSetFn(node, newValue) {
33868
33706
  if (!producerUpdatesAllowed()) {
33869
33707
  throwInvalidWriteToSignalError();
33870
33708
  }
33871
- const value = node.value;
33872
- if (Object.is(value, newValue)) {
33873
- if (typeof ngDevMode !== 'undefined' && ngDevMode && !node.equal(value, newValue)) {
33874
- console.warn('Signal value equality implementations should always return `true` for' +
33875
- ' values that are the same according to `Object.is` but returned `false` instead.');
33876
- }
33877
- }
33878
- else if (!node.equal(value, newValue)) {
33709
+ if (!node.equal(node.value, newValue)) {
33879
33710
  node.value = newValue;
33880
33711
  signalValueChanged(node);
33881
33712
  }
@@ -33989,6 +33820,244 @@ function setAlternateWeakRefImpl(impl) {
33989
33820
  // TODO: remove this function
33990
33821
  }
33991
33822
 
33823
+ // A delay in milliseconds before the scan is run after onLoad, to avoid any
33824
+ // potential race conditions with other LCP-related functions. This delay
33825
+ // happens outside of the main JavaScript execution and will only effect the timing
33826
+ // on when the warning becomes visible in the console.
33827
+ const SCAN_DELAY = 200;
33828
+ const OVERSIZED_IMAGE_TOLERANCE = 1200;
33829
+ class ImagePerformanceWarning {
33830
+ constructor() {
33831
+ // Map of full image URLs -> original `ngSrc` values.
33832
+ this.window = null;
33833
+ this.observer = null;
33834
+ this.options = inject(IMAGE_CONFIG);
33835
+ this.ngZone = inject(NgZone);
33836
+ }
33837
+ start() {
33838
+ if (typeof PerformanceObserver === 'undefined' ||
33839
+ (this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning)) {
33840
+ return;
33841
+ }
33842
+ this.observer = this.initPerformanceObserver();
33843
+ const doc = getDocument();
33844
+ const win = doc.defaultView;
33845
+ if (typeof win !== 'undefined') {
33846
+ this.window = win;
33847
+ // Wait to avoid race conditions where LCP image triggers
33848
+ // load event before it's recorded by the performance observer
33849
+ const waitToScan = () => {
33850
+ setTimeout(this.scanImages.bind(this), SCAN_DELAY);
33851
+ };
33852
+ // Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in
33853
+ // the scope of this functionality.
33854
+ this.ngZone.runOutsideAngular(() => {
33855
+ // Consider the case when the application is created and destroyed multiple times.
33856
+ // Typically, applications are created instantly once the page is loaded, and the
33857
+ // `window.load` listener is always triggered. However, the `window.load` event will never
33858
+ // be fired if the page is loaded, and the application is created later. Checking for
33859
+ // `readyState` is the easiest way to determine whether the page has been loaded or not.
33860
+ if (doc.readyState === 'complete') {
33861
+ waitToScan();
33862
+ }
33863
+ else {
33864
+ this.window?.addEventListener('load', waitToScan, { once: true });
33865
+ }
33866
+ });
33867
+ }
33868
+ }
33869
+ ngOnDestroy() {
33870
+ this.observer?.disconnect();
33871
+ }
33872
+ initPerformanceObserver() {
33873
+ if (typeof PerformanceObserver === 'undefined') {
33874
+ return null;
33875
+ }
33876
+ const observer = new PerformanceObserver((entryList) => {
33877
+ const entries = entryList.getEntries();
33878
+ if (entries.length === 0)
33879
+ return;
33880
+ // We use the latest entry produced by the `PerformanceObserver` as the best
33881
+ // signal on which element is actually an LCP one. As an example, the first image to load on
33882
+ // a page, by virtue of being the only thing on the page so far, is often a LCP candidate
33883
+ // and gets reported by PerformanceObserver, but isn't necessarily the LCP element.
33884
+ const lcpElement = entries[entries.length - 1];
33885
+ // Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.
33886
+ // See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint
33887
+ const imgSrc = lcpElement.element?.src ?? '';
33888
+ // Exclude `data:` and `blob:` URLs, since they are fetched resources.
33889
+ if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:'))
33890
+ return;
33891
+ this.lcpImageUrl = imgSrc;
33892
+ });
33893
+ observer.observe({ type: 'largest-contentful-paint', buffered: true });
33894
+ return observer;
33895
+ }
33896
+ scanImages() {
33897
+ const images = getDocument().querySelectorAll('img');
33898
+ let lcpElementFound, lcpElementLoadedCorrectly = false;
33899
+ images.forEach(image => {
33900
+ if (!this.options?.disableImageSizeWarning) {
33901
+ for (const image of images) {
33902
+ // Image elements using the NgOptimizedImage directive are excluded,
33903
+ // as that directive has its own version of this check.
33904
+ if (!image.getAttribute('ng-img') && this.isOversized(image)) {
33905
+ logOversizedImageWarning(image.src);
33906
+ }
33907
+ }
33908
+ }
33909
+ if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {
33910
+ if (image.src === this.lcpImageUrl) {
33911
+ lcpElementFound = true;
33912
+ if (image.loading !== 'lazy' || image.getAttribute('ng-img')) {
33913
+ // This variable is set to true and never goes back to false to account
33914
+ // for the case where multiple images have the same src url, and some
33915
+ // have lazy loading while others don't.
33916
+ // Also ignore NgOptimizedImage because there's a different warning for that.
33917
+ lcpElementLoadedCorrectly = true;
33918
+ }
33919
+ }
33920
+ }
33921
+ });
33922
+ if (lcpElementFound && !lcpElementLoadedCorrectly && this.lcpImageUrl &&
33923
+ !this.options?.disableImageLazyLoadWarning) {
33924
+ logLazyLCPWarning(this.lcpImageUrl);
33925
+ }
33926
+ }
33927
+ isOversized(image) {
33928
+ if (!this.window) {
33929
+ return false;
33930
+ }
33931
+ const computedStyle = this.window.getComputedStyle(image);
33932
+ let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));
33933
+ let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));
33934
+ const boxSizing = computedStyle.getPropertyValue('box-sizing');
33935
+ const objectFit = computedStyle.getPropertyValue('object-fit');
33936
+ if (objectFit === `cover`) {
33937
+ // Object fit cover may indicate a use case such as a sprite sheet where
33938
+ // this warning does not apply.
33939
+ return false;
33940
+ }
33941
+ if (boxSizing === 'border-box') {
33942
+ const paddingTop = computedStyle.getPropertyValue('padding-top');
33943
+ const paddingRight = computedStyle.getPropertyValue('padding-right');
33944
+ const paddingBottom = computedStyle.getPropertyValue('padding-bottom');
33945
+ const paddingLeft = computedStyle.getPropertyValue('padding-left');
33946
+ renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
33947
+ renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
33948
+ }
33949
+ const intrinsicWidth = image.naturalWidth;
33950
+ const intrinsicHeight = image.naturalHeight;
33951
+ const recommendedWidth = this.window.devicePixelRatio * renderedWidth;
33952
+ const recommendedHeight = this.window.devicePixelRatio * renderedHeight;
33953
+ const oversizedWidth = (intrinsicWidth - recommendedWidth) >= OVERSIZED_IMAGE_TOLERANCE;
33954
+ const oversizedHeight = (intrinsicHeight - recommendedHeight) >= OVERSIZED_IMAGE_TOLERANCE;
33955
+ return oversizedWidth || oversizedHeight;
33956
+ }
33957
+ static { this.ɵfac = function ImagePerformanceWarning_Factory(t) { return new (t || ImagePerformanceWarning)(); }; }
33958
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ImagePerformanceWarning, factory: ImagePerformanceWarning.ɵfac, providedIn: 'root' }); }
33959
+ }
33960
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{
33961
+ type: Injectable,
33962
+ args: [{ providedIn: 'root' }]
33963
+ }], null, null); })();
33964
+ function logLazyLCPWarning(src) {
33965
+ console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} is the Largest Contentful Paint (LCP) element ` +
33966
+ `but was given a "loading" value of "lazy", which can negatively impact ` +
33967
+ `application loading performance. This warning can be addressed by ` +
33968
+ `changing the loading value of the LCP image to "eager", or by using the ` +
33969
+ `NgOptimizedImage directive's prioritization utilities. For more ` +
33970
+ `information about addressing or disabling this warning, see ` +
33971
+ `https://angular.io/errors/NG0913`));
33972
+ }
33973
+ function logOversizedImageWarning(src) {
33974
+ console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} has intrinsic file dimensions much larger than its ` +
33975
+ `rendered size. This can negatively impact application loading performance. ` +
33976
+ `For more information about addressing or disabling this warning, see ` +
33977
+ `https://angular.io/errors/NG0913`));
33978
+ }
33979
+
33980
+ /**
33981
+ * Internal create application API that implements the core application creation logic and optional
33982
+ * bootstrap logic.
33983
+ *
33984
+ * Platforms (such as `platform-browser`) may require different set of application and platform
33985
+ * providers for an application to function correctly. As a result, platforms may use this function
33986
+ * internally and supply the necessary providers during the bootstrap, while exposing
33987
+ * platform-specific APIs as a part of their public API.
33988
+ *
33989
+ * @returns A promise that returns an `ApplicationRef` instance once resolved.
33990
+ */
33991
+ function internalCreateApplication(config) {
33992
+ try {
33993
+ const { rootComponent, appProviders, platformProviders } = config;
33994
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {
33995
+ assertStandaloneComponentType(rootComponent);
33996
+ }
33997
+ const platformInjector = createOrReusePlatformInjector(platformProviders);
33998
+ // Create root application injector based on a set of providers configured at the platform
33999
+ // bootstrap level as well as providers passed to the bootstrap call by a user.
34000
+ const allAppProviders = [
34001
+ provideZoneChangeDetection(),
34002
+ ...(appProviders || []),
34003
+ ];
34004
+ const adapter = new EnvironmentNgModuleRefAdapter({
34005
+ providers: allAppProviders,
34006
+ parent: platformInjector,
34007
+ debugName: (typeof ngDevMode === 'undefined' || ngDevMode) ? 'Environment Injector' : '',
34008
+ // We skip environment initializers because we need to run them inside the NgZone, which
34009
+ // happens after we get the NgZone instance from the Injector.
34010
+ runEnvironmentInitializers: false,
34011
+ });
34012
+ const envInjector = adapter.injector;
34013
+ const ngZone = envInjector.get(NgZone);
34014
+ return ngZone.run(() => {
34015
+ envInjector.resolveInjectorInitializers();
34016
+ const exceptionHandler = envInjector.get(ErrorHandler, null);
34017
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !exceptionHandler) {
34018
+ throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No `ErrorHandler` found in the Dependency Injection tree.');
34019
+ }
34020
+ let onErrorSubscription;
34021
+ ngZone.runOutsideAngular(() => {
34022
+ onErrorSubscription = ngZone.onError.subscribe({
34023
+ next: (error) => {
34024
+ exceptionHandler.handleError(error);
34025
+ }
34026
+ });
34027
+ });
34028
+ // If the whole platform is destroyed, invoke the `destroy` method
34029
+ // for all bootstrapped applications as well.
34030
+ const destroyListener = () => envInjector.destroy();
34031
+ const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS);
34032
+ onPlatformDestroyListeners.add(destroyListener);
34033
+ envInjector.onDestroy(() => {
34034
+ onErrorSubscription.unsubscribe();
34035
+ onPlatformDestroyListeners.delete(destroyListener);
34036
+ });
34037
+ return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
34038
+ const initStatus = envInjector.get(ApplicationInitStatus);
34039
+ initStatus.runInitializers();
34040
+ return initStatus.donePromise.then(() => {
34041
+ const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
34042
+ setLocaleId(localeId || DEFAULT_LOCALE_ID);
34043
+ const appRef = envInjector.get(ApplicationRef);
34044
+ if (rootComponent !== undefined) {
34045
+ appRef.bootstrap(rootComponent);
34046
+ }
34047
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
34048
+ const imagePerformanceService = envInjector.get(ImagePerformanceWarning);
34049
+ imagePerformanceService.start();
34050
+ }
34051
+ return appRef;
34052
+ });
34053
+ });
34054
+ });
34055
+ }
34056
+ catch (e) {
34057
+ return Promise.reject(e);
34058
+ }
34059
+ }
34060
+
33992
34061
  /**
33993
34062
  * Retrieves all defer blocks in a given LView.
33994
34063
  *
@@ -35041,5 +35110,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
35041
35110
  * Generated bundle index. Do not edit.
35042
35111
  */
35043
35112
 
35044
- export { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AfterRenderPhase, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, Renderer2, RendererFactory2, RendererStyleFlags2, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, afterNextRender, afterRender, asNativeElements, assertInInjectionContext, assertNotInReactiveContext, assertPlatform, booleanAttribute, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, numberAttribute, platformCore, provideZoneChangeDetection, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AfterRenderEventManager as ɵAfterRenderEventManager, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG as ɵDEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockState as ɵDeferBlockState, EffectScheduler as ɵEffectScheduler, IMAGE_CONFIG as ɵIMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS as ɵIMAGE_CONFIG_DEFAULTS, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, IS_HYDRATION_DOM_REUSE_ENABLED as ɵIS_HYDRATION_DOM_REUSE_ENABLED, InitialRenderPendingTasks as ɵInitialRenderPendingTasks, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, SSR_CONTENT_INTEGRITY_MARKER as ɵSSR_CONTENT_INTEGRITY_MARKER, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, ZoneAwareQueueingScheduler as ɵZoneAwareQueueingScheduler, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, depsTracker as ɵdepsTracker, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadataFn as ɵgetAsyncClassMetadataFn, getDebugNode as ɵgetDebugNode, getDeferBlocks as ɵgetDeferBlocks, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalAfterNextRender as ɵinternalAfterNextRender, internalCreateApplication as ɵinternalCreateApplication, isBoundToModule as ɵisBoundToModule, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, performanceMarkFeature as ɵperformanceMarkFeature, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, renderDeferBlockState as ɵrenderDeferBlockState, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, restoreComponentResolutionQueue as ɵrestoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl, ɵsetClassDebugInfo, setClassMetadata as ɵsetClassMetadata, setClassMetadataAsync as ɵsetClassMetadataAsync, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setInjectorProfilerContext as ɵsetInjectorProfilerContext, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, triggerResourceLoading as ɵtriggerResourceLoading, truncateMiddle as ɵtruncateMiddle, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenStable as ɵwhenStable, withDomHydration as ɵwithDomHydration, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵInputTransformsFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵcontentQuery, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵvalidateIframeAttribute, ɵɵviewQuery };
35113
+ export { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AfterRenderPhase, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, Renderer2, RendererFactory2, RendererStyleFlags2, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, afterNextRender, afterRender, asNativeElements, assertInInjectionContext, assertNotInReactiveContext, assertPlatform, booleanAttribute, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, numberAttribute, platformCore, provideZoneChangeDetection, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AfterRenderEventManager as ɵAfterRenderEventManager, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, ChangeDetectionScheduler as ɵChangeDetectionScheduler, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG as ɵDEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockState as ɵDeferBlockState, EffectScheduler as ɵEffectScheduler, IMAGE_CONFIG as ɵIMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS as ɵIMAGE_CONFIG_DEFAULTS, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, IS_HYDRATION_DOM_REUSE_ENABLED as ɵIS_HYDRATION_DOM_REUSE_ENABLED, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, PendingTasks as ɵPendingTasks, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, SSR_CONTENT_INTEGRITY_MARKER as ɵSSR_CONTENT_INTEGRITY_MARKER, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, ZoneAwareQueueingScheduler as ɵZoneAwareQueueingScheduler, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, depsTracker as ɵdepsTracker, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadataFn as ɵgetAsyncClassMetadataFn, getDebugNode as ɵgetDebugNode, getDeferBlocks as ɵgetDeferBlocks, getDirectives as ɵgetDirectives, getEnsureDirtyViewsAreAlwaysReachable as ɵgetEnsureDirtyViewsAreAlwaysReachable, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalAfterNextRender as ɵinternalAfterNextRender, internalCreateApplication as ɵinternalCreateApplication, isBoundToModule as ɵisBoundToModule, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, performanceMarkFeature as ɵperformanceMarkFeature, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, renderDeferBlockState as ɵrenderDeferBlockState, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, restoreComponentResolutionQueue as ɵrestoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl, ɵsetClassDebugInfo, setClassMetadata as ɵsetClassMetadata, setClassMetadataAsync as ɵsetClassMetadataAsync, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setEnsureDirtyViewsAreAlwaysReachable as ɵsetEnsureDirtyViewsAreAlwaysReachable, setInjectorProfilerContext as ɵsetInjectorProfilerContext, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, triggerResourceLoading as ɵtriggerResourceLoading, truncateMiddle as ɵtruncateMiddle, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenStable as ɵwhenStable, withDomHydration as ɵwithDomHydration, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵInputTransformsFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵcontentQuery, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵvalidateIframeAttribute, ɵɵviewQuery };
35045
35114
  //# sourceMappingURL=core.mjs.map