@angular/router 14.0.4 → 14.0.7

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 (35) hide show
  1. package/esm2020/src/apply_redirects.mjs +14 -18
  2. package/esm2020/src/components/empty_outlet.mjs +3 -3
  3. package/esm2020/src/create_url_tree.mjs +6 -4
  4. package/esm2020/src/directives/router_link.mjs +6 -6
  5. package/esm2020/src/directives/router_link_active.mjs +3 -3
  6. package/esm2020/src/directives/router_outlet.mjs +10 -9
  7. package/esm2020/src/errors.mjs +2 -0
  8. package/esm2020/src/models.mjs +1 -1
  9. package/esm2020/src/operators/check_guards.mjs +12 -35
  10. package/esm2020/src/page_title_strategy.mjs +11 -5
  11. package/esm2020/src/recognize.mjs +3 -2
  12. package/esm2020/src/router.mjs +12 -10
  13. package/esm2020/src/router_config_loader.mjs +3 -3
  14. package/esm2020/src/router_module.mjs +57 -18
  15. package/esm2020/src/router_preloader.mjs +9 -9
  16. package/esm2020/src/router_scroller.mjs +3 -3
  17. package/esm2020/src/shared.mjs +3 -2
  18. package/esm2020/src/url_tree.mjs +6 -4
  19. package/esm2020/src/utils/config.mjs +17 -17
  20. package/esm2020/src/version.mjs +1 -1
  21. package/esm2020/testing/src/router_testing_module.mjs +10 -12
  22. package/fesm2015/router.mjs +153 -132
  23. package/fesm2015/router.mjs.map +1 -1
  24. package/fesm2015/testing.mjs +10 -12
  25. package/fesm2015/testing.mjs.map +1 -1
  26. package/fesm2015/upgrade.mjs +1 -1
  27. package/fesm2020/router.mjs +153 -132
  28. package/fesm2020/router.mjs.map +1 -1
  29. package/fesm2020/testing.mjs +10 -12
  30. package/fesm2020/testing.mjs.map +1 -1
  31. package/fesm2020/upgrade.mjs +1 -1
  32. package/index.d.ts +17 -3
  33. package/package.json +4 -4
  34. package/testing/index.d.ts +2 -3
  35. package/upgrade/index.d.ts +1 -1
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Angular v14.0.4
2
+ * @license Angular v14.0.7
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import * as i0 from '@angular/core';
8
- import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, InjectionToken, InjectFlags, NgModuleFactory, Injectable, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, Inject, ApplicationRef, ENVIRONMENT_INITIALIZER, Version } from '@angular/core';
8
+ import { ɵisObservable, ɵisPromise, ɵRuntimeError, EventEmitter, Directive, Attribute, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, InjectionToken, InjectFlags, NgModuleFactory, Injectable, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, inject, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, Inject, ApplicationRef, ENVIRONMENT_INITIALIZER, Version } from '@angular/core';
9
9
  import { from, of, BehaviorSubject, combineLatest, throwError, EmptyError, concat, defer, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
10
10
  import { map, switchMap, take, startWith, scan, filter, catchError, concatMap, last as last$1, first, mergeMap, tap, takeLast, mapTo, finalize, refCount, defaultIfEmpty, mergeAll } from 'rxjs/operators';
11
11
  import * as i3 from '@angular/common';
@@ -520,9 +520,10 @@ class ParamsAsMap {
520
520
  function convertToParamMap(params) {
521
521
  return new ParamsAsMap(params);
522
522
  }
523
+ const REDIRECTING_CANCELLATION_REASON = 'Redirecting to ';
523
524
  const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
524
525
  function navigationCancelingError(message) {
525
- const error = Error('NavigationCancelingError: ' + message);
526
+ const error = Error('NavigationCancelingError: ' + (message || ''));
526
527
  error[NAVIGATION_CANCELING_ERROR] = true;
527
528
  return error;
528
529
  }
@@ -651,6 +652,7 @@ function wrapIntoObservable(value) {
651
652
  * Use of this source code is governed by an MIT-style license that can be
652
653
  * found in the LICENSE file at https://angular.io/license
653
654
  */
655
+ const NG_DEV_MODE$7 = typeof ngDevMode === 'undefined' || ngDevMode;
654
656
  function createEmptyUrlTree() {
655
657
  return new UrlTree(new UrlSegmentGroup([], {}), {}, null);
656
658
  }
@@ -1115,7 +1117,7 @@ class UrlParser {
1115
1117
  parseSegment() {
1116
1118
  const path = matchSegments(this.remaining);
1117
1119
  if (path === '' && this.peekStartsWith(';')) {
1118
- throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);
1120
+ throw new ɵRuntimeError(4009 /* RuntimeErrorCode.EMPTY_PATH_WITH_PARAMS */, NG_DEV_MODE$7 && `Empty path url segment cannot have parameters: '${this.remaining}'.`);
1119
1121
  }
1120
1122
  this.capture(path);
1121
1123
  return new UrlSegment(decode(path), this.parseMatrixParams());
@@ -1184,7 +1186,7 @@ class UrlParser {
1184
1186
  // if is is not one of these characters, then the segment was unescaped
1185
1187
  // or the group was not closed
1186
1188
  if (next !== '/' && next !== ')' && next !== ';') {
1187
- throw new Error(`Cannot parse url '${this.url}'`);
1189
+ throw new ɵRuntimeError(4010 /* RuntimeErrorCode.UNPARSABLE_URL */, NG_DEV_MODE$7 && `Cannot parse url '${this.url}'`);
1188
1190
  }
1189
1191
  let outletName = undefined;
1190
1192
  if (path.indexOf(':') > -1) {
@@ -1215,7 +1217,7 @@ class UrlParser {
1215
1217
  }
1216
1218
  capture(str) {
1217
1219
  if (!this.consumeOptional(str)) {
1218
- throw new Error(`Expected "${str}".`);
1220
+ throw new ɵRuntimeError(4011 /* RuntimeErrorCode.UNEXPECTED_VALUE_IN_URL */, NG_DEV_MODE$7 && `Expected "${str}".`);
1219
1221
  }
1220
1222
  }
1221
1223
  }
@@ -1769,6 +1771,7 @@ function createActivatedRoute(c) {
1769
1771
  * Use of this source code is governed by an MIT-style license that can be
1770
1772
  * found in the LICENSE file at https://angular.io/license
1771
1773
  */
1774
+ const NG_DEV_MODE$6 = typeof ngDevMode === 'undefined' || ngDevMode;
1772
1775
  function createUrlTree(route, urlTree, commands, queryParams, fragment) {
1773
1776
  var _a, _b;
1774
1777
  if (commands.length === 0) {
@@ -1841,11 +1844,11 @@ class Navigation {
1841
1844
  this.numberOfDoubleDots = numberOfDoubleDots;
1842
1845
  this.commands = commands;
1843
1846
  if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {
1844
- throw new Error('Root segment cannot have matrix parameters');
1847
+ throw new ɵRuntimeError(4003 /* RuntimeErrorCode.ROOT_SEGMENT_MATRIX_PARAMS */, NG_DEV_MODE$6 && 'Root segment cannot have matrix parameters');
1845
1848
  }
1846
1849
  const cmdWithOutlet = commands.find(isCommandWithOutlets);
1847
1850
  if (cmdWithOutlet && cmdWithOutlet !== last(commands)) {
1848
- throw new Error('{outlets:{}} has to be the last command');
1851
+ throw new ɵRuntimeError(4004 /* RuntimeErrorCode.MISPLACED_OUTLETS_COMMAND */, NG_DEV_MODE$6 && '{outlets:{}} has to be the last command');
1849
1852
  }
1850
1853
  }
1851
1854
  toRoot() {
@@ -1926,7 +1929,7 @@ function createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) {
1926
1929
  dd -= ci;
1927
1930
  g = g.parent;
1928
1931
  if (!g) {
1929
- throw new Error('Invalid number of \'../\'');
1932
+ throw new ɵRuntimeError(4005 /* RuntimeErrorCode.INVALID_DOUBLE_DOTS */, NG_DEV_MODE$6 && 'Invalid number of \'../\'');
1930
1933
  }
1931
1934
  ci = g.segments.length;
1932
1935
  }
@@ -2158,6 +2161,7 @@ class ChildrenOutletContexts {
2158
2161
  * Use of this source code is governed by an MIT-style license that can be
2159
2162
  * found in the LICENSE file at https://angular.io/license
2160
2163
  */
2164
+ const NG_DEV_MODE$5 = typeof ngDevMode === 'undefined' || ngDevMode;
2161
2165
  /**
2162
2166
  * @description
2163
2167
  *
@@ -2267,12 +2271,12 @@ class RouterOutlet {
2267
2271
  */
2268
2272
  get component() {
2269
2273
  if (!this.activated)
2270
- throw new Error('Outlet is not activated');
2274
+ throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$5 && 'Outlet is not activated');
2271
2275
  return this.activated.instance;
2272
2276
  }
2273
2277
  get activatedRoute() {
2274
2278
  if (!this.activated)
2275
- throw new Error('Outlet is not activated');
2279
+ throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$5 && 'Outlet is not activated');
2276
2280
  return this._activatedRoute;
2277
2281
  }
2278
2282
  get activatedRouteData() {
@@ -2286,7 +2290,7 @@ class RouterOutlet {
2286
2290
  */
2287
2291
  detach() {
2288
2292
  if (!this.activated)
2289
- throw new Error('Outlet is not activated');
2293
+ throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$5 && 'Outlet is not activated');
2290
2294
  this.location.detach();
2291
2295
  const cmp = this.activated;
2292
2296
  this.activated = null;
@@ -2314,7 +2318,7 @@ class RouterOutlet {
2314
2318
  }
2315
2319
  activateWith(activatedRoute, resolverOrInjector) {
2316
2320
  if (this.isActivated) {
2317
- throw new Error('Cannot activate an already activated outlet');
2321
+ throw new ɵRuntimeError(4013 /* RuntimeErrorCode.OUTLET_ALREADY_ACTIVATED */, NG_DEV_MODE$5 && 'Cannot activate an already activated outlet');
2318
2322
  }
2319
2323
  this._activatedRoute = activatedRoute;
2320
2324
  const location = this.location;
@@ -2336,9 +2340,9 @@ class RouterOutlet {
2336
2340
  this.activateEvents.emit(this.activated.instance);
2337
2341
  }
2338
2342
  }
2339
- RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
2340
- RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.4", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
2341
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterOutlet, decorators: [{
2343
+ RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
2344
+ RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
2345
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterOutlet, decorators: [{
2342
2346
  type: Directive,
2343
2347
  args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
2344
2348
  }], ctorParameters: function () {
@@ -2397,9 +2401,9 @@ function isComponentFactoryResolver(item) {
2397
2401
  */
2398
2402
  class ɵEmptyOutletComponent {
2399
2403
  }
2400
- ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2401
- ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: ɵEmptyOutletComponent, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
2402
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
2404
+ ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2405
+ ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: ɵEmptyOutletComponent, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
2406
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
2403
2407
  type: Component,
2404
2408
  args: [{ template: `<router-outlet></router-outlet>` }]
2405
2409
  }] });
@@ -2449,13 +2453,13 @@ function validateConfig(config, parentPath = '', requireStandaloneComponents = f
2449
2453
  }
2450
2454
  function assertStandalone(fullPath, component) {
2451
2455
  if (component && !ɵisStandalone(component)) {
2452
- throw new Error(`Invalid configuration of route '${fullPath}'. The component must be standalone.`);
2456
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}'. The component must be standalone.`);
2453
2457
  }
2454
2458
  }
2455
2459
  function validateNode(route, fullPath, requireStandaloneComponents) {
2456
2460
  if (typeof ngDevMode === 'undefined' || ngDevMode) {
2457
2461
  if (!route) {
2458
- throw new Error(`
2462
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `
2459
2463
  Invalid configuration of route '${fullPath}': Encountered undefined route.
2460
2464
  The reason might be an extra comma.
2461
2465
 
@@ -2468,47 +2472,47 @@ function validateNode(route, fullPath, requireStandaloneComponents) {
2468
2472
  `);
2469
2473
  }
2470
2474
  if (Array.isArray(route)) {
2471
- throw new Error(`Invalid configuration of route '${fullPath}': Array cannot be specified`);
2475
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': Array cannot be specified`);
2472
2476
  }
2473
2477
  if (!route.component && !route.loadComponent && !route.children && !route.loadChildren &&
2474
2478
  (route.outlet && route.outlet !== PRIMARY_OUTLET)) {
2475
- throw new Error(`Invalid configuration of route '${fullPath}': a componentless route without children or loadChildren cannot have a named outlet set`);
2479
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': a componentless route without children or loadChildren cannot have a named outlet set`);
2476
2480
  }
2477
2481
  if (route.redirectTo && route.children) {
2478
- throw new Error(`Invalid configuration of route '${fullPath}': redirectTo and children cannot be used together`);
2482
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and children cannot be used together`);
2479
2483
  }
2480
2484
  if (route.redirectTo && route.loadChildren) {
2481
- throw new Error(`Invalid configuration of route '${fullPath}': redirectTo and loadChildren cannot be used together`);
2485
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and loadChildren cannot be used together`);
2482
2486
  }
2483
2487
  if (route.children && route.loadChildren) {
2484
- throw new Error(`Invalid configuration of route '${fullPath}': children and loadChildren cannot be used together`);
2488
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': children and loadChildren cannot be used together`);
2485
2489
  }
2486
2490
  if (route.redirectTo && (route.component || route.loadComponent)) {
2487
- throw new Error(`Invalid configuration of route '${fullPath}': redirectTo and component/loadComponent cannot be used together`);
2491
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and component/loadComponent cannot be used together`);
2488
2492
  }
2489
2493
  if (route.component && route.loadComponent) {
2490
- throw new Error(`Invalid configuration of route '${fullPath}': component and loadComponent cannot be used together`);
2494
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': component and loadComponent cannot be used together`);
2491
2495
  }
2492
2496
  if (route.redirectTo && route.canActivate) {
2493
- throw new Error(`Invalid configuration of route '${fullPath}': redirectTo and canActivate cannot be used together. Redirects happen before activation ` +
2497
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and canActivate cannot be used together. Redirects happen before activation ` +
2494
2498
  `so canActivate will never be executed.`);
2495
2499
  }
2496
2500
  if (route.path && route.matcher) {
2497
- throw new Error(`Invalid configuration of route '${fullPath}': path and matcher cannot be used together`);
2501
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': path and matcher cannot be used together`);
2498
2502
  }
2499
2503
  if (route.redirectTo === void 0 && !route.component && !route.loadComponent &&
2500
2504
  !route.children && !route.loadChildren) {
2501
- throw new Error(`Invalid configuration of route '${fullPath}'. One of the following must be provided: component, loadComponent, redirectTo, children or loadChildren`);
2505
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}'. One of the following must be provided: component, loadComponent, redirectTo, children or loadChildren`);
2502
2506
  }
2503
2507
  if (route.path === void 0 && route.matcher === void 0) {
2504
- throw new Error(`Invalid configuration of route '${fullPath}': routes must have either a path or a matcher specified`);
2508
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': routes must have either a path or a matcher specified`);
2505
2509
  }
2506
2510
  if (typeof route.path === 'string' && route.path.charAt(0) === '/') {
2507
- throw new Error(`Invalid configuration of route '${fullPath}': path cannot start with a slash`);
2511
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': path cannot start with a slash`);
2508
2512
  }
2509
2513
  if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) {
2510
2514
  const exp = `The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`;
2511
- throw new Error(`Invalid configuration of route '{path: "${fullPath}", redirectTo: "${route.redirectTo}"}': please provide 'pathMatch'. ${exp}`);
2515
+ throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '{path: "${fullPath}", redirectTo: "${route.redirectTo}"}': please provide 'pathMatch'. ${exp}`);
2512
2516
  }
2513
2517
  if (requireStandaloneComponents) {
2514
2518
  assertStandalone(fullPath, route.component);
@@ -3004,6 +3008,7 @@ function noLeftoversInUrl(segmentGroup, segments, outlet) {
3004
3008
  * Use of this source code is governed by an MIT-style license that can be
3005
3009
  * found in the LICENSE file at https://angular.io/license
3006
3010
  */
3011
+ const NG_DEV_MODE$4 = typeof ngDevMode === 'undefined' || ngDevMode;
3007
3012
  class NoMatch$1 {
3008
3013
  constructor(segmentGroup) {
3009
3014
  this.segmentGroup = segmentGroup || null;
@@ -3021,10 +3026,12 @@ function absoluteRedirect(newTree) {
3021
3026
  return throwError(new AbsoluteRedirect(newTree));
3022
3027
  }
3023
3028
  function namedOutletsRedirect(redirectTo) {
3024
- return throwError(new Error(`Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`));
3029
+ return throwError(new ɵRuntimeError(4000 /* RuntimeErrorCode.NAMED_OUTLET_REDIRECT */, NG_DEV_MODE$4 &&
3030
+ `Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`));
3025
3031
  }
3026
3032
  function canLoadFails(route) {
3027
- return throwError(navigationCancelingError(`Cannot load children because the guard of the route "path: '${route.path}'" returned false`));
3033
+ return throwError(navigationCancelingError(NG_DEV_MODE$4 &&
3034
+ `Cannot load children because the guard of the route "path: '${route.path}'" returned false`));
3028
3035
  }
3029
3036
  /**
3030
3037
  * Returns the `UrlTree` with the redirection applied.
@@ -3083,7 +3090,7 @@ class ApplyRedirects {
3083
3090
  }));
3084
3091
  }
3085
3092
  noMatchError(e) {
3086
- return new Error(`Cannot match any routes. URL Segment: '${e.segmentGroup}'`);
3093
+ return new ɵRuntimeError(4002 /* RuntimeErrorCode.NO_MATCH */, NG_DEV_MODE$4 && `Cannot match any routes. URL Segment: '${e.segmentGroup}'`);
3087
3094
  }
3088
3095
  createUrlTree(rootCandidate, queryParams, fragment) {
3089
3096
  const root = rootCandidate.segments.length > 0 ?
@@ -3255,23 +3262,14 @@ class ApplyRedirects {
3255
3262
  return of(true);
3256
3263
  const canLoadObservables = canLoad.map((injectionToken) => {
3257
3264
  const guard = injector.get(injectionToken);
3258
- let guardVal;
3259
- if (isCanLoad(guard)) {
3260
- guardVal = guard.canLoad(route, segments);
3261
- }
3262
- else if (isFunction(guard)) {
3263
- guardVal = guard(route, segments);
3264
- }
3265
- else {
3266
- throw new Error('Invalid CanLoad guard');
3267
- }
3265
+ const guardVal = isCanLoad(guard) ? guard.canLoad(route, segments) : guard(route, segments);
3268
3266
  return wrapIntoObservable(guardVal);
3269
3267
  });
3270
3268
  return of(canLoadObservables)
3271
3269
  .pipe(prioritizedGuardValue(), tap((result) => {
3272
3270
  if (!isUrlTree(result))
3273
3271
  return;
3274
- const error = navigationCancelingError(`Redirecting to "${this.urlSerializer.serialize(result)}"`);
3272
+ const error = navigationCancelingError(REDIRECTING_CANCELLATION_REASON + this.urlSerializer.serialize(result));
3275
3273
  error.url = result;
3276
3274
  throw error;
3277
3275
  }), map(result => result === true));
@@ -3326,7 +3324,8 @@ class ApplyRedirects {
3326
3324
  findPosParam(redirectTo, redirectToUrlSegment, posParams) {
3327
3325
  const pos = posParams[redirectToUrlSegment.path.substring(1)];
3328
3326
  if (!pos)
3329
- throw new Error(`Cannot redirect to '${redirectTo}'. Cannot find '${redirectToUrlSegment.path}'.`);
3327
+ throw new ɵRuntimeError(4001 /* RuntimeErrorCode.MISSING_REDIRECT */, NG_DEV_MODE$4 &&
3328
+ `Cannot redirect to '${redirectTo}'. Cannot find '${redirectToUrlSegment.path}'.`);
3330
3329
  return pos;
3331
3330
  }
3332
3331
  findOrReturn(redirectToUrlSegment, actualSegments) {
@@ -3595,17 +3594,9 @@ function runCanActivate(futureRSS, futureARS, moduleInjector) {
3595
3594
  const canActivateObservables = canActivate.map((c) => {
3596
3595
  return defer(() => {
3597
3596
  const guard = getToken(c, futureARS, moduleInjector);
3598
- let observable;
3599
- if (isCanActivate(guard)) {
3600
- observable = wrapIntoObservable(guard.canActivate(futureARS, futureRSS));
3601
- }
3602
- else if (isFunction(guard)) {
3603
- observable = wrapIntoObservable(guard(futureARS, futureRSS));
3604
- }
3605
- else {
3606
- throw new Error('Invalid CanActivate guard');
3607
- }
3608
- return observable.pipe(first());
3597
+ const guardVal = isCanActivate(guard) ? guard.canActivate(futureARS, futureRSS) :
3598
+ guard(futureARS, futureRSS);
3599
+ return wrapIntoObservable(guardVal).pipe(first());
3609
3600
  });
3610
3601
  });
3611
3602
  return of(canActivateObservables).pipe(prioritizedGuardValue());
@@ -3620,17 +3611,9 @@ function runCanActivateChild(futureRSS, path, moduleInjector) {
3620
3611
  return defer(() => {
3621
3612
  const guardsMapped = d.guards.map((c) => {
3622
3613
  const guard = getToken(c, d.node, moduleInjector);
3623
- let observable;
3624
- if (isCanActivateChild(guard)) {
3625
- observable = wrapIntoObservable(guard.canActivateChild(futureARS, futureRSS));
3626
- }
3627
- else if (isFunction(guard)) {
3628
- observable = wrapIntoObservable(guard(futureARS, futureRSS));
3629
- }
3630
- else {
3631
- throw new Error('Invalid CanActivateChild guard');
3632
- }
3633
- return observable.pipe(first());
3614
+ const guardVal = isCanActivateChild(guard) ? guard.canActivateChild(futureARS, futureRSS) :
3615
+ guard(futureARS, futureRSS);
3616
+ return wrapIntoObservable(guardVal).pipe(first());
3634
3617
  });
3635
3618
  return of(guardsMapped).pipe(prioritizedGuardValue());
3636
3619
  });
@@ -3643,17 +3626,10 @@ function runCanDeactivate(component, currARS, currRSS, futureRSS, moduleInjector
3643
3626
  return of(true);
3644
3627
  const canDeactivateObservables = canDeactivate.map((c) => {
3645
3628
  const guard = getToken(c, currARS, moduleInjector);
3646
- let observable;
3647
- if (isCanDeactivate(guard)) {
3648
- observable = wrapIntoObservable(guard.canDeactivate(component, currARS, currRSS, futureRSS));
3649
- }
3650
- else if (isFunction(guard)) {
3651
- observable = wrapIntoObservable(guard(component, currARS, currRSS, futureRSS));
3652
- }
3653
- else {
3654
- throw new Error('Invalid CanDeactivate guard');
3655
- }
3656
- return observable.pipe(first());
3629
+ const guardVal = isCanDeactivate(guard) ?
3630
+ guard.canDeactivate(component, currARS, currRSS, futureRSS) :
3631
+ guard(component, currARS, currRSS, futureRSS);
3632
+ return wrapIntoObservable(guardVal).pipe(first());
3657
3633
  });
3658
3634
  return of(canDeactivateObservables).pipe(prioritizedGuardValue());
3659
3635
  }
@@ -3895,7 +3871,7 @@ function checkOutletNameUniqueness(nodes) {
3895
3871
  if (routeWithSameOutletName) {
3896
3872
  const p = routeWithSameOutletName.url.map(s => s.toString()).join('/');
3897
3873
  const c = n.value.url.map(s => s.toString()).join('/');
3898
- throw new Error(`Two segments cannot have the same outlet name: '${p}' and '${c}'.`);
3874
+ throw new ɵRuntimeError(4006 /* RuntimeErrorCode.TWO_SEGMENTS_WITH_SAME_OUTLET */, NG_DEV_MODE$3 && `Two segments cannot have the same outlet name: '${p}' and '${c}'.`);
3899
3875
  }
3900
3876
  names[n.value.outlet] = n.value;
3901
3877
  });
@@ -4204,9 +4180,9 @@ class RouterConfigLoader {
4204
4180
  }));
4205
4181
  }
4206
4182
  }
4207
- RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
4208
- RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterConfigLoader });
4209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterConfigLoader, decorators: [{
4183
+ RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
4184
+ RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterConfigLoader });
4185
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterConfigLoader, decorators: [{
4210
4186
  type: Injectable
4211
4187
  }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
4212
4188
 
@@ -4294,6 +4270,7 @@ class Router {
4294
4270
  this.lastSuccessfulNavigation = null;
4295
4271
  this.currentNavigation = null;
4296
4272
  this.disposed = false;
4273
+ /** @internal */
4297
4274
  this.navigationId = 0;
4298
4275
  /**
4299
4276
  * The id of the currently active page in the router.
@@ -4555,7 +4532,8 @@ class Router {
4555
4532
  this.triggerEvent(guardsStart);
4556
4533
  }), map(t => (Object.assign(Object.assign({}, t), { guards: getAllRouteGuards(t.targetSnapshot, t.currentSnapshot, this.rootContexts) }))), checkGuards(this.ngModule.injector, (evt) => this.triggerEvent(evt)), tap(t => {
4557
4534
  if (isUrlTree(t.guardsResult)) {
4558
- const error = navigationCancelingError(`Redirecting to "${this.serializeUrl(t.guardsResult)}"`);
4535
+ const error = navigationCancelingError(REDIRECTING_CANCELLATION_REASON +
4536
+ `"${this.serializeUrl(t.guardsResult)}"`);
4559
4537
  error.url = t.guardsResult;
4560
4538
  throw error;
4561
4539
  }
@@ -4592,7 +4570,7 @@ class Router {
4592
4570
  }));
4593
4571
  }
4594
4572
  return undefined;
4595
- }), switchTap(() => this.afterPreactivation()),
4573
+ }),
4596
4574
  // --- LOAD COMPONENTS ---
4597
4575
  switchTap((t) => {
4598
4576
  const loadComponents = (route) => {
@@ -4612,7 +4590,7 @@ class Router {
4612
4590
  };
4613
4591
  return combineLatest(loadComponents(t.targetSnapshot.root))
4614
4592
  .pipe(defaultIfEmpty(), take(1));
4615
- }), map((t) => {
4593
+ }), switchTap(() => this.afterPreactivation()), map((t) => {
4616
4594
  const targetRouterState = createRouterState(this.routeReuseStrategy, t.targetSnapshot, t.currentRouterState);
4617
4595
  return (Object.assign(Object.assign({}, t), { targetRouterState }));
4618
4596
  }),
@@ -5170,16 +5148,16 @@ class Router {
5170
5148
  return { navigationId };
5171
5149
  }
5172
5150
  }
5173
- Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
5174
- Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Router });
5175
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Router, decorators: [{
5151
+ Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
5152
+ Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: Router });
5153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: Router, decorators: [{
5176
5154
  type: Injectable
5177
5155
  }], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
5178
5156
  function validateCommands(commands) {
5179
5157
  for (let i = 0; i < commands.length; i++) {
5180
5158
  const cmd = commands[i];
5181
5159
  if (cmd == null) {
5182
- throw new Error(`The requested path contains ${cmd} segment at index ${i}`);
5160
+ throw new ɵRuntimeError(4008 /* RuntimeErrorCode.NULLISH_COMMAND */, NG_DEV_MODE$1 && `The requested path contains ${cmd} segment at index ${i}`);
5183
5161
  }
5184
5162
  }
5185
5163
  }
@@ -5364,9 +5342,9 @@ class RouterLink {
5364
5342
  });
5365
5343
  }
5366
5344
  }
5367
- RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
5368
- RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.4", type: RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: { queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick()" } }, usesOnChanges: true, ngImport: i0 });
5369
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterLink, decorators: [{
5345
+ RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
5346
+ RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: { queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick()" } }, usesOnChanges: true, ngImport: i0 });
5347
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterLink, decorators: [{
5370
5348
  type: Directive,
5371
5349
  args: [{ selector: ':not(a):not(area)[routerLink]' }]
5372
5350
  }], ctorParameters: function () {
@@ -5485,9 +5463,9 @@ class RouterLinkWithHref {
5485
5463
  });
5486
5464
  }
5487
5465
  }
5488
- RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
5489
- RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.4", type: RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target", "attr.href": "this.href" } }, usesOnChanges: true, ngImport: i0 });
5490
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterLinkWithHref, decorators: [{
5466
+ RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
5467
+ RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target", "attr.href": "this.href" } }, usesOnChanges: true, ngImport: i0 });
5468
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterLinkWithHref, decorators: [{
5491
5469
  type: Directive,
5492
5470
  args: [{ selector: 'a[routerLink],area[routerLink]' }]
5493
5471
  }], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
@@ -5714,9 +5692,9 @@ class RouterLinkActive {
5714
5692
  this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
5715
5693
  }
5716
5694
  }
5717
- RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }, { token: RouterLinkWithHref, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
5718
- RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.4", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }, { propertyName: "linksWithHrefs", predicate: RouterLinkWithHref, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
5719
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterLinkActive, decorators: [{
5695
+ RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }, { token: RouterLinkWithHref, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
5696
+ RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }, { propertyName: "linksWithHrefs", predicate: RouterLinkWithHref, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
5697
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterLinkActive, decorators: [{
5720
5698
  type: Directive,
5721
5699
  args: [{
5722
5700
  selector: '[routerLinkActive]',
@@ -5802,6 +5780,12 @@ class TitleStrategy {
5802
5780
  return snapshot.data[RouteTitle];
5803
5781
  }
5804
5782
  }
5783
+ TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5784
+ TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) });
5785
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TitleStrategy, decorators: [{
5786
+ type: Injectable,
5787
+ args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
5788
+ }] });
5805
5789
  /**
5806
5790
  * The default `TitleStrategy` used by the router that updates the title using the `Title` service.
5807
5791
  */
@@ -5822,9 +5806,9 @@ class DefaultTitleStrategy extends TitleStrategy {
5822
5806
  }
5823
5807
  }
5824
5808
  }
5825
- DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
5826
- DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
5827
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
5809
+ DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
5810
+ DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
5811
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
5828
5812
  type: Injectable,
5829
5813
  args: [{ providedIn: 'root' }]
5830
5814
  }], ctorParameters: function () { return [{ type: i1.Title }]; } });
@@ -5861,9 +5845,9 @@ class PreloadAllModules {
5861
5845
  return fn().pipe(catchError(() => of(null)));
5862
5846
  }
5863
5847
  }
5864
- PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5865
- PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
5866
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: PreloadAllModules, decorators: [{
5848
+ PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5849
+ PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
5850
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: PreloadAllModules, decorators: [{
5867
5851
  type: Injectable,
5868
5852
  args: [{ providedIn: 'root' }]
5869
5853
  }] });
@@ -5881,9 +5865,9 @@ class NoPreloading {
5881
5865
  return of(null);
5882
5866
  }
5883
5867
  }
5884
- NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5885
- NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: NoPreloading, providedIn: 'root' });
5886
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: NoPreloading, decorators: [{
5868
+ NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5869
+ NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: NoPreloading, providedIn: 'root' });
5870
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: NoPreloading, decorators: [{
5887
5871
  type: Injectable,
5888
5872
  args: [{ providedIn: 'root' }]
5889
5873
  }] });
@@ -5971,9 +5955,9 @@ class RouterPreloader {
5971
5955
  });
5972
5956
  }
5973
5957
  }
5974
- RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
5975
- RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterPreloader });
5976
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterPreloader, decorators: [{
5958
+ RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
5959
+ RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterPreloader });
5960
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterPreloader, decorators: [{
5977
5961
  type: Injectable
5978
5962
  }], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
5979
5963
 
@@ -6053,9 +6037,9 @@ class RouterScroller {
6053
6037
  }
6054
6038
  }
6055
6039
  }
6056
- RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
6057
- RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterScroller });
6058
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterScroller, decorators: [{
6040
+ RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
6041
+ RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterScroller });
6042
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterScroller, decorators: [{
6059
6043
  type: Injectable
6060
6044
  }], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
6061
6045
 
@@ -6092,9 +6076,9 @@ const ROUTER_PROVIDERS = [
6092
6076
  provide: Router,
6093
6077
  useFactory: setupRouter,
6094
6078
  deps: [
6095
- UrlSerializer, ChildrenOutletContexts, Location, Injector, Compiler, ROUTES,
6096
- ROUTER_CONFIGURATION, DefaultTitleStrategy, [TitleStrategy, new Optional()],
6097
- [UrlHandlingStrategy, new Optional()], [RouteReuseStrategy, new Optional()]
6079
+ UrlSerializer, ChildrenOutletContexts, Location, Injector, Compiler, ROUTES, TitleStrategy,
6080
+ ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()],
6081
+ [RouteReuseStrategy, new Optional()]
6098
6082
  ]
6099
6083
  },
6100
6084
  ChildrenOutletContexts,
@@ -6188,10 +6172,10 @@ class RouterModule {
6188
6172
  return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
6189
6173
  }
6190
6174
  }
6191
- RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
6192
- RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.4", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
6193
- RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterModule });
6194
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: RouterModule, decorators: [{
6175
+ RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
6176
+ RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
6177
+ RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterModule });
6178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterModule, decorators: [{
6195
6179
  type: NgModule,
6196
6180
  args: [{
6197
6181
  declarations: ROUTER_DIRECTIVES,
@@ -6229,7 +6213,7 @@ function providePathLocationStrategy() {
6229
6213
  }
6230
6214
  function provideForRootGuard(router) {
6231
6215
  if (NG_DEV_MODE && router) {
6232
- throw new Error(`RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.`);
6216
+ throw new ɵRuntimeError(4007 /* RuntimeErrorCode.FOR_ROOT_CALLED_TWICE */, `RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.`);
6233
6217
  }
6234
6218
  return 'guarded';
6235
6219
  }
@@ -6255,7 +6239,7 @@ function provideRoutes(routes) {
6255
6239
  { provide: ROUTES, multi: true, useValue: routes },
6256
6240
  ];
6257
6241
  }
6258
- function setupRouter(urlSerializer, contexts, location, injector, compiler, config, opts = {}, defaultTitleStrategy, titleStrategy, urlHandlingStrategy, routeReuseStrategy) {
6242
+ function setupRouter(urlSerializer, contexts, location, injector, compiler, config, titleStrategy, opts = {}, urlHandlingStrategy, routeReuseStrategy) {
6259
6243
  const router = new Router(null, urlSerializer, contexts, location, injector, compiler, flatten(config));
6260
6244
  if (urlHandlingStrategy) {
6261
6245
  router.urlHandlingStrategy = urlHandlingStrategy;
@@ -6263,7 +6247,7 @@ function setupRouter(urlSerializer, contexts, location, injector, compiler, conf
6263
6247
  if (routeReuseStrategy) {
6264
6248
  router.routeReuseStrategy = routeReuseStrategy;
6265
6249
  }
6266
- router.titleStrategy = titleStrategy !== null && titleStrategy !== void 0 ? titleStrategy : defaultTitleStrategy;
6250
+ router.titleStrategy = titleStrategy;
6267
6251
  assignExtraOptionsToRouter(opts, router);
6268
6252
  return router;
6269
6253
  }
@@ -6356,17 +6340,54 @@ function provideEnabledBlockingInitialNavigation() {
6356
6340
  useFactory: (injector) => {
6357
6341
  const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
6358
6342
  let initNavigation = false;
6343
+ /**
6344
+ * Performs the given action once the router finishes its next/current navigation.
6345
+ *
6346
+ * If the navigation is canceled or errors without a redirect, the navigation is considered
6347
+ * complete. If the `NavigationEnd` event emits, the navigation is also considered complete.
6348
+ */
6349
+ function afterNextNavigation(action) {
6350
+ const router = injector.get(Router);
6351
+ router.events
6352
+ .pipe(filter((e) => e instanceof NavigationEnd || e instanceof NavigationCancel ||
6353
+ e instanceof NavigationError), map(e => {
6354
+ if (e instanceof NavigationEnd) {
6355
+ // Navigation assumed to succeed if we get `ActivationStart`
6356
+ return true;
6357
+ }
6358
+ const newNavigationStarted = router.navigationId !== e.id;
6359
+ // TODO(atscott): Do not rely on the string reason to determine if cancelation
6360
+ // is redirecting
6361
+ const redirectingWithUrlTree = e instanceof NavigationCancel ?
6362
+ e.reason.indexOf(REDIRECTING_CANCELLATION_REASON) !== -1 :
6363
+ false;
6364
+ // Navigation failed, but if we already have a new navigation, wait for the
6365
+ // result of that one instead.
6366
+ return newNavigationStarted || redirectingWithUrlTree ? null : false;
6367
+ }), filter((result) => result !== null), take(1))
6368
+ .subscribe(() => {
6369
+ action();
6370
+ });
6371
+ }
6359
6372
  return () => {
6360
6373
  return locationInitialized.then(() => {
6361
6374
  return new Promise(resolve => {
6362
6375
  const router = injector.get(Router);
6363
6376
  const bootstrapDone = injector.get(BOOTSTRAP_DONE);
6377
+ afterNextNavigation(() => {
6378
+ // Unblock APP_INITIALIZER in case the initial navigation was canceled or errored
6379
+ // without a redirect.
6380
+ resolve(true);
6381
+ initNavigation = true;
6382
+ });
6364
6383
  router.afterPreactivation = () => {
6365
- // only the initial navigation should be delayed
6384
+ // Unblock APP_INITIALIZER once we get to `afterPreactivation`. At this point, we
6385
+ // assume activation will complete successfully (even though this is not
6386
+ // guaranteed).
6387
+ resolve(true);
6388
+ // only the initial navigation should be delayed until bootstrapping is done.
6366
6389
  if (!initNavigation) {
6367
- initNavigation = true;
6368
- resolve(true);
6369
- return bootstrapDone;
6390
+ return bootstrapDone.closed ? of(void 0) : bootstrapDone;
6370
6391
  // subsequent navigations should not be delayed
6371
6392
  }
6372
6393
  else {
@@ -6438,7 +6459,7 @@ function providePreloading(preloadingStrategy) {
6438
6459
  /**
6439
6460
  * @publicApi
6440
6461
  */
6441
- const VERSION = new Version('14.0.4');
6462
+ const VERSION = new Version('14.0.7');
6442
6463
 
6443
6464
  /**
6444
6465
  * @license