{"version":3,"file":"router.js","sources":["../../../../../../packages/router/src/events.ts","../../../../../../packages/router/src/shared.ts","../../../../../../packages/router/src/utils/collection.ts","../../../../../../packages/router/src/url_tree.ts","../../../../../../packages/router/src/utils/tree.ts","../../../../../../packages/router/src/router_state.ts","../../../../../../packages/router/src/create_router_state.ts","../../../../../../packages/router/src/create_url_tree.ts","../../../../../../packages/router/src/operators/activate_routes.ts","../../../../../../packages/router/src/config.ts","../../../../../../packages/router/src/utils/type_guards.ts","../../../../../../packages/router/src/operators/prioritized_guard_value.ts","../../../../../../packages/router/src/components/empty_outlet.ts","../../../../../../packages/router/src/utils/config.ts","../../../../../../packages/router/src/utils/config_matching.ts","../../../../../../packages/router/src/apply_redirects.ts","../../../../../../packages/router/src/operators/apply_redirects.ts","../../../../../../packages/router/src/utils/preactivation.ts","../../../../../../packages/router/src/operators/check_guards.ts","../../../../../../packages/router/src/recognize.ts","../../../../../../packages/router/src/operators/recognize.ts","../../../../../../packages/router/src/operators/resolve_data.ts","../../../../../../packages/router/src/operators/switch_tap.ts","../../../../../../packages/router/src/route_reuse_strategy.ts","../../../../../../packages/router/src/router_config_loader.ts","../../../../../../packages/router/src/router_outlet_context.ts","../../../../../../packages/router/src/url_handling_strategy.ts","../../../../../../packages/router/src/router.ts","../../../../../../packages/router/src/directives/router_link.ts","../../../../../../packages/router/src/directives/router_link_active.ts","../../../../../../packages/router/src/directives/router_outlet.ts","../../../../../../packages/router/src/router_preloader.ts","../../../../../../packages/router/src/router_scroller.ts","../../../../../../packages/router/src/router_module.ts","../../../../../../packages/router/src/version.ts","../../../../../../packages/router/src/private_export.ts","../../../../../../packages/router/src/index.ts","../../../../../../packages/router/public_api.ts","../../../../../../packages/router/index.ts","../../../../../../packages/router/router.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Route} from './config';\nimport {ActivatedRouteSnapshot, RouterStateSnapshot} from './router_state';\n\n/**\n * Identifies the call or event that triggered a navigation.\n *\n * * 'imperative': Triggered by `router.navigateByUrl()` or `router.navigate()`.\n * * 'popstate' : Triggered by a `popstate` event.\n * * 'hashchange'-: Triggered by a `hashchange` event.\n *\n * @publicApi\n */\nexport type NavigationTrigger = 'imperative'|'popstate'|'hashchange';\n\n/**\n * Base for events the router goes through, as opposed to events tied to a specific\n * route. Fired one time for any given navigation.\n *\n * The following code shows how a class subscribes to router events.\n *\n * ```ts\n * import {Event, RouterEvent, Router} from '@angular/router';\n *\n * class MyService {\n * constructor(public router: Router) {\n * router.events.pipe(\n * filter((e: Event): e is RouterEvent => e instanceof RouterEvent)\n * ).subscribe((e: RouterEvent) => {\n * // Do something\n * });\n * }\n * }\n * ```\n *\n * @see `Event`\n * @see [Router events summary](guide/router-reference#router-events)\n * @publicApi\n */\nexport class RouterEvent {\n constructor(\n /** A unique ID that the router assigns to every router navigation. */\n public id: number,\n /** The URL that is the destination for this navigation. */\n public url: string) {}\n}\n\n/**\n * An event triggered when a navigation starts.\n *\n * @publicApi\n */\nexport class NavigationStart extends RouterEvent {\n /**\n * Identifies the call or event that triggered the navigation.\n * An `imperative` trigger is a call to `router.navigateByUrl()` or `router.navigate()`.\n *\n * @see `NavigationEnd`\n * @see `NavigationCancel`\n * @see `NavigationError`\n */\n navigationTrigger?: 'imperative'|'popstate'|'hashchange';\n\n /**\n * The navigation state that was previously supplied to the `pushState` call,\n * when the navigation is triggered by a `popstate` event. Otherwise null.\n *\n * The state object is defined by `NavigationExtras`, and contains any\n * developer-defined state value, as well as a unique ID that\n * the router assigns to every router transition/navigation.\n *\n * From the perspective of the router, the router never \"goes back\".\n * When the user clicks on the back button in the browser,\n * a new navigation ID is created.\n *\n * Use the ID in this previous-state object to differentiate between a newly created\n * state and one returned to by a `popstate` event, so that you can restore some\n * remembered state, such as scroll position.\n *\n */\n restoredState?: {[k: string]: any, navigationId: number}|null;\n\n constructor(\n /** @docsNotRequired */\n id: number,\n /** @docsNotRequired */\n url: string,\n /** @docsNotRequired */\n navigationTrigger: 'imperative'|'popstate'|'hashchange' = 'imperative',\n /** @docsNotRequired */\n restoredState: {[k: string]: any, navigationId: number}|null = null) {\n super(id, url);\n this.navigationTrigger = navigationTrigger;\n this.restoredState = restoredState;\n }\n\n /** @docsNotRequired */\n override toString(): string {\n return `NavigationStart(id: ${this.id}, url: '${this.url}')`;\n }\n}\n\n/**\n * An event triggered when a navigation ends successfully.\n *\n * @see `NavigationStart`\n * @see `NavigationCancel`\n * @see `NavigationError`\n *\n * @publicApi\n */\nexport class NavigationEnd extends RouterEvent {\n constructor(\n /** @docsNotRequired */\n id: number,\n /** @docsNotRequired */\n url: string,\n /** @docsNotRequired */\n public urlAfterRedirects: string) {\n super(id, url);\n }\n\n /** @docsNotRequired */\n override toString(): string {\n return `NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${\n this.urlAfterRedirects}')`;\n }\n}\n\n/**\n * An event triggered when a navigation is canceled, directly or indirectly.\n * This can happen for several reasons including when a route guard\n * returns `false` or initiates a redirect by returning a `UrlTree`.\n *\n * @see `NavigationStart`\n * @see `NavigationEnd`\n * @see `NavigationError`\n *\n * @publicApi\n */\nexport class NavigationCancel extends RouterEvent {\n constructor(\n /** @docsNotRequired */\n id: number,\n /** @docsNotRequired */\n url: string,\n /** @docsNotRequired */\n public reason: string) {\n super(id, url);\n }\n\n /** @docsNotRequired */\n override toString(): string {\n return `NavigationCancel(id: ${this.id}, url: '${this.url}')`;\n }\n}\n\n/**\n * An event triggered when a navigation fails due to an unexpected error.\n *\n * @see `NavigationStart`\n * @see `NavigationEnd`\n * @see `NavigationCancel`\n *\n * @publicApi\n */\nexport class NavigationError extends RouterEvent {\n constructor(\n /** @docsNotRequired */\n id: number,\n /** @docsNotRequired */\n url: string,\n /** @docsNotRequired */\n public error: any) {\n super(id, url);\n }\n\n /** @docsNotRequired */\n override toString(): string {\n return `NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`;\n }\n}\n\n/**\n * An event triggered when routes are recognized.\n *\n * @publicApi\n */\nexport class RoutesRecognized extends RouterEvent {\n constructor(\n /** @docsNotRequired */\n id: number,\n /** @docsNotRequired */\n url: string,\n /** @docsNotRequired */\n public urlAfterRedirects: string,\n /** @docsNotRequired */\n public state: RouterStateSnapshot) {\n super(id, url);\n }\n\n /** @docsNotRequired */\n override toString(): string {\n return `RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${\n this.urlAfterRedirects}', state: ${this.state})`;\n }\n}\n\n/**\n * An event triggered at the start of the Guard phase of routing.\n *\n * @see `GuardsCheckEnd`\n *\n * @publicApi\n */\nexport class GuardsCheckStart extends RouterEvent {\n constructor(\n /** @docsNotRequired */\n id: number,\n /** @docsNotRequired */\n url: string,\n /** @docsNotRequired */\n public urlAfterRedirects: string,\n /** @docsNotRequired */\n public state: RouterStateSnapshot) {\n super(id, url);\n }\n\n override toString(): string {\n return `GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${\n this.urlAfterRedirects}', state: ${this.state})`;\n }\n}\n\n/**\n * An event triggered at the end of the Guard phase of routing.\n *\n * @see `GuardsCheckStart`\n *\n * @publicApi\n */\nexport class GuardsCheckEnd extends RouterEvent {\n constructor(\n /** @docsNotRequired */\n id: number,\n /** @docsNotRequired */\n url: string,\n /** @docsNotRequired */\n public urlAfterRedirects: string,\n /** @docsNotRequired */\n public state: RouterStateSnapshot,\n /** @docsNotRequired */\n public shouldActivate: boolean) {\n super(id, url);\n }\n\n override toString(): string {\n return `GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${\n this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`;\n }\n}\n\n/**\n * An event triggered at the start of the Resolve phase of routing.\n *\n * Runs in the \"resolve\" phase whether or not there is anything to resolve.\n * In future, may change to only run when there are things to be resolved.\n *\n * @see `ResolveEnd`\n *\n * @publicApi\n */\nexport class ResolveStart extends RouterEvent {\n constructor(\n /** @docsNotRequired */\n id: number,\n /** @docsNotRequired */\n url: string,\n /** @docsNotRequired */\n public urlAfterRedirects: string,\n /** @docsNotRequired */\n public state: RouterStateSnapshot) {\n super(id, url);\n }\n\n override toString(): string {\n return `ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${\n this.urlAfterRedirects}', state: ${this.state})`;\n }\n}\n\n/**\n * An event triggered at the end of the Resolve phase of routing.\n * @see `ResolveStart`.\n *\n * @publicApi\n */\nexport class ResolveEnd extends RouterEvent {\n constructor(\n /** @docsNotRequired */\n id: number,\n /** @docsNotRequired */\n url: string,\n /** @docsNotRequired */\n public urlAfterRedirects: string,\n /** @docsNotRequired */\n public state: RouterStateSnapshot) {\n super(id, url);\n }\n\n override toString(): string {\n return `ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${\n this.urlAfterRedirects}', state: ${this.state})`;\n }\n}\n\n/**\n * An event triggered before lazy loading a route configuration.\n *\n * @see `RouteConfigLoadEnd`\n *\n * @publicApi\n */\nexport class RouteConfigLoadStart {\n constructor(\n /** @docsNotRequired */\n public route: Route) {}\n toString(): string {\n return `RouteConfigLoadStart(path: ${this.route.path})`;\n }\n}\n\n/**\n * An event triggered when a route has been lazy loaded.\n *\n * @see `RouteConfigLoadStart`\n *\n * @publicApi\n */\nexport class RouteConfigLoadEnd {\n constructor(\n /** @docsNotRequired */\n public route: Route) {}\n toString(): string {\n return `RouteConfigLoadEnd(path: ${this.route.path})`;\n }\n}\n\n/**\n * An event triggered at the start of the child-activation\n * part of the Resolve phase of routing.\n * @see `ChildActivationEnd`\n * @see `ResolveStart`\n *\n * @publicApi\n */\nexport class ChildActivationStart {\n constructor(\n /** @docsNotRequired */\n public snapshot: ActivatedRouteSnapshot) {}\n toString(): string {\n const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return `ChildActivationStart(path: '${path}')`;\n }\n}\n\n/**\n * An event triggered at the end of the child-activation part\n * of the Resolve phase of routing.\n * @see `ChildActivationStart`\n * @see `ResolveStart`\n * @publicApi\n */\nexport class ChildActivationEnd {\n constructor(\n /** @docsNotRequired */\n public snapshot: ActivatedRouteSnapshot) {}\n toString(): string {\n const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return `ChildActivationEnd(path: '${path}')`;\n }\n}\n\n/**\n * An event triggered at the start of the activation part\n * of the Resolve phase of routing.\n * @see `ActivationEnd`\n * @see `ResolveStart`\n *\n * @publicApi\n */\nexport class ActivationStart {\n constructor(\n /** @docsNotRequired */\n public snapshot: ActivatedRouteSnapshot) {}\n toString(): string {\n const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return `ActivationStart(path: '${path}')`;\n }\n}\n\n/**\n * An event triggered at the end of the activation part\n * of the Resolve phase of routing.\n * @see `ActivationStart`\n * @see `ResolveStart`\n *\n * @publicApi\n */\nexport class ActivationEnd {\n constructor(\n /** @docsNotRequired */\n public snapshot: ActivatedRouteSnapshot) {}\n toString(): string {\n const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n return `ActivationEnd(path: '${path}')`;\n }\n}\n\n/**\n * An event triggered by scrolling.\n *\n * @publicApi\n */\nexport class Scroll {\n constructor(\n /** @docsNotRequired */\n readonly routerEvent: NavigationEnd,\n\n /** @docsNotRequired */\n readonly position: [number, number]|null,\n\n /** @docsNotRequired */\n readonly anchor: string|null) {}\n\n toString(): string {\n const pos = this.position ? `${this.position[0]}, ${this.position[1]}` : null;\n return `Scroll(anchor: '${this.anchor}', position: '${pos}')`;\n }\n}\n\n/**\n * Router events that allow you to track the lifecycle of the router.\n *\n * The events occur in the following sequence:\n *\n * * [NavigationStart](api/router/NavigationStart): Navigation starts.\n * * [RouteConfigLoadStart](api/router/RouteConfigLoadStart): Before\n * the router [lazy loads](/guide/router#lazy-loading) a route configuration.\n * * [RouteConfigLoadEnd](api/router/RouteConfigLoadEnd): After a route has been lazy loaded.\n * * [RoutesRecognized](api/router/RoutesRecognized): When the router parses the URL\n * and the routes are recognized.\n * * [GuardsCheckStart](api/router/GuardsCheckStart): When the router begins the *guards*\n * phase of routing.\n * * [ChildActivationStart](api/router/ChildActivationStart): When the router\n * begins activating a route's children.\n * * [ActivationStart](api/router/ActivationStart): When the router begins activating a route.\n * * [GuardsCheckEnd](api/router/GuardsCheckEnd): When the router finishes the *guards*\n * phase of routing successfully.\n * * [ResolveStart](api/router/ResolveStart): When the router begins the *resolve*\n * phase of routing.\n * * [ResolveEnd](api/router/ResolveEnd): When the router finishes the *resolve*\n * phase of routing successfully.\n * * [ChildActivationEnd](api/router/ChildActivationEnd): When the router finishes\n * activating a route's children.\n * * [ActivationEnd](api/router/ActivationEnd): When the router finishes activating a route.\n * * [NavigationEnd](api/router/NavigationEnd): When navigation ends successfully.\n * * [NavigationCancel](api/router/NavigationCancel): When navigation is canceled.\n * * [NavigationError](api/router/NavigationError): When navigation fails\n * due to an unexpected error.\n * * [Scroll](api/router/Scroll): When the user scrolls.\n *\n * @publicApi\n */\nexport type Event = RouterEvent|RouteConfigLoadStart|RouteConfigLoadEnd|ChildActivationStart|\n ChildActivationEnd|ActivationStart|ActivationEnd|Scroll;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Route, UrlMatchResult} from './config';\nimport {UrlSegment, UrlSegmentGroup} from './url_tree';\n\n\n/**\n * The primary routing outlet.\n *\n * @publicApi\n */\nexport const PRIMARY_OUTLET = 'primary';\n\n/**\n * A collection of matrix and query URL parameters.\n * @see `convertToParamMap()`\n * @see `ParamMap`\n *\n * @publicApi\n */\nexport type Params = {\n [key: string]: any;\n};\n\n/**\n * A map that provides access to the required and optional parameters\n * specific to a route.\n * The map supports retrieving a single value with `get()`\n * or multiple values with `getAll()`.\n *\n * @see [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams)\n *\n * @publicApi\n */\nexport interface ParamMap {\n /**\n * Reports whether the map contains a given parameter.\n * @param name The parameter name.\n * @returns True if the map contains the given parameter, false otherwise.\n */\n has(name: string): boolean;\n /**\n * Retrieves a single value for a parameter.\n * @param name The parameter name.\n * @return The parameter's single value,\n * or the first value if the parameter has multiple values,\n * or `null` when there is no such parameter.\n */\n get(name: string): string|null;\n /**\n * Retrieves multiple values for a parameter.\n * @param name The parameter name.\n * @return An array containing one or more values,\n * or an empty array if there is no such parameter.\n *\n */\n getAll(name: string): string[];\n\n /** Names of the parameters in the map. */\n readonly keys: string[];\n}\n\nclass ParamsAsMap implements ParamMap {\n private params: Params;\n\n constructor(params: Params) {\n this.params = params || {};\n }\n\n has(name: string): boolean {\n return Object.prototype.hasOwnProperty.call(this.params, name);\n }\n\n get(name: string): string|null {\n if (this.has(name)) {\n const v = this.params[name];\n return Array.isArray(v) ? v[0] : v;\n }\n\n return null;\n }\n\n getAll(name: string): string[] {\n if (this.has(name)) {\n const v = this.params[name];\n return Array.isArray(v) ? v : [v];\n }\n\n return [];\n }\n\n get keys(): string[] {\n return Object.keys(this.params);\n }\n}\n\n/**\n * Converts a `Params` instance to a `ParamMap`.\n * @param params The instance to convert.\n * @returns The new map instance.\n *\n * @publicApi\n */\nexport function convertToParamMap(params: Params): ParamMap {\n return new ParamsAsMap(params);\n}\n\nconst NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';\n\nexport function navigationCancelingError(message: string) {\n const error = Error('NavigationCancelingError: ' + message);\n (error as any)[NAVIGATION_CANCELING_ERROR] = true;\n return error;\n}\n\nexport function isNavigationCancelingError(error: Error) {\n return error && (error as any)[NAVIGATION_CANCELING_ERROR];\n}\n\n// Matches the route configuration (`route`) against the actual URL (`segments`).\nexport function defaultUrlMatcher(\n segments: UrlSegment[], segmentGroup: UrlSegmentGroup, route: Route): UrlMatchResult|null {\n const parts = route.path!.split('/');\n\n if (parts.length > segments.length) {\n // The actual URL is shorter than the config, no match\n return null;\n }\n\n if (route.pathMatch === 'full' &&\n (segmentGroup.hasChildren() || parts.length < segments.length)) {\n // The config is longer than the actual URL but we are looking for a full match, return null\n return null;\n }\n\n const posParams: {[key: string]: UrlSegment} = {};\n\n // Check each config part against the actual URL\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const segment = segments[index];\n const isParameter = part.startsWith(':');\n if (isParameter) {\n posParams[part.substring(1)] = segment;\n } else if (part !== segment.path) {\n // The actual URL part does not match the config, no match\n return null;\n }\n }\n\n return {consumed: segments.slice(0, parts.length), posParams};\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵisObservable as isObservable, ɵisPromise as isPromise} from '@angular/core';\nimport {from, Observable, of} from 'rxjs';\n\nimport {Params} from '../shared';\n\nexport function shallowEqualArrays(a: any[], b: any[]): boolean {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; ++i) {\n if (!shallowEqual(a[i], b[i])) return false;\n }\n return true;\n}\n\nexport function shallowEqual(a: Params, b: Params): boolean {\n // While `undefined` should never be possible, it would sometimes be the case in IE 11\n // and pre-chromium Edge. The check below accounts for this edge case.\n const k1 = a ? Object.keys(a) : undefined;\n const k2 = b ? Object.keys(b) : undefined;\n if (!k1 || !k2 || k1.length != k2.length) {\n return false;\n }\n let key: string;\n for (let i = 0; i < k1.length; i++) {\n key = k1[i];\n if (!equalArraysOrString(a[key], b[key])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Test equality for arrays of strings or a string.\n */\nexport function equalArraysOrString(a: string|string[], b: string|string[]) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false;\n const aSorted = [...a].sort();\n const bSorted = [...b].sort();\n return aSorted.every((val, index) => bSorted[index] === val);\n } else {\n return a === b;\n }\n}\n\n/**\n * Flattens single-level nested arrays.\n */\nexport function flatten(arr: T[][]): T[] {\n return Array.prototype.concat.apply([], arr);\n}\n\n/**\n * Return the last element of an array.\n */\nexport function last(a: T[]): T|null {\n return a.length > 0 ? a[a.length - 1] : null;\n}\n\n/**\n * Verifys all booleans in an array are `true`.\n */\nexport function and(bools: boolean[]): boolean {\n return !bools.some(v => !v);\n}\n\nexport function forEach(map: {[key: string]: V}, callback: (v: V, k: string) => void): void {\n for (const prop in map) {\n if (map.hasOwnProperty(prop)) {\n callback(map[prop], prop);\n }\n }\n}\n\nexport function wrapIntoObservable(value: T|Promise|Observable): Observable {\n if (isObservable(value)) {\n return value;\n }\n\n if (isPromise(value)) {\n // Use `Promise.resolve()` to wrap promise-like instances.\n // Required ie when a Resolver returns a AngularJS `$q` promise to correctly trigger the\n // change detection.\n return from(Promise.resolve(value));\n }\n\n return of(value);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {convertToParamMap, ParamMap, Params, PRIMARY_OUTLET} from './shared';\nimport {equalArraysOrString, forEach, shallowEqual} from './utils/collection';\n\nexport function createEmptyUrlTree() {\n return new UrlTree(new UrlSegmentGroup([], {}), {}, null);\n}\n\n/**\n * A set of options which specify how to determine if a `UrlTree` is active, given the `UrlTree`\n * for the current router state.\n *\n * @publicApi\n * @see Router.isActive\n */\nexport interface IsActiveMatchOptions {\n /**\n * Defines the strategy for comparing the matrix parameters of two `UrlTree`s.\n *\n * The matrix parameter matching is dependent on the strategy for matching the\n * segments. That is, if the `paths` option is set to `'subset'`, only\n * the matrix parameters of the matching segments will be compared.\n *\n * - `'exact'`: Requires that matching segments also have exact matrix parameter\n * matches.\n * - `'subset'`: The matching segments in the router's active `UrlTree` may contain\n * extra matrix parameters, but those that exist in the `UrlTree` in question must match.\n * - `'ignored'`: When comparing `UrlTree`s, matrix params will be ignored.\n */\n matrixParams: 'exact'|'subset'|'ignored';\n /**\n * Defines the strategy for comparing the query parameters of two `UrlTree`s.\n *\n * - `'exact'`: the query parameters must match exactly.\n * - `'subset'`: the active `UrlTree` may contain extra parameters,\n * but must match the key and value of any that exist in the `UrlTree` in question.\n * - `'ignored'`: When comparing `UrlTree`s, query params will be ignored.\n */\n queryParams: 'exact'|'subset'|'ignored';\n /**\n * Defines the strategy for comparing the `UrlSegment`s of the `UrlTree`s.\n *\n * - `'exact'`: all segments in each `UrlTree` must match.\n * - `'subset'`: a `UrlTree` will be determined to be active if it\n * is a subtree of the active route. That is, the active route may contain extra\n * segments, but must at least have all the segements of the `UrlTree` in question.\n */\n paths: 'exact'|'subset';\n /**\n * - 'exact'`: indicates that the `UrlTree` fragments must be equal.\n * - `'ignored'`: the fragments will not be compared when determining if a\n * `UrlTree` is active.\n */\n fragment: 'exact'|'ignored';\n}\n\ntype ParamMatchOptions = 'exact'|'subset'|'ignored';\n\ntype PathCompareFn =\n (container: UrlSegmentGroup, containee: UrlSegmentGroup, matrixParams: ParamMatchOptions) =>\n boolean;\ntype ParamCompareFn = (container: Params, containee: Params) => boolean;\n\nconst pathCompareMap: Record = {\n 'exact': equalSegmentGroups,\n 'subset': containsSegmentGroup,\n};\nconst paramCompareMap: Record = {\n 'exact': equalParams,\n 'subset': containsParams,\n 'ignored': () => true,\n};\n\nexport function containsTree(\n container: UrlTree, containee: UrlTree, options: IsActiveMatchOptions): boolean {\n return pathCompareMap[options.paths](container.root, containee.root, options.matrixParams) &&\n paramCompareMap[options.queryParams](container.queryParams, containee.queryParams) &&\n !(options.fragment === 'exact' && container.fragment !== containee.fragment);\n}\n\nfunction equalParams(container: Params, containee: Params): boolean {\n // TODO: This does not handle array params correctly.\n return shallowEqual(container, containee);\n}\n\nfunction equalSegmentGroups(\n container: UrlSegmentGroup, containee: UrlSegmentGroup,\n matrixParams: ParamMatchOptions): boolean {\n if (!equalPath(container.segments, containee.segments)) return false;\n if (!matrixParamsMatch(container.segments, containee.segments, matrixParams)) {\n return false;\n }\n if (container.numberOfChildren !== containee.numberOfChildren) return false;\n for (const c in containee.children) {\n if (!container.children[c]) return false;\n if (!equalSegmentGroups(container.children[c], containee.children[c], matrixParams))\n return false;\n }\n return true;\n}\n\nfunction containsParams(container: Params, containee: Params): boolean {\n return Object.keys(containee).length <= Object.keys(container).length &&\n Object.keys(containee).every(key => equalArraysOrString(container[key], containee[key]));\n}\n\nfunction containsSegmentGroup(\n container: UrlSegmentGroup, containee: UrlSegmentGroup,\n matrixParams: ParamMatchOptions): boolean {\n return containsSegmentGroupHelper(container, containee, containee.segments, matrixParams);\n}\n\nfunction containsSegmentGroupHelper(\n container: UrlSegmentGroup, containee: UrlSegmentGroup, containeePaths: UrlSegment[],\n matrixParams: ParamMatchOptions): boolean {\n if (container.segments.length > containeePaths.length) {\n const current = container.segments.slice(0, containeePaths.length);\n if (!equalPath(current, containeePaths)) return false;\n if (containee.hasChildren()) return false;\n if (!matrixParamsMatch(current, containeePaths, matrixParams)) return false;\n return true;\n\n } else if (container.segments.length === containeePaths.length) {\n if (!equalPath(container.segments, containeePaths)) return false;\n if (!matrixParamsMatch(container.segments, containeePaths, matrixParams)) return false;\n for (const c in containee.children) {\n if (!container.children[c]) return false;\n if (!containsSegmentGroup(container.children[c], containee.children[c], matrixParams)) {\n return false;\n }\n }\n return true;\n\n } else {\n const current = containeePaths.slice(0, container.segments.length);\n const next = containeePaths.slice(container.segments.length);\n if (!equalPath(container.segments, current)) return false;\n if (!matrixParamsMatch(container.segments, current, matrixParams)) return false;\n if (!container.children[PRIMARY_OUTLET]) return false;\n return containsSegmentGroupHelper(\n container.children[PRIMARY_OUTLET], containee, next, matrixParams);\n }\n}\n\nfunction matrixParamsMatch(\n containerPaths: UrlSegment[], containeePaths: UrlSegment[], options: ParamMatchOptions) {\n return containeePaths.every((containeeSegment, i) => {\n return paramCompareMap[options](containerPaths[i].parameters, containeeSegment.parameters);\n });\n}\n\n/**\n * @description\n *\n * Represents the parsed URL.\n *\n * Since a router state is a tree, and the URL is nothing but a serialized state, the URL is a\n * serialized tree.\n * UrlTree is a data structure that provides a lot of affordances in dealing with URLs\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * @Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const tree: UrlTree =\n * router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment');\n * const f = tree.fragment; // return 'fragment'\n * const q = tree.queryParams; // returns {debug: 'true'}\n * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];\n * const s: UrlSegment[] = g.segments; // returns 2 segments 'team' and '33'\n * g.children[PRIMARY_OUTLET].segments; // returns 2 segments 'user' and 'victor'\n * g.children['support'].segments; // return 1 segment 'help'\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport class UrlTree {\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _queryParamMap!: ParamMap;\n\n /** @internal */\n constructor(\n /** The root segment group of the URL tree */\n public root: UrlSegmentGroup,\n /** The query params of the URL */\n public queryParams: Params,\n /** The fragment of the URL */\n public fragment: string|null) {}\n\n get queryParamMap(): ParamMap {\n if (!this._queryParamMap) {\n this._queryParamMap = convertToParamMap(this.queryParams);\n }\n return this._queryParamMap;\n }\n\n /** @docsNotRequired */\n toString(): string {\n return DEFAULT_SERIALIZER.serialize(this);\n }\n}\n\n/**\n * @description\n *\n * Represents the parsed URL segment group.\n *\n * See `UrlTree` for more information.\n *\n * @publicApi\n */\nexport class UrlSegmentGroup {\n /** @internal */\n _sourceSegment?: UrlSegmentGroup;\n /** @internal */\n _segmentIndexShift?: number;\n /** The parent node in the url tree */\n parent: UrlSegmentGroup|null = null;\n\n constructor(\n /** The URL segments of this group. See `UrlSegment` for more information */\n public segments: UrlSegment[],\n /** The list of children of this group */\n public children: {[key: string]: UrlSegmentGroup}) {\n forEach(children, (v: any, k: any) => v.parent = this);\n }\n\n /** Whether the segment has child segments */\n hasChildren(): boolean {\n return this.numberOfChildren > 0;\n }\n\n /** Number of child segments */\n get numberOfChildren(): number {\n return Object.keys(this.children).length;\n }\n\n /** @docsNotRequired */\n toString(): string {\n return serializePaths(this);\n }\n}\n\n\n/**\n * @description\n *\n * Represents a single URL segment.\n *\n * A UrlSegment is a part of a URL between the two slashes. It contains a path and the matrix\n * parameters associated with the segment.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * @Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const tree: UrlTree = router.parseUrl('/team;id=33');\n * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];\n * const s: UrlSegment[] = g.segments;\n * s[0].path; // returns 'team'\n * s[0].parameters; // returns {id: 33}\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport class UrlSegment {\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _parameterMap!: ParamMap;\n\n constructor(\n /** The path part of a URL segment */\n public path: string,\n\n /** The matrix parameters associated with a segment */\n public parameters: {[name: string]: string}) {}\n\n get parameterMap() {\n if (!this._parameterMap) {\n this._parameterMap = convertToParamMap(this.parameters);\n }\n return this._parameterMap;\n }\n\n /** @docsNotRequired */\n toString(): string {\n return serializePath(this);\n }\n}\n\nexport function equalSegments(as: UrlSegment[], bs: UrlSegment[]): boolean {\n return equalPath(as, bs) && as.every((a, i) => shallowEqual(a.parameters, bs[i].parameters));\n}\n\nexport function equalPath(as: UrlSegment[], bs: UrlSegment[]): boolean {\n if (as.length !== bs.length) return false;\n return as.every((a, i) => a.path === bs[i].path);\n}\n\nexport function mapChildrenIntoArray(\n segment: UrlSegmentGroup, fn: (v: UrlSegmentGroup, k: string) => T[]): T[] {\n let res: T[] = [];\n forEach(segment.children, (child: UrlSegmentGroup, childOutlet: string) => {\n if (childOutlet === PRIMARY_OUTLET) {\n res = res.concat(fn(child, childOutlet));\n }\n });\n forEach(segment.children, (child: UrlSegmentGroup, childOutlet: string) => {\n if (childOutlet !== PRIMARY_OUTLET) {\n res = res.concat(fn(child, childOutlet));\n }\n });\n return res;\n}\n\n\n/**\n * @description\n *\n * Serializes and deserializes a URL string into a URL tree.\n *\n * The url serialization strategy is customizable. You can\n * make all URLs case insensitive by providing a custom UrlSerializer.\n *\n * See `DefaultUrlSerializer` for an example of a URL serializer.\n *\n * @publicApi\n */\nexport abstract class UrlSerializer {\n /** Parse a url into a `UrlTree` */\n abstract parse(url: string): UrlTree;\n\n /** Converts a `UrlTree` into a url */\n abstract serialize(tree: UrlTree): string;\n}\n\n/**\n * @description\n *\n * A default implementation of the `UrlSerializer`.\n *\n * Example URLs:\n *\n * ```\n * /inbox/33(popup:compose)\n * /inbox/33;open=true/messages/44\n * ```\n *\n * DefaultUrlSerializer uses parentheses to serialize secondary segments (e.g., popup:compose), the\n * colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to\n * specify route specific parameters.\n *\n * @publicApi\n */\nexport class DefaultUrlSerializer implements UrlSerializer {\n /** Parses a url into a `UrlTree` */\n parse(url: string): UrlTree {\n const p = new UrlParser(url);\n return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n }\n\n /** Converts a `UrlTree` into a url */\n serialize(tree: UrlTree): string {\n const segment = `/${serializeSegment(tree.root, true)}`;\n const query = serializeQueryParams(tree.queryParams);\n const fragment =\n typeof tree.fragment === `string` ? `#${encodeUriFragment(tree.fragment)}` : '';\n\n return `${segment}${query}${fragment}`;\n }\n}\n\nconst DEFAULT_SERIALIZER = new DefaultUrlSerializer();\n\nexport function serializePaths(segment: UrlSegmentGroup): string {\n return segment.segments.map(p => serializePath(p)).join('/');\n}\n\nfunction serializeSegment(segment: UrlSegmentGroup, root: boolean): string {\n if (!segment.hasChildren()) {\n return serializePaths(segment);\n }\n\n if (root) {\n const primary = segment.children[PRIMARY_OUTLET] ?\n serializeSegment(segment.children[PRIMARY_OUTLET], false) :\n '';\n const children: string[] = [];\n\n forEach(segment.children, (v: UrlSegmentGroup, k: string) => {\n if (k !== PRIMARY_OUTLET) {\n children.push(`${k}:${serializeSegment(v, false)}`);\n }\n });\n\n return children.length > 0 ? `${primary}(${children.join('//')})` : primary;\n\n } else {\n const children = mapChildrenIntoArray(segment, (v: UrlSegmentGroup, k: string) => {\n if (k === PRIMARY_OUTLET) {\n return [serializeSegment(segment.children[PRIMARY_OUTLET], false)];\n }\n\n return [`${k}:${serializeSegment(v, false)}`];\n });\n\n // use no parenthesis if the only child is a primary outlet route\n if (Object.keys(segment.children).length === 1 && segment.children[PRIMARY_OUTLET] != null) {\n return `${serializePaths(segment)}/${children[0]}`;\n }\n\n return `${serializePaths(segment)}/(${children.join('//')})`;\n }\n}\n\n/**\n * Encodes a URI string with the default encoding. This function will only ever be called from\n * `encodeUriQuery` or `encodeUriSegment` as it's the base set of encodings to be used. We need\n * a custom encoding because encodeURIComponent is too aggressive and encodes stuff that doesn't\n * have to be encoded per https://url.spec.whatwg.org.\n */\nfunction encodeUriString(s: string): string {\n return encodeURIComponent(s)\n .replace(/%40/g, '@')\n .replace(/%3A/gi, ':')\n .replace(/%24/g, '$')\n .replace(/%2C/gi, ',');\n}\n\n/**\n * This function should be used to encode both keys and values in a query string key/value. In\n * the following URL, you need to call encodeUriQuery on \"k\" and \"v\":\n *\n * http://www.site.org/html;mk=mv?k=v#f\n */\nexport function encodeUriQuery(s: string): string {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}\n\n/**\n * This function should be used to encode a URL fragment. In the following URL, you need to call\n * encodeUriFragment on \"f\":\n *\n * http://www.site.org/html;mk=mv?k=v#f\n */\nexport function encodeUriFragment(s: string): string {\n return encodeURI(s);\n}\n\n/**\n * This function should be run on any URI segment as well as the key and value in a key/value\n * pair for matrix params. In the following URL, you need to call encodeUriSegment on \"html\",\n * \"mk\", and \"mv\":\n *\n * http://www.site.org/html;mk=mv?k=v#f\n */\nexport function encodeUriSegment(s: string): string {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}\n\nexport function decode(s: string): string {\n return decodeURIComponent(s);\n}\n\n// Query keys/values should have the \"+\" replaced first, as \"+\" in a query string is \" \".\n// decodeURIComponent function will not decode \"+\" as a space.\nexport function decodeQuery(s: string): string {\n return decode(s.replace(/\\+/g, '%20'));\n}\n\nexport function serializePath(path: UrlSegment): string {\n return `${encodeUriSegment(path.path)}${serializeMatrixParams(path.parameters)}`;\n}\n\nfunction serializeMatrixParams(params: {[key: string]: string}): string {\n return Object.keys(params)\n .map(key => `;${encodeUriSegment(key)}=${encodeUriSegment(params[key])}`)\n .join('');\n}\n\nfunction serializeQueryParams(params: {[key: string]: any}): string {\n const strParams: string[] =\n Object.keys(params)\n .map((name) => {\n const value = params[name];\n return Array.isArray(value) ?\n value.map(v => `${encodeUriQuery(name)}=${encodeUriQuery(v)}`).join('&') :\n `${encodeUriQuery(name)}=${encodeUriQuery(value)}`;\n })\n .filter(s => !!s);\n\n return strParams.length ? `?${strParams.join('&')}` : '';\n}\n\nconst SEGMENT_RE = /^[^\\/()?;=#]+/;\nfunction matchSegments(str: string): string {\n const match = str.match(SEGMENT_RE);\n return match ? match[0] : '';\n}\n\nconst QUERY_PARAM_RE = /^[^=?&#]+/;\n// Return the name of the query param at the start of the string or an empty string\nfunction matchQueryParams(str: string): string {\n const match = str.match(QUERY_PARAM_RE);\n return match ? match[0] : '';\n}\n\nconst QUERY_PARAM_VALUE_RE = /^[^?&#]+/;\n// Return the value of the query param at the start of the string or an empty string\nfunction matchUrlQueryParamValue(str: string): string {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}\n\nclass UrlParser {\n private remaining: string;\n\n constructor(private url: string) {\n this.remaining = url;\n }\n\n parseRootSegment(): UrlSegmentGroup {\n this.consumeOptional('/');\n\n if (this.remaining === '' || this.peekStartsWith('?') || this.peekStartsWith('#')) {\n return new UrlSegmentGroup([], {});\n }\n\n // The root segment group never has segments\n return new UrlSegmentGroup([], this.parseChildren());\n }\n\n parseQueryParams(): Params {\n const params: Params = {};\n if (this.consumeOptional('?')) {\n do {\n this.parseQueryParam(params);\n } while (this.consumeOptional('&'));\n }\n return params;\n }\n\n parseFragment(): string|null {\n return this.consumeOptional('#') ? decodeURIComponent(this.remaining) : null;\n }\n\n private parseChildren(): {[outlet: string]: UrlSegmentGroup} {\n if (this.remaining === '') {\n return {};\n }\n\n this.consumeOptional('/');\n\n const segments: UrlSegment[] = [];\n if (!this.peekStartsWith('(')) {\n segments.push(this.parseSegment());\n }\n\n while (this.peekStartsWith('/') && !this.peekStartsWith('//') && !this.peekStartsWith('/(')) {\n this.capture('/');\n segments.push(this.parseSegment());\n }\n\n let children: {[outlet: string]: UrlSegmentGroup} = {};\n if (this.peekStartsWith('/(')) {\n this.capture('/');\n children = this.parseParens(true);\n }\n\n let res: {[outlet: string]: UrlSegmentGroup} = {};\n if (this.peekStartsWith('(')) {\n res = this.parseParens(false);\n }\n\n if (segments.length > 0 || Object.keys(children).length > 0) {\n res[PRIMARY_OUTLET] = new UrlSegmentGroup(segments, children);\n }\n\n return res;\n }\n\n // parse a segment with its matrix parameters\n // ie `name;k1=v1;k2`\n private parseSegment(): UrlSegment {\n const path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }\n\n private parseMatrixParams(): {[key: string]: string} {\n const params: {[key: string]: string} = {};\n while (this.consumeOptional(';')) {\n this.parseParam(params);\n }\n return params;\n }\n\n private parseParam(params: {[key: string]: string}): void {\n const key = matchSegments(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value: any = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchSegments(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n\n params[decode(key)] = decode(value);\n }\n\n // Parse a single query parameter `name[=value]`\n private parseQueryParam(params: Params): void {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value: any = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n } else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }\n\n // parse `(a/b//outlet_name:c/d)`\n private parseParens(allowPrimary: boolean): {[outlet: string]: UrlSegmentGroup} {\n const segments: {[key: string]: UrlSegmentGroup} = {};\n this.capture('(');\n\n while (!this.consumeOptional(')') && this.remaining.length > 0) {\n const path = matchSegments(this.remaining);\n\n const next = this.remaining[path.length];\n\n // if is is not one of these characters, then the segment was unescaped\n // or the group was not closed\n if (next !== '/' && next !== ')' && next !== ';') {\n throw new Error(`Cannot parse url '${this.url}'`);\n }\n\n let outletName: string = undefined!;\n if (path.indexOf(':') > -1) {\n outletName = path.substr(0, path.indexOf(':'));\n this.capture(outletName);\n this.capture(':');\n } else if (allowPrimary) {\n outletName = PRIMARY_OUTLET;\n }\n\n const children = this.parseChildren();\n segments[outletName] = Object.keys(children).length === 1 ? children[PRIMARY_OUTLET] :\n new UrlSegmentGroup([], children);\n this.consumeOptional('//');\n }\n\n return segments;\n }\n\n private peekStartsWith(str: string): boolean {\n return this.remaining.startsWith(str);\n }\n\n // Consumes the prefix when it is present and returns whether it has been consumed\n private consumeOptional(str: string): boolean {\n if (this.peekStartsWith(str)) {\n this.remaining = this.remaining.substring(str.length);\n return true;\n }\n return false;\n }\n\n private capture(str: string): void {\n if (!this.consumeOptional(str)) {\n throw new Error(`Expected \"${str}\".`);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport class Tree {\n /** @internal */\n _root: TreeNode;\n\n constructor(root: TreeNode) {\n this._root = root;\n }\n\n get root(): T {\n return this._root.value;\n }\n\n /**\n * @internal\n */\n parent(t: T): T|null {\n const p = this.pathFromRoot(t);\n return p.length > 1 ? p[p.length - 2] : null;\n }\n\n /**\n * @internal\n */\n children(t: T): T[] {\n const n = findNode(t, this._root);\n return n ? n.children.map(t => t.value) : [];\n }\n\n /**\n * @internal\n */\n firstChild(t: T): T|null {\n const n = findNode(t, this._root);\n return n && n.children.length > 0 ? n.children[0].value : null;\n }\n\n /**\n * @internal\n */\n siblings(t: T): T[] {\n const p = findPath(t, this._root);\n if (p.length < 2) return [];\n\n const c = p[p.length - 2].children.map(c => c.value);\n return c.filter(cc => cc !== t);\n }\n\n /**\n * @internal\n */\n pathFromRoot(t: T): T[] {\n return findPath(t, this._root).map(s => s.value);\n }\n}\n\n\n// DFS for the node matching the value\nfunction findNode(value: T, node: TreeNode): TreeNode|null {\n if (value === node.value) return node;\n\n for (const child of node.children) {\n const node = findNode(value, child);\n if (node) return node;\n }\n\n return null;\n}\n\n// Return the path to the node with the given value using DFS\nfunction findPath(value: T, node: TreeNode): TreeNode[] {\n if (value === node.value) return [node];\n\n for (const child of node.children) {\n const path = findPath(value, child);\n if (path.length) {\n path.unshift(node);\n return path;\n }\n }\n\n return [];\n}\n\nexport class TreeNode {\n constructor(public value: T, public children: TreeNode[]) {}\n\n toString(): string {\n return `TreeNode(${this.value})`;\n }\n}\n\n// Return the list of T indexed by outlet name\nexport function nodeChildrenAsMap(node: TreeNode|null) {\n const map: {[outlet: string]: TreeNode} = {};\n\n if (node) {\n node.children.forEach(child => map[child.value.outlet] = child);\n }\n\n return map;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '@angular/core';\nimport {BehaviorSubject, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {Data, ResolveData, Route} from './config';\nimport {convertToParamMap, ParamMap, Params, PRIMARY_OUTLET} from './shared';\nimport {equalSegments, UrlSegment, UrlSegmentGroup, UrlTree} from './url_tree';\nimport {shallowEqual, shallowEqualArrays} from './utils/collection';\nimport {Tree, TreeNode} from './utils/tree';\n\n\n\n/**\n * Represents the state of the router as a tree of activated routes.\n *\n * @usageNotes\n *\n * Every node in the route tree is an `ActivatedRoute` instance\n * that knows about the \"consumed\" URL segments, the extracted parameters,\n * and the resolved data.\n * Use the `ActivatedRoute` properties to traverse the tree from any node.\n *\n * The following fragment shows how a component gets the root node\n * of the current state to establish its own route tree:\n *\n * ```\n * @Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const state: RouterState = router.routerState;\n * const root: ActivatedRoute = state.root;\n * const child = root.firstChild;\n * const id: Observable = child.params.map(p => p.id);\n * //...\n * }\n * }\n * ```\n *\n * @see `ActivatedRoute`\n * @see [Getting route information](guide/router#getting-route-information)\n *\n * @publicApi\n */\nexport class RouterState extends Tree {\n /** @internal */\n constructor(\n root: TreeNode,\n /** The current snapshot of the router state */\n public snapshot: RouterStateSnapshot) {\n super(root);\n setRouterState(this, root);\n }\n\n override toString(): string {\n return this.snapshot.toString();\n }\n}\n\nexport function createEmptyState(urlTree: UrlTree, rootComponent: Type|null): RouterState {\n const snapshot = createEmptyStateSnapshot(urlTree, rootComponent);\n const emptyUrl = new BehaviorSubject([new UrlSegment('', {})]);\n const emptyParams = new BehaviorSubject({});\n const emptyData = new BehaviorSubject({});\n const emptyQueryParams = new BehaviorSubject({});\n const fragment = new BehaviorSubject('');\n const activated = new ActivatedRoute(\n emptyUrl, emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent,\n snapshot.root);\n activated.snapshot = snapshot.root;\n return new RouterState(new TreeNode(activated, []), snapshot);\n}\n\nexport function createEmptyStateSnapshot(\n urlTree: UrlTree, rootComponent: Type|null): RouterStateSnapshot {\n const emptyParams = {};\n const emptyData = {};\n const emptyQueryParams = {};\n const fragment = '';\n const activated = new ActivatedRouteSnapshot(\n [], emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, null,\n urlTree.root, -1, {});\n return new RouterStateSnapshot('', new TreeNode(activated, []));\n}\n\n/**\n * Provides access to information about a route associated with a component\n * that is loaded in an outlet.\n * Use to traverse the `RouterState` tree and extract information from nodes.\n *\n * The following example shows how to construct a component using information from a\n * currently activated route.\n *\n * Note: the observables in this class only emit when the current and previous values differ based\n * on shallow equality. For example, changing deeply nested properties in resolved `data` will not\n * cause the `ActivatedRoute.data` `Observable` to emit a new value.\n *\n * {@example router/activated-route/module.ts region=\"activated-route\"\n * header=\"activated-route.component.ts\"}\n *\n * @see [Getting route information](guide/router#getting-route-information)\n *\n * @publicApi\n */\nexport class ActivatedRoute {\n /** The current snapshot of this route */\n snapshot!: ActivatedRouteSnapshot;\n /** @internal */\n _futureSnapshot: ActivatedRouteSnapshot;\n /** @internal */\n _routerState!: RouterState;\n /** @internal */\n _paramMap!: Observable;\n /** @internal */\n _queryParamMap!: Observable;\n\n /** @internal */\n constructor(\n /** An observable of the URL segments matched by this route. */\n public url: Observable,\n /** An observable of the matrix parameters scoped to this route. */\n public params: Observable,\n /** An observable of the query parameters shared by all the routes. */\n public queryParams: Observable,\n /** An observable of the URL fragment shared by all the routes. */\n public fragment: Observable,\n /** An observable of the static and resolved data of this route. */\n public data: Observable,\n /** The outlet name of the route, a constant. */\n public outlet: string,\n /** The component of the route, a constant. */\n // TODO(vsavkin): remove |string\n public component: Type|string|null, futureSnapshot: ActivatedRouteSnapshot) {\n this._futureSnapshot = futureSnapshot;\n }\n\n /** The configuration used to match this route. */\n get routeConfig(): Route|null {\n return this._futureSnapshot.routeConfig;\n }\n\n /** The root of the router state. */\n get root(): ActivatedRoute {\n return this._routerState.root;\n }\n\n /** The parent of this route in the router state tree. */\n get parent(): ActivatedRoute|null {\n return this._routerState.parent(this);\n }\n\n /** The first child of this route in the router state tree. */\n get firstChild(): ActivatedRoute|null {\n return this._routerState.firstChild(this);\n }\n\n /** The children of this route in the router state tree. */\n get children(): ActivatedRoute[] {\n return this._routerState.children(this);\n }\n\n /** The path from the root of the router state tree to this route. */\n get pathFromRoot(): ActivatedRoute[] {\n return this._routerState.pathFromRoot(this);\n }\n\n /**\n * An Observable that contains a map of the required and optional parameters\n * specific to the route.\n * The map supports retrieving single and multiple values from the same parameter.\n */\n get paramMap(): Observable {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(map((p: Params): ParamMap => convertToParamMap(p)));\n }\n return this._paramMap;\n }\n\n /**\n * An Observable that contains a map of the query parameters available to all routes.\n * The map supports retrieving single and multiple values from the query parameter.\n */\n get queryParamMap(): Observable {\n if (!this._queryParamMap) {\n this._queryParamMap =\n this.queryParams.pipe(map((p: Params): ParamMap => convertToParamMap(p)));\n }\n return this._queryParamMap;\n }\n\n toString(): string {\n return this.snapshot ? this.snapshot.toString() : `Future(${this._futureSnapshot})`;\n }\n}\n\nexport type ParamsInheritanceStrategy = 'emptyOnly'|'always';\n\n/** @internal */\nexport type Inherited = {\n params: Params,\n data: Data,\n resolve: Data,\n};\n\n/**\n * Returns the inherited params, data, and resolve for a given route.\n * By default, this only inherits values up to the nearest path-less or component-less route.\n * @internal\n */\nexport function inheritedParamsDataResolve(\n route: ActivatedRouteSnapshot,\n paramsInheritanceStrategy: ParamsInheritanceStrategy = 'emptyOnly'): Inherited {\n const pathFromRoot = route.pathFromRoot;\n\n let inheritingStartingFrom = 0;\n if (paramsInheritanceStrategy !== 'always') {\n inheritingStartingFrom = pathFromRoot.length - 1;\n\n while (inheritingStartingFrom >= 1) {\n const current = pathFromRoot[inheritingStartingFrom];\n const parent = pathFromRoot[inheritingStartingFrom - 1];\n // current route is an empty path => inherits its parent's params and data\n if (current.routeConfig && current.routeConfig.path === '') {\n inheritingStartingFrom--;\n\n // parent is componentless => current route should inherit its params and data\n } else if (!parent.component) {\n inheritingStartingFrom--;\n\n } else {\n break;\n }\n }\n }\n\n return flattenInherited(pathFromRoot.slice(inheritingStartingFrom));\n}\n\n/** @internal */\nfunction flattenInherited(pathFromRoot: ActivatedRouteSnapshot[]): Inherited {\n return pathFromRoot.reduce((res, curr) => {\n const params = {...res.params, ...curr.params};\n const data = {...res.data, ...curr.data};\n const resolve = {...res.resolve, ...curr._resolvedData};\n return {params, data, resolve};\n }, {params: {}, data: {}, resolve: {}});\n}\n\n/**\n * @description\n *\n * Contains the information about a route associated with a component loaded in an\n * outlet at a particular moment in time. ActivatedRouteSnapshot can also be used to\n * traverse the router state tree.\n *\n * The following example initializes a component with route information extracted\n * from the snapshot of the root node at the time of creation.\n *\n * ```\n * @Component({templateUrl:'./my-component.html'})\n * class MyComponent {\n * constructor(route: ActivatedRoute) {\n * const id: string = route.snapshot.params.id;\n * const url: string = route.snapshot.url.join('');\n * const user = route.snapshot.data.user;\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport class ActivatedRouteSnapshot {\n /** The configuration used to match this route **/\n public readonly routeConfig: Route|null;\n /** @internal **/\n _urlSegment: UrlSegmentGroup;\n /** @internal */\n _lastPathIndex: number;\n /** @internal */\n _resolve: ResolveData;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _resolvedData!: Data;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _routerState!: RouterStateSnapshot;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _paramMap!: ParamMap;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _queryParamMap!: ParamMap;\n\n /** @internal */\n constructor(\n /** The URL segments matched by this route */\n public url: UrlSegment[],\n /**\n * The matrix parameters scoped to this route.\n *\n * You can compute all params (or data) in the router state or to get params outside\n * of an activated component by traversing the `RouterState` tree as in the following\n * example:\n * ```\n * collectRouteParams(router: Router) {\n * let params = {};\n * let stack: ActivatedRouteSnapshot[] = [router.routerState.snapshot.root];\n * while (stack.length > 0) {\n * const route = stack.pop()!;\n * params = {...params, ...route.params};\n * stack.push(...route.children);\n * }\n * return params;\n * }\n * ```\n */\n public params: Params,\n /** The query parameters shared by all the routes */\n public queryParams: Params,\n /** The URL fragment shared by all the routes */\n public fragment: string|null,\n /** The static and resolved data of this route */\n public data: Data,\n /** The outlet name of the route */\n public outlet: string,\n /** The component of the route */\n public component: Type|string|null, routeConfig: Route|null, urlSegment: UrlSegmentGroup,\n lastPathIndex: number, resolve: ResolveData) {\n this.routeConfig = routeConfig;\n this._urlSegment = urlSegment;\n this._lastPathIndex = lastPathIndex;\n this._resolve = resolve;\n }\n\n /** The root of the router state */\n get root(): ActivatedRouteSnapshot {\n return this._routerState.root;\n }\n\n /** The parent of this route in the router state tree */\n get parent(): ActivatedRouteSnapshot|null {\n return this._routerState.parent(this);\n }\n\n /** The first child of this route in the router state tree */\n get firstChild(): ActivatedRouteSnapshot|null {\n return this._routerState.firstChild(this);\n }\n\n /** The children of this route in the router state tree */\n get children(): ActivatedRouteSnapshot[] {\n return this._routerState.children(this);\n }\n\n /** The path from the root of the router state tree to this route */\n get pathFromRoot(): ActivatedRouteSnapshot[] {\n return this._routerState.pathFromRoot(this);\n }\n\n get paramMap(): ParamMap {\n if (!this._paramMap) {\n this._paramMap = convertToParamMap(this.params);\n }\n return this._paramMap;\n }\n\n get queryParamMap(): ParamMap {\n if (!this._queryParamMap) {\n this._queryParamMap = convertToParamMap(this.queryParams);\n }\n return this._queryParamMap;\n }\n\n toString(): string {\n const url = this.url.map(segment => segment.toString()).join('/');\n const matched = this.routeConfig ? this.routeConfig.path : '';\n return `Route(url:'${url}', path:'${matched}')`;\n }\n}\n\n/**\n * @description\n *\n * Represents the state of the router at a moment in time.\n *\n * This is a tree of activated route snapshots. Every node in this tree knows about\n * the \"consumed\" URL segments, the extracted parameters, and the resolved data.\n *\n * The following example shows how a component is initialized with information\n * from the snapshot of the root node's state at the time of creation.\n *\n * ```\n * @Component({templateUrl:'template.html'})\n * class MyComponent {\n * constructor(router: Router) {\n * const state: RouterState = router.routerState;\n * const snapshot: RouterStateSnapshot = state.snapshot;\n * const root: ActivatedRouteSnapshot = snapshot.root;\n * const child = root.firstChild;\n * const id: Observable = child.params.map(p => p.id);\n * //...\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport class RouterStateSnapshot extends Tree {\n /** @internal */\n constructor(\n /** The url from which this snapshot was created */\n public url: string, root: TreeNode) {\n super(root);\n setRouterState(this, root);\n }\n\n override toString(): string {\n return serializeNode(this._root);\n }\n}\n\nfunction setRouterState(state: U, node: TreeNode): void {\n node.value._routerState = state;\n node.children.forEach(c => setRouterState(state, c));\n}\n\nfunction serializeNode(node: TreeNode): string {\n const c = node.children.length > 0 ? ` { ${node.children.map(serializeNode).join(', ')} } ` : '';\n return `${node.value}${c}`;\n}\n\n/**\n * The expectation is that the activate route is created with the right set of parameters.\n * So we push new values into the observables only when they are not the initial values.\n * And we detect that by checking if the snapshot field is set.\n */\nexport function advanceActivatedRoute(route: ActivatedRoute): void {\n if (route.snapshot) {\n const currentSnapshot = route.snapshot;\n const nextSnapshot = route._futureSnapshot;\n route.snapshot = nextSnapshot;\n if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) {\n (route.queryParams).next(nextSnapshot.queryParams);\n }\n if (currentSnapshot.fragment !== nextSnapshot.fragment) {\n (route.fragment).next(nextSnapshot.fragment);\n }\n if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) {\n (route.params).next(nextSnapshot.params);\n }\n if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) {\n (route.url).next(nextSnapshot.url);\n }\n if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) {\n (route.data).next(nextSnapshot.data);\n }\n } else {\n route.snapshot = route._futureSnapshot;\n\n // this is for resolved data\n (route.data).next(route._futureSnapshot.data);\n }\n}\n\n\nexport function equalParamsAndUrlSegments(\n a: ActivatedRouteSnapshot, b: ActivatedRouteSnapshot): boolean {\n const equalUrlParams = shallowEqual(a.params, b.params) && equalSegments(a.url, b.url);\n const parentsMismatch = !a.parent !== !b.parent;\n\n return equalUrlParams && !parentsMismatch &&\n (!a.parent || equalParamsAndUrlSegments(a.parent, b.parent!));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BehaviorSubject} from 'rxjs';\n\nimport {DetachedRouteHandleInternal, RouteReuseStrategy} from './route_reuse_strategy';\nimport {ActivatedRoute, ActivatedRouteSnapshot, RouterState, RouterStateSnapshot} from './router_state';\nimport {TreeNode} from './utils/tree';\n\nexport function createRouterState(\n routeReuseStrategy: RouteReuseStrategy, curr: RouterStateSnapshot,\n prevState: RouterState): RouterState {\n const root = createNode(routeReuseStrategy, curr._root, prevState ? prevState._root : undefined);\n return new RouterState(root, curr);\n}\n\nfunction createNode(\n routeReuseStrategy: RouteReuseStrategy, curr: TreeNode,\n prevState?: TreeNode): TreeNode {\n // reuse an activated route that is currently displayed on the screen\n if (prevState && routeReuseStrategy.shouldReuseRoute(curr.value, prevState.value.snapshot)) {\n const value = prevState.value;\n value._futureSnapshot = curr.value;\n const children = createOrReuseChildren(routeReuseStrategy, curr, prevState);\n return new TreeNode(value, children);\n } else {\n if (routeReuseStrategy.shouldAttach(curr.value)) {\n // retrieve an activated route that is used to be displayed, but is not currently displayed\n const detachedRouteHandle = routeReuseStrategy.retrieve(curr.value);\n if (detachedRouteHandle !== null) {\n const tree = (detachedRouteHandle as DetachedRouteHandleInternal).route;\n setFutureSnapshotsOfActivatedRoutes(curr, tree);\n return tree;\n }\n }\n\n const value = createActivatedRoute(curr.value);\n const children = curr.children.map(c => createNode(routeReuseStrategy, c));\n return new TreeNode(value, children);\n }\n}\n\nfunction setFutureSnapshotsOfActivatedRoutes(\n curr: TreeNode, result: TreeNode): void {\n if (curr.value.routeConfig !== result.value.routeConfig) {\n throw new Error('Cannot reattach ActivatedRouteSnapshot created from a different route');\n }\n if (curr.children.length !== result.children.length) {\n throw new Error('Cannot reattach ActivatedRouteSnapshot with a different number of children');\n }\n result.value._futureSnapshot = curr.value;\n for (let i = 0; i < curr.children.length; ++i) {\n setFutureSnapshotsOfActivatedRoutes(curr.children[i], result.children[i]);\n }\n}\n\nfunction createOrReuseChildren(\n routeReuseStrategy: RouteReuseStrategy, curr: TreeNode,\n prevState: TreeNode) {\n return curr.children.map(child => {\n for (const p of prevState.children) {\n if (routeReuseStrategy.shouldReuseRoute(child.value, p.value.snapshot)) {\n return createNode(routeReuseStrategy, child, p);\n }\n }\n return createNode(routeReuseStrategy, child);\n });\n}\n\nfunction createActivatedRoute(c: ActivatedRouteSnapshot) {\n return new ActivatedRoute(\n new BehaviorSubject(c.url), new BehaviorSubject(c.params), new BehaviorSubject(c.queryParams),\n new BehaviorSubject(c.fragment), new BehaviorSubject(c.data), c.outlet, c.component, c);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ActivatedRoute} from './router_state';\nimport {Params, PRIMARY_OUTLET} from './shared';\nimport {UrlSegment, UrlSegmentGroup, UrlTree} from './url_tree';\nimport {forEach, last, shallowEqual} from './utils/collection';\n\nexport function createUrlTree(\n route: ActivatedRoute, urlTree: UrlTree, commands: any[], queryParams: Params|null,\n fragment: string|null): UrlTree {\n if (commands.length === 0) {\n return tree(urlTree.root, urlTree.root, urlTree, queryParams, fragment);\n }\n\n const nav = computeNavigation(commands);\n\n if (nav.toRoot()) {\n return tree(urlTree.root, new UrlSegmentGroup([], {}), urlTree, queryParams, fragment);\n }\n\n const startingPosition = findStartingPosition(nav, urlTree, route);\n\n const segmentGroup = startingPosition.processChildren ?\n updateSegmentGroupChildren(\n startingPosition.segmentGroup, startingPosition.index, nav.commands) :\n updateSegmentGroup(startingPosition.segmentGroup, startingPosition.index, nav.commands);\n return tree(startingPosition.segmentGroup, segmentGroup, urlTree, queryParams, fragment);\n}\n\nfunction isMatrixParams(command: any): boolean {\n return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath;\n}\n\n/**\n * Determines if a given command has an `outlets` map. When we encounter a command\n * with an outlets k/v map, we need to apply each outlet individually to the existing segment.\n */\nfunction isCommandWithOutlets(command: any): command is {outlets: {[key: string]: any}} {\n return typeof command === 'object' && command != null && command.outlets;\n}\n\nfunction tree(\n oldSegmentGroup: UrlSegmentGroup, newSegmentGroup: UrlSegmentGroup, urlTree: UrlTree,\n queryParams: Params|null, fragment: string|null): UrlTree {\n let qp: any = {};\n if (queryParams) {\n forEach(queryParams, (value: any, name: any) => {\n qp[name] = Array.isArray(value) ? value.map((v: any) => `${v}`) : `${value}`;\n });\n }\n\n if (urlTree.root === oldSegmentGroup) {\n return new UrlTree(newSegmentGroup, qp, fragment);\n }\n\n return new UrlTree(replaceSegment(urlTree.root, oldSegmentGroup, newSegmentGroup), qp, fragment);\n}\n\nfunction replaceSegment(\n current: UrlSegmentGroup, oldSegment: UrlSegmentGroup,\n newSegment: UrlSegmentGroup): UrlSegmentGroup {\n const children: {[key: string]: UrlSegmentGroup} = {};\n forEach(current.children, (c: UrlSegmentGroup, outletName: string) => {\n if (c === oldSegment) {\n children[outletName] = newSegment;\n } else {\n children[outletName] = replaceSegment(c, oldSegment, newSegment);\n }\n });\n return new UrlSegmentGroup(current.segments, children);\n}\n\nclass Navigation {\n constructor(\n public isAbsolute: boolean, public numberOfDoubleDots: number, public commands: any[]) {\n if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {\n throw new Error('Root segment cannot have matrix parameters');\n }\n\n const cmdWithOutlet = commands.find(isCommandWithOutlets);\n if (cmdWithOutlet && cmdWithOutlet !== last(commands)) {\n throw new Error('{outlets:{}} has to be the last command');\n }\n }\n\n public toRoot(): boolean {\n return this.isAbsolute && this.commands.length === 1 && this.commands[0] == '/';\n }\n}\n\n/** Transforms commands to a normalized `Navigation` */\nfunction computeNavigation(commands: any[]): Navigation {\n if ((typeof commands[0] === 'string') && commands.length === 1 && commands[0] === '/') {\n return new Navigation(true, 0, commands);\n }\n\n let numberOfDoubleDots = 0;\n let isAbsolute = false;\n\n const res: any[] = commands.reduce((res, cmd, cmdIdx) => {\n if (typeof cmd === 'object' && cmd != null) {\n if (cmd.outlets) {\n const outlets: {[k: string]: any} = {};\n forEach(cmd.outlets, (commands: any, name: string) => {\n outlets[name] = typeof commands === 'string' ? commands.split('/') : commands;\n });\n return [...res, {outlets}];\n }\n\n if (cmd.segmentPath) {\n return [...res, cmd.segmentPath];\n }\n }\n\n if (!(typeof cmd === 'string')) {\n return [...res, cmd];\n }\n\n if (cmdIdx === 0) {\n cmd.split('/').forEach((urlPart, partIndex) => {\n if (partIndex == 0 && urlPart === '.') {\n // skip './a'\n } else if (partIndex == 0 && urlPart === '') { // '/a'\n isAbsolute = true;\n } else if (urlPart === '..') { // '../a'\n numberOfDoubleDots++;\n } else if (urlPart != '') {\n res.push(urlPart);\n }\n });\n\n return res;\n }\n\n return [...res, cmd];\n }, []);\n\n return new Navigation(isAbsolute, numberOfDoubleDots, res);\n}\n\nclass Position {\n constructor(\n public segmentGroup: UrlSegmentGroup, public processChildren: boolean, public index: number) {\n }\n}\n\nfunction findStartingPosition(nav: Navigation, tree: UrlTree, route: ActivatedRoute): Position {\n if (nav.isAbsolute) {\n return new Position(tree.root, true, 0);\n }\n\n if (route.snapshot._lastPathIndex === -1) {\n const segmentGroup = route.snapshot._urlSegment;\n // Pathless ActivatedRoute has _lastPathIndex === -1 but should not process children\n // see issue #26224, #13011, #35687\n // However, if the ActivatedRoute is the root we should process children like above.\n const processChildren = segmentGroup === tree.root;\n return new Position(segmentGroup, processChildren, 0);\n }\n\n const modifier = isMatrixParams(nav.commands[0]) ? 0 : 1;\n const index = route.snapshot._lastPathIndex + modifier;\n return createPositionApplyingDoubleDots(\n route.snapshot._urlSegment, index, nav.numberOfDoubleDots);\n}\n\nfunction createPositionApplyingDoubleDots(\n group: UrlSegmentGroup, index: number, numberOfDoubleDots: number): Position {\n let g = group;\n let ci = index;\n let dd = numberOfDoubleDots;\n while (dd > ci) {\n dd -= ci;\n g = g.parent!;\n if (!g) {\n throw new Error('Invalid number of \\'../\\'');\n }\n ci = g.segments.length;\n }\n return new Position(g, false, ci - dd);\n}\n\nfunction getOutlets(commands: unknown[]): {[k: string]: unknown[]|string} {\n if (isCommandWithOutlets(commands[0])) {\n return commands[0].outlets;\n }\n\n return {[PRIMARY_OUTLET]: commands};\n}\n\nfunction updateSegmentGroup(\n segmentGroup: UrlSegmentGroup, startIndex: number, commands: any[]): UrlSegmentGroup {\n if (!segmentGroup) {\n segmentGroup = new UrlSegmentGroup([], {});\n }\n if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n return updateSegmentGroupChildren(segmentGroup, startIndex, commands);\n }\n\n const m = prefixedWith(segmentGroup, startIndex, commands);\n const slicedCommands = commands.slice(m.commandIndex);\n if (m.match && m.pathIndex < segmentGroup.segments.length) {\n const g = new UrlSegmentGroup(segmentGroup.segments.slice(0, m.pathIndex), {});\n g.children[PRIMARY_OUTLET] =\n new UrlSegmentGroup(segmentGroup.segments.slice(m.pathIndex), segmentGroup.children);\n return updateSegmentGroupChildren(g, 0, slicedCommands);\n } else if (m.match && slicedCommands.length === 0) {\n return new UrlSegmentGroup(segmentGroup.segments, {});\n } else if (m.match && !segmentGroup.hasChildren()) {\n return createNewSegmentGroup(segmentGroup, startIndex, commands);\n } else if (m.match) {\n return updateSegmentGroupChildren(segmentGroup, 0, slicedCommands);\n } else {\n return createNewSegmentGroup(segmentGroup, startIndex, commands);\n }\n}\n\nfunction updateSegmentGroupChildren(\n segmentGroup: UrlSegmentGroup, startIndex: number, commands: any[]): UrlSegmentGroup {\n if (commands.length === 0) {\n return new UrlSegmentGroup(segmentGroup.segments, {});\n } else {\n const outlets = getOutlets(commands);\n const children: {[key: string]: UrlSegmentGroup} = {};\n\n forEach(outlets, (commands, outlet) => {\n if (typeof commands === 'string') {\n commands = [commands];\n }\n if (commands !== null) {\n children[outlet] = updateSegmentGroup(segmentGroup.children[outlet], startIndex, commands);\n }\n });\n\n forEach(segmentGroup.children, (child: UrlSegmentGroup, childOutlet: string) => {\n if (outlets[childOutlet] === undefined) {\n children[childOutlet] = child;\n }\n });\n return new UrlSegmentGroup(segmentGroup.segments, children);\n }\n}\n\nfunction prefixedWith(segmentGroup: UrlSegmentGroup, startIndex: number, commands: any[]) {\n let currentCommandIndex = 0;\n let currentPathIndex = startIndex;\n\n const noMatch = {match: false, pathIndex: 0, commandIndex: 0};\n while (currentPathIndex < segmentGroup.segments.length) {\n if (currentCommandIndex >= commands.length) return noMatch;\n const path = segmentGroup.segments[currentPathIndex];\n const command = commands[currentCommandIndex];\n // Do not try to consume command as part of the prefixing if it has outlets because it can\n // contain outlets other than the one being processed. Consuming the outlets command would\n // result in other outlets being ignored.\n if (isCommandWithOutlets(command)) {\n break;\n }\n const curr = `${command}`;\n const next =\n currentCommandIndex < commands.length - 1 ? commands[currentCommandIndex + 1] : null;\n\n if (currentPathIndex > 0 && curr === undefined) break;\n\n if (curr && next && (typeof next === 'object') && next.outlets === undefined) {\n if (!compare(curr, next, path)) return noMatch;\n currentCommandIndex += 2;\n } else {\n if (!compare(curr, {}, path)) return noMatch;\n currentCommandIndex++;\n }\n currentPathIndex++;\n }\n\n return {match: true, pathIndex: currentPathIndex, commandIndex: currentCommandIndex};\n}\n\nfunction createNewSegmentGroup(\n segmentGroup: UrlSegmentGroup, startIndex: number, commands: any[]): UrlSegmentGroup {\n const paths = segmentGroup.segments.slice(0, startIndex);\n\n let i = 0;\n while (i < commands.length) {\n const command = commands[i];\n if (isCommandWithOutlets(command)) {\n const children = createNewSegmentChildren(command.outlets);\n return new UrlSegmentGroup(paths, children);\n }\n\n // if we start with an object literal, we need to reuse the path part from the segment\n if (i === 0 && isMatrixParams(commands[0])) {\n const p = segmentGroup.segments[startIndex];\n paths.push(new UrlSegment(p.path, stringify(commands[0])));\n i++;\n continue;\n }\n\n const curr = isCommandWithOutlets(command) ? command.outlets[PRIMARY_OUTLET] : `${command}`;\n const next = (i < commands.length - 1) ? commands[i + 1] : null;\n if (curr && next && isMatrixParams(next)) {\n paths.push(new UrlSegment(curr, stringify(next)));\n i += 2;\n } else {\n paths.push(new UrlSegment(curr, {}));\n i++;\n }\n }\n return new UrlSegmentGroup(paths, {});\n}\n\nfunction createNewSegmentChildren(outlets: {[name: string]: unknown[]|string}):\n {[outlet: string]: UrlSegmentGroup} {\n const children: {[outlet: string]: UrlSegmentGroup} = {};\n forEach(outlets, (commands, outlet) => {\n if (typeof commands === 'string') {\n commands = [commands];\n }\n if (commands !== null) {\n children[outlet] = createNewSegmentGroup(new UrlSegmentGroup([], {}), 0, commands);\n }\n });\n return children;\n}\n\nfunction stringify(params: {[key: string]: any}): {[key: string]: string} {\n const res: {[key: string]: string} = {};\n forEach(params, (v: any, k: string) => res[k] = `${v}`);\n return res;\n}\n\nfunction compare(path: string, params: {[key: string]: any}, segment: UrlSegment): boolean {\n return path == segment.path && shallowEqual(params, segment.parameters);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {MonoTypeOperatorFunction} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {LoadedRouterConfig} from '../config';\nimport {ActivationEnd, ChildActivationEnd, Event} from '../events';\nimport {DetachedRouteHandleInternal, RouteReuseStrategy} from '../route_reuse_strategy';\nimport {NavigationTransition} from '../router';\nimport {ChildrenOutletContexts} from '../router_outlet_context';\nimport {ActivatedRoute, ActivatedRouteSnapshot, advanceActivatedRoute, RouterState} from '../router_state';\nimport {forEach} from '../utils/collection';\nimport {nodeChildrenAsMap, TreeNode} from '../utils/tree';\n\nexport const activateRoutes =\n (rootContexts: ChildrenOutletContexts, routeReuseStrategy: RouteReuseStrategy,\n forwardEvent: (evt: Event) => void): MonoTypeOperatorFunction =>\n map(t => {\n new ActivateRoutes(\n routeReuseStrategy, t.targetRouterState!, t.currentRouterState, forwardEvent)\n .activate(rootContexts);\n return t;\n });\n\nexport class ActivateRoutes {\n constructor(\n private routeReuseStrategy: RouteReuseStrategy, private futureState: RouterState,\n private currState: RouterState, private forwardEvent: (evt: Event) => void) {}\n\n activate(parentContexts: ChildrenOutletContexts): void {\n const futureRoot = this.futureState._root;\n const currRoot = this.currState ? this.currState._root : null;\n\n this.deactivateChildRoutes(futureRoot, currRoot, parentContexts);\n advanceActivatedRoute(this.futureState.root);\n this.activateChildRoutes(futureRoot, currRoot, parentContexts);\n }\n\n // De-activate the child route that are not re-used for the future state\n private deactivateChildRoutes(\n futureNode: TreeNode, currNode: TreeNode|null,\n contexts: ChildrenOutletContexts): void {\n const children: {[outletName: string]: TreeNode} = nodeChildrenAsMap(currNode);\n\n // Recurse on the routes active in the future state to de-activate deeper children\n futureNode.children.forEach(futureChild => {\n const childOutletName = futureChild.value.outlet;\n this.deactivateRoutes(futureChild, children[childOutletName], contexts);\n delete children[childOutletName];\n });\n\n // De-activate the routes that will not be re-used\n forEach(children, (v: TreeNode, childName: string) => {\n this.deactivateRouteAndItsChildren(v, contexts);\n });\n }\n\n private deactivateRoutes(\n futureNode: TreeNode, currNode: TreeNode,\n parentContext: ChildrenOutletContexts): void {\n const future = futureNode.value;\n const curr = currNode ? currNode.value : null;\n\n if (future === curr) {\n // Reusing the node, check to see if the children need to be de-activated\n if (future.component) {\n // If we have a normal route, we need to go through an outlet.\n const context = parentContext.getContext(future.outlet);\n if (context) {\n this.deactivateChildRoutes(futureNode, currNode, context.children);\n }\n } else {\n // if we have a componentless route, we recurse but keep the same outlet map.\n this.deactivateChildRoutes(futureNode, currNode, parentContext);\n }\n } else {\n if (curr) {\n // Deactivate the current route which will not be re-used\n this.deactivateRouteAndItsChildren(currNode, parentContext);\n }\n }\n }\n\n private deactivateRouteAndItsChildren(\n route: TreeNode, parentContexts: ChildrenOutletContexts): void {\n if (this.routeReuseStrategy.shouldDetach(route.value.snapshot)) {\n this.detachAndStoreRouteSubtree(route, parentContexts);\n } else {\n this.deactivateRouteAndOutlet(route, parentContexts);\n }\n }\n\n private detachAndStoreRouteSubtree(\n route: TreeNode, parentContexts: ChildrenOutletContexts): void {\n const context = parentContexts.getContext(route.value.outlet);\n if (context && context.outlet) {\n const componentRef = context.outlet.detach();\n const contexts = context.children.onOutletDeactivated();\n this.routeReuseStrategy.store(route.value.snapshot, {componentRef, route, contexts});\n }\n }\n\n private deactivateRouteAndOutlet(\n route: TreeNode, parentContexts: ChildrenOutletContexts): void {\n const context = parentContexts.getContext(route.value.outlet);\n // The context could be `null` if we are on a componentless route but there may still be\n // children that need deactivating.\n const contexts = context && route.value.component ? context.children : parentContexts;\n const children: {[outletName: string]: TreeNode} = nodeChildrenAsMap(route);\n\n for (const childOutlet of Object.keys(children)) {\n this.deactivateRouteAndItsChildren(children[childOutlet], contexts);\n }\n\n if (context && context.outlet) {\n // Destroy the component\n context.outlet.deactivate();\n // Destroy the contexts for all the outlets that were in the component\n context.children.onOutletDeactivated();\n // Clear the information about the attached component on the context but keep the reference to\n // the outlet.\n context.attachRef = null;\n context.resolver = null;\n context.route = null;\n }\n }\n\n private activateChildRoutes(\n futureNode: TreeNode, currNode: TreeNode|null,\n contexts: ChildrenOutletContexts): void {\n const children: {[outlet: string]: TreeNode} = nodeChildrenAsMap(currNode);\n futureNode.children.forEach(c => {\n this.activateRoutes(c, children[c.value.outlet], contexts);\n this.forwardEvent(new ActivationEnd(c.value.snapshot));\n });\n if (futureNode.children.length) {\n this.forwardEvent(new ChildActivationEnd(futureNode.value.snapshot));\n }\n }\n\n private activateRoutes(\n futureNode: TreeNode, currNode: TreeNode,\n parentContexts: ChildrenOutletContexts): void {\n const future = futureNode.value;\n const curr = currNode ? currNode.value : null;\n\n advanceActivatedRoute(future);\n\n // reusing the node\n if (future === curr) {\n if (future.component) {\n // If we have a normal route, we need to go through an outlet.\n const context = parentContexts.getOrCreateContext(future.outlet);\n this.activateChildRoutes(futureNode, currNode, context.children);\n } else {\n // if we have a componentless route, we recurse but keep the same outlet map.\n this.activateChildRoutes(futureNode, currNode, parentContexts);\n }\n } else {\n if (future.component) {\n // if we have a normal route, we need to place the component into the outlet and recurse.\n const context = parentContexts.getOrCreateContext(future.outlet);\n\n if (this.routeReuseStrategy.shouldAttach(future.snapshot)) {\n const stored =\n (this.routeReuseStrategy.retrieve(future.snapshot));\n this.routeReuseStrategy.store(future.snapshot, null);\n context.children.onOutletReAttached(stored.contexts);\n context.attachRef = stored.componentRef;\n context.route = stored.route.value;\n if (context.outlet) {\n // Attach right away when the outlet has already been instantiated\n // Otherwise attach from `RouterOutlet.ngOnInit` when it is instantiated\n context.outlet.attach(stored.componentRef, stored.route.value);\n }\n advanceActivatedRouteNodeAndItsChildren(stored.route);\n } else {\n const config = parentLoadedConfig(future.snapshot);\n const cmpFactoryResolver = config ? config.module.componentFactoryResolver : null;\n\n context.attachRef = null;\n context.route = future;\n context.resolver = cmpFactoryResolver;\n if (context.outlet) {\n // Activate the outlet when it has already been instantiated\n // Otherwise it will get activated from its `ngOnInit` when instantiated\n context.outlet.activateWith(future, cmpFactoryResolver);\n }\n\n this.activateChildRoutes(futureNode, null, context.children);\n }\n } else {\n // if we have a componentless route, we recurse but keep the same outlet map.\n this.activateChildRoutes(futureNode, null, parentContexts);\n }\n }\n }\n}\n\nfunction advanceActivatedRouteNodeAndItsChildren(node: TreeNode): void {\n advanceActivatedRoute(node.value);\n node.children.forEach(advanceActivatedRouteNodeAndItsChildren);\n}\n\nfunction parentLoadedConfig(snapshot: ActivatedRouteSnapshot): LoadedRouterConfig|null {\n for (let s = snapshot.parent; s; s = s.parent) {\n const route = s.routeConfig;\n if (route && route._loadedConfig) return route._loadedConfig;\n if (route && route.component) return null;\n }\n\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModuleFactory, NgModuleRef, Type} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {ActivatedRouteSnapshot} from './router_state';\nimport {UrlSegment, UrlSegmentGroup} from './url_tree';\n\n\n/**\n * Represents a route configuration for the Router service.\n * An array of `Route` objects, used in `Router.config` and for nested route configurations\n * in `Route.children`.\n *\n * @see `Route`\n * @see `Router`\n * @see [Router configuration guide](guide/router-reference#configuration)\n * @publicApi\n */\nexport type Routes = Route[];\n\n/**\n * Represents the result of matching URLs with a custom matching function.\n *\n * * `consumed` is an array of the consumed URL segments.\n * * `posParams` is a map of positional parameters.\n *\n * @see `UrlMatcher()`\n * @publicApi\n */\nexport type UrlMatchResult = {\n consumed: UrlSegment[];\n posParams?: {[name: string]: UrlSegment};\n};\n\n/**\n * A function for matching a route against URLs. Implement a custom URL matcher\n * for `Route.matcher` when a combination of `path` and `pathMatch`\n * is not expressive enough. Cannot be used together with `path` and `pathMatch`.\n *\n * The function takes the following arguments and returns a `UrlMatchResult` object.\n * * *segments* : An array of URL segments.\n * * *group* : A segment group.\n * * *route* : The route to match against.\n *\n * The following example implementation matches HTML files.\n *\n * ```\n * export function htmlFiles(url: UrlSegment[]) {\n * return url.length === 1 && url[0].path.endsWith('.html') ? ({consumed: url}) : null;\n * }\n *\n * export const routes = [{ matcher: htmlFiles, component: AnyComponent }];\n * ```\n *\n * @publicApi\n */\nexport type UrlMatcher = (segments: UrlSegment[], group: UrlSegmentGroup, route: Route) =>\n UrlMatchResult|null;\n\n/**\n *\n * Represents static data associated with a particular route.\n *\n * @see `Route#data`\n *\n * @publicApi\n */\nexport type Data = {\n [name: string]: any\n};\n\n/**\n *\n * Represents the resolved data associated with a particular route.\n *\n * @see `Route#resolve`.\n *\n * @publicApi\n */\nexport type ResolveData = {\n [name: string]: any\n};\n\n/**\n *\n * A function that is called to resolve a collection of lazy-loaded routes.\n * Must be an arrow function of the following form:\n * `() => import('...').then(mod => mod.MODULE)`\n *\n * For example:\n *\n * ```\n * [{\n * path: 'lazy',\n * loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),\n * }];\n * ```\n *\n * @see [Route.loadChildren](api/router/Route#loadChildren)\n * @publicApi\n */\nexport type LoadChildrenCallback = () => Type|NgModuleFactory|Observable>|\n Promise|Type|any>;\n\n/**\n *\n * A function that returns a set of routes to load.\n *\n * The string form of `LoadChildren` is deprecated (see `DeprecatedLoadChildren`). The function\n * form (`LoadChildrenCallback`) should be used instead.\n *\n * @see `loadChildrenCallback`\n * @publicApi\n */\nexport type LoadChildren = LoadChildrenCallback|DeprecatedLoadChildren;\n\n/**\n * A string of the form `path/to/file#exportName` that acts as a URL for a set of routes to load.\n *\n * @see `loadChildrenCallback`\n * @publicApi\n * @deprecated The `string` form of `loadChildren` is deprecated in favor of the\n * `LoadChildrenCallback` function which uses the ES dynamic `import()` expression.\n * This offers a more natural and standards-based mechanism to dynamically\n * load an ES module at runtime.\n */\nexport type DeprecatedLoadChildren = string;\n\n/**\n *\n * How to handle query parameters in a router link.\n * One of:\n * - `merge` : Merge new with current parameters.\n * - `preserve` : Preserve current parameters.\n *\n * @see `UrlCreationOptions#queryParamsHandling`\n * @see `RouterLink`\n * @publicApi\n */\nexport type QueryParamsHandling = 'merge'|'preserve'|'';\n\n/**\n *\n * A policy for when to run guards and resolvers on a route.\n *\n * @see [Route.runGuardsAndResolvers](api/router/Route#runGuardsAndResolvers)\n * @publicApi\n */\nexport type RunGuardsAndResolvers =\n 'pathParamsChange'|'pathParamsOrQueryParamsChange'|'paramsChange'|'paramsOrQueryParamsChange'|\n 'always'|((from: ActivatedRouteSnapshot, to: ActivatedRouteSnapshot) => boolean);\n\n/**\n * A configuration object that defines a single route.\n * A set of routes are collected in a `Routes` array to define a `Router` configuration.\n * The router attempts to match segments of a given URL against each route,\n * using the configuration options defined in this object.\n *\n * Supports static, parameterized, redirect, and wildcard routes, as well as\n * custom route data and resolve methods.\n *\n * For detailed usage information, see the [Routing Guide](guide/router).\n *\n * @usageNotes\n *\n * ### Simple Configuration\n *\n * The following route specifies that when navigating to, for example,\n * `/team/11/user/bob`, the router creates the 'Team' component\n * with the 'User' child component in it.\n *\n * ```\n * [{\n * path: 'team/:id',\n * component: Team,\n * children: [{\n * path: 'user/:name',\n * component: User\n * }]\n * }]\n * ```\n *\n * ### Multiple Outlets\n *\n * The following route creates sibling components with multiple outlets.\n * When navigating to `/team/11(aux:chat/jim)`, the router creates the 'Team' component next to\n * the 'Chat' component. The 'Chat' component is placed into the 'aux' outlet.\n *\n * ```\n * [{\n * path: 'team/:id',\n * component: Team\n * }, {\n * path: 'chat/:user',\n * component: Chat\n * outlet: 'aux'\n * }]\n * ```\n *\n * ### Wild Cards\n *\n * The following route uses wild-card notation to specify a component\n * that is always instantiated regardless of where you navigate to.\n *\n * ```\n * [{\n * path: '**',\n * component: WildcardComponent\n * }]\n * ```\n *\n * ### Redirects\n *\n * The following route uses the `redirectTo` property to ignore a segment of\n * a given URL when looking for a child path.\n *\n * When navigating to '/team/11/legacy/user/jim', the router changes the URL segment\n * '/team/11/legacy/user/jim' to '/team/11/user/jim', and then instantiates\n * the Team component with the User child component in it.\n *\n * ```\n * [{\n * path: 'team/:id',\n * component: Team,\n * children: [{\n * path: 'legacy/user/:name',\n * redirectTo: 'user/:name'\n * }, {\n * path: 'user/:name',\n * component: User\n * }]\n * }]\n * ```\n *\n * The redirect path can be relative, as shown in this example, or absolute.\n * If we change the `redirectTo` value in the example to the absolute URL segment '/user/:name',\n * the result URL is also absolute, '/user/jim'.\n\n * ### Empty Path\n *\n * Empty-path route configurations can be used to instantiate components that do not 'consume'\n * any URL segments.\n *\n * In the following configuration, when navigating to\n * `/team/11`, the router instantiates the 'AllUsers' component.\n *\n * ```\n * [{\n * path: 'team/:id',\n * component: Team,\n * children: [{\n * path: '',\n * component: AllUsers\n * }, {\n * path: 'user/:name',\n * component: User\n * }]\n * }]\n * ```\n *\n * Empty-path routes can have children. In the following example, when navigating\n * to `/team/11/user/jim`, the router instantiates the wrapper component with\n * the user component in it.\n *\n * Note that an empty path route inherits its parent's parameters and data.\n *\n * ```\n * [{\n * path: 'team/:id',\n * component: Team,\n * children: [{\n * path: '',\n * component: WrapperCmp,\n * children: [{\n * path: 'user/:name',\n * component: User\n * }]\n * }]\n * }]\n * ```\n *\n * ### Matching Strategy\n *\n * The default path-match strategy is 'prefix', which means that the router\n * checks URL elements from the left to see if the URL matches a specified path.\n * For example, '/team/11/user' matches 'team/:id'.\n *\n * ```\n * [{\n * path: '',\n * pathMatch: 'prefix', //default\n * redirectTo: 'main'\n * }, {\n * path: 'main',\n * component: Main\n * }]\n * ```\n *\n * You can specify the path-match strategy 'full' to make sure that the path\n * covers the whole unconsumed URL. It is important to do this when redirecting\n * empty-path routes. Otherwise, because an empty path is a prefix of any URL,\n * the router would apply the redirect even when navigating to the redirect destination,\n * creating an endless loop.\n *\n * In the following example, supplying the 'full' `pathMatch` strategy ensures\n * that the router applies the redirect if and only if navigating to '/'.\n *\n * ```\n * [{\n * path: '',\n * pathMatch: 'full',\n * redirectTo: 'main'\n * }, {\n * path: 'main',\n * component: Main\n * }]\n * ```\n *\n * ### Componentless Routes\n *\n * You can share parameters between sibling components.\n * For example, suppose that two sibling components should go next to each other,\n * and both of them require an ID parameter. You can accomplish this using a route\n * that does not specify a component at the top level.\n *\n * In the following example, 'MainChild' and 'AuxChild' are siblings.\n * When navigating to 'parent/10/(a//aux:b)', the route instantiates\n * the main child and aux child components next to each other.\n * For this to work, the application component must have the primary and aux outlets defined.\n *\n * ```\n * [{\n * path: 'parent/:id',\n * children: [\n * { path: 'a', component: MainChild },\n * { path: 'b', component: AuxChild, outlet: 'aux' }\n * ]\n * }]\n * ```\n *\n * The router merges the parameters, data, and resolve of the componentless\n * parent into the parameters, data, and resolve of the children.\n *\n * This is especially useful when child components are defined\n * with an empty path string, as in the following example.\n * With this configuration, navigating to '/parent/10' creates\n * the main child and aux components.\n *\n * ```\n * [{\n * path: 'parent/:id',\n * children: [\n * { path: '', component: MainChild },\n * { path: '', component: AuxChild, outlet: 'aux' }\n * ]\n * }]\n * ```\n *\n * ### Lazy Loading\n *\n * Lazy loading speeds up application load time by splitting the application\n * into multiple bundles and loading them on demand.\n * To use lazy loading, provide the `loadChildren` property in the `Route` object,\n * instead of the `children` property.\n *\n * Given the following example route, the router will lazy load\n * the associated module on demand using the browser native import system.\n *\n * ```\n * [{\n * path: 'lazy',\n * loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),\n * }];\n * ```\n *\n * @publicApi\n */\nexport interface Route {\n /**\n * The path to match against. Cannot be used together with a custom `matcher` function.\n * A URL string that uses router matching notation.\n * Can be a wild card (`**`) that matches any URL (see Usage Notes below).\n * Default is \"/\" (the root path).\n *\n */\n path?: string;\n /**\n * The path-matching strategy, one of 'prefix' or 'full'.\n * Default is 'prefix'.\n *\n * By default, the router checks URL elements from the left to see if the URL\n * matches a given path and stops when there is a config match. Importantly there must still be a\n * config match for each segment of the URL. For example, '/team/11/user' matches the prefix\n * 'team/:id' if one of the route's children matches the segment 'user'. That is, the URL\n * '/team/11/user` matches the config\n * `{path: 'team/:id', children: [{path: ':user', component: User}]}`\n * but does not match when there are no children as in `{path: 'team/:id', component: Team}`.\n *\n * The path-match strategy 'full' matches against the entire URL.\n * It is important to do this when redirecting empty-path routes.\n * Otherwise, because an empty path is a prefix of any URL,\n * the router would apply the redirect even when navigating\n * to the redirect destination, creating an endless loop.\n *\n */\n pathMatch?: string;\n /**\n * A custom URL-matching function. Cannot be used together with `path`.\n */\n matcher?: UrlMatcher;\n /**\n * The component to instantiate when the path matches.\n * Can be empty if child routes specify components.\n */\n component?: Type;\n /**\n * A URL to redirect to when the path matches.\n *\n * Absolute if the URL begins with a slash (/), otherwise relative to the path URL.\n * Note that no further redirects are evaluated after an absolute redirect.\n *\n * When not present, router does not redirect.\n */\n redirectTo?: string;\n /**\n * Name of a `RouterOutlet` object where the component can be placed\n * when the path matches.\n */\n outlet?: string;\n /**\n * An array of dependency-injection tokens used to look up `CanActivate()`\n * handlers, in order to determine if the current user is allowed to\n * activate the component. By default, any user can activate.\n */\n canActivate?: any[];\n /**\n * An array of DI tokens used to look up `CanActivateChild()` handlers,\n * in order to determine if the current user is allowed to activate\n * a child of the component. By default, any user can activate a child.\n */\n canActivateChild?: any[];\n /**\n * An array of DI tokens used to look up `CanDeactivate()`\n * handlers, in order to determine if the current user is allowed to\n * deactivate the component. By default, any user can deactivate.\n *\n */\n canDeactivate?: any[];\n /**\n * An array of DI tokens used to look up `CanLoad()`\n * handlers, in order to determine if the current user is allowed to\n * load the component. By default, any user can load.\n */\n canLoad?: any[];\n /**\n * Additional developer-defined data provided to the component via\n * `ActivatedRoute`. By default, no additional data is passed.\n */\n data?: Data;\n /**\n * A map of DI tokens used to look up data resolvers. See `Resolve`.\n */\n resolve?: ResolveData;\n /**\n * An array of child `Route` objects that specifies a nested route\n * configuration.\n */\n children?: Routes;\n /**\n * An object specifying lazy-loaded child routes.\n */\n loadChildren?: LoadChildren;\n /**\n * Defines when guards and resolvers will be run. One of\n * - `paramsOrQueryParamsChange` : Run when query parameters change.\n * - `always` : Run on every execution.\n * By default, guards and resolvers run only when the matrix\n * parameters of the route change.\n */\n runGuardsAndResolvers?: RunGuardsAndResolvers;\n /**\n * Filled for routes with `loadChildren` once the module has been loaded\n * @internal\n */\n _loadedConfig?: LoadedRouterConfig;\n /**\n * Filled for routes with `loadChildren` during load\n * @internal\n */\n _loader$?: Observable;\n}\n\nexport class LoadedRouterConfig {\n constructor(public routes: Route[], public module: NgModuleRef) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CanActivate, CanActivateChild, CanDeactivate, CanLoad} from '../interfaces';\nimport {UrlTree} from '../url_tree';\n\n/**\n * Simple function check, but generic so type inference will flow. Example:\n *\n * function product(a: number, b: number) {\n * return a * b;\n * }\n *\n * if (isFunction(fn)) {\n * return fn(1, 2);\n * } else {\n * throw \"Must provide the `product` function\";\n * }\n */\nexport function isFunction(v: any): v is T {\n return typeof v === 'function';\n}\n\nexport function isBoolean(v: any): v is boolean {\n return typeof v === 'boolean';\n}\n\nexport function isUrlTree(v: any): v is UrlTree {\n return v instanceof UrlTree;\n}\n\nexport function isCanLoad(guard: any): guard is CanLoad {\n return guard && isFunction(guard.canLoad);\n}\n\nexport function isCanActivate(guard: any): guard is CanActivate {\n return guard && isFunction(guard.canActivate);\n}\n\nexport function isCanActivateChild(guard: any): guard is CanActivateChild {\n return guard && isFunction(guard.canActivateChild);\n}\n\nexport function isCanDeactivate(guard: any): guard is CanDeactivate {\n return guard && isFunction>(guard.canDeactivate);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {combineLatest, Observable, OperatorFunction} from 'rxjs';\nimport {filter, map, scan, startWith, switchMap, take} from 'rxjs/operators';\n\nimport {UrlTree} from '../url_tree';\nimport {isUrlTree} from '../utils/type_guards';\n\nconst INITIAL_VALUE = Symbol('INITIAL_VALUE');\ndeclare type INTERIM_VALUES = typeof INITIAL_VALUE | boolean | UrlTree;\n\nexport function prioritizedGuardValue():\n OperatorFunction[], boolean|UrlTree> {\n return switchMap(obs => {\n return combineLatest(obs.map(o => o.pipe(take(1), startWith(INITIAL_VALUE as INTERIM_VALUES))))\n .pipe(\n scan(\n (acc: INTERIM_VALUES, list: INTERIM_VALUES[]) => {\n let isPending = false;\n return list.reduce((innerAcc, val, i: number) => {\n if (innerAcc !== INITIAL_VALUE) return innerAcc;\n\n // Toggle pending flag if any values haven't been set yet\n if (val === INITIAL_VALUE) isPending = true;\n\n // Any other return values are only valid if we haven't yet hit a pending\n // call. This guarantees that in the case of a guard at the bottom of the\n // tree that returns a redirect, we will wait for the higher priority\n // guard at the top to finish before performing the redirect.\n if (!isPending) {\n // Early return when we hit a `false` value as that should always\n // cancel navigation\n if (val === false) return val;\n\n if (i === list.length - 1 || isUrlTree(val)) {\n return val;\n }\n }\n\n return innerAcc;\n }, acc);\n },\n INITIAL_VALUE),\n filter(item => item !== INITIAL_VALUE),\n map(item => isUrlTree(item) ? item : item === true), //\n take(1)) as Observable;\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Component} from '@angular/core';\n\n/**\n * This component is used internally within the router to be a placeholder when an empty\n * router-outlet is needed. For example, with a config such as:\n *\n * `{path: 'parent', outlet: 'nav', children: [...]}`\n *\n * In order to render, there needs to be a component on this config, which will default\n * to this `EmptyOutletComponent`.\n */\n@Component({template: ``})\nexport class ɵEmptyOutletComponent {\n}\n\nexport {ɵEmptyOutletComponent as EmptyOutletComponent};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EmptyOutletComponent} from '../components/empty_outlet';\nimport {Route, Routes} from '../config';\nimport {PRIMARY_OUTLET} from '../shared';\n\nexport function validateConfig(config: Routes, parentPath: string = ''): void {\n // forEach doesn't iterate undefined values\n for (let i = 0; i < config.length; i++) {\n const route: Route = config[i];\n const fullPath: string = getFullPath(parentPath, route);\n validateNode(route, fullPath);\n }\n}\n\nfunction validateNode(route: Route, fullPath: string): void {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!route) {\n throw new Error(`\n Invalid configuration of route '${fullPath}': Encountered undefined route.\n The reason might be an extra comma.\n\n Example:\n const routes: Routes = [\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n { path: 'dashboard', component: DashboardComponent },, << two commas\n { path: 'detail/:id', component: HeroDetailComponent }\n ];\n `);\n }\n if (Array.isArray(route)) {\n throw new Error(`Invalid configuration of route '${fullPath}': Array cannot be specified`);\n }\n if (!route.component && !route.children && !route.loadChildren &&\n (route.outlet && route.outlet !== PRIMARY_OUTLET)) {\n throw new Error(`Invalid configuration of route '${\n fullPath}': a componentless route without children or loadChildren cannot have a named outlet set`);\n }\n if (route.redirectTo && route.children) {\n throw new Error(`Invalid configuration of route '${\n fullPath}': redirectTo and children cannot be used together`);\n }\n if (route.redirectTo && route.loadChildren) {\n throw new Error(`Invalid configuration of route '${\n fullPath}': redirectTo and loadChildren cannot be used together`);\n }\n if (route.children && route.loadChildren) {\n throw new Error(`Invalid configuration of route '${\n fullPath}': children and loadChildren cannot be used together`);\n }\n if (route.redirectTo && route.component) {\n throw new Error(`Invalid configuration of route '${\n fullPath}': redirectTo and component cannot be used together`);\n }\n if (route.redirectTo && route.canActivate) {\n throw new Error(\n `Invalid configuration of route '${\n fullPath}': redirectTo and canActivate cannot be used together. Redirects happen before activation ` +\n `so canActivate will never be executed.`);\n }\n if (route.path && route.matcher) {\n throw new Error(\n `Invalid configuration of route '${fullPath}': path and matcher cannot be used together`);\n }\n if (route.redirectTo === void 0 && !route.component && !route.children && !route.loadChildren) {\n throw new Error(`Invalid configuration of route '${\n fullPath}'. One of the following must be provided: component, redirectTo, children or loadChildren`);\n }\n if (route.path === void 0 && route.matcher === void 0) {\n throw new Error(`Invalid configuration of route '${\n fullPath}': routes must have either a path or a matcher specified`);\n }\n if (typeof route.path === 'string' && route.path.charAt(0) === '/') {\n throw new Error(\n `Invalid configuration of route '${fullPath}': path cannot start with a slash`);\n }\n if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) {\n const exp =\n `The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`;\n throw new Error(`Invalid configuration of route '{path: \"${fullPath}\", redirectTo: \"${\n route.redirectTo}\"}': please provide 'pathMatch'. ${exp}`);\n }\n if (route.pathMatch !== void 0 && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {\n throw new Error(`Invalid configuration of route '${\n fullPath}': pathMatch can only be set to 'prefix' or 'full'`);\n }\n }\n if (route.children) {\n validateConfig(route.children, fullPath);\n }\n}\n\nfunction getFullPath(parentPath: string, currentRoute: Route): string {\n if (!currentRoute) {\n return parentPath;\n }\n if (!parentPath && !currentRoute.path) {\n return '';\n } else if (parentPath && !currentRoute.path) {\n return `${parentPath}/`;\n } else if (!parentPath && currentRoute.path) {\n return currentRoute.path;\n } else {\n return `${parentPath}/${currentRoute.path}`;\n }\n}\n\n/**\n * Makes a copy of the config and adds any default required properties.\n */\nexport function standardizeConfig(r: Route): Route {\n const children = r.children && r.children.map(standardizeConfig);\n const c = children ? {...r, children} : {...r};\n if (!c.component && (children || c.loadChildren) && (c.outlet && c.outlet !== PRIMARY_OUTLET)) {\n c.component = EmptyOutletComponent;\n }\n return c;\n}\n\n/** Returns the `route.outlet` or PRIMARY_OUTLET if none exists. */\nexport function getOutlet(route: Route): string {\n return route.outlet || PRIMARY_OUTLET;\n}\n\n/**\n * Sorts the `routes` such that the ones with an outlet matching `outletName` come first.\n * The order of the configs is otherwise preserved.\n */\nexport function sortByMatchingOutlets(routes: Routes, outletName: string): Routes {\n const sortedConfig = routes.filter(r => getOutlet(r) === outletName);\n sortedConfig.push(...routes.filter(r => getOutlet(r) !== outletName));\n return sortedConfig;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Route} from '../config';\nimport {defaultUrlMatcher, PRIMARY_OUTLET} from '../shared';\nimport {UrlSegment, UrlSegmentGroup} from '../url_tree';\n\nimport {forEach} from './collection';\nimport {getOutlet} from './config';\n\nexport interface MatchResult {\n matched: boolean;\n consumedSegments: UrlSegment[];\n lastChild: number;\n parameters: {[k: string]: string};\n positionalParamSegments: {[k: string]: UrlSegment};\n}\n\nconst noMatch: MatchResult = {\n matched: false,\n consumedSegments: [],\n lastChild: 0,\n parameters: {},\n positionalParamSegments: {}\n};\n\nexport function match(\n segmentGroup: UrlSegmentGroup, route: Route, segments: UrlSegment[]): MatchResult {\n if (route.path === '') {\n if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || segments.length > 0)) {\n return {...noMatch};\n }\n\n return {\n matched: true,\n consumedSegments: [],\n lastChild: 0,\n parameters: {},\n positionalParamSegments: {}\n };\n }\n\n const matcher = route.matcher || defaultUrlMatcher;\n const res = matcher(segments, segmentGroup, route);\n if (!res) return {...noMatch};\n\n const posParams: {[n: string]: string} = {};\n forEach(res.posParams!, (v: UrlSegment, k: string) => {\n posParams[k] = v.path;\n });\n const parameters = res.consumed.length > 0 ?\n {...posParams, ...res.consumed[res.consumed.length - 1].parameters} :\n posParams;\n\n return {\n matched: true,\n consumedSegments: res.consumed,\n lastChild: res.consumed.length,\n // TODO(atscott): investigate combining parameters and positionalParamSegments\n parameters,\n positionalParamSegments: res.posParams ?? {}\n };\n}\n\nexport function split(\n segmentGroup: UrlSegmentGroup, consumedSegments: UrlSegment[], slicedSegments: UrlSegment[],\n config: Route[], relativeLinkResolution: 'legacy'|'corrected' = 'corrected') {\n if (slicedSegments.length > 0 &&\n containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, config)) {\n const s = new UrlSegmentGroup(\n consumedSegments,\n createChildrenForEmptyPaths(\n segmentGroup, consumedSegments, config,\n new UrlSegmentGroup(slicedSegments, segmentGroup.children)));\n s._sourceSegment = segmentGroup;\n s._segmentIndexShift = consumedSegments.length;\n return {segmentGroup: s, slicedSegments: []};\n }\n\n if (slicedSegments.length === 0 &&\n containsEmptyPathMatches(segmentGroup, slicedSegments, config)) {\n const s = new UrlSegmentGroup(\n segmentGroup.segments,\n addEmptyPathsToChildrenIfNeeded(\n segmentGroup, consumedSegments, slicedSegments, config, segmentGroup.children,\n relativeLinkResolution));\n s._sourceSegment = segmentGroup;\n s._segmentIndexShift = consumedSegments.length;\n return {segmentGroup: s, slicedSegments};\n }\n\n const s = new UrlSegmentGroup(segmentGroup.segments, segmentGroup.children);\n s._sourceSegment = segmentGroup;\n s._segmentIndexShift = consumedSegments.length;\n return {segmentGroup: s, slicedSegments};\n}\n\nfunction addEmptyPathsToChildrenIfNeeded(\n segmentGroup: UrlSegmentGroup, consumedSegments: UrlSegment[], slicedSegments: UrlSegment[],\n routes: Route[], children: {[name: string]: UrlSegmentGroup},\n relativeLinkResolution: 'legacy'|'corrected'): {[name: string]: UrlSegmentGroup} {\n const res: {[name: string]: UrlSegmentGroup} = {};\n for (const r of routes) {\n if (emptyPathMatch(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) {\n const s = new UrlSegmentGroup([], {});\n s._sourceSegment = segmentGroup;\n if (relativeLinkResolution === 'legacy') {\n s._segmentIndexShift = segmentGroup.segments.length;\n } else {\n s._segmentIndexShift = consumedSegments.length;\n }\n res[getOutlet(r)] = s;\n }\n }\n return {...children, ...res};\n}\n\nfunction createChildrenForEmptyPaths(\n segmentGroup: UrlSegmentGroup, consumedSegments: UrlSegment[], routes: Route[],\n primarySegment: UrlSegmentGroup): {[name: string]: UrlSegmentGroup} {\n const res: {[name: string]: UrlSegmentGroup} = {};\n res[PRIMARY_OUTLET] = primarySegment;\n primarySegment._sourceSegment = segmentGroup;\n primarySegment._segmentIndexShift = consumedSegments.length;\n\n for (const r of routes) {\n if (r.path === '' && getOutlet(r) !== PRIMARY_OUTLET) {\n const s = new UrlSegmentGroup([], {});\n s._sourceSegment = segmentGroup;\n s._segmentIndexShift = consumedSegments.length;\n res[getOutlet(r)] = s;\n }\n }\n return res;\n}\n\nfunction containsEmptyPathMatchesWithNamedOutlets(\n segmentGroup: UrlSegmentGroup, slicedSegments: UrlSegment[], routes: Route[]): boolean {\n return routes.some(\n r => emptyPathMatch(segmentGroup, slicedSegments, r) && getOutlet(r) !== PRIMARY_OUTLET);\n}\n\nfunction containsEmptyPathMatches(\n segmentGroup: UrlSegmentGroup, slicedSegments: UrlSegment[], routes: Route[]): boolean {\n return routes.some(r => emptyPathMatch(segmentGroup, slicedSegments, r));\n}\n\nfunction emptyPathMatch(\n segmentGroup: UrlSegmentGroup, slicedSegments: UrlSegment[], r: Route): boolean {\n if ((segmentGroup.hasChildren() || slicedSegments.length > 0) && r.pathMatch === 'full') {\n return false;\n }\n\n return r.path === '';\n}\n\n/**\n * Determines if `route` is a path match for the `rawSegment`, `segments`, and `outlet` without\n * verifying that its children are a full match for the remainder of the `rawSegment` children as\n * well.\n */\nexport function isImmediateMatch(\n route: Route, rawSegment: UrlSegmentGroup, segments: UrlSegment[], outlet: string): boolean {\n // We allow matches to empty paths when the outlets differ so we can match a url like `/(b:b)` to\n // a config like\n // * `{path: '', children: [{path: 'b', outlet: 'b'}]}`\n // or even\n // * `{path: '', outlet: 'a', children: [{path: 'b', outlet: 'b'}]`\n //\n // The exception here is when the segment outlet is for the primary outlet. This would\n // result in a match inside the named outlet because all children there are written as primary\n // outlets. So we need to prevent child named outlet matches in a url like `/b` in a config like\n // * `{path: '', outlet: 'x' children: [{path: 'b'}]}`\n // This should only match if the url is `/(x:b)`.\n if (getOutlet(route) !== outlet &&\n (outlet === PRIMARY_OUTLET || !emptyPathMatch(rawSegment, segments, route))) {\n return false;\n }\n if (route.path === '**') {\n return true;\n }\n return match(rawSegment, route, segments).matched;\n}\n\nexport function noLeftoversInUrl(\n segmentGroup: UrlSegmentGroup, segments: UrlSegment[], outlet: string): boolean {\n return segments.length === 0 && !segmentGroup.children[outlet];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, NgModuleRef} from '@angular/core';\nimport {EmptyError, from, Observable, Observer, of} from 'rxjs';\nimport {catchError, concatMap, first, last, map, mergeMap, scan, tap} from 'rxjs/operators';\n\nimport {LoadedRouterConfig, Route, Routes} from './config';\nimport {CanLoadFn} from './interfaces';\nimport {prioritizedGuardValue} from './operators/prioritized_guard_value';\nimport {RouterConfigLoader} from './router_config_loader';\nimport {navigationCancelingError, Params, PRIMARY_OUTLET} from './shared';\nimport {UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree} from './url_tree';\nimport {forEach, wrapIntoObservable} from './utils/collection';\nimport {getOutlet, sortByMatchingOutlets} from './utils/config';\nimport {isImmediateMatch, match, noLeftoversInUrl, split} from './utils/config_matching';\nimport {isCanLoad, isFunction, isUrlTree} from './utils/type_guards';\n\nclass NoMatch {\n public segmentGroup: UrlSegmentGroup|null;\n\n constructor(segmentGroup?: UrlSegmentGroup) {\n this.segmentGroup = segmentGroup || null;\n }\n}\n\nclass AbsoluteRedirect {\n constructor(public urlTree: UrlTree) {}\n}\n\nfunction noMatch(segmentGroup: UrlSegmentGroup): Observable {\n return new Observable(\n (obs: Observer) => obs.error(new NoMatch(segmentGroup)));\n}\n\nfunction absoluteRedirect(newTree: UrlTree): Observable {\n return new Observable(\n (obs: Observer) => obs.error(new AbsoluteRedirect(newTree)));\n}\n\nfunction namedOutletsRedirect(redirectTo: string): Observable {\n return new Observable(\n (obs: Observer) => obs.error(new Error(\n `Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`)));\n}\n\nfunction canLoadFails(route: Route): Observable {\n return new Observable(\n (obs: Observer) => obs.error(\n navigationCancelingError(`Cannot load children because the guard of the route \"path: '${\n route.path}'\" returned false`)));\n}\n\n/**\n * Returns the `UrlTree` with the redirection applied.\n *\n * Lazy modules are loaded along the way.\n */\nexport function applyRedirects(\n moduleInjector: Injector, configLoader: RouterConfigLoader, urlSerializer: UrlSerializer,\n urlTree: UrlTree, config: Routes): Observable {\n return new ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config).apply();\n}\n\nclass ApplyRedirects {\n private allowRedirects: boolean = true;\n private ngModule: NgModuleRef;\n\n constructor(\n moduleInjector: Injector, private configLoader: RouterConfigLoader,\n private urlSerializer: UrlSerializer, private urlTree: UrlTree, private config: Routes) {\n this.ngModule = moduleInjector.get(NgModuleRef);\n }\n\n apply(): Observable {\n const splitGroup = split(this.urlTree.root, [], [], this.config).segmentGroup;\n // TODO(atscott): creating a new segment removes the _sourceSegment _segmentIndexShift, which is\n // only necessary to prevent failures in tests which assert exact object matches. The `split` is\n // now shared between `applyRedirects` and `recognize` but only the `recognize` step needs these\n // properties. Before the implementations were merged, the `applyRedirects` would not assign\n // them. We should be able to remove this logic as a \"breaking change\" but should do some more\n // investigation into the failures first.\n const rootSegmentGroup = new UrlSegmentGroup(splitGroup.segments, splitGroup.children);\n\n const expanded$ =\n this.expandSegmentGroup(this.ngModule, this.config, rootSegmentGroup, PRIMARY_OUTLET);\n const urlTrees$ = expanded$.pipe(map((rootSegmentGroup: UrlSegmentGroup) => {\n return this.createUrlTree(\n squashSegmentGroup(rootSegmentGroup), this.urlTree.queryParams, this.urlTree.fragment);\n }));\n return urlTrees$.pipe(catchError((e: any) => {\n if (e instanceof AbsoluteRedirect) {\n // After an absolute redirect we do not apply any more redirects!\n // If this implementation changes, update the documentation note in `redirectTo`.\n this.allowRedirects = false;\n // we need to run matching, so we can fetch all lazy-loaded modules\n return this.match(e.urlTree);\n }\n\n if (e instanceof NoMatch) {\n throw this.noMatchError(e);\n }\n\n throw e;\n }));\n }\n\n private match(tree: UrlTree): Observable {\n const expanded$ =\n this.expandSegmentGroup(this.ngModule, this.config, tree.root, PRIMARY_OUTLET);\n const mapped$ = expanded$.pipe(map((rootSegmentGroup: UrlSegmentGroup) => {\n return this.createUrlTree(\n squashSegmentGroup(rootSegmentGroup), tree.queryParams, tree.fragment);\n }));\n return mapped$.pipe(catchError((e: any): Observable => {\n if (e instanceof NoMatch) {\n throw this.noMatchError(e);\n }\n\n throw e;\n }));\n }\n\n private noMatchError(e: NoMatch): any {\n return new Error(`Cannot match any routes. URL Segment: '${e.segmentGroup}'`);\n }\n\n private createUrlTree(rootCandidate: UrlSegmentGroup, queryParams: Params, fragment: string|null):\n UrlTree {\n const root = rootCandidate.segments.length > 0 ?\n new UrlSegmentGroup([], {[PRIMARY_OUTLET]: rootCandidate}) :\n rootCandidate;\n return new UrlTree(root, queryParams, fragment);\n }\n\n private expandSegmentGroup(\n ngModule: NgModuleRef, routes: Route[], segmentGroup: UrlSegmentGroup,\n outlet: string): Observable {\n if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n return this.expandChildren(ngModule, routes, segmentGroup)\n .pipe(map((children: any) => new UrlSegmentGroup([], children)));\n }\n\n return this.expandSegment(ngModule, segmentGroup, routes, segmentGroup.segments, outlet, true);\n }\n\n // Recursively expand segment groups for all the child outlets\n private expandChildren(\n ngModule: NgModuleRef, routes: Route[],\n segmentGroup: UrlSegmentGroup): Observable<{[name: string]: UrlSegmentGroup}> {\n // Expand outlets one at a time, starting with the primary outlet. We need to do it this way\n // because an absolute redirect from the primary outlet takes precedence.\n const childOutlets: string[] = [];\n for (const child of Object.keys(segmentGroup.children)) {\n if (child === 'primary') {\n childOutlets.unshift(child);\n } else {\n childOutlets.push(child);\n }\n }\n\n return from(childOutlets)\n .pipe(\n concatMap(childOutlet => {\n const child = segmentGroup.children[childOutlet];\n // Sort the routes so routes with outlets that match the segment appear\n // first, followed by routes for other outlets, which might match if they have an\n // empty path.\n const sortedRoutes = sortByMatchingOutlets(routes, childOutlet);\n return this.expandSegmentGroup(ngModule, sortedRoutes, child, childOutlet)\n .pipe(map(s => ({segment: s, outlet: childOutlet})));\n }),\n scan(\n (children, expandedChild) => {\n children[expandedChild.outlet] = expandedChild.segment;\n return children;\n },\n {} as {[outlet: string]: UrlSegmentGroup}),\n last(),\n );\n }\n\n private expandSegment(\n ngModule: NgModuleRef, segmentGroup: UrlSegmentGroup, routes: Route[],\n segments: UrlSegment[], outlet: string,\n allowRedirects: boolean): Observable {\n return from(routes).pipe(\n concatMap((r: any) => {\n const expanded$ = this.expandSegmentAgainstRoute(\n ngModule, segmentGroup, routes, r, segments, outlet, allowRedirects);\n return expanded$.pipe(catchError((e: any) => {\n if (e instanceof NoMatch) {\n return of(null);\n }\n throw e;\n }));\n }),\n first((s): s is UrlSegmentGroup => !!s), catchError((e: any, _: any) => {\n if (e instanceof EmptyError || e.name === 'EmptyError') {\n if (noLeftoversInUrl(segmentGroup, segments, outlet)) {\n return of(new UrlSegmentGroup([], {}));\n }\n throw new NoMatch(segmentGroup);\n }\n throw e;\n }));\n }\n\n private expandSegmentAgainstRoute(\n ngModule: NgModuleRef, segmentGroup: UrlSegmentGroup, routes: Route[], route: Route,\n paths: UrlSegment[], outlet: string, allowRedirects: boolean): Observable {\n if (!isImmediateMatch(route, segmentGroup, paths, outlet)) {\n return noMatch(segmentGroup);\n }\n\n if (route.redirectTo === undefined) {\n return this.matchSegmentAgainstRoute(ngModule, segmentGroup, route, paths, outlet);\n }\n\n if (allowRedirects && this.allowRedirects) {\n return this.expandSegmentAgainstRouteUsingRedirect(\n ngModule, segmentGroup, routes, route, paths, outlet);\n }\n\n return noMatch(segmentGroup);\n }\n\n private expandSegmentAgainstRouteUsingRedirect(\n ngModule: NgModuleRef, segmentGroup: UrlSegmentGroup, routes: Route[], route: Route,\n segments: UrlSegment[], outlet: string): Observable {\n if (route.path === '**') {\n return this.expandWildCardWithParamsAgainstRouteUsingRedirect(\n ngModule, routes, route, outlet);\n }\n\n return this.expandRegularSegmentAgainstRouteUsingRedirect(\n ngModule, segmentGroup, routes, route, segments, outlet);\n }\n\n private expandWildCardWithParamsAgainstRouteUsingRedirect(\n ngModule: NgModuleRef, routes: Route[], route: Route,\n outlet: string): Observable {\n const newTree = this.applyRedirectCommands([], route.redirectTo!, {});\n if (route.redirectTo!.startsWith('/')) {\n return absoluteRedirect(newTree);\n }\n\n return this.lineralizeSegments(route, newTree).pipe(mergeMap((newSegments: UrlSegment[]) => {\n const group = new UrlSegmentGroup(newSegments, {});\n return this.expandSegment(ngModule, group, routes, newSegments, outlet, false);\n }));\n }\n\n private expandRegularSegmentAgainstRouteUsingRedirect(\n ngModule: NgModuleRef, segmentGroup: UrlSegmentGroup, routes: Route[], route: Route,\n segments: UrlSegment[], outlet: string): Observable {\n const {matched, consumedSegments, lastChild, positionalParamSegments} =\n match(segmentGroup, route, segments);\n if (!matched) return noMatch(segmentGroup);\n\n const newTree =\n this.applyRedirectCommands(consumedSegments, route.redirectTo!, positionalParamSegments);\n if (route.redirectTo!.startsWith('/')) {\n return absoluteRedirect(newTree);\n }\n\n return this.lineralizeSegments(route, newTree).pipe(mergeMap((newSegments: UrlSegment[]) => {\n return this.expandSegment(\n ngModule, segmentGroup, routes, newSegments.concat(segments.slice(lastChild)), outlet,\n false);\n }));\n }\n\n private matchSegmentAgainstRoute(\n ngModule: NgModuleRef, rawSegmentGroup: UrlSegmentGroup, route: Route,\n segments: UrlSegment[], outlet: string): Observable {\n if (route.path === '**') {\n if (route.loadChildren) {\n const loaded$ = route._loadedConfig ? of(route._loadedConfig) :\n this.configLoader.load(ngModule.injector, route);\n return loaded$.pipe(map((cfg: LoadedRouterConfig) => {\n route._loadedConfig = cfg;\n return new UrlSegmentGroup(segments, {});\n }));\n }\n\n return of(new UrlSegmentGroup(segments, {}));\n }\n\n const {matched, consumedSegments, lastChild} = match(rawSegmentGroup, route, segments);\n if (!matched) return noMatch(rawSegmentGroup);\n\n const rawSlicedSegments = segments.slice(lastChild);\n const childConfig$ = this.getChildConfig(ngModule, route, segments);\n\n return childConfig$.pipe(mergeMap((routerConfig: LoadedRouterConfig) => {\n const childModule = routerConfig.module;\n const childConfig = routerConfig.routes;\n\n const {segmentGroup: splitSegmentGroup, slicedSegments} =\n split(rawSegmentGroup, consumedSegments, rawSlicedSegments, childConfig);\n // See comment on the other call to `split` about why this is necessary.\n const segmentGroup =\n new UrlSegmentGroup(splitSegmentGroup.segments, splitSegmentGroup.children);\n\n if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {\n const expanded$ = this.expandChildren(childModule, childConfig, segmentGroup);\n return expanded$.pipe(\n map((children: any) => new UrlSegmentGroup(consumedSegments, children)));\n }\n\n if (childConfig.length === 0 && slicedSegments.length === 0) {\n return of(new UrlSegmentGroup(consumedSegments, {}));\n }\n\n const matchedOnOutlet = getOutlet(route) === outlet;\n const expanded$ = this.expandSegment(\n childModule, segmentGroup, childConfig, slicedSegments,\n matchedOnOutlet ? PRIMARY_OUTLET : outlet, true);\n return expanded$.pipe(\n map((cs: UrlSegmentGroup) =>\n new UrlSegmentGroup(consumedSegments.concat(cs.segments), cs.children)));\n }));\n }\n\n private getChildConfig(ngModule: NgModuleRef, route: Route, segments: UrlSegment[]):\n Observable {\n if (route.children) {\n // The children belong to the same module\n return of(new LoadedRouterConfig(route.children, ngModule));\n }\n\n if (route.loadChildren) {\n // lazy children belong to the loaded module\n if (route._loadedConfig !== undefined) {\n return of(route._loadedConfig);\n }\n\n return this.runCanLoadGuards(ngModule.injector, route, segments)\n .pipe(mergeMap((shouldLoadResult: boolean) => {\n if (shouldLoadResult) {\n return this.configLoader.load(ngModule.injector, route)\n .pipe(map((cfg: LoadedRouterConfig) => {\n route._loadedConfig = cfg;\n return cfg;\n }));\n }\n return canLoadFails(route);\n }));\n }\n\n return of(new LoadedRouterConfig([], ngModule));\n }\n\n private runCanLoadGuards(moduleInjector: Injector, route: Route, segments: UrlSegment[]):\n Observable {\n const canLoad = route.canLoad;\n if (!canLoad || canLoad.length === 0) return of(true);\n\n const canLoadObservables = canLoad.map((injectionToken: any) => {\n const guard = moduleInjector.get(injectionToken);\n let guardVal;\n if (isCanLoad(guard)) {\n guardVal = guard.canLoad(route, segments);\n } else if (isFunction(guard)) {\n guardVal = guard(route, segments);\n } else {\n throw new Error('Invalid CanLoad guard');\n }\n return wrapIntoObservable(guardVal);\n });\n\n return of(canLoadObservables)\n .pipe(\n prioritizedGuardValue(),\n tap((result: UrlTree|boolean) => {\n if (!isUrlTree(result)) return;\n\n const error: Error&{url?: UrlTree} = navigationCancelingError(\n `Redirecting to \"${this.urlSerializer.serialize(result)}\"`);\n error.url = result;\n throw error;\n }),\n map(result => result === true),\n );\n }\n\n private lineralizeSegments(route: Route, urlTree: UrlTree): Observable {\n let res: UrlSegment[] = [];\n let c = urlTree.root;\n while (true) {\n res = res.concat(c.segments);\n if (c.numberOfChildren === 0) {\n return of(res);\n }\n\n if (c.numberOfChildren > 1 || !c.children[PRIMARY_OUTLET]) {\n return namedOutletsRedirect(route.redirectTo!);\n }\n\n c = c.children[PRIMARY_OUTLET];\n }\n }\n\n private applyRedirectCommands(\n segments: UrlSegment[], redirectTo: string, posParams: {[k: string]: UrlSegment}): UrlTree {\n return this.applyRedirectCreatreUrlTree(\n redirectTo, this.urlSerializer.parse(redirectTo), segments, posParams);\n }\n\n private applyRedirectCreatreUrlTree(\n redirectTo: string, urlTree: UrlTree, segments: UrlSegment[],\n posParams: {[k: string]: UrlSegment}): UrlTree {\n const newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams);\n return new UrlTree(\n newRoot, this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams),\n urlTree.fragment);\n }\n\n private createQueryParams(redirectToParams: Params, actualParams: Params): Params {\n const res: Params = {};\n forEach(redirectToParams, (v: any, k: string) => {\n const copySourceValue = typeof v === 'string' && v.startsWith(':');\n if (copySourceValue) {\n const sourceName = v.substring(1);\n res[k] = actualParams[sourceName];\n } else {\n res[k] = v;\n }\n });\n return res;\n }\n\n private createSegmentGroup(\n redirectTo: string, group: UrlSegmentGroup, segments: UrlSegment[],\n posParams: {[k: string]: UrlSegment}): UrlSegmentGroup {\n const updatedSegments = this.createSegments(redirectTo, group.segments, segments, posParams);\n\n let children: {[n: string]: UrlSegmentGroup} = {};\n forEach(group.children, (child: UrlSegmentGroup, name: string) => {\n children[name] = this.createSegmentGroup(redirectTo, child, segments, posParams);\n });\n\n return new UrlSegmentGroup(updatedSegments, children);\n }\n\n private createSegments(\n redirectTo: string, redirectToSegments: UrlSegment[], actualSegments: UrlSegment[],\n posParams: {[k: string]: UrlSegment}): UrlSegment[] {\n return redirectToSegments.map(\n s => s.path.startsWith(':') ? this.findPosParam(redirectTo, s, posParams) :\n this.findOrReturn(s, actualSegments));\n }\n\n private findPosParam(\n redirectTo: string, redirectToUrlSegment: UrlSegment,\n posParams: {[k: string]: UrlSegment}): UrlSegment {\n const pos = posParams[redirectToUrlSegment.path.substring(1)];\n if (!pos)\n throw new Error(\n `Cannot redirect to '${redirectTo}'. Cannot find '${redirectToUrlSegment.path}'.`);\n return pos;\n }\n\n private findOrReturn(redirectToUrlSegment: UrlSegment, actualSegments: UrlSegment[]): UrlSegment {\n let idx = 0;\n for (const s of actualSegments) {\n if (s.path === redirectToUrlSegment.path) {\n actualSegments.splice(idx);\n return s;\n }\n idx++;\n }\n return redirectToUrlSegment;\n }\n}\n\n/**\n * When possible, merges the primary outlet child into the parent `UrlSegmentGroup`.\n *\n * When a segment group has only one child which is a primary outlet, merges that child into the\n * parent. That is, the child segment group's segments are merged into the `s` and the child's\n * children become the children of `s`. Think of this like a 'squash', merging the child segment\n * group into the parent.\n */\nfunction mergeTrivialChildren(s: UrlSegmentGroup): UrlSegmentGroup {\n if (s.numberOfChildren === 1 && s.children[PRIMARY_OUTLET]) {\n const c = s.children[PRIMARY_OUTLET];\n return new UrlSegmentGroup(s.segments.concat(c.segments), c.children);\n }\n\n return s;\n}\n\n/**\n * Recursively merges primary segment children into their parents and also drops empty children\n * (those which have no segments and no children themselves). The latter prevents serializing a\n * group into something like `/a(aux:)`, where `aux` is an empty child segment.\n */\nfunction squashSegmentGroup(segmentGroup: UrlSegmentGroup): UrlSegmentGroup {\n const newChildren = {} as any;\n for (const childOutlet of Object.keys(segmentGroup.children)) {\n const child = segmentGroup.children[childOutlet];\n const childCandidate = squashSegmentGroup(child);\n // don't add empty children\n if (childCandidate.segments.length > 0 || childCandidate.hasChildren()) {\n newChildren[childOutlet] = childCandidate;\n }\n }\n const s = new UrlSegmentGroup(segmentGroup.segments, newChildren);\n return mergeTrivialChildren(s);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '@angular/core';\nimport {MonoTypeOperatorFunction} from 'rxjs';\nimport {map, switchMap} from 'rxjs/operators';\n\nimport {applyRedirects as applyRedirectsFn} from '../apply_redirects';\nimport {Routes} from '../config';\nimport {NavigationTransition} from '../router';\nimport {RouterConfigLoader} from '../router_config_loader';\nimport {UrlSerializer} from '../url_tree';\n\nexport function applyRedirects(\n moduleInjector: Injector, configLoader: RouterConfigLoader, urlSerializer: UrlSerializer,\n config: Routes): MonoTypeOperatorFunction {\n return switchMap(\n t => applyRedirectsFn(moduleInjector, configLoader, urlSerializer, t.extractedUrl, config)\n .pipe(map(urlAfterRedirects => ({...t, urlAfterRedirects}))));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '@angular/core';\n\nimport {LoadedRouterConfig, RunGuardsAndResolvers} from '../config';\nimport {ChildrenOutletContexts, OutletContext} from '../router_outlet_context';\nimport {ActivatedRouteSnapshot, equalParamsAndUrlSegments, RouterStateSnapshot} from '../router_state';\nimport {equalPath} from '../url_tree';\nimport {forEach, shallowEqual} from '../utils/collection';\nimport {nodeChildrenAsMap, TreeNode} from '../utils/tree';\n\nexport class CanActivate {\n readonly route: ActivatedRouteSnapshot;\n constructor(public path: ActivatedRouteSnapshot[]) {\n this.route = this.path[this.path.length - 1];\n }\n}\n\nexport class CanDeactivate {\n constructor(public component: Object|null, public route: ActivatedRouteSnapshot) {}\n}\n\nexport declare type Checks = {\n canDeactivateChecks: CanDeactivate[],\n canActivateChecks: CanActivate[],\n};\n\nexport function getAllRouteGuards(\n future: RouterStateSnapshot, curr: RouterStateSnapshot,\n parentContexts: ChildrenOutletContexts) {\n const futureRoot = future._root;\n const currRoot = curr ? curr._root : null;\n\n return getChildRouteGuards(futureRoot, currRoot, parentContexts, [futureRoot.value]);\n}\n\nexport function getCanActivateChild(p: ActivatedRouteSnapshot):\n {node: ActivatedRouteSnapshot, guards: any[]}|null {\n const canActivateChild = p.routeConfig ? p.routeConfig.canActivateChild : null;\n if (!canActivateChild || canActivateChild.length === 0) return null;\n return {node: p, guards: canActivateChild};\n}\n\nexport function getToken(\n token: any, snapshot: ActivatedRouteSnapshot, moduleInjector: Injector): any {\n const config = getClosestLoadedConfig(snapshot);\n const injector = config ? config.module.injector : moduleInjector;\n return injector.get(token);\n}\n\nfunction getClosestLoadedConfig(snapshot: ActivatedRouteSnapshot): LoadedRouterConfig|null {\n if (!snapshot) return null;\n\n for (let s = snapshot.parent; s; s = s.parent) {\n const route = s.routeConfig;\n if (route && route._loadedConfig) return route._loadedConfig;\n }\n\n return null;\n}\n\nfunction getChildRouteGuards(\n futureNode: TreeNode, currNode: TreeNode|null,\n contexts: ChildrenOutletContexts|null, futurePath: ActivatedRouteSnapshot[], checks: Checks = {\n canDeactivateChecks: [],\n canActivateChecks: []\n }): Checks {\n const prevChildren = nodeChildrenAsMap(currNode);\n\n // Process the children of the future route\n futureNode.children.forEach(c => {\n getRouteGuards(c, prevChildren[c.value.outlet], contexts, futurePath.concat([c.value]), checks);\n delete prevChildren[c.value.outlet];\n });\n\n // Process any children left from the current route (not active for the future route)\n forEach(\n prevChildren,\n (v: TreeNode, k: string) =>\n deactivateRouteAndItsChildren(v, contexts!.getContext(k), checks));\n\n return checks;\n}\n\nfunction getRouteGuards(\n futureNode: TreeNode, currNode: TreeNode,\n parentContexts: ChildrenOutletContexts|null, futurePath: ActivatedRouteSnapshot[],\n checks: Checks = {\n canDeactivateChecks: [],\n canActivateChecks: []\n }): Checks {\n const future = futureNode.value;\n const curr = currNode ? currNode.value : null;\n const context = parentContexts ? parentContexts.getContext(futureNode.value.outlet) : null;\n\n // reusing the node\n if (curr && future.routeConfig === curr.routeConfig) {\n const shouldRun =\n shouldRunGuardsAndResolvers(curr, future, future.routeConfig!.runGuardsAndResolvers);\n if (shouldRun) {\n checks.canActivateChecks.push(new CanActivate(futurePath));\n } else {\n // we need to set the data\n future.data = curr.data;\n future._resolvedData = curr._resolvedData;\n }\n\n // If we have a component, we need to go through an outlet.\n if (future.component) {\n getChildRouteGuards(\n futureNode, currNode, context ? context.children : null, futurePath, checks);\n\n // if we have a componentless route, we recurse but keep the same outlet map.\n } else {\n getChildRouteGuards(futureNode, currNode, parentContexts, futurePath, checks);\n }\n\n if (shouldRun && context && context.outlet && context.outlet.isActivated) {\n checks.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, curr));\n }\n } else {\n if (curr) {\n deactivateRouteAndItsChildren(currNode, context, checks);\n }\n\n checks.canActivateChecks.push(new CanActivate(futurePath));\n // If we have a component, we need to go through an outlet.\n if (future.component) {\n getChildRouteGuards(futureNode, null, context ? context.children : null, futurePath, checks);\n\n // if we have a componentless route, we recurse but keep the same outlet map.\n } else {\n getChildRouteGuards(futureNode, null, parentContexts, futurePath, checks);\n }\n }\n\n return checks;\n}\n\nfunction shouldRunGuardsAndResolvers(\n curr: ActivatedRouteSnapshot, future: ActivatedRouteSnapshot,\n mode: RunGuardsAndResolvers|undefined): boolean {\n if (typeof mode === 'function') {\n return mode(curr, future);\n }\n switch (mode) {\n case 'pathParamsChange':\n return !equalPath(curr.url, future.url);\n\n case 'pathParamsOrQueryParamsChange':\n return !equalPath(curr.url, future.url) ||\n !shallowEqual(curr.queryParams, future.queryParams);\n\n case 'always':\n return true;\n\n case 'paramsOrQueryParamsChange':\n return !equalParamsAndUrlSegments(curr, future) ||\n !shallowEqual(curr.queryParams, future.queryParams);\n\n case 'paramsChange':\n default:\n return !equalParamsAndUrlSegments(curr, future);\n }\n}\n\nfunction deactivateRouteAndItsChildren(\n route: TreeNode, context: OutletContext|null, checks: Checks): void {\n const children = nodeChildrenAsMap(route);\n const r = route.value;\n\n forEach(children, (node: TreeNode, childName: string) => {\n if (!r.component) {\n deactivateRouteAndItsChildren(node, context, checks);\n } else if (context) {\n deactivateRouteAndItsChildren(node, context.children.getContext(childName), checks);\n } else {\n deactivateRouteAndItsChildren(node, null, checks);\n }\n });\n\n if (!r.component) {\n checks.canDeactivateChecks.push(new CanDeactivate(null, r));\n } else if (context && context.outlet && context.outlet.isActivated) {\n checks.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, r));\n } else {\n checks.canDeactivateChecks.push(new CanDeactivate(null, r));\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '@angular/core';\nimport {concat, defer, from, MonoTypeOperatorFunction, Observable, of} from 'rxjs';\nimport {concatMap, first, map, mergeMap} from 'rxjs/operators';\n\nimport {ActivationStart, ChildActivationStart, Event} from '../events';\nimport {CanActivateChildFn, CanActivateFn, CanDeactivateFn} from '../interfaces';\nimport {NavigationTransition} from '../router';\nimport {ActivatedRouteSnapshot, RouterStateSnapshot} from '../router_state';\nimport {UrlTree} from '../url_tree';\nimport {wrapIntoObservable} from '../utils/collection';\nimport {CanActivate, CanDeactivate, getCanActivateChild, getToken} from '../utils/preactivation';\nimport {isBoolean, isCanActivate, isCanActivateChild, isCanDeactivate, isFunction} from '../utils/type_guards';\n\nimport {prioritizedGuardValue} from './prioritized_guard_value';\n\nexport function checkGuards(moduleInjector: Injector, forwardEvent?: (evt: Event) => void):\n MonoTypeOperatorFunction {\n return mergeMap(t => {\n const {targetSnapshot, currentSnapshot, guards: {canActivateChecks, canDeactivateChecks}} = t;\n if (canDeactivateChecks.length === 0 && canActivateChecks.length === 0) {\n return of({...t, guardsResult: true});\n }\n\n return runCanDeactivateChecks(\n canDeactivateChecks, targetSnapshot!, currentSnapshot, moduleInjector)\n .pipe(\n mergeMap(canDeactivate => {\n return canDeactivate && isBoolean(canDeactivate) ?\n runCanActivateChecks(\n targetSnapshot!, canActivateChecks, moduleInjector, forwardEvent) :\n of(canDeactivate);\n }),\n map(guardsResult => ({...t, guardsResult})));\n });\n}\n\nfunction runCanDeactivateChecks(\n checks: CanDeactivate[], futureRSS: RouterStateSnapshot, currRSS: RouterStateSnapshot,\n moduleInjector: Injector) {\n return from(checks).pipe(\n mergeMap(\n check =>\n runCanDeactivate(check.component, check.route, currRSS, futureRSS, moduleInjector)),\n first(result => {\n return result !== true;\n }, true as boolean | UrlTree));\n}\n\nfunction runCanActivateChecks(\n futureSnapshot: RouterStateSnapshot, checks: CanActivate[], moduleInjector: Injector,\n forwardEvent?: (evt: Event) => void) {\n return from(checks).pipe(\n concatMap((check: CanActivate) => {\n return concat(\n fireChildActivationStart(check.route.parent, forwardEvent),\n fireActivationStart(check.route, forwardEvent),\n runCanActivateChild(futureSnapshot, check.path, moduleInjector),\n runCanActivate(futureSnapshot, check.route, moduleInjector));\n }),\n first(result => {\n return result !== true;\n }, true as boolean | UrlTree));\n}\n\n/**\n * This should fire off `ActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n */\nfunction fireActivationStart(\n snapshot: ActivatedRouteSnapshot|null,\n forwardEvent?: (evt: Event) => void): Observable {\n if (snapshot !== null && forwardEvent) {\n forwardEvent(new ActivationStart(snapshot));\n }\n return of(true);\n}\n\n/**\n * This should fire off `ChildActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ChildActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n */\nfunction fireChildActivationStart(\n snapshot: ActivatedRouteSnapshot|null,\n forwardEvent?: (evt: Event) => void): Observable {\n if (snapshot !== null && forwardEvent) {\n forwardEvent(new ChildActivationStart(snapshot));\n }\n return of(true);\n}\n\nfunction runCanActivate(\n futureRSS: RouterStateSnapshot, futureARS: ActivatedRouteSnapshot,\n moduleInjector: Injector): Observable {\n const canActivate = futureARS.routeConfig ? futureARS.routeConfig.canActivate : null;\n if (!canActivate || canActivate.length === 0) return of(true);\n\n const canActivateObservables = canActivate.map((c: any) => {\n return defer(() => {\n const guard = getToken(c, futureARS, moduleInjector);\n let observable;\n if (isCanActivate(guard)) {\n observable = wrapIntoObservable(guard.canActivate(futureARS, futureRSS));\n } else if (isFunction(guard)) {\n observable = wrapIntoObservable(guard(futureARS, futureRSS));\n } else {\n throw new Error('Invalid CanActivate guard');\n }\n return observable.pipe(first());\n });\n });\n return of(canActivateObservables).pipe(prioritizedGuardValue());\n}\n\nfunction runCanActivateChild(\n futureRSS: RouterStateSnapshot, path: ActivatedRouteSnapshot[],\n moduleInjector: Injector): Observable {\n const futureARS = path[path.length - 1];\n\n const canActivateChildGuards = path.slice(0, path.length - 1)\n .reverse()\n .map(p => getCanActivateChild(p))\n .filter(_ => _ !== null);\n\n const canActivateChildGuardsMapped = canActivateChildGuards.map((d: any) => {\n return defer(() => {\n const guardsMapped = d.guards.map((c: any) => {\n const guard = getToken(c, d.node, moduleInjector);\n let observable;\n if (isCanActivateChild(guard)) {\n observable = wrapIntoObservable(guard.canActivateChild(futureARS, futureRSS));\n } else if (isFunction(guard)) {\n observable = wrapIntoObservable(guard(futureARS, futureRSS));\n } else {\n throw new Error('Invalid CanActivateChild guard');\n }\n return observable.pipe(first());\n });\n return of(guardsMapped).pipe(prioritizedGuardValue());\n });\n });\n return of(canActivateChildGuardsMapped).pipe(prioritizedGuardValue());\n}\n\nfunction runCanDeactivate(\n component: Object|null, currARS: ActivatedRouteSnapshot, currRSS: RouterStateSnapshot,\n futureRSS: RouterStateSnapshot, moduleInjector: Injector): Observable {\n const canDeactivate = currARS && currARS.routeConfig ? currARS.routeConfig.canDeactivate : null;\n if (!canDeactivate || canDeactivate.length === 0) return of(true);\n const canDeactivateObservables = canDeactivate.map((c: any) => {\n const guard = getToken(c, currARS, moduleInjector);\n let observable;\n if (isCanDeactivate(guard)) {\n observable = wrapIntoObservable(guard.canDeactivate(component!, currARS, currRSS, futureRSS));\n } else if (isFunction>(guard)) {\n observable = wrapIntoObservable(guard(component, currARS, currRSS, futureRSS));\n } else {\n throw new Error('Invalid CanDeactivate guard');\n }\n return observable.pipe(first());\n });\n return of(canDeactivateObservables).pipe(prioritizedGuardValue());\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '@angular/core';\nimport {Observable, Observer, of} from 'rxjs';\n\nimport {Data, ResolveData, Route, Routes} from './config';\nimport {ActivatedRouteSnapshot, inheritedParamsDataResolve, ParamsInheritanceStrategy, RouterStateSnapshot} from './router_state';\nimport {PRIMARY_OUTLET} from './shared';\nimport {UrlSegment, UrlSegmentGroup, UrlTree} from './url_tree';\nimport {last} from './utils/collection';\nimport {getOutlet, sortByMatchingOutlets} from './utils/config';\nimport {isImmediateMatch, match, noLeftoversInUrl, split} from './utils/config_matching';\nimport {TreeNode} from './utils/tree';\n\nclass NoMatch {}\n\nfunction newObservableError(e: unknown): Observable {\n // TODO(atscott): This pattern is used throughout the router code and can be `throwError` instead.\n return new Observable((obs: Observer) => obs.error(e));\n}\n\nexport function recognize(\n rootComponentType: Type|null, config: Routes, urlTree: UrlTree, url: string,\n paramsInheritanceStrategy: ParamsInheritanceStrategy = 'emptyOnly',\n relativeLinkResolution: 'legacy'|'corrected' = 'legacy'): Observable {\n try {\n const result = new Recognizer(\n rootComponentType, config, urlTree, url, paramsInheritanceStrategy,\n relativeLinkResolution)\n .recognize();\n if (result === null) {\n return newObservableError(new NoMatch());\n } else {\n return of(result);\n }\n } catch (e) {\n // Catch the potential error from recognize due to duplicate outlet matches and return as an\n // `Observable` error instead.\n return newObservableError(e);\n }\n}\n\nexport class Recognizer {\n constructor(\n private rootComponentType: Type|null, private config: Routes, private urlTree: UrlTree,\n private url: string, private paramsInheritanceStrategy: ParamsInheritanceStrategy,\n private relativeLinkResolution: 'legacy'|'corrected') {}\n\n recognize(): RouterStateSnapshot|null {\n const rootSegmentGroup =\n split(\n this.urlTree.root, [], [], this.config.filter(c => c.redirectTo === undefined),\n this.relativeLinkResolution)\n .segmentGroup;\n\n const children = this.processSegmentGroup(this.config, rootSegmentGroup, PRIMARY_OUTLET);\n if (children === null) {\n return null;\n }\n\n // Use Object.freeze to prevent readers of the Router state from modifying it outside of a\n // navigation, resulting in the router being out of sync with the browser.\n const root = new ActivatedRouteSnapshot(\n [], Object.freeze({}), Object.freeze({...this.urlTree.queryParams}), this.urlTree.fragment,\n {}, PRIMARY_OUTLET, this.rootComponentType, null, this.urlTree.root, -1, {});\n\n const rootNode = new TreeNode(root, children);\n const routeState = new RouterStateSnapshot(this.url, rootNode);\n this.inheritParamsAndData(routeState._root);\n return routeState;\n }\n\n inheritParamsAndData(routeNode: TreeNode): void {\n const route = routeNode.value;\n\n const i = inheritedParamsDataResolve(route, this.paramsInheritanceStrategy);\n route.params = Object.freeze(i.params);\n route.data = Object.freeze(i.data);\n\n routeNode.children.forEach(n => this.inheritParamsAndData(n));\n }\n\n processSegmentGroup(config: Route[], segmentGroup: UrlSegmentGroup, outlet: string):\n TreeNode[]|null {\n if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n return this.processChildren(config, segmentGroup);\n }\n\n return this.processSegment(config, segmentGroup, segmentGroup.segments, outlet);\n }\n\n /**\n * Matches every child outlet in the `segmentGroup` to a `Route` in the config. Returns `null` if\n * we cannot find a match for _any_ of the children.\n *\n * @param config - The `Routes` to match against\n * @param segmentGroup - The `UrlSegmentGroup` whose children need to be matched against the\n * config.\n */\n processChildren(config: Route[], segmentGroup: UrlSegmentGroup):\n TreeNode[]|null {\n const children: Array> = [];\n for (const childOutlet of Object.keys(segmentGroup.children)) {\n const child = segmentGroup.children[childOutlet];\n // Sort the config so that routes with outlets that match the one being activated appear\n // first, followed by routes for other outlets, which might match if they have an empty path.\n const sortedConfig = sortByMatchingOutlets(config, childOutlet);\n const outletChildren = this.processSegmentGroup(sortedConfig, child, childOutlet);\n if (outletChildren === null) {\n // Configs must match all segment children so because we did not find a match for this\n // outlet, return `null`.\n return null;\n }\n children.push(...outletChildren);\n }\n // Because we may have matched two outlets to the same empty path segment, we can have multiple\n // activated results for the same outlet. We should merge the children of these results so the\n // final return value is only one `TreeNode` per outlet.\n const mergedChildren = mergeEmptyPathMatches(children);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // This should really never happen - we are only taking the first match for each outlet and\n // merge the empty path matches.\n checkOutletNameUniqueness(mergedChildren);\n }\n sortActivatedRouteSnapshots(mergedChildren);\n return mergedChildren;\n }\n\n processSegment(\n config: Route[], segmentGroup: UrlSegmentGroup, segments: UrlSegment[],\n outlet: string): TreeNode[]|null {\n for (const r of config) {\n const children = this.processSegmentAgainstRoute(r, segmentGroup, segments, outlet);\n if (children !== null) {\n return children;\n }\n }\n if (noLeftoversInUrl(segmentGroup, segments, outlet)) {\n return [];\n }\n\n return null;\n }\n\n processSegmentAgainstRoute(\n route: Route, rawSegment: UrlSegmentGroup, segments: UrlSegment[],\n outlet: string): TreeNode[]|null {\n if (route.redirectTo || !isImmediateMatch(route, rawSegment, segments, outlet)) return null;\n\n let snapshot: ActivatedRouteSnapshot;\n let consumedSegments: UrlSegment[] = [];\n let rawSlicedSegments: UrlSegment[] = [];\n\n if (route.path === '**') {\n const params = segments.length > 0 ? last(segments)!.parameters : {};\n snapshot = new ActivatedRouteSnapshot(\n segments, params, Object.freeze({...this.urlTree.queryParams}), this.urlTree.fragment,\n getData(route), getOutlet(route), route.component!, route,\n getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + segments.length,\n getResolve(route));\n } else {\n const result = match(rawSegment, route, segments);\n if (!result.matched) {\n return null;\n }\n consumedSegments = result.consumedSegments;\n rawSlicedSegments = segments.slice(result.lastChild);\n\n snapshot = new ActivatedRouteSnapshot(\n consumedSegments, result.parameters, Object.freeze({...this.urlTree.queryParams}),\n this.urlTree.fragment, getData(route), getOutlet(route), route.component!, route,\n getSourceSegmentGroup(rawSegment),\n getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));\n }\n\n const childConfig: Route[] = getChildConfig(route);\n\n const {segmentGroup, slicedSegments} = split(\n rawSegment, consumedSegments, rawSlicedSegments,\n // Filter out routes with redirectTo because we are trying to create activated route\n // snapshots and don't handle redirects here. That should have been done in\n // `applyRedirects`.\n childConfig.filter(c => c.redirectTo === undefined), this.relativeLinkResolution);\n\n if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {\n const children = this.processChildren(childConfig, segmentGroup);\n if (children === null) {\n return null;\n }\n return [new TreeNode(snapshot, children)];\n }\n\n if (childConfig.length === 0 && slicedSegments.length === 0) {\n return [new TreeNode(snapshot, [])];\n }\n\n const matchedOnOutlet = getOutlet(route) === outlet;\n // If we matched a config due to empty path match on a different outlet, we need to continue\n // passing the current outlet for the segment rather than switch to PRIMARY.\n // Note that we switch to primary when we have a match because outlet configs look like this:\n // {path: 'a', outlet: 'a', children: [\n // {path: 'b', component: B},\n // {path: 'c', component: C},\n // ]}\n // Notice that the children of the named outlet are configured with the primary outlet\n const children = this.processSegment(\n childConfig, segmentGroup, slicedSegments, matchedOnOutlet ? PRIMARY_OUTLET : outlet);\n if (children === null) {\n return null;\n }\n return [new TreeNode(snapshot, children)];\n }\n}\n\nfunction sortActivatedRouteSnapshots(nodes: TreeNode[]): void {\n nodes.sort((a, b) => {\n if (a.value.outlet === PRIMARY_OUTLET) return -1;\n if (b.value.outlet === PRIMARY_OUTLET) return 1;\n return a.value.outlet.localeCompare(b.value.outlet);\n });\n}\n\nfunction getChildConfig(route: Route): Route[] {\n if (route.children) {\n return route.children;\n }\n\n if (route.loadChildren) {\n return route._loadedConfig!.routes;\n }\n\n return [];\n}\n\nfunction hasEmptyPathConfig(node: TreeNode) {\n const config = node.value.routeConfig;\n return config && config.path === '' && config.redirectTo === undefined;\n}\n\n/**\n * Finds `TreeNode`s with matching empty path route configs and merges them into `TreeNode` with the\n * children from each duplicate. This is necessary because different outlets can match a single\n * empty path route config and the results need to then be merged.\n */\nfunction mergeEmptyPathMatches(nodes: Array>):\n Array> {\n const result: Array> = [];\n // The set of nodes which contain children that were merged from two duplicate empty path nodes.\n const mergedNodes: Set> = new Set();\n\n for (const node of nodes) {\n if (!hasEmptyPathConfig(node)) {\n result.push(node);\n continue;\n }\n\n const duplicateEmptyPathNode =\n result.find(resultNode => node.value.routeConfig === resultNode.value.routeConfig);\n if (duplicateEmptyPathNode !== undefined) {\n duplicateEmptyPathNode.children.push(...node.children);\n mergedNodes.add(duplicateEmptyPathNode);\n } else {\n result.push(node);\n }\n }\n // For each node which has children from multiple sources, we need to recompute a new `TreeNode`\n // by also merging those children. This is necessary when there are multiple empty path configs in\n // a row. Put another way: whenever we combine children of two nodes, we need to also check if any\n // of those children can be combined into a single node as well.\n for (const mergedNode of mergedNodes) {\n const mergedChildren = mergeEmptyPathMatches(mergedNode.children);\n result.push(new TreeNode(mergedNode.value, mergedChildren));\n }\n return result.filter(n => !mergedNodes.has(n));\n}\n\nfunction checkOutletNameUniqueness(nodes: TreeNode[]): void {\n const names: {[k: string]: ActivatedRouteSnapshot} = {};\n nodes.forEach(n => {\n const routeWithSameOutletName = names[n.value.outlet];\n if (routeWithSameOutletName) {\n const p = routeWithSameOutletName.url.map(s => s.toString()).join('/');\n const c = n.value.url.map(s => s.toString()).join('/');\n throw new Error(`Two segments cannot have the same outlet name: '${p}' and '${c}'.`);\n }\n names[n.value.outlet] = n.value;\n });\n}\n\nfunction getSourceSegmentGroup(segmentGroup: UrlSegmentGroup): UrlSegmentGroup {\n let s = segmentGroup;\n while (s._sourceSegment) {\n s = s._sourceSegment;\n }\n return s;\n}\n\nfunction getPathIndexShift(segmentGroup: UrlSegmentGroup): number {\n let s = segmentGroup;\n let res = (s._segmentIndexShift ? s._segmentIndexShift : 0);\n while (s._sourceSegment) {\n s = s._sourceSegment;\n res += (s._segmentIndexShift ? s._segmentIndexShift : 0);\n }\n return res - 1;\n}\n\nfunction getData(route: Route): Data {\n return route.data || {};\n}\n\nfunction getResolve(route: Route): ResolveData {\n return route.resolve || {};\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '@angular/core';\nimport {MonoTypeOperatorFunction} from 'rxjs';\nimport {map, mergeMap} from 'rxjs/operators';\n\nimport {Route} from '../config';\nimport {recognize as recognizeFn} from '../recognize';\nimport {NavigationTransition} from '../router';\nimport {UrlTree} from '../url_tree';\n\nexport function recognize(\n rootComponentType: Type|null, config: Route[], serializer: (url: UrlTree) => string,\n paramsInheritanceStrategy: 'emptyOnly'|'always',\n relativeLinkResolution: 'legacy'|'corrected'): MonoTypeOperatorFunction {\n return mergeMap(\n t => recognizeFn(\n rootComponentType, config, t.urlAfterRedirects, serializer(t.urlAfterRedirects),\n paramsInheritanceStrategy, relativeLinkResolution)\n .pipe(map(targetSnapshot => ({...t, targetSnapshot}))));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '@angular/core';\nimport {EMPTY, from, MonoTypeOperatorFunction, Observable, of} from 'rxjs';\nimport {concatMap, map, mergeMap, takeLast, tap} from 'rxjs/operators';\n\nimport {ResolveData} from '../config';\nimport {NavigationTransition} from '../router';\nimport {ActivatedRouteSnapshot, inheritedParamsDataResolve, RouterStateSnapshot} from '../router_state';\nimport {wrapIntoObservable} from '../utils/collection';\nimport {getToken} from '../utils/preactivation';\n\nexport function resolveData(\n paramsInheritanceStrategy: 'emptyOnly'|'always',\n moduleInjector: Injector): MonoTypeOperatorFunction {\n return mergeMap(t => {\n const {targetSnapshot, guards: {canActivateChecks}} = t;\n\n if (!canActivateChecks.length) {\n return of(t);\n }\n let canActivateChecksResolved = 0;\n return from(canActivateChecks)\n .pipe(\n concatMap(\n check => runResolve(\n check.route, targetSnapshot!, paramsInheritanceStrategy, moduleInjector)),\n tap(() => canActivateChecksResolved++),\n takeLast(1),\n mergeMap(_ => canActivateChecksResolved === canActivateChecks.length ? of(t) : EMPTY),\n );\n });\n}\n\nfunction runResolve(\n futureARS: ActivatedRouteSnapshot, futureRSS: RouterStateSnapshot,\n paramsInheritanceStrategy: 'emptyOnly'|'always', moduleInjector: Injector) {\n const resolve = futureARS._resolve;\n return resolveNode(resolve, futureARS, futureRSS, moduleInjector)\n .pipe(map((resolvedData: any) => {\n futureARS._resolvedData = resolvedData;\n futureARS.data = {\n ...futureARS.data,\n ...inheritedParamsDataResolve(futureARS, paramsInheritanceStrategy).resolve\n };\n return null;\n }));\n}\n\nfunction resolveNode(\n resolve: ResolveData, futureARS: ActivatedRouteSnapshot, futureRSS: RouterStateSnapshot,\n moduleInjector: Injector): Observable {\n const keys = Object.keys(resolve);\n if (keys.length === 0) {\n return of({});\n }\n const data: {[k: string]: any} = {};\n return from(keys).pipe(\n mergeMap(\n (key: string) => getResolver(resolve[key], futureARS, futureRSS, moduleInjector)\n .pipe(tap((value: any) => {\n data[key] = value;\n }))),\n takeLast(1),\n mergeMap(() => {\n // Ensure all resolvers returned values, otherwise don't emit any \"next\" and just complete\n // the chain which will cancel navigation\n if (Object.keys(data).length === keys.length) {\n return of(data);\n }\n return EMPTY;\n }),\n );\n}\n\nfunction getResolver(\n injectionToken: any, futureARS: ActivatedRouteSnapshot, futureRSS: RouterStateSnapshot,\n moduleInjector: Injector): Observable {\n const resolver = getToken(injectionToken, futureARS, moduleInjector);\n return resolver.resolve ? wrapIntoObservable(resolver.resolve(futureARS, futureRSS)) :\n wrapIntoObservable(resolver(futureARS, futureRSS));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {from, MonoTypeOperatorFunction, ObservableInput, of} from 'rxjs';\nimport {map, switchMap} from 'rxjs/operators';\n\n/**\n * Perform a side effect through a switchMap for every emission on the source Observable,\n * but return an Observable that is identical to the source. It's essentially the same as\n * the `tap` operator, but if the side effectful `next` function returns an ObservableInput,\n * it will wait before continuing with the original value.\n */\nexport function switchTap(next: (x: T) => void|ObservableInput):\n MonoTypeOperatorFunction {\n return switchMap(v => {\n const nextResult = next(v);\n if (nextResult) {\n return from(nextResult).pipe(map(() => v));\n }\n return of(v);\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentRef} from '@angular/core';\n\nimport {OutletContext} from './router_outlet_context';\nimport {ActivatedRoute, ActivatedRouteSnapshot} from './router_state';\nimport {TreeNode} from './utils/tree';\n\n/**\n * @description\n *\n * Represents the detached route tree.\n *\n * This is an opaque value the router will give to a custom route reuse strategy\n * to store and retrieve later on.\n *\n * @publicApi\n */\nexport type DetachedRouteHandle = {};\n\n/** @internal */\nexport type DetachedRouteHandleInternal = {\n contexts: Map,\n componentRef: ComponentRef,\n route: TreeNode,\n};\n\n/**\n * @description\n *\n * Provides a way to customize when activated routes get reused.\n *\n * @publicApi\n */\nexport abstract class RouteReuseStrategy {\n /** Determines if this route (and its subtree) should be detached to be reused later */\n abstract shouldDetach(route: ActivatedRouteSnapshot): boolean;\n\n /**\n * Stores the detached route.\n *\n * Storing a `null` value should erase the previously stored value.\n */\n abstract store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle|null): void;\n\n /** Determines if this route (and its subtree) should be reattached */\n abstract shouldAttach(route: ActivatedRouteSnapshot): boolean;\n\n /** Retrieves the previously stored route */\n abstract retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle|null;\n\n /** Determines if a route should be reused */\n abstract shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;\n}\n\n/**\n * @description\n *\n * This base route reuse strategy only reuses routes when the matched router configs are\n * identical. This prevents components from being destroyed and recreated\n * when just the fragment or query parameters change\n * (that is, the existing component is _reused_).\n *\n * This strategy does not store any routes for later reuse.\n *\n * Angular uses this strategy by default.\n *\n *\n * It can be used as a base class for custom route reuse strategies, i.e. you can create your own\n * class that extends the `BaseRouteReuseStrategy` one.\n * @publicApi\n */\nexport abstract class BaseRouteReuseStrategy implements RouteReuseStrategy {\n /**\n * Whether the given route should detach for later reuse.\n * Always returns false for `BaseRouteReuseStrategy`.\n * */\n shouldDetach(route: ActivatedRouteSnapshot): boolean {\n return false;\n }\n\n /**\n * A no-op; the route is never stored since this strategy never detaches routes for later re-use.\n */\n store(route: ActivatedRouteSnapshot, detachedTree: DetachedRouteHandle): void {}\n\n /** Returns `false`, meaning the route (and its subtree) is never reattached */\n shouldAttach(route: ActivatedRouteSnapshot): boolean {\n return false;\n }\n\n /** Returns `null` because this strategy does not store routes for later re-use. */\n retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle|null {\n return null;\n }\n\n /**\n * Determines if a route should be reused.\n * This strategy returns `true` when the future route config and current route config are\n * identical.\n */\n shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {\n return future.routeConfig === curr.routeConfig;\n }\n}\n\nexport class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Compiler, InjectFlags, InjectionToken, Injector, NgModuleFactory, NgModuleFactoryLoader} from '@angular/core';\nimport {ConnectableObservable, from, Observable, of, Subject} from 'rxjs';\nimport {catchError, map, mergeMap, refCount, tap} from 'rxjs/operators';\n\nimport {LoadChildren, LoadedRouterConfig, Route} from './config';\nimport {flatten, wrapIntoObservable} from './utils/collection';\nimport {standardizeConfig} from './utils/config';\n\n/**\n * The [DI token](guide/glossary/#di-token) for a router configuration.\n *\n * `ROUTES` is a low level API for router configuration via dependency injection.\n *\n * We recommend that in almost all cases to use higher level APIs such as `RouterModule.forRoot()`,\n * `RouterModule.forChild()`, `provideRoutes`, or `Router.resetConfig()`.\n *\n * @publicApi\n */\nexport const ROUTES = new InjectionToken('ROUTES');\n\nexport class RouterConfigLoader {\n constructor(\n private loader: NgModuleFactoryLoader, private compiler: Compiler,\n private onLoadStartListener?: (r: Route) => void,\n private onLoadEndListener?: (r: Route) => void) {}\n\n load(parentInjector: Injector, route: Route): Observable {\n if (route._loader$) {\n return route._loader$;\n }\n\n if (this.onLoadStartListener) {\n this.onLoadStartListener(route);\n }\n const moduleFactory$ = this.loadModuleFactory(route.loadChildren!);\n const loadRunner = moduleFactory$.pipe(\n map((factory: NgModuleFactory) => {\n if (this.onLoadEndListener) {\n this.onLoadEndListener(route);\n }\n const module = factory.create(parentInjector);\n // When loading a module that doesn't provide `RouterModule.forChild()` preloader\n // will get stuck in an infinite loop. The child module's Injector will look to\n // its parent `Injector` when it doesn't find any ROUTES so it will return routes\n // for it's parent module instead.\n return new LoadedRouterConfig(\n flatten(\n module.injector.get(ROUTES, undefined, InjectFlags.Self | InjectFlags.Optional))\n .map(standardizeConfig),\n module);\n }),\n catchError((err) => {\n route._loader$ = undefined;\n throw err;\n }),\n );\n // Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much\n route._loader$ = new ConnectableObservable(loadRunner, () => new Subject())\n .pipe(refCount());\n return route._loader$;\n }\n\n private loadModuleFactory(loadChildren: LoadChildren): Observable> {\n if (typeof loadChildren === 'string') {\n return from(this.loader.load(loadChildren));\n } else {\n return wrapIntoObservable(loadChildren()).pipe(mergeMap((t: any) => {\n if (t instanceof NgModuleFactory) {\n return of(t);\n } else {\n return from(this.compiler.compileModuleAsync(t));\n }\n }));\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentFactoryResolver, ComponentRef} from '@angular/core';\n\nimport {RouterOutletContract} from './directives/router_outlet';\nimport {ActivatedRoute} from './router_state';\n\n\n/**\n * Store contextual information about a `RouterOutlet`\n *\n * @publicApi\n */\nexport class OutletContext {\n outlet: RouterOutletContract|null = null;\n route: ActivatedRoute|null = null;\n resolver: ComponentFactoryResolver|null = null;\n children = new ChildrenOutletContexts();\n attachRef: ComponentRef|null = null;\n}\n\n/**\n * Store contextual information about the children (= nested) `RouterOutlet`\n *\n * @publicApi\n */\nexport class ChildrenOutletContexts {\n // contexts for child outlets, by name.\n private contexts = new Map();\n\n /** Called when a `RouterOutlet` directive is instantiated */\n onChildOutletCreated(childName: string, outlet: RouterOutletContract): void {\n const context = this.getOrCreateContext(childName);\n context.outlet = outlet;\n this.contexts.set(childName, context);\n }\n\n /**\n * Called when a `RouterOutlet` directive is destroyed.\n * We need to keep the context as the outlet could be destroyed inside a NgIf and might be\n * re-created later.\n */\n onChildOutletDestroyed(childName: string): void {\n const context = this.getContext(childName);\n if (context) {\n context.outlet = null;\n context.attachRef = null;\n }\n }\n\n /**\n * Called when the corresponding route is deactivated during navigation.\n * Because the component get destroyed, all children outlet are destroyed.\n */\n onOutletDeactivated(): Map {\n const contexts = this.contexts;\n this.contexts = new Map();\n return contexts;\n }\n\n onOutletReAttached(contexts: Map) {\n this.contexts = contexts;\n }\n\n getOrCreateContext(childName: string): OutletContext {\n let context = this.getContext(childName);\n\n if (!context) {\n context = new OutletContext();\n this.contexts.set(childName, context);\n }\n\n return context;\n }\n\n getContext(childName: string): OutletContext|null {\n return this.contexts.get(childName) || null;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {UrlTree} from './url_tree';\n\n/**\n * @description\n *\n * Provides a way to migrate AngularJS applications to Angular.\n *\n * @publicApi\n */\nexport abstract class UrlHandlingStrategy {\n /**\n * Tells the router if this URL should be processed.\n *\n * When it returns true, the router will execute the regular navigation.\n * When it returns false, the router will set the router state to an empty state.\n * As a result, all the active components will be destroyed.\n *\n */\n abstract shouldProcessUrl(url: UrlTree): boolean;\n\n /**\n * Extracts the part of the URL that should be handled by the router.\n * The rest of the URL will remain untouched.\n */\n abstract extract(url: UrlTree): UrlTree;\n\n /**\n * Merges the URL fragment with the rest of the URL.\n */\n abstract merge(newUrlPart: UrlTree, rawUrl: UrlTree): UrlTree;\n}\n\n/**\n * @publicApi\n */\nexport class DefaultUrlHandlingStrategy implements UrlHandlingStrategy {\n shouldProcessUrl(url: UrlTree): boolean {\n return true;\n }\n extract(url: UrlTree): UrlTree {\n return url;\n }\n merge(newUrlPart: UrlTree, wholeUrl: UrlTree): UrlTree {\n return newUrlPart;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Location, PopStateEvent} from '@angular/common';\nimport {Compiler, Injectable, Injector, NgModuleFactoryLoader, NgModuleRef, NgZone, Type, ɵConsole as Console} from '@angular/core';\nimport {BehaviorSubject, EMPTY, Observable, of, Subject, SubscriptionLike} from 'rxjs';\nimport {catchError, filter, finalize, map, switchMap, tap} from 'rxjs/operators';\n\nimport {QueryParamsHandling, Route, Routes} from './config';\nimport {createRouterState} from './create_router_state';\nimport {createUrlTree} from './create_url_tree';\nimport {Event, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, NavigationTrigger, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RoutesRecognized} from './events';\nimport {activateRoutes} from './operators/activate_routes';\nimport {applyRedirects} from './operators/apply_redirects';\nimport {checkGuards} from './operators/check_guards';\nimport {recognize} from './operators/recognize';\nimport {resolveData} from './operators/resolve_data';\nimport {switchTap} from './operators/switch_tap';\nimport {DefaultRouteReuseStrategy, RouteReuseStrategy} from './route_reuse_strategy';\nimport {RouterConfigLoader} from './router_config_loader';\nimport {ChildrenOutletContexts} from './router_outlet_context';\nimport {ActivatedRoute, createEmptyState, RouterState, RouterStateSnapshot} from './router_state';\nimport {isNavigationCancelingError, navigationCancelingError, Params} from './shared';\nimport {DefaultUrlHandlingStrategy, UrlHandlingStrategy} from './url_handling_strategy';\nimport {containsTree, createEmptyUrlTree, IsActiveMatchOptions, UrlSerializer, UrlTree} from './url_tree';\nimport {standardizeConfig, validateConfig} from './utils/config';\nimport {Checks, getAllRouteGuards} from './utils/preactivation';\nimport {isUrlTree} from './utils/type_guards';\n\n\n/**\n * @description\n *\n * Options that modify the `Router` URL.\n * Supply an object containing any of these properties to a `Router` navigation function to\n * control how the target URL should be constructed.\n *\n * @see [Router.navigate() method](api/router/Router#navigate)\n * @see [Router.createUrlTree() method](api/router/Router#createurltree)\n * @see [Routing and Navigation guide](guide/router)\n *\n * @publicApi\n */\nexport interface UrlCreationOptions {\n /**\n * Specifies a root URI to use for relative navigation.\n *\n * For example, consider the following route configuration where the parent route\n * has two children.\n *\n * ```\n * [{\n * path: 'parent',\n * component: ParentComponent,\n * children: [{\n * path: 'list',\n * component: ListComponent\n * },{\n * path: 'child',\n * component: ChildComponent\n * }]\n * }]\n * ```\n *\n * The following `go()` function navigates to the `list` route by\n * interpreting the destination URI as relative to the activated `child` route\n *\n * ```\n * @Component({...})\n * class ChildComponent {\n * constructor(private router: Router, private route: ActivatedRoute) {}\n *\n * go() {\n * this.router.navigate(['../list'], { relativeTo: this.route });\n * }\n * }\n * ```\n *\n * A value of `null` or `undefined` indicates that the navigation commands should be applied\n * relative to the root.\n */\n relativeTo?: ActivatedRoute|null;\n\n /**\n * Sets query parameters to the URL.\n *\n * ```\n * // Navigate to /results?page=1\n * this.router.navigate(['/results'], { queryParams: { page: 1 } });\n * ```\n */\n queryParams?: Params|null;\n\n /**\n * Sets the hash fragment for the URL.\n *\n * ```\n * // Navigate to /results#top\n * this.router.navigate(['/results'], { fragment: 'top' });\n * ```\n */\n fragment?: string;\n\n /**\n * How to handle query parameters in the router link for the next navigation.\n * One of:\n * * `preserve` : Preserve current parameters.\n * * `merge` : Merge new with current parameters.\n *\n * The \"preserve\" option discards any new query params:\n * ```\n * // from /view1?page=1 to/view2?page=1\n * this.router.navigate(['/view2'], { queryParams: { page: 2 }, queryParamsHandling: \"preserve\"\n * });\n * ```\n * The \"merge\" option appends new query params to the params from the current URL:\n * ```\n * // from /view1?page=1 to/view2?page=1&otherKey=2\n * this.router.navigate(['/view2'], { queryParams: { otherKey: 2 }, queryParamsHandling: \"merge\"\n * });\n * ```\n * In case of a key collision between current parameters and those in the `queryParams` object,\n * the new value is used.\n *\n */\n queryParamsHandling?: QueryParamsHandling|null;\n\n /**\n * When true, preserves the URL fragment for the next navigation\n *\n * ```\n * // Preserve fragment from /results#top to /view#top\n * this.router.navigate(['/view'], { preserveFragment: true });\n * ```\n */\n preserveFragment?: boolean;\n}\n\n/**\n * @description\n *\n * Options that modify the `Router` navigation strategy.\n * Supply an object containing any of these properties to a `Router` navigation function to\n * control how the navigation should be handled.\n *\n * @see [Router.navigate() method](api/router/Router#navigate)\n * @see [Router.navigateByUrl() method](api/router/Router#navigatebyurl)\n * @see [Routing and Navigation guide](guide/router)\n *\n * @publicApi\n */\nexport interface NavigationBehaviorOptions {\n /**\n * When true, navigates without pushing a new state into history.\n *\n * ```\n * // Navigate silently to /view\n * this.router.navigate(['/view'], { skipLocationChange: true });\n * ```\n */\n skipLocationChange?: boolean;\n\n /**\n * When true, navigates while replacing the current state in history.\n *\n * ```\n * // Navigate to /view\n * this.router.navigate(['/view'], { replaceUrl: true });\n * ```\n */\n replaceUrl?: boolean;\n\n /**\n * Developer-defined state that can be passed to any navigation.\n * Access this value through the `Navigation.extras` object\n * returned from the [Router.getCurrentNavigation()\n * method](api/router/Router#getcurrentnavigation) while a navigation is executing.\n *\n * After a navigation completes, the router writes an object containing this\n * value together with a `navigationId` to `history.state`.\n * The value is written when `location.go()` or `location.replaceState()`\n * is called before activating this route.\n *\n * Note that `history.state` does not pass an object equality test because\n * the router adds the `navigationId` on each navigation.\n *\n */\n state?: {[k: string]: any};\n}\n\n/**\n * @description\n *\n * Options that modify the `Router` navigation strategy.\n * Supply an object containing any of these properties to a `Router` navigation function to\n * control how the target URL should be constructed or interpreted.\n *\n * @see [Router.navigate() method](api/router/Router#navigate)\n * @see [Router.navigateByUrl() method](api/router/Router#navigatebyurl)\n * @see [Router.createUrlTree() method](api/router/Router#createurltree)\n * @see [Routing and Navigation guide](guide/router)\n * @see UrlCreationOptions\n * @see NavigationBehaviorOptions\n *\n * @publicApi\n */\nexport interface NavigationExtras extends UrlCreationOptions, NavigationBehaviorOptions {}\n\n/**\n * Error handler that is invoked when a navigation error occurs.\n *\n * If the handler returns a value, the navigation Promise is resolved with this value.\n * If the handler throws an exception, the navigation Promise is rejected with\n * the exception.\n *\n * @publicApi\n */\nexport type ErrorHandler = (error: any) => any;\n\nfunction defaultErrorHandler(error: any): any {\n throw error;\n}\n\nfunction defaultMalformedUriErrorHandler(\n error: URIError, urlSerializer: UrlSerializer, url: string): UrlTree {\n return urlSerializer.parse('/');\n}\n\nexport type RestoredState = {\n [k: string]: any,\n // TODO(#27607): Remove `navigationId` and `ɵrouterPageId` and move to `ng` or `ɵ` namespace.\n navigationId: number,\n // The `ɵ` prefix is there to reduce the chance of colliding with any existing user properties on\n // the history state.\n ɵrouterPageId?: number,\n};\n\n/**\n * Information about a navigation operation.\n * Retrieve the most recent navigation object with the\n * [Router.getCurrentNavigation() method](api/router/Router#getcurrentnavigation) .\n *\n * * *id* : The unique identifier of the current navigation.\n * * *initialUrl* : The target URL passed into the `Router#navigateByUrl()` call before navigation.\n * This is the value before the router has parsed or applied redirects to it.\n * * *extractedUrl* : The initial target URL after being parsed with `UrlSerializer.extract()`.\n * * *finalUrl* : The extracted URL after redirects have been applied.\n * This URL may not be available immediately, therefore this property can be `undefined`.\n * It is guaranteed to be set after the `RoutesRecognized` event fires.\n * * *trigger* : Identifies how this navigation was triggered.\n * -- 'imperative'--Triggered by `router.navigateByUrl` or `router.navigate`.\n * -- 'popstate'--Triggered by a popstate event.\n * -- 'hashchange'--Triggered by a hashchange event.\n * * *extras* : A `NavigationExtras` options object that controlled the strategy used for this\n * navigation.\n * * *previousNavigation* : The previously successful `Navigation` object. Only one previous\n * navigation is available, therefore this previous `Navigation` object has a `null` value for its\n * own `previousNavigation`.\n *\n * @publicApi\n */\nexport interface Navigation {\n /**\n * The unique identifier of the current navigation.\n */\n id: number;\n /**\n * The target URL passed into the `Router#navigateByUrl()` call before navigation. This is\n * the value before the router has parsed or applied redirects to it.\n */\n initialUrl: string|UrlTree;\n /**\n * The initial target URL after being parsed with `UrlSerializer.extract()`.\n */\n extractedUrl: UrlTree;\n /**\n * The extracted URL after redirects have been applied.\n * This URL may not be available immediately, therefore this property can be `undefined`.\n * It is guaranteed to be set after the `RoutesRecognized` event fires.\n */\n finalUrl?: UrlTree;\n /**\n * Identifies how this navigation was triggered.\n *\n * * 'imperative'--Triggered by `router.navigateByUrl` or `router.navigate`.\n * * 'popstate'--Triggered by a popstate event.\n * * 'hashchange'--Triggered by a hashchange event.\n */\n trigger: 'imperative'|'popstate'|'hashchange';\n /**\n * Options that controlled the strategy used for this navigation.\n * See `NavigationExtras`.\n */\n extras: NavigationExtras;\n /**\n * The previously successful `Navigation` object. Only one previous navigation\n * is available, therefore this previous `Navigation` object has a `null` value\n * for its own `previousNavigation`.\n */\n previousNavigation: Navigation|null;\n}\n\nexport type NavigationTransition = {\n id: number,\n targetPageId: number,\n currentUrlTree: UrlTree,\n currentRawUrl: UrlTree,\n extractedUrl: UrlTree,\n urlAfterRedirects: UrlTree,\n rawUrl: UrlTree,\n extras: NavigationExtras,\n resolve: any,\n reject: any,\n promise: Promise,\n source: NavigationTrigger,\n restoredState: RestoredState|null,\n currentSnapshot: RouterStateSnapshot,\n targetSnapshot: RouterStateSnapshot|null,\n currentRouterState: RouterState,\n targetRouterState: RouterState|null,\n guards: Checks,\n guardsResult: boolean|UrlTree|null,\n};\n\n/**\n * @internal\n */\nexport type RouterHook = (snapshot: RouterStateSnapshot, runExtras: {\n appliedUrlTree: UrlTree,\n rawUrlTree: UrlTree,\n skipLocationChange: boolean,\n replaceUrl: boolean,\n navigationId: number\n}) => Observable;\n\n/**\n * @internal\n */\nfunction defaultRouterHook(snapshot: RouterStateSnapshot, runExtras: {\n appliedUrlTree: UrlTree,\n rawUrlTree: UrlTree,\n skipLocationChange: boolean,\n replaceUrl: boolean,\n navigationId: number\n}): Observable {\n return of(null) as any;\n}\n\n/**\n * Information related to a location change, necessary for scheduling follow-up Router navigations.\n */\ntype LocationChangeInfo = {\n source: 'popstate'|'hashchange',\n urlTree: UrlTree,\n state: RestoredState|null,\n transitionId: number\n};\n\n/**\n * The equivalent `IsActiveMatchOptions` options for `Router.isActive` is called with `true`\n * (exact = true).\n */\nexport const exactMatchOptions: IsActiveMatchOptions = {\n paths: 'exact',\n fragment: 'ignored',\n matrixParams: 'ignored',\n queryParams: 'exact'\n};\n\n/**\n * The equivalent `IsActiveMatchOptions` options for `Router.isActive` is called with `false`\n * (exact = false).\n */\nexport const subsetMatchOptions: IsActiveMatchOptions = {\n paths: 'subset',\n fragment: 'ignored',\n matrixParams: 'ignored',\n queryParams: 'subset'\n};\n\n/**\n * @description\n *\n * A service that provides navigation among views and URL manipulation capabilities.\n *\n * @see `Route`.\n * @see [Routing and Navigation Guide](guide/router).\n *\n * @ngModule RouterModule\n *\n * @publicApi\n */\n@Injectable()\nexport class Router {\n /**\n * Represents the activated `UrlTree` that the `Router` is configured to handle (through\n * `UrlHandlingStrategy`). That is, after we find the route config tree that we're going to\n * activate, run guards, and are just about to activate the route, we set the currentUrlTree.\n *\n * This should match the `browserUrlTree` when a navigation succeeds. If the\n * `UrlHandlingStrategy.shouldProcessUrl` is `false`, only the `browserUrlTree` is updated.\n */\n private currentUrlTree: UrlTree;\n /**\n * Meant to represent the entire browser url after a successful navigation. In the life of a\n * navigation transition:\n * 1. The rawUrl represents the full URL that's being navigated to\n * 2. We apply redirects, which might only apply to _part_ of the URL (due to\n * `UrlHandlingStrategy`).\n * 3. Right before activation (because we assume activation will succeed), we update the\n * rawUrlTree to be a combination of the urlAfterRedirects (again, this might only apply to part\n * of the initial url) and the rawUrl of the transition (which was the original navigation url in\n * its full form).\n */\n private rawUrlTree: UrlTree;\n /**\n * Meant to represent the part of the browser url that the `Router` is set up to handle (via the\n * `UrlHandlingStrategy`). This value is updated immediately after the browser url is updated (or\n * the browser url update is skipped via `skipLocationChange`). With that, note that\n * `browserUrlTree` _may not_ reflect the actual browser URL for two reasons:\n *\n * 1. `UrlHandlingStrategy` only handles part of the URL\n * 2. `skipLocationChange` does not update the browser url.\n *\n * So to reiterate, `browserUrlTree` only represents the Router's internal understanding of the\n * current route, either before guards with `urlUpdateStrategy === 'eager'` or right before\n * activation with `'deferred'`.\n *\n * This should match the `currentUrlTree` when the navigation succeeds.\n */\n private browserUrlTree: UrlTree;\n private readonly transitions: BehaviorSubject;\n private navigations: Observable;\n private lastSuccessfulNavigation: Navigation|null = null;\n private currentNavigation: Navigation|null = null;\n private disposed = false;\n\n private locationSubscription?: SubscriptionLike;\n /**\n * Tracks the previously seen location change from the location subscription so we can compare\n * the two latest to see if they are duplicates. See setUpLocationChangeListener.\n */\n private lastLocationChangeInfo: LocationChangeInfo|null = null;\n private navigationId: number = 0;\n\n /**\n * The id of the currently active page in the router.\n * Updated to the transition's target id on a successful navigation.\n *\n * This is used to track what page the router last activated. When an attempted navigation fails,\n * the router can then use this to compute how to restore the state back to the previously active\n * page.\n */\n private currentPageId: number = 0;\n /**\n * The ɵrouterPageId of whatever page is currently active in the browser history. This is\n * important for computing the target page id for new navigations because we need to ensure each\n * page id in the browser history is 1 more than the previous entry.\n */\n private get browserPageId(): number|undefined {\n return (this.location.getState() as RestoredState | null)?.ɵrouterPageId;\n }\n private configLoader: RouterConfigLoader;\n private ngModule: NgModuleRef;\n private console: Console;\n private isNgZoneEnabled: boolean = false;\n\n /**\n * An event stream for routing events in this NgModule.\n */\n public readonly events: Observable = new Subject();\n /**\n * The current state of routing in this NgModule.\n */\n public readonly routerState: RouterState;\n\n /**\n * A handler for navigation errors in this NgModule.\n */\n errorHandler: ErrorHandler = defaultErrorHandler;\n\n /**\n * A handler for errors thrown by `Router.parseUrl(url)`\n * when `url` contains an invalid character.\n * The most common case is a `%` sign\n * that's not encoded and is not part of a percent encoded sequence.\n */\n malformedUriErrorHandler:\n (error: URIError, urlSerializer: UrlSerializer,\n url: string) => UrlTree = defaultMalformedUriErrorHandler;\n\n /**\n * True if at least one navigation event has occurred,\n * false otherwise.\n */\n navigated: boolean = false;\n private lastSuccessfulId: number = -1;\n\n /**\n * Hooks that enable you to pause navigation,\n * either before or after the preactivation phase.\n * Used by `RouterModule`.\n *\n * @internal\n */\n hooks: {\n beforePreactivation: RouterHook,\n afterPreactivation: RouterHook\n } = {beforePreactivation: defaultRouterHook, afterPreactivation: defaultRouterHook};\n\n /**\n * A strategy for extracting and merging URLs.\n * Used for AngularJS to Angular migrations.\n */\n urlHandlingStrategy: UrlHandlingStrategy = new DefaultUrlHandlingStrategy();\n\n /**\n * A strategy for re-using routes.\n */\n routeReuseStrategy: RouteReuseStrategy = new DefaultRouteReuseStrategy();\n\n /**\n * How to handle a navigation request to the current URL. One of:\n *\n * - `'ignore'` : The router ignores the request.\n * - `'reload'` : The router reloads the URL. Use to implement a \"refresh\" feature.\n *\n * Note that this only configures whether the Route reprocesses the URL and triggers related\n * action and events like redirects, guards, and resolvers. By default, the router re-uses a\n * component instance when it re-navigates to the same component type without visiting a different\n * component first. This behavior is configured by the `RouteReuseStrategy`. In order to reload\n * routed components on same url navigation, you need to set `onSameUrlNavigation` to `'reload'`\n * _and_ provide a `RouteReuseStrategy` which returns `false` for `shouldReuseRoute`.\n */\n onSameUrlNavigation: 'reload'|'ignore' = 'ignore';\n\n /**\n * How to merge parameters, data, and resolved data from parent to child\n * routes. One of:\n *\n * - `'emptyOnly'` : Inherit parent parameters, data, and resolved data\n * for path-less or component-less routes.\n * - `'always'` : Inherit parent parameters, data, and resolved data\n * for all child routes.\n */\n paramsInheritanceStrategy: 'emptyOnly'|'always' = 'emptyOnly';\n\n /**\n * Determines when the router updates the browser URL.\n * By default (`\"deferred\"`), updates the browser URL after navigation has finished.\n * Set to `'eager'` to update the browser URL at the beginning of navigation.\n * You can choose to update early so that, if navigation fails,\n * you can show an error message with the URL that failed.\n */\n urlUpdateStrategy: 'deferred'|'eager' = 'deferred';\n\n /**\n * Enables a bug fix that corrects relative link resolution in components with empty paths.\n * @see `RouterModule`\n */\n relativeLinkResolution: 'legacy'|'corrected' = 'corrected';\n\n /**\n * Configures how the Router attempts to restore state when a navigation is cancelled.\n *\n * 'replace' - Always uses `location.replaceState` to set the browser state to the state of the\n * router before the navigation started.\n *\n * 'computed' - Will always return to the same state that corresponds to the actual Angular route\n * when the navigation gets cancelled right after triggering a `popstate` event.\n *\n * The default value is `replace`\n *\n * @internal\n */\n // TODO(atscott): Determine how/when/if to make this public API\n // This shouldn’t be an option at all but may need to be in order to allow migration without a\n // breaking change. We need to determine if it should be made into public api (or if we forgo\n // the option and release as a breaking change bug fix in a major version).\n canceledNavigationResolution: 'replace'|'computed' = 'replace';\n\n /**\n * Creates the router service.\n */\n // TODO: vsavkin make internal after the final is out.\n constructor(\n private rootComponentType: Type|null, private urlSerializer: UrlSerializer,\n private rootContexts: ChildrenOutletContexts, private location: Location, injector: Injector,\n loader: NgModuleFactoryLoader, compiler: Compiler, public config: Routes) {\n const onLoadStart = (r: Route) => this.triggerEvent(new RouteConfigLoadStart(r));\n const onLoadEnd = (r: Route) => this.triggerEvent(new RouteConfigLoadEnd(r));\n\n this.ngModule = injector.get(NgModuleRef);\n this.console = injector.get(Console);\n const ngZone = injector.get(NgZone);\n this.isNgZoneEnabled = ngZone instanceof NgZone && NgZone.isInAngularZone();\n\n this.resetConfig(config);\n this.currentUrlTree = createEmptyUrlTree();\n this.rawUrlTree = this.currentUrlTree;\n this.browserUrlTree = this.currentUrlTree;\n\n this.configLoader = new RouterConfigLoader(loader, compiler, onLoadStart, onLoadEnd);\n this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType);\n\n this.transitions = new BehaviorSubject({\n id: 0,\n targetPageId: 0,\n currentUrlTree: this.currentUrlTree,\n currentRawUrl: this.currentUrlTree,\n extractedUrl: this.urlHandlingStrategy.extract(this.currentUrlTree),\n urlAfterRedirects: this.urlHandlingStrategy.extract(this.currentUrlTree),\n rawUrl: this.currentUrlTree,\n extras: {},\n resolve: null,\n reject: null,\n promise: Promise.resolve(true),\n source: 'imperative',\n restoredState: null,\n currentSnapshot: this.routerState.snapshot,\n targetSnapshot: null,\n currentRouterState: this.routerState,\n targetRouterState: null,\n guards: {canActivateChecks: [], canDeactivateChecks: []},\n guardsResult: null,\n });\n this.navigations = this.setupNavigations(this.transitions);\n\n this.processNavigations();\n }\n\n private setupNavigations(transitions: Observable):\n Observable {\n const eventsSubject = (this.events as Subject);\n return transitions.pipe(\n filter(t => t.id !== 0),\n\n // Extract URL\n map(t =>\n ({...t, extractedUrl: this.urlHandlingStrategy.extract(t.rawUrl)} as\n NavigationTransition)),\n\n // Using switchMap so we cancel executing navigations when a new one comes in\n switchMap(t => {\n let completed = false;\n let errored = false;\n return of(t).pipe(\n // Store the Navigation object\n tap(t => {\n this.currentNavigation = {\n id: t.id,\n initialUrl: t.currentRawUrl,\n extractedUrl: t.extractedUrl,\n trigger: t.source,\n extras: t.extras,\n previousNavigation: this.lastSuccessfulNavigation ?\n {...this.lastSuccessfulNavigation, previousNavigation: null} :\n null\n };\n }),\n switchMap(t => {\n const browserUrlTree = this.browserUrlTree.toString();\n const urlTransition = !this.navigated ||\n t.extractedUrl.toString() !== browserUrlTree ||\n // Navigations which succeed or ones which fail and are cleaned up\n // correctly should result in `browserUrlTree` and `currentUrlTree`\n // matching. If this is not the case, assume something went wrong and try\n // processing the URL again.\n browserUrlTree !== this.currentUrlTree.toString();\n const processCurrentUrl =\n (this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&\n this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl);\n\n\n if (processCurrentUrl) {\n // If the source of the navigation is from a browser event, the URL is\n // already updated. We already need to sync the internal state.\n if (isBrowserTriggeredNavigation(t.source)) {\n this.browserUrlTree = t.extractedUrl;\n }\n return of(t).pipe(\n // Fire NavigationStart event\n switchMap(t => {\n const transition = this.transitions.getValue();\n eventsSubject.next(new NavigationStart(\n t.id, this.serializeUrl(t.extractedUrl), t.source,\n t.restoredState));\n if (transition !== this.transitions.getValue()) {\n return EMPTY;\n }\n\n // This delay is required to match old behavior that forced\n // navigation to always be async\n return Promise.resolve(t);\n }),\n\n // ApplyRedirects\n applyRedirects(\n this.ngModule.injector, this.configLoader, this.urlSerializer,\n this.config),\n\n // Update the currentNavigation\n tap(t => {\n this.currentNavigation = {\n ...this.currentNavigation!,\n finalUrl: t.urlAfterRedirects\n };\n }),\n\n // Recognize\n recognize(\n this.rootComponentType, this.config,\n (url) => this.serializeUrl(url), this.paramsInheritanceStrategy,\n this.relativeLinkResolution),\n\n // Update URL if in `eager` update mode\n tap(t => {\n if (this.urlUpdateStrategy === 'eager') {\n if (!t.extras.skipLocationChange) {\n this.setBrowserUrl(t.urlAfterRedirects, t);\n // TODO(atscott): The above line is incorrect. It sets the url to\n // only the part that is handled by the router. It should merge\n // that with the rawUrl so the url includes segments not handled\n // by the router:\n // const rawUrl = this.urlHandlingStrategy.merge(\n // t.urlAfterRedirects, t.rawUrl);\n // this.setBrowserUrl(rawUrl, t);\n }\n this.browserUrlTree = t.urlAfterRedirects;\n }\n\n // Fire RoutesRecognized\n const routesRecognized = new RoutesRecognized(\n t.id, this.serializeUrl(t.extractedUrl),\n this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot!);\n eventsSubject.next(routesRecognized);\n }));\n } else {\n const processPreviousUrl = urlTransition && this.rawUrlTree &&\n this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree);\n /* When the current URL shouldn't be processed, but the previous one was,\n * we handle this \"error condition\" by navigating to the previously\n * successful URL, but leaving the URL intact.*/\n if (processPreviousUrl) {\n const {id, extractedUrl, source, restoredState, extras} = t;\n const navStart = new NavigationStart(\n id, this.serializeUrl(extractedUrl), source, restoredState);\n eventsSubject.next(navStart);\n const targetSnapshot =\n createEmptyState(extractedUrl, this.rootComponentType).snapshot;\n\n return of({\n ...t,\n targetSnapshot,\n urlAfterRedirects: extractedUrl,\n extras: {...extras, skipLocationChange: false, replaceUrl: false},\n });\n } else {\n /* When neither the current or previous URL can be processed, do nothing\n * other than update router's internal reference to the current \"settled\"\n * URL. This way the next navigation will be coming from the current URL\n * in the browser.\n */\n this.rawUrlTree = t.rawUrl;\n this.browserUrlTree = t.urlAfterRedirects;\n t.resolve(null);\n return EMPTY;\n }\n }\n }),\n\n // Before Preactivation\n switchTap(t => {\n const {\n targetSnapshot,\n id: navigationId,\n extractedUrl: appliedUrlTree,\n rawUrl: rawUrlTree,\n extras: {skipLocationChange, replaceUrl}\n } = t;\n return this.hooks.beforePreactivation(targetSnapshot!, {\n navigationId,\n appliedUrlTree,\n rawUrlTree,\n skipLocationChange: !!skipLocationChange,\n replaceUrl: !!replaceUrl,\n });\n }),\n\n // --- GUARDS ---\n tap(t => {\n const guardsStart = new GuardsCheckStart(\n t.id, this.serializeUrl(t.extractedUrl),\n this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot!);\n this.triggerEvent(guardsStart);\n }),\n\n map(t => ({\n ...t,\n guards: getAllRouteGuards(\n t.targetSnapshot!, t.currentSnapshot, this.rootContexts)\n })),\n\n checkGuards(this.ngModule.injector, (evt: Event) => this.triggerEvent(evt)),\n tap(t => {\n if (isUrlTree(t.guardsResult)) {\n const error: Error&{url?: UrlTree} = navigationCancelingError(\n `Redirecting to \"${this.serializeUrl(t.guardsResult)}\"`);\n error.url = t.guardsResult;\n throw error;\n }\n\n const guardsEnd = new GuardsCheckEnd(\n t.id, this.serializeUrl(t.extractedUrl),\n this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot!,\n !!t.guardsResult);\n this.triggerEvent(guardsEnd);\n }),\n\n filter(t => {\n if (!t.guardsResult) {\n this.restoreHistory(t);\n this.cancelNavigationTransition(t, '');\n return false;\n }\n return true;\n }),\n\n // --- RESOLVE ---\n switchTap(t => {\n if (t.guards.canActivateChecks.length) {\n return of(t).pipe(\n tap(t => {\n const resolveStart = new ResolveStart(\n t.id, this.serializeUrl(t.extractedUrl),\n this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot!);\n this.triggerEvent(resolveStart);\n }),\n switchMap(t => {\n let dataResolved = false;\n return of(t).pipe(\n resolveData(\n this.paramsInheritanceStrategy, this.ngModule.injector),\n tap({\n next: () => dataResolved = true,\n complete: () => {\n if (!dataResolved) {\n this.restoreHistory(t);\n this.cancelNavigationTransition(\n t,\n `At least one route resolver didn't emit any value.`);\n }\n }\n }),\n );\n }),\n tap(t => {\n const resolveEnd = new ResolveEnd(\n t.id, this.serializeUrl(t.extractedUrl),\n this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot!);\n this.triggerEvent(resolveEnd);\n }));\n }\n return undefined;\n }),\n\n // --- AFTER PREACTIVATION ---\n switchTap((t: NavigationTransition) => {\n const {\n targetSnapshot,\n id: navigationId,\n extractedUrl: appliedUrlTree,\n rawUrl: rawUrlTree,\n extras: {skipLocationChange, replaceUrl}\n } = t;\n return this.hooks.afterPreactivation(targetSnapshot!, {\n navigationId,\n appliedUrlTree,\n rawUrlTree,\n skipLocationChange: !!skipLocationChange,\n replaceUrl: !!replaceUrl,\n });\n }),\n\n map((t: NavigationTransition) => {\n const targetRouterState = createRouterState(\n this.routeReuseStrategy, t.targetSnapshot!, t.currentRouterState);\n return ({...t, targetRouterState});\n }),\n\n /* Once here, we are about to activate syncronously. The assumption is this\n will succeed, and user code may read from the Router service. Therefore\n before activation, we need to update router properties storing the current\n URL and the RouterState, as well as updated the browser URL. All this should\n happen *before* activating. */\n tap((t: NavigationTransition) => {\n this.currentUrlTree = t.urlAfterRedirects;\n this.rawUrlTree =\n this.urlHandlingStrategy.merge(t.urlAfterRedirects, t.rawUrl);\n\n (this as {routerState: RouterState}).routerState = t.targetRouterState!;\n\n if (this.urlUpdateStrategy === 'deferred') {\n if (!t.extras.skipLocationChange) {\n this.setBrowserUrl(this.rawUrlTree, t);\n }\n this.browserUrlTree = t.urlAfterRedirects;\n }\n }),\n\n activateRoutes(\n this.rootContexts, this.routeReuseStrategy,\n (evt: Event) => this.triggerEvent(evt)),\n\n tap({\n next() {\n completed = true;\n },\n complete() {\n completed = true;\n }\n }),\n finalize(() => {\n /* When the navigation stream finishes either through error or success, we\n * set the `completed` or `errored` flag. However, there are some situations\n * where we could get here without either of those being set. For instance, a\n * redirect during NavigationStart. Therefore, this is a catch-all to make\n * sure the NavigationCancel\n * event is fired when a navigation gets cancelled but not caught by other\n * means. */\n if (!completed && !errored) {\n const cancelationReason = `Navigation ID ${\n t.id} is not equal to the current navigation id ${this.navigationId}`;\n if (this.canceledNavigationResolution === 'replace') {\n // Must reset to current URL tree here to ensure history.state is set. On\n // a fresh page load, if a new navigation comes in before a successful\n // navigation completes, there will be nothing in\n // history.state.navigationId. This can cause sync problems with\n // AngularJS sync code which looks for a value here in order to determine\n // whether or not to handle a given popstate event or to leave it to the\n // Angular router.\n this.restoreHistory(t);\n this.cancelNavigationTransition(t, cancelationReason);\n } else {\n // We cannot trigger a `location.historyGo` if the\n // cancellation was due to a new navigation before the previous could\n // complete. This is because `location.historyGo` triggers a `popstate`\n // which would also trigger another navigation. Instead, treat this as a\n // redirect and do not reset the state.\n this.cancelNavigationTransition(t, cancelationReason);\n // TODO(atscott): The same problem happens here with a fresh page load\n // and a new navigation before that completes where we won't set a page\n // id.\n }\n }\n // Only clear current navigation if it is still set to the one that\n // finalized.\n if (this.currentNavigation?.id === t.id) {\n this.currentNavigation = null;\n }\n }),\n catchError((e) => {\n // TODO(atscott): The NavigationTransition `t` used here does not accurately\n // reflect the current state of the whole transition because some operations\n // return a new object rather than modifying the one in the outermost\n // `switchMap`.\n // The fix can likely be to:\n // 1. Rename the outer `t` variable so it's not shadowed all the time and\n // confusing\n // 2. Keep reassigning to the outer variable after each stage to ensure it\n // gets updated. Or change the implementations to not return a copy.\n // Not changed yet because it affects existing code and would need to be\n // tested more thoroughly.\n errored = true;\n /* This error type is issued during Redirect, and is handled as a\n * cancellation rather than an error. */\n if (isNavigationCancelingError(e)) {\n const redirecting = isUrlTree(e.url);\n if (!redirecting) {\n // Set property only if we're not redirecting. If we landed on a page and\n // redirect to `/` route, the new navigation is going to see the `/`\n // isn't a change from the default currentUrlTree and won't navigate.\n // This is only applicable with initial navigation, so setting\n // `navigated` only when not redirecting resolves this scenario.\n this.navigated = true;\n this.restoreHistory(t, true);\n }\n const navCancel = new NavigationCancel(\n t.id, this.serializeUrl(t.extractedUrl), e.message);\n eventsSubject.next(navCancel);\n\n // When redirecting, we need to delay resolving the navigation\n // promise and push it to the redirect navigation\n if (!redirecting) {\n t.resolve(false);\n } else {\n // setTimeout is required so this navigation finishes with\n // the return EMPTY below. If it isn't allowed to finish\n // processing, there can be multiple navigations to the same\n // URL.\n setTimeout(() => {\n const mergedTree =\n this.urlHandlingStrategy.merge(e.url, this.rawUrlTree);\n const extras = {\n skipLocationChange: t.extras.skipLocationChange,\n // The URL is already updated at this point if we have 'eager' URL\n // updates or if the navigation was triggered by the browser (back\n // button, URL bar, etc). We want to replace that item in history if\n // the navigation is rejected.\n replaceUrl: this.urlUpdateStrategy === 'eager' ||\n isBrowserTriggeredNavigation(t.source)\n };\n\n this.scheduleNavigation(\n mergedTree, 'imperative', null, extras,\n {resolve: t.resolve, reject: t.reject, promise: t.promise});\n }, 0);\n }\n\n /* All other errors should reset to the router's internal URL reference to\n * the pre-error state. */\n } else {\n this.restoreHistory(t, true);\n const navError =\n new NavigationError(t.id, this.serializeUrl(t.extractedUrl), e);\n eventsSubject.next(navError);\n try {\n t.resolve(this.errorHandler(e));\n } catch (ee) {\n t.reject(ee);\n }\n }\n return EMPTY;\n }));\n // TODO(jasonaden): remove cast once g3 is on updated TypeScript\n })) as any as Observable;\n }\n\n /**\n * @internal\n * TODO: this should be removed once the constructor of the router made internal\n */\n resetRootComponentType(rootComponentType: Type): void {\n this.rootComponentType = rootComponentType;\n // TODO: vsavkin router 4.0 should make the root component set to null\n // this will simplify the lifecycle of the router.\n this.routerState.root.component = this.rootComponentType;\n }\n\n private getTransition(): NavigationTransition {\n const transition = this.transitions.value;\n // TODO(atscott): This comment doesn't make it clear why this value needs to be set. In the case\n // described below (where we don't handle previous or current url), the `browserUrlTree` is set\n // to the `urlAfterRedirects` value. However, these values *are already the same* because of the\n // line below. So it seems that we should be able to remove the line below and the line where\n // `browserUrlTree` is updated when we aren't handling any part of the navigation url.\n // Run TGP to confirm that this can be done.\n\n // This value needs to be set. Other values such as extractedUrl are set on initial navigation\n // but the urlAfterRedirects may not get set if we aren't processing the new URL *and* not\n // processing the previous URL.\n transition.urlAfterRedirects = this.browserUrlTree;\n return transition;\n }\n\n private setTransition(t: Partial): void {\n this.transitions.next({...this.getTransition(), ...t});\n }\n\n /**\n * Sets up the location change listener and performs the initial navigation.\n */\n initialNavigation(): void {\n this.setUpLocationChangeListener();\n if (this.navigationId === 0) {\n this.navigateByUrl(this.location.path(true), {replaceUrl: true});\n }\n }\n\n /**\n * Sets up the location change listener. This listener detects navigations triggered from outside\n * the Router (the browser back/forward buttons, for example) and schedules a corresponding Router\n * navigation so that the correct events, guards, etc. are triggered.\n */\n setUpLocationChangeListener(): void {\n // Don't need to use Zone.wrap any more, because zone.js\n // already patch onPopState, so location change callback will\n // run into ngZone\n if (!this.locationSubscription) {\n this.locationSubscription = this.location.subscribe(event => {\n const currentChange = this.extractLocationChangeInfoFromEvent(event);\n // The `setTimeout` was added in #12160 and is likely to support Angular/AngularJS\n // hybrid apps.\n if (this.shouldScheduleNavigation(this.lastLocationChangeInfo, currentChange)) {\n setTimeout(() => {\n const {source, state, urlTree} = currentChange;\n const extras: NavigationExtras = {replaceUrl: true};\n if (state) {\n const stateCopy = {...state} as Partial;\n delete stateCopy.navigationId;\n delete stateCopy.ɵrouterPageId;\n if (Object.keys(stateCopy).length !== 0) {\n extras.state = stateCopy;\n }\n }\n this.scheduleNavigation(urlTree, source, state, extras);\n }, 0);\n }\n this.lastLocationChangeInfo = currentChange;\n });\n }\n }\n\n /** Extracts router-related information from a `PopStateEvent`. */\n private extractLocationChangeInfoFromEvent(change: PopStateEvent): LocationChangeInfo {\n return {\n source: change['type'] === 'popstate' ? 'popstate' : 'hashchange',\n urlTree: this.parseUrl(change['url']!),\n // Navigations coming from Angular router have a navigationId state\n // property. When this exists, restore the state.\n state: change.state?.navigationId ? change.state : null,\n transitionId: this.getTransition().id\n } as const;\n }\n\n /**\n * Determines whether two events triggered by the Location subscription are due to the same\n * navigation. The location subscription can fire two events (popstate and hashchange) for a\n * single navigation. The second one should be ignored, that is, we should not schedule another\n * navigation in the Router.\n */\n private shouldScheduleNavigation(previous: LocationChangeInfo|null, current: LocationChangeInfo):\n boolean {\n if (!previous) return true;\n\n const sameDestination = current.urlTree.toString() === previous.urlTree.toString();\n const eventsOccurredAtSameTime = current.transitionId === previous.transitionId;\n if (!eventsOccurredAtSameTime || !sameDestination) {\n return true;\n }\n\n if ((current.source === 'hashchange' && previous.source === 'popstate') ||\n (current.source === 'popstate' && previous.source === 'hashchange')) {\n return false;\n }\n\n return true;\n }\n\n /** The current URL. */\n get url(): string {\n return this.serializeUrl(this.currentUrlTree);\n }\n\n /**\n * Returns the current `Navigation` object when the router is navigating,\n * and `null` when idle.\n */\n getCurrentNavigation(): Navigation|null {\n return this.currentNavigation;\n }\n\n /** @internal */\n triggerEvent(event: Event): void {\n (this.events as Subject).next(event);\n }\n\n /**\n * Resets the route configuration used for navigation and generating links.\n *\n * @param config The route array for the new configuration.\n *\n * @usageNotes\n *\n * ```\n * router.resetConfig([\n * { path: 'team/:id', component: TeamCmp, children: [\n * { path: 'simple', component: SimpleCmp },\n * { path: 'user/:name', component: UserCmp }\n * ]}\n * ]);\n * ```\n */\n resetConfig(config: Routes): void {\n validateConfig(config);\n this.config = config.map(standardizeConfig);\n this.navigated = false;\n this.lastSuccessfulId = -1;\n }\n\n /** @nodoc */\n ngOnDestroy(): void {\n this.dispose();\n }\n\n /** Disposes of the router. */\n dispose(): void {\n this.transitions.complete();\n if (this.locationSubscription) {\n this.locationSubscription.unsubscribe();\n this.locationSubscription = undefined;\n }\n this.disposed = true;\n }\n\n /**\n * Appends URL segments to the current URL tree to create a new URL tree.\n *\n * @param commands An array of URL fragments with which to construct the new URL tree.\n * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path\n * segments, followed by the parameters for each segment.\n * The fragments are applied to the current URL tree or the one provided in the `relativeTo`\n * property of the options object, if supplied.\n * @param navigationExtras Options that control the navigation strategy.\n * @returns The new URL tree.\n *\n * @usageNotes\n *\n * ```\n * // create /team/33/user/11\n * router.createUrlTree(['/team', 33, 'user', 11]);\n *\n * // create /team/33;expand=true/user/11\n * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);\n *\n * // you can collapse static segments like this (this works only with the first passed-in value):\n * router.createUrlTree(['/team/33/user', userId]);\n *\n * // If the first segment can contain slashes, and you do not want the router to split it,\n * // you can do the following:\n * router.createUrlTree([{segmentPath: '/one/two'}]);\n *\n * // create /team/33/(user/11//right:chat)\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);\n *\n * // remove the right secondary node\n * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);\n *\n * // assuming the current url is `/team/33/user/11` and the route points to `user/11`\n *\n * // navigate to /team/33/user/11/details\n * router.createUrlTree(['details'], {relativeTo: route});\n *\n * // navigate to /team/33/user/22\n * router.createUrlTree(['../22'], {relativeTo: route});\n *\n * // navigate to /team/44/user/22\n * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});\n *\n * Note that a value of `null` or `undefined` for `relativeTo` indicates that the\n * tree should be created relative to the root.\n * ```\n */\n createUrlTree(commands: any[], navigationExtras: UrlCreationOptions = {}): UrlTree {\n const {relativeTo, queryParams, fragment, queryParamsHandling, preserveFragment} =\n navigationExtras;\n const a = relativeTo || this.routerState.root;\n const f = preserveFragment ? this.currentUrlTree.fragment : fragment;\n let q: Params|null = null;\n switch (queryParamsHandling) {\n case 'merge':\n q = {...this.currentUrlTree.queryParams, ...queryParams};\n break;\n case 'preserve':\n q = this.currentUrlTree.queryParams;\n break;\n default:\n q = queryParams || null;\n }\n if (q !== null) {\n q = this.removeEmptyProps(q);\n }\n return createUrlTree(a, this.currentUrlTree, commands, q, f ?? null);\n }\n\n /**\n * Navigates to a view using an absolute route path.\n *\n * @param url An absolute path for a defined route. The function does not apply any delta to the\n * current URL.\n * @param extras An object containing properties that modify the navigation strategy.\n *\n * @returns A Promise that resolves to 'true' when navigation succeeds,\n * to 'false' when navigation fails, or is rejected on error.\n *\n * @usageNotes\n *\n * The following calls request navigation to an absolute path.\n *\n * ```\n * router.navigateByUrl(\"/team/33/user/11\");\n *\n * // Navigate without updating the URL\n * router.navigateByUrl(\"/team/33/user/11\", { skipLocationChange: true });\n * ```\n *\n * @see [Routing and Navigation guide](guide/router)\n *\n */\n navigateByUrl(url: string|UrlTree, extras: NavigationBehaviorOptions = {\n skipLocationChange: false\n }): Promise {\n if (typeof ngDevMode === 'undefined' ||\n ngDevMode && this.isNgZoneEnabled && !NgZone.isInAngularZone()) {\n this.console.warn(\n `Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?`);\n }\n\n const urlTree = isUrlTree(url) ? url : this.parseUrl(url);\n const mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree);\n\n return this.scheduleNavigation(mergedTree, 'imperative', null, extras);\n }\n\n /**\n * Navigate based on the provided array of commands and a starting point.\n * If no starting route is provided, the navigation is absolute.\n *\n * @param commands An array of URL fragments with which to construct the target URL.\n * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path\n * segments, followed by the parameters for each segment.\n * The fragments are applied to the current URL or the one provided in the `relativeTo` property\n * of the options object, if supplied.\n * @param extras An options object that determines how the URL should be constructed or\n * interpreted.\n *\n * @returns A Promise that resolves to `true` when navigation succeeds, to `false` when navigation\n * fails,\n * or is rejected on error.\n *\n * @usageNotes\n *\n * The following calls request navigation to a dynamic route path relative to the current URL.\n *\n * ```\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route});\n *\n * // Navigate without updating the URL, overriding the default behavior\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});\n * ```\n *\n * @see [Routing and Navigation guide](guide/router)\n *\n */\n navigate(commands: any[], extras: NavigationExtras = {skipLocationChange: false}):\n Promise {\n validateCommands(commands);\n return this.navigateByUrl(this.createUrlTree(commands, extras), extras);\n }\n\n /** Serializes a `UrlTree` into a string */\n serializeUrl(url: UrlTree): string {\n return this.urlSerializer.serialize(url);\n }\n\n /** Parses a string into a `UrlTree` */\n parseUrl(url: string): UrlTree {\n let urlTree: UrlTree;\n try {\n urlTree = this.urlSerializer.parse(url);\n } catch (e) {\n urlTree = this.malformedUriErrorHandler(e, this.urlSerializer, url);\n }\n return urlTree;\n }\n\n /**\n * Returns whether the url is activated.\n *\n * @deprecated\n * Use `IsActiveMatchOptions` instead.\n *\n * - The equivalent `IsActiveMatchOptions` for `true` is\n * `{paths: 'exact', queryParams: 'exact', fragment: 'ignored', matrixParams: 'ignored'}`.\n * - The equivalent for `false` is\n * `{paths: 'subset', queryParams: 'subset', fragment: 'ignored', matrixParams: 'ignored'}`.\n */\n isActive(url: string|UrlTree, exact: boolean): boolean;\n /**\n * Returns whether the url is activated.\n */\n isActive(url: string|UrlTree, matchOptions: IsActiveMatchOptions): boolean;\n /** @internal */\n isActive(url: string|UrlTree, matchOptions: boolean|IsActiveMatchOptions): boolean;\n isActive(url: string|UrlTree, matchOptions: boolean|IsActiveMatchOptions): boolean {\n let options: IsActiveMatchOptions;\n if (matchOptions === true) {\n options = {...exactMatchOptions};\n } else if (matchOptions === false) {\n options = {...subsetMatchOptions};\n } else {\n options = matchOptions;\n }\n if (isUrlTree(url)) {\n return containsTree(this.currentUrlTree, url, options);\n }\n\n const urlTree = this.parseUrl(url);\n return containsTree(this.currentUrlTree, urlTree, options);\n }\n\n private removeEmptyProps(params: Params): Params {\n return Object.keys(params).reduce((result: Params, key: string) => {\n const value: any = params[key];\n if (value !== null && value !== undefined) {\n result[key] = value;\n }\n return result;\n }, {});\n }\n\n private processNavigations(): void {\n this.navigations.subscribe(\n t => {\n this.navigated = true;\n this.lastSuccessfulId = t.id;\n this.currentPageId = t.targetPageId;\n (this.events as Subject)\n .next(new NavigationEnd(\n t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(this.currentUrlTree)));\n this.lastSuccessfulNavigation = this.currentNavigation;\n t.resolve(true);\n },\n e => {\n this.console.warn(`Unhandled Navigation Error: ${e}`);\n });\n }\n\n private scheduleNavigation(\n rawUrl: UrlTree, source: NavigationTrigger, restoredState: RestoredState|null,\n extras: NavigationExtras,\n priorPromise?: {resolve: any, reject: any, promise: Promise}): Promise {\n if (this.disposed) {\n return Promise.resolve(false);\n }\n\n // * Imperative navigations (router.navigate) might trigger additional navigations to the same\n // URL via a popstate event and the locationChangeListener. We should skip these duplicate\n // navs. Duplicates may also be triggered by attempts to sync AngularJS and Angular router\n // states.\n // * Imperative navigations can be cancelled by router guards, meaning the URL won't change. If\n // the user follows that with a navigation using the back/forward button or manual URL change,\n // the destination may be the same as the previous imperative attempt. We should not skip\n // these navigations because it's a separate case from the one above -- it's not a duplicate\n // navigation.\n const lastNavigation = this.getTransition();\n // We don't want to skip duplicate successful navs if they're imperative because\n // onSameUrlNavigation could be 'reload' (so the duplicate is intended).\n const browserNavPrecededByRouterNav = isBrowserTriggeredNavigation(source) && lastNavigation &&\n !isBrowserTriggeredNavigation(lastNavigation.source);\n const lastNavigationSucceeded = this.lastSuccessfulId === lastNavigation.id;\n // If the last navigation succeeded or is in flight, we can use the rawUrl as the comparison.\n // However, if it failed, we should compare to the final result (urlAfterRedirects).\n const lastNavigationUrl = (lastNavigationSucceeded || this.currentNavigation) ?\n lastNavigation.rawUrl :\n lastNavigation.urlAfterRedirects;\n const duplicateNav = lastNavigationUrl.toString() === rawUrl.toString();\n if (browserNavPrecededByRouterNav && duplicateNav) {\n return Promise.resolve(true); // return value is not used\n }\n\n let resolve: any;\n let reject: any;\n let promise: Promise;\n if (priorPromise) {\n resolve = priorPromise.resolve;\n reject = priorPromise.reject;\n promise = priorPromise.promise;\n\n } else {\n promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n }\n\n const id = ++this.navigationId;\n let targetPageId: number;\n if (this.canceledNavigationResolution === 'computed') {\n const isInitialPage = this.currentPageId === 0;\n if (isInitialPage) {\n restoredState = this.location.getState() as RestoredState | null;\n }\n // If the `ɵrouterPageId` exist in the state then `targetpageId` should have the value of\n // `ɵrouterPageId`. This is the case for something like a page refresh where we assign the\n // target id to the previously set value for that page.\n if (restoredState && restoredState.ɵrouterPageId) {\n targetPageId = restoredState.ɵrouterPageId;\n } else {\n // If we're replacing the URL or doing a silent navigation, we do not want to increment the\n // page id because we aren't pushing a new entry to history.\n if (extras.replaceUrl || extras.skipLocationChange) {\n targetPageId = this.browserPageId ?? 0;\n } else {\n targetPageId = (this.browserPageId ?? 0) + 1;\n }\n }\n } else {\n // This is unused when `canceledNavigationResolution` is not computed.\n targetPageId = 0;\n }\n\n this.setTransition({\n id,\n targetPageId,\n source,\n restoredState,\n currentUrlTree: this.currentUrlTree,\n currentRawUrl: this.rawUrlTree,\n rawUrl,\n extras,\n resolve,\n reject,\n promise,\n currentSnapshot: this.routerState.snapshot,\n currentRouterState: this.routerState\n });\n\n // Make sure that the error is propagated even though `processNavigations` catch\n // handler does not rethrow\n return promise.catch((e: any) => {\n return Promise.reject(e);\n });\n }\n\n private setBrowserUrl(url: UrlTree, t: NavigationTransition) {\n const path = this.urlSerializer.serialize(url);\n const state = {...t.extras.state, ...this.generateNgRouterState(t.id, t.targetPageId)};\n if (this.location.isCurrentPathEqualTo(path) || !!t.extras.replaceUrl) {\n this.location.replaceState(path, '', state);\n } else {\n this.location.go(path, '', state);\n }\n }\n\n /**\n * Performs the necessary rollback action to restore the browser URL to the\n * state before the transition.\n */\n private restoreHistory(t: NavigationTransition, restoringFromCaughtError = false) {\n if (this.canceledNavigationResolution === 'computed') {\n const targetPagePosition = this.currentPageId - t.targetPageId;\n // The navigator change the location before triggered the browser event,\n // so we need to go back to the current url if the navigation is canceled.\n // Also, when navigation gets cancelled while using url update strategy eager, then we need to\n // go back. Because, when `urlUpdateSrategy` is `eager`; `setBrowserUrl` method is called\n // before any verification.\n const browserUrlUpdateOccurred =\n (t.source === 'popstate' || this.urlUpdateStrategy === 'eager' ||\n this.currentUrlTree === this.currentNavigation?.finalUrl);\n if (browserUrlUpdateOccurred && targetPagePosition !== 0) {\n this.location.historyGo(targetPagePosition);\n } else if (\n this.currentUrlTree === this.currentNavigation?.finalUrl && targetPagePosition === 0) {\n // We got to the activation stage (where currentUrlTree is set to the navigation's\n // finalUrl), but we weren't moving anywhere in history (skipLocationChange or replaceUrl).\n // We still need to reset the router state back to what it was when the navigation started.\n this.resetState(t);\n // TODO(atscott): resetting the `browserUrlTree` should really be done in `resetState`.\n // Investigate if this can be done by running TGP.\n this.browserUrlTree = t.currentUrlTree;\n this.resetUrlToCurrentUrlTree();\n } else {\n // The browser URL and router state was not updated before the navigation cancelled so\n // there's no restoration needed.\n }\n } else if (this.canceledNavigationResolution === 'replace') {\n // TODO(atscott): It seems like we should _always_ reset the state here. It would be a no-op\n // for `deferred` navigations that haven't change the internal state yet because guards\n // reject. For 'eager' navigations, it seems like we also really should reset the state\n // because the navigation was cancelled. Investigate if this can be done by running TGP.\n if (restoringFromCaughtError) {\n this.resetState(t);\n }\n this.resetUrlToCurrentUrlTree();\n }\n }\n\n private resetState(t: NavigationTransition): void {\n (this as {routerState: RouterState}).routerState = t.currentRouterState;\n this.currentUrlTree = t.currentUrlTree;\n this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, t.rawUrl);\n }\n\n private resetUrlToCurrentUrlTree(): void {\n this.location.replaceState(\n this.urlSerializer.serialize(this.rawUrlTree), '',\n this.generateNgRouterState(this.lastSuccessfulId, this.currentPageId));\n }\n\n private cancelNavigationTransition(t: NavigationTransition, reason: string) {\n const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), reason);\n this.triggerEvent(navCancel);\n t.resolve(false);\n }\n\n private generateNgRouterState(navigationId: number, routerPageId?: number) {\n if (this.canceledNavigationResolution === 'computed') {\n return {navigationId, ɵrouterPageId: routerPageId};\n }\n return {navigationId};\n }\n}\n\nfunction validateCommands(commands: string[]): void {\n for (let i = 0; i < commands.length; i++) {\n const cmd = commands[i];\n if (cmd == null) {\n throw new Error(`The requested path contains ${cmd} segment at index ${i}`);\n }\n }\n}\n\nfunction isBrowserTriggeredNavigation(source: 'imperative'|'popstate'|'hashchange') {\n return source !== 'imperative';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {LocationStrategy} from '@angular/common';\nimport {Attribute, Directive, ElementRef, HostBinding, HostListener, Input, OnChanges, OnDestroy, Renderer2, SimpleChanges} from '@angular/core';\nimport {Subject, Subscription} from 'rxjs';\n\nimport {QueryParamsHandling} from '../config';\nimport {Event, NavigationEnd} from '../events';\nimport {Router} from '../router';\nimport {ActivatedRoute} from '../router_state';\nimport {Params} from '../shared';\nimport {UrlTree} from '../url_tree';\n\n\n/**\n * @description\n *\n * When applied to an element in a template, makes that element a link\n * that initiates navigation to a route. Navigation opens one or more routed components\n * in one or more `` locations on the page.\n *\n * Given a route configuration `[{ path: 'user/:name', component: UserCmp }]`,\n * the following creates a static link to the route:\n * `link to user component`\n *\n * You can use dynamic values to generate the link.\n * For a dynamic link, pass an array of path segments,\n * followed by the params for each segment.\n * For example, `['/team', teamId, 'user', userName, {details: true}]`\n * generates a link to `/team/11/user/bob;details=true`.\n *\n * Multiple static segments can be merged into one term and combined with dynamic segements.\n * For example, `['/team/11/user', userName, {details: true}]`\n *\n * The input that you provide to the link is treated as a delta to the current URL.\n * For instance, suppose the current URL is `/user/(box//aux:team)`.\n * The link `Jim` creates the URL\n * `/user/(jim//aux:team)`.\n * See {@link Router#createUrlTree createUrlTree} for more information.\n *\n * @usageNotes\n *\n * You can use absolute or relative paths in a link, set query parameters,\n * control how parameters are handled, and keep a history of navigation states.\n *\n * ### Relative link paths\n *\n * The first segment name can be prepended with `/`, `./`, or `../`.\n * * If the first segment begins with `/`, the router looks up the route from the root of the\n * app.\n * * If the first segment begins with `./`, or doesn't begin with a slash, the router\n * looks in the children of the current activated route.\n * * If the first segment begins with `../`, the router goes up one level in the route tree.\n *\n * ### Setting and handling query params and fragments\n *\n * The following link adds a query parameter and a fragment to the generated URL:\n *\n * ```\n * \n * link to user component\n * \n * ```\n * By default, the directive constructs the new URL using the given query parameters.\n * The example generates the link: `/user/bob?debug=true#education`.\n *\n * You can instruct the directive to handle query parameters differently\n * by specifying the `queryParamsHandling` option in the link.\n * Allowed values are:\n *\n * - `'merge'`: Merge the given `queryParams` into the current query params.\n * - `'preserve'`: Preserve the current query params.\n *\n * For example:\n *\n * ```\n * \n * link to user component\n * \n * ```\n *\n * See {@link UrlCreationOptions.queryParamsHandling UrlCreationOptions#queryParamsHandling}.\n *\n * ### Preserving navigation history\n *\n * You can provide a `state` value to be persisted to the browser's\n * [`History.state` property](https://developer.mozilla.org/en-US/docs/Web/API/History#Properties).\n * For example:\n *\n * ```\n * \n * link to user component\n * \n * ```\n *\n * Use {@link Router.getCurrentNavigation() Router#getCurrentNavigation} to retrieve a saved\n * navigation-state value. For example, to capture the `tracingId` during the `NavigationStart`\n * event:\n *\n * ```\n * // Get NavigationStart events\n * router.events.pipe(filter(e => e instanceof NavigationStart)).subscribe(e => {\n * const navigation = router.getCurrentNavigation();\n * tracingService.trace({id: navigation.extras.state.tracingId});\n * });\n * ```\n *\n * @ngModule RouterModule\n *\n * @publicApi\n */\n@Directive({selector: ':not(a):not(area)[routerLink]'})\nexport class RouterLink implements OnChanges {\n /**\n * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the\n * `UrlCreationOptions`.\n * @see {@link UrlCreationOptions#queryParams UrlCreationOptions#queryParams}\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n @Input() queryParams?: Params|null;\n /**\n * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the\n * `UrlCreationOptions`.\n * @see {@link UrlCreationOptions#fragment UrlCreationOptions#fragment}\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n @Input() fragment?: string;\n /**\n * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the\n * `UrlCreationOptions`.\n * @see {@link UrlCreationOptions#queryParamsHandling UrlCreationOptions#queryParamsHandling}\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n @Input() queryParamsHandling?: QueryParamsHandling|null;\n /**\n * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the\n * `UrlCreationOptions`.\n * @see {@link UrlCreationOptions#preserveFragment UrlCreationOptions#preserveFragment}\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n // TODO(issue/24571): remove '!'.\n @Input() preserveFragment!: boolean;\n /**\n * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the\n * `NavigationBehaviorOptions`.\n * @see {@link NavigationBehaviorOptions#skipLocationChange NavigationBehaviorOptions#skipLocationChange}\n * @see {@link Router#navigateByUrl Router#navigateByUrl}\n */\n // TODO(issue/24571): remove '!'.\n @Input() skipLocationChange!: boolean;\n /**\n * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the\n * `NavigationBehaviorOptions`.\n * @see {@link NavigationBehaviorOptions#replaceUrl NavigationBehaviorOptions#replaceUrl}\n * @see {@link Router#navigateByUrl Router#navigateByUrl}\n */\n // TODO(issue/24571): remove '!'.\n @Input() replaceUrl!: boolean;\n /**\n * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the\n * `NavigationBehaviorOptions`.\n * @see {@link NavigationBehaviorOptions#state NavigationBehaviorOptions#state}\n * @see {@link Router#navigateByUrl Router#navigateByUrl}\n */\n @Input() state?: {[k: string]: any};\n /**\n * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the\n * `UrlCreationOptions`.\n * Specify a value here when you do not want to use the default value\n * for `routerLink`, which is the current activated route.\n * Note that a value of `undefined` here will use the `routerLink` default.\n * @see {@link UrlCreationOptions#relativeTo UrlCreationOptions#relativeTo}\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n @Input() relativeTo?: ActivatedRoute|null;\n\n private commands: any[] = [];\n private preserve!: boolean;\n\n /** @internal */\n onChanges = new Subject();\n\n constructor(\n private router: Router, private route: ActivatedRoute,\n @Attribute('tabindex') tabIndex: string, renderer: Renderer2, el: ElementRef) {\n if (tabIndex == null) {\n renderer.setAttribute(el.nativeElement, 'tabindex', '0');\n }\n }\n\n /** @nodoc */\n ngOnChanges(changes: SimpleChanges) {\n // This is subscribed to by `RouterLinkActive` so that it knows to update when there are changes\n // to the RouterLinks it's tracking.\n this.onChanges.next(this);\n }\n\n /**\n * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.\n * - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.\n * - **string**: shorthand for array of commands with just the string, i.e. `['/route']`\n * - **null|undefined**: shorthand for an empty array of commands, i.e. `[]`\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n @Input()\n set routerLink(commands: any[]|string|null|undefined) {\n if (commands != null) {\n this.commands = Array.isArray(commands) ? commands : [commands];\n } else {\n this.commands = [];\n }\n }\n\n /** @nodoc */\n @HostListener('click')\n onClick(): boolean {\n const extras = {\n skipLocationChange: attrBoolValue(this.skipLocationChange),\n replaceUrl: attrBoolValue(this.replaceUrl),\n state: this.state,\n };\n this.router.navigateByUrl(this.urlTree, extras);\n return true;\n }\n\n get urlTree(): UrlTree {\n return this.router.createUrlTree(this.commands, {\n // If the `relativeTo` input is not defined, we want to use `this.route` by default.\n // Otherwise, we should use the value provided by the user in the input.\n relativeTo: this.relativeTo !== undefined ? this.relativeTo : this.route,\n queryParams: this.queryParams,\n fragment: this.fragment,\n queryParamsHandling: this.queryParamsHandling,\n preserveFragment: attrBoolValue(this.preserveFragment),\n });\n }\n}\n\n/**\n * @description\n *\n * Lets you link to specific routes in your app.\n *\n * See `RouterLink` for more information.\n *\n * @ngModule RouterModule\n *\n * @publicApi\n */\n@Directive({selector: 'a[routerLink],area[routerLink]'})\nexport class RouterLinkWithHref implements OnChanges, OnDestroy {\n // TODO(issue/24571): remove '!'.\n @HostBinding('attr.target') @Input() target!: string;\n /**\n * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the\n * `UrlCreationOptions`.\n * @see {@link UrlCreationOptions#queryParams UrlCreationOptions#queryParams}\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n @Input() queryParams?: Params|null;\n /**\n * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the\n * `UrlCreationOptions`.\n * @see {@link UrlCreationOptions#fragment UrlCreationOptions#fragment}\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n @Input() fragment?: string;\n /**\n * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the\n * `UrlCreationOptions`.\n * @see {@link UrlCreationOptions#queryParamsHandling UrlCreationOptions#queryParamsHandling}\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n @Input() queryParamsHandling?: QueryParamsHandling|null;\n /**\n * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the\n * `UrlCreationOptions`.\n * @see {@link UrlCreationOptions#preserveFragment UrlCreationOptions#preserveFragment}\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n // TODO(issue/24571): remove '!'.\n @Input() preserveFragment!: boolean;\n /**\n * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the\n * `NavigationBehaviorOptions`.\n * @see {@link NavigationBehaviorOptions#skipLocationChange NavigationBehaviorOptions#skipLocationChange}\n * @see {@link Router#navigateByUrl Router#navigateByUrl}\n */\n // TODO(issue/24571): remove '!'.\n @Input() skipLocationChange!: boolean;\n /**\n * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the\n * `NavigationBehaviorOptions`.\n * @see {@link NavigationBehaviorOptions#replaceUrl NavigationBehaviorOptions#replaceUrl}\n * @see {@link Router#navigateByUrl Router#navigateByUrl}\n */\n // TODO(issue/24571): remove '!'.\n @Input() replaceUrl!: boolean;\n /**\n * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the\n * `NavigationBehaviorOptions`.\n * @see {@link NavigationBehaviorOptions#state NavigationBehaviorOptions#state}\n * @see {@link Router#navigateByUrl Router#navigateByUrl}\n */\n @Input() state?: {[k: string]: any};\n /**\n * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the\n * `UrlCreationOptions`.\n * Specify a value here when you do not want to use the default value\n * for `routerLink`, which is the current activated route.\n * Note that a value of `undefined` here will use the `routerLink` default.\n * @see {@link UrlCreationOptions#relativeTo UrlCreationOptions#relativeTo}\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n @Input() relativeTo?: ActivatedRoute|null;\n\n private commands: any[] = [];\n private subscription: Subscription;\n // TODO(issue/24571): remove '!'.\n private preserve!: boolean;\n\n // the url displayed on the anchor element.\n // TODO(issue/24571): remove '!'.\n @HostBinding() href!: string;\n\n /** @internal */\n onChanges = new Subject();\n\n constructor(\n private router: Router, private route: ActivatedRoute,\n private locationStrategy: LocationStrategy) {\n this.subscription = router.events.subscribe((s: Event) => {\n if (s instanceof NavigationEnd) {\n this.updateTargetUrlAndHref();\n }\n });\n }\n\n /**\n * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.\n * - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.\n * - **string**: shorthand for array of commands with just the string, i.e. `['/route']`\n * - **null|undefined**: shorthand for an empty array of commands, i.e. `[]`\n * @see {@link Router#createUrlTree Router#createUrlTree}\n */\n @Input()\n set routerLink(commands: any[]|string|null|undefined) {\n if (commands != null) {\n this.commands = Array.isArray(commands) ? commands : [commands];\n } else {\n this.commands = [];\n }\n }\n\n /** @nodoc */\n ngOnChanges(changes: SimpleChanges): any {\n this.updateTargetUrlAndHref();\n this.onChanges.next(this);\n }\n /** @nodoc */\n ngOnDestroy(): any {\n this.subscription.unsubscribe();\n }\n\n /** @nodoc */\n @HostListener(\n 'click',\n ['$event.button', '$event.ctrlKey', '$event.shiftKey', '$event.altKey', '$event.metaKey'])\n onClick(button: number, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean):\n boolean {\n if (button !== 0 || ctrlKey || shiftKey || altKey || metaKey) {\n return true;\n }\n\n if (typeof this.target === 'string' && this.target != '_self') {\n return true;\n }\n\n const extras = {\n skipLocationChange: attrBoolValue(this.skipLocationChange),\n replaceUrl: attrBoolValue(this.replaceUrl),\n state: this.state\n };\n this.router.navigateByUrl(this.urlTree, extras);\n return false;\n }\n\n private updateTargetUrlAndHref(): void {\n this.href = this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree));\n }\n\n get urlTree(): UrlTree {\n return this.router.createUrlTree(this.commands, {\n // If the `relativeTo` input is not defined, we want to use `this.route` by default.\n // Otherwise, we should use the value provided by the user in the input.\n relativeTo: this.relativeTo !== undefined ? this.relativeTo : this.route,\n queryParams: this.queryParams,\n fragment: this.fragment,\n queryParamsHandling: this.queryParamsHandling,\n preserveFragment: attrBoolValue(this.preserveFragment),\n });\n }\n}\n\nfunction attrBoolValue(s: any): boolean {\n return s === '' || !!s;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AfterContentInit, ChangeDetectorRef, ContentChildren, Directive, ElementRef, Input, OnChanges, OnDestroy, Optional, QueryList, Renderer2, SimpleChanges} from '@angular/core';\nimport {from, of, Subscription} from 'rxjs';\nimport {mergeAll} from 'rxjs/operators';\n\nimport {Event, NavigationEnd} from '../events';\nimport {Router} from '../router';\nimport {IsActiveMatchOptions} from '../url_tree';\n\nimport {RouterLink, RouterLinkWithHref} from './router_link';\n\n\n/**\n *\n * @description\n *\n * Tracks whether the linked route of an element is currently active, and allows you\n * to specify one or more CSS classes to add to the element when the linked route\n * is active.\n *\n * Use this directive to create a visual distinction for elements associated with an active route.\n * For example, the following code highlights the word \"Bob\" when the router\n * activates the associated route:\n *\n * ```\n * Bob\n * ```\n *\n * Whenever the URL is either '/user' or '/user/bob', the \"active-link\" class is\n * added to the anchor tag. If the URL changes, the class is removed.\n *\n * You can set more than one class using a space-separated string or an array.\n * For example:\n *\n * ```\n * Bob\n * Bob\n * ```\n *\n * To add the classes only when the URL matches the link exactly, add the option `exact: true`:\n *\n * ```\n * Bob\n * ```\n *\n * To directly check the `isActive` status of the link, assign the `RouterLinkActive`\n * instance to a template variable.\n * For example, the following checks the status without assigning any CSS classes:\n *\n * ```\n * \n * Bob {{ rla.isActive ? '(already open)' : ''}}\n * \n * ```\n *\n * You can apply the `RouterLinkActive` directive to an ancestor of linked elements.\n * For example, the following sets the active-link class on the `
` parent tag\n * when the URL is either '/user/jim' or '/user/bob'.\n *\n * ```\n *
\n * Jim\n * Bob\n *
\n * ```\n *\n * @ngModule RouterModule\n *\n * @publicApi\n */\n@Directive({\n selector: '[routerLinkActive]',\n exportAs: 'routerLinkActive',\n})\nexport class RouterLinkActive implements OnChanges, OnDestroy, AfterContentInit {\n @ContentChildren(RouterLink, {descendants: true}) links!: QueryList;\n @ContentChildren(RouterLinkWithHref, {descendants: true})\n linksWithHrefs!: QueryList;\n\n private classes: string[] = [];\n private routerEventsSubscription: Subscription;\n private linkInputChangesSubscription?: Subscription;\n public readonly isActive: boolean = false;\n\n /**\n * Options to configure how to determine if the router link is active.\n *\n * These options are passed to the `Router.isActive()` function.\n *\n * @see Router.isActive\n */\n @Input() routerLinkActiveOptions: {exact: boolean}|IsActiveMatchOptions = {exact: false};\n\n\n constructor(\n private router: Router, private element: ElementRef, private renderer: Renderer2,\n private readonly cdr: ChangeDetectorRef, @Optional() private link?: RouterLink,\n @Optional() private linkWithHref?: RouterLinkWithHref) {\n this.routerEventsSubscription = router.events.subscribe((s: Event) => {\n if (s instanceof NavigationEnd) {\n this.update();\n }\n });\n }\n\n /** @nodoc */\n ngAfterContentInit(): void {\n // `of(null)` is used to force subscribe body to execute once immediately (like `startWith`).\n of(this.links.changes, this.linksWithHrefs.changes, of(null)).pipe(mergeAll()).subscribe(_ => {\n this.update();\n this.subscribeToEachLinkOnChanges();\n });\n }\n\n private subscribeToEachLinkOnChanges() {\n this.linkInputChangesSubscription?.unsubscribe();\n const allLinkChanges =\n [...this.links.toArray(), ...this.linksWithHrefs.toArray(), this.link, this.linkWithHref]\n .filter((link): link is RouterLink|RouterLinkWithHref => !!link)\n .map(link => link.onChanges);\n this.linkInputChangesSubscription = from(allLinkChanges).pipe(mergeAll()).subscribe(link => {\n if (this.isActive !== this.isLinkActive(this.router)(link)) {\n this.update();\n }\n });\n }\n\n @Input()\n set routerLinkActive(data: string[]|string) {\n const classes = Array.isArray(data) ? data : data.split(' ');\n this.classes = classes.filter(c => !!c);\n }\n\n /** @nodoc */\n ngOnChanges(changes: SimpleChanges): void {\n this.update();\n }\n /** @nodoc */\n ngOnDestroy(): void {\n this.routerEventsSubscription.unsubscribe();\n this.linkInputChangesSubscription?.unsubscribe();\n }\n\n private update(): void {\n if (!this.links || !this.linksWithHrefs || !this.router.navigated) return;\n Promise.resolve().then(() => {\n const hasActiveLinks = this.hasActiveLinks();\n if (this.isActive !== hasActiveLinks) {\n (this as any).isActive = hasActiveLinks;\n this.cdr.markForCheck();\n this.classes.forEach((c) => {\n if (hasActiveLinks) {\n this.renderer.addClass(this.element.nativeElement, c);\n } else {\n this.renderer.removeClass(this.element.nativeElement, c);\n }\n });\n }\n });\n }\n\n private isLinkActive(router: Router): (link: (RouterLink|RouterLinkWithHref)) => boolean {\n const options: boolean|IsActiveMatchOptions =\n isActiveMatchOptions(this.routerLinkActiveOptions) ?\n this.routerLinkActiveOptions :\n // While the types should disallow `undefined` here, it's possible without strict inputs\n (this.routerLinkActiveOptions.exact || false);\n return (link: RouterLink|RouterLinkWithHref) => router.isActive(link.urlTree, options);\n }\n\n private hasActiveLinks(): boolean {\n const isActiveCheckFn = this.isLinkActive(this.router);\n return this.link && isActiveCheckFn(this.link) ||\n this.linkWithHref && isActiveCheckFn(this.linkWithHref) ||\n this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);\n }\n}\n\n/**\n * Use instead of `'paths' in options` to be compatible with property renaming\n */\nfunction isActiveMatchOptions(options: {exact: boolean}|\n IsActiveMatchOptions): options is IsActiveMatchOptions {\n return !!(options as IsActiveMatchOptions).paths;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Attribute, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, Directive, EventEmitter, Injector, OnDestroy, OnInit, Output, ViewContainerRef,} from '@angular/core';\nimport {Data} from '../config';\nimport {ChildrenOutletContexts} from '../router_outlet_context';\nimport {ActivatedRoute} from '../router_state';\nimport {PRIMARY_OUTLET} from '../shared';\n\n/**\n * An interface that defines the contract for developing a component outlet for the `Router`.\n *\n * An outlet acts as a placeholder that Angular dynamically fills based on the current router state.\n *\n * A router outlet should register itself with the `Router` via\n * `ChildrenOutletContexts#onChildOutletCreated` and unregister with\n * `ChildrenOutletContexts#onChildOutletDestroyed`. When the `Router` identifies a matched `Route`,\n * it looks for a registered outlet in the `ChildrenOutletContexts` and activates it.\n *\n * @see `ChildrenOutletContexts`\n * @publicApi\n */\nexport interface RouterOutletContract {\n /**\n * Whether the given outlet is activated.\n *\n * An outlet is considered \"activated\" if it has an active component.\n */\n isActivated: boolean;\n\n /** The instance of the activated component or `null` if the outlet is not activated. */\n component: Object|null;\n\n /**\n * The `Data` of the `ActivatedRoute` snapshot.\n */\n activatedRouteData: Data;\n\n /**\n * The `ActivatedRoute` for the outlet or `null` if the outlet is not activated.\n */\n activatedRoute: ActivatedRoute|null;\n\n /**\n * Called by the `Router` when the outlet should activate (create a component).\n */\n activateWith(activatedRoute: ActivatedRoute, resolver: ComponentFactoryResolver|null): void;\n\n /**\n * A request to destroy the currently activated component.\n *\n * When a `RouteReuseStrategy` indicates that an `ActivatedRoute` should be removed but stored for\n * later re-use rather than destroyed, the `Router` will call `detach` instead.\n */\n deactivate(): void;\n\n /**\n * Called when the `RouteReuseStrategy` instructs to detach the subtree.\n *\n * This is similar to `deactivate`, but the activated component should _not_ be destroyed.\n * Instead, it is returned so that it can be reattached later via the `attach` method.\n */\n detach(): ComponentRef;\n\n /**\n * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree.\n */\n attach(ref: ComponentRef, activatedRoute: ActivatedRoute): void;\n\n /**\n * Emits an activate event when a new component is instantiated\n **/\n activateEvents?: EventEmitter;\n\n /**\n * Emits a deactivate event when a component is destroyed.\n */\n deactivateEvents?: EventEmitter;\n}\n\n/**\n * @description\n *\n * Acts as a placeholder that Angular dynamically fills based on the current router state.\n *\n * Each outlet can have a unique name, determined by the optional `name` attribute.\n * The name cannot be set or changed dynamically. If not set, default value is \"primary\".\n *\n * ```\n * \n * \n * \n * ```\n *\n * Named outlets can be the targets of secondary routes.\n * The `Route` object for a secondary route has an `outlet` property to identify the target outlet:\n *\n * `{path: , component: , outlet: }`\n *\n * Using named outlets and secondary routes, you can target multiple outlets in\n * the same `RouterLink` directive.\n *\n * The router keeps track of separate branches in a navigation tree for each named outlet and\n * generates a representation of that tree in the URL.\n * The URL for a secondary route uses the following syntax to specify both the primary and secondary\n * routes at the same time:\n *\n * `http://base-path/primary-route-path(outlet-name:route-path)`\n *\n * A router outlet emits an activate event when a new component is instantiated,\n * and a deactivate event when a component is destroyed.\n *\n * ```\n * \n * ```\n *\n * @see [Routing tutorial](guide/router-tutorial-toh#named-outlets \"Example of a named\n * outlet and secondary route configuration\").\n * @see `RouterLink`\n * @see `Route`\n * @ngModule RouterModule\n *\n * @publicApi\n */\n@Directive({selector: 'router-outlet', exportAs: 'outlet'})\nexport class RouterOutlet implements OnDestroy, OnInit, RouterOutletContract {\n private activated: ComponentRef|null = null;\n private _activatedRoute: ActivatedRoute|null = null;\n private name: string;\n\n @Output('activate') activateEvents = new EventEmitter();\n @Output('deactivate') deactivateEvents = new EventEmitter();\n\n constructor(\n private parentContexts: ChildrenOutletContexts, private location: ViewContainerRef,\n private resolver: ComponentFactoryResolver, @Attribute('name') name: string,\n private changeDetector: ChangeDetectorRef) {\n this.name = name || PRIMARY_OUTLET;\n parentContexts.onChildOutletCreated(this.name, this);\n }\n\n /** @nodoc */\n ngOnDestroy(): void {\n this.parentContexts.onChildOutletDestroyed(this.name);\n }\n\n /** @nodoc */\n ngOnInit(): void {\n if (!this.activated) {\n // If the outlet was not instantiated at the time the route got activated we need to populate\n // the outlet when it is initialized (ie inside a NgIf)\n const context = this.parentContexts.getContext(this.name);\n if (context && context.route) {\n if (context.attachRef) {\n // `attachRef` is populated when there is an existing component to mount\n this.attach(context.attachRef, context.route);\n } else {\n // otherwise the component defined in the configuration is created\n this.activateWith(context.route, context.resolver || null);\n }\n }\n }\n }\n\n get isActivated(): boolean {\n return !!this.activated;\n }\n\n /**\n * @returns The currently activated component instance.\n * @throws An error if the outlet is not activated.\n */\n get component(): Object {\n if (!this.activated) throw new Error('Outlet is not activated');\n return this.activated.instance;\n }\n\n get activatedRoute(): ActivatedRoute {\n if (!this.activated) throw new Error('Outlet is not activated');\n return this._activatedRoute as ActivatedRoute;\n }\n\n get activatedRouteData(): Data {\n if (this._activatedRoute) {\n return this._activatedRoute.snapshot.data;\n }\n return {};\n }\n\n /**\n * Called when the `RouteReuseStrategy` instructs to detach the subtree\n */\n detach(): ComponentRef {\n if (!this.activated) throw new Error('Outlet is not activated');\n this.location.detach();\n const cmp = this.activated;\n this.activated = null;\n this._activatedRoute = null;\n return cmp;\n }\n\n /**\n * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree\n */\n attach(ref: ComponentRef, activatedRoute: ActivatedRoute) {\n this.activated = ref;\n this._activatedRoute = activatedRoute;\n this.location.insert(ref.hostView);\n }\n\n deactivate(): void {\n if (this.activated) {\n const c = this.component;\n this.activated.destroy();\n this.activated = null;\n this._activatedRoute = null;\n this.deactivateEvents.emit(c);\n }\n }\n\n activateWith(activatedRoute: ActivatedRoute, resolver: ComponentFactoryResolver|null) {\n if (this.isActivated) {\n throw new Error('Cannot activate an already activated outlet');\n }\n this._activatedRoute = activatedRoute;\n const snapshot = activatedRoute._futureSnapshot;\n const component = snapshot.routeConfig!.component;\n resolver = resolver || this.resolver;\n const factory = resolver.resolveComponentFactory(component);\n const childContexts = this.parentContexts.getOrCreateContext(this.name).children;\n const injector = new OutletInjector(activatedRoute, childContexts, this.location.injector);\n this.activated = this.location.createComponent(factory, this.location.length, injector);\n // Calling `markForCheck` to make sure we will run the change detection when the\n // `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.\n this.changeDetector.markForCheck();\n this.activateEvents.emit(this.activated.instance);\n }\n}\n\nclass OutletInjector implements Injector {\n constructor(\n private route: ActivatedRoute, private childContexts: ChildrenOutletContexts,\n private parent: Injector) {}\n\n get(token: any, notFoundValue?: any): any {\n if (token === ActivatedRoute) {\n return this.route;\n }\n\n if (token === ChildrenOutletContexts) {\n return this.childContexts;\n }\n\n return this.parent.get(token, notFoundValue);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Compiler, Injectable, Injector, NgModuleFactoryLoader, NgModuleRef, OnDestroy} from '@angular/core';\nimport {from, Observable, of, Subscription} from 'rxjs';\nimport {catchError, concatMap, filter, map, mergeAll, mergeMap} from 'rxjs/operators';\n\nimport {LoadedRouterConfig, Route, Routes} from './config';\nimport {Event, NavigationEnd, RouteConfigLoadEnd, RouteConfigLoadStart} from './events';\nimport {Router} from './router';\nimport {RouterConfigLoader} from './router_config_loader';\n\n\n/**\n * @description\n *\n * Provides a preloading strategy.\n *\n * @publicApi\n */\nexport abstract class PreloadingStrategy {\n abstract preload(route: Route, fn: () => Observable): Observable;\n}\n\n/**\n * @description\n *\n * Provides a preloading strategy that preloads all modules as quickly as possible.\n *\n * ```\n * RouterModule.forRoot(ROUTES, {preloadingStrategy: PreloadAllModules})\n * ```\n *\n * @publicApi\n */\nexport class PreloadAllModules implements PreloadingStrategy {\n preload(route: Route, fn: () => Observable): Observable {\n return fn().pipe(catchError(() => of(null)));\n }\n}\n\n/**\n * @description\n *\n * Provides a preloading strategy that does not preload any modules.\n *\n * This strategy is enabled by default.\n *\n * @publicApi\n */\nexport class NoPreloading implements PreloadingStrategy {\n preload(route: Route, fn: () => Observable): Observable {\n return of(null);\n }\n}\n\n/**\n * The preloader optimistically loads all router configurations to\n * make navigations into lazily-loaded sections of the application faster.\n *\n * The preloader runs in the background. When the router bootstraps, the preloader\n * starts listening to all navigation events. After every such event, the preloader\n * will check if any configurations can be loaded lazily.\n *\n * If a route is protected by `canLoad` guards, the preloaded will not load it.\n *\n * @publicApi\n */\n@Injectable()\nexport class RouterPreloader implements OnDestroy {\n private loader: RouterConfigLoader;\n private subscription?: Subscription;\n\n constructor(\n private router: Router, moduleLoader: NgModuleFactoryLoader, compiler: Compiler,\n private injector: Injector, private preloadingStrategy: PreloadingStrategy) {\n const onStartLoad = (r: Route) => router.triggerEvent(new RouteConfigLoadStart(r));\n const onEndLoad = (r: Route) => router.triggerEvent(new RouteConfigLoadEnd(r));\n\n this.loader = new RouterConfigLoader(moduleLoader, compiler, onStartLoad, onEndLoad);\n }\n\n setUpPreloading(): void {\n this.subscription =\n this.router.events\n .pipe(filter((e: Event) => e instanceof NavigationEnd), concatMap(() => this.preload()))\n .subscribe(() => {});\n }\n\n preload(): Observable {\n const ngModule = this.injector.get(NgModuleRef);\n return this.processRoutes(ngModule, this.router.config);\n }\n\n /** @nodoc */\n ngOnDestroy(): void {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n\n private processRoutes(ngModule: NgModuleRef, routes: Routes): Observable {\n const res: Observable[] = [];\n for (const route of routes) {\n // we already have the config loaded, just recurse\n if (route.loadChildren && !route.canLoad && route._loadedConfig) {\n const childConfig = route._loadedConfig;\n res.push(this.processRoutes(childConfig.module, childConfig.routes));\n\n // no config loaded, fetch the config\n } else if (route.loadChildren && !route.canLoad) {\n res.push(this.preloadConfig(ngModule, route));\n\n // recurse into children\n } else if (route.children) {\n res.push(this.processRoutes(ngModule, route.children));\n }\n }\n return from(res).pipe(mergeAll(), map((_) => void 0));\n }\n\n private preloadConfig(ngModule: NgModuleRef, route: Route): Observable {\n return this.preloadingStrategy.preload(route, () => {\n const loaded$ = route._loadedConfig ? of(route._loadedConfig) :\n this.loader.load(ngModule.injector, route);\n return loaded$.pipe(mergeMap((config: LoadedRouterConfig) => {\n route._loadedConfig = config;\n return this.processRoutes(config.module, config.routes);\n }));\n });\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ViewportScroller} from '@angular/common';\nimport {Injectable, OnDestroy} from '@angular/core';\nimport {Unsubscribable} from 'rxjs';\n\nimport {NavigationEnd, NavigationStart, Scroll} from './events';\nimport {Router} from './router';\n\n@Injectable()\nexport class RouterScroller implements OnDestroy {\n // TODO(issue/24571): remove '!'.\n private routerEventsSubscription!: Unsubscribable;\n // TODO(issue/24571): remove '!'.\n private scrollEventsSubscription!: Unsubscribable;\n\n private lastId = 0;\n private lastSource: 'imperative'|'popstate'|'hashchange'|undefined = 'imperative';\n private restoredId = 0;\n private store: {[key: string]: [number, number]} = {};\n\n constructor(\n private router: Router,\n /** @docsNotRequired */ public readonly viewportScroller: ViewportScroller, private options: {\n scrollPositionRestoration?: 'disabled'|'enabled'|'top',\n anchorScrolling?: 'disabled'|'enabled'\n } = {}) {\n // Default both options to 'disabled'\n options.scrollPositionRestoration = options.scrollPositionRestoration || 'disabled';\n options.anchorScrolling = options.anchorScrolling || 'disabled';\n }\n\n init(): void {\n // we want to disable the automatic scrolling because having two places\n // responsible for scrolling results race conditions, especially given\n // that browser don't implement this behavior consistently\n if (this.options.scrollPositionRestoration !== 'disabled') {\n this.viewportScroller.setHistoryScrollRestoration('manual');\n }\n this.routerEventsSubscription = this.createScrollEvents();\n this.scrollEventsSubscription = this.consumeScrollEvents();\n }\n\n private createScrollEvents() {\n return this.router.events.subscribe(e => {\n if (e instanceof NavigationStart) {\n // store the scroll position of the current stable navigations.\n this.store[this.lastId] = this.viewportScroller.getScrollPosition();\n this.lastSource = e.navigationTrigger;\n this.restoredId = e.restoredState ? e.restoredState.navigationId : 0;\n } else if (e instanceof NavigationEnd) {\n this.lastId = e.id;\n this.scheduleScrollEvent(e, this.router.parseUrl(e.urlAfterRedirects).fragment);\n }\n });\n }\n\n private consumeScrollEvents() {\n return this.router.events.subscribe(e => {\n if (!(e instanceof Scroll)) return;\n // a popstate event. The pop state event will always ignore anchor scrolling.\n if (e.position) {\n if (this.options.scrollPositionRestoration === 'top') {\n this.viewportScroller.scrollToPosition([0, 0]);\n } else if (this.options.scrollPositionRestoration === 'enabled') {\n this.viewportScroller.scrollToPosition(e.position);\n }\n // imperative navigation \"forward\"\n } else {\n if (e.anchor && this.options.anchorScrolling === 'enabled') {\n this.viewportScroller.scrollToAnchor(e.anchor);\n } else if (this.options.scrollPositionRestoration !== 'disabled') {\n this.viewportScroller.scrollToPosition([0, 0]);\n }\n }\n });\n }\n\n private scheduleScrollEvent(routerEvent: NavigationEnd, anchor: string|null): void {\n this.router.triggerEvent(new Scroll(\n routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor));\n }\n\n /** @nodoc */\n ngOnDestroy() {\n if (this.routerEventsSubscription) {\n this.routerEventsSubscription.unsubscribe();\n }\n if (this.scrollEventsSubscription) {\n this.scrollEventsSubscription.unsubscribe();\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {APP_BASE_HREF, HashLocationStrategy, Location, LOCATION_INITIALIZED, LocationStrategy, PathLocationStrategy, PlatformLocation, ViewportScroller} from '@angular/common';\nimport {ANALYZE_FOR_ENTRY_COMPONENTS, APP_BOOTSTRAP_LISTENER, APP_INITIALIZER, ApplicationRef, Compiler, ComponentRef, Inject, Injectable, InjectionToken, Injector, ModuleWithProviders, NgModule, NgModuleFactoryLoader, NgProbeToken, OnDestroy, Optional, Provider, SkipSelf, SystemJsNgModuleLoader} from '@angular/core';\nimport {of, Subject} from 'rxjs';\n\nimport {EmptyOutletComponent} from './components/empty_outlet';\nimport {Route, Routes} from './config';\nimport {RouterLink, RouterLinkWithHref} from './directives/router_link';\nimport {RouterLinkActive} from './directives/router_link_active';\nimport {RouterOutlet} from './directives/router_outlet';\nimport {Event} from './events';\nimport {RouteReuseStrategy} from './route_reuse_strategy';\nimport {ErrorHandler, Router} from './router';\nimport {ROUTES} from './router_config_loader';\nimport {ChildrenOutletContexts} from './router_outlet_context';\nimport {NoPreloading, PreloadAllModules, PreloadingStrategy, RouterPreloader} from './router_preloader';\nimport {RouterScroller} from './router_scroller';\nimport {ActivatedRoute} from './router_state';\nimport {UrlHandlingStrategy} from './url_handling_strategy';\nimport {DefaultUrlSerializer, UrlSerializer, UrlTree} from './url_tree';\nimport {flatten} from './utils/collection';\n\n/**\n * The directives defined in the `RouterModule`.\n */\nconst ROUTER_DIRECTIVES =\n [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, EmptyOutletComponent];\n\n/**\n * A [DI token](guide/glossary/#di-token) for the router service.\n *\n * @publicApi\n */\nexport const ROUTER_CONFIGURATION = new InjectionToken('ROUTER_CONFIGURATION');\n\n/**\n * @docsNotRequired\n */\nexport const ROUTER_FORROOT_GUARD = new InjectionToken('ROUTER_FORROOT_GUARD');\n\nexport const ROUTER_PROVIDERS: Provider[] = [\n Location,\n {provide: UrlSerializer, useClass: DefaultUrlSerializer},\n {\n provide: Router,\n useFactory: setupRouter,\n deps: [\n UrlSerializer, ChildrenOutletContexts, Location, Injector, NgModuleFactoryLoader, Compiler,\n ROUTES, ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()],\n [RouteReuseStrategy, new Optional()]\n ]\n },\n ChildrenOutletContexts,\n {provide: ActivatedRoute, useFactory: rootRoute, deps: [Router]},\n {provide: NgModuleFactoryLoader, useClass: SystemJsNgModuleLoader},\n RouterPreloader,\n NoPreloading,\n PreloadAllModules,\n {provide: ROUTER_CONFIGURATION, useValue: {enableTracing: false}},\n];\n\nexport function routerNgProbeToken() {\n return new NgProbeToken('Router', Router);\n}\n\n/**\n * @description\n *\n * Adds directives and providers for in-app navigation among views defined in an application.\n * Use the Angular `Router` service to declaratively specify application states and manage state\n * transitions.\n *\n * You can import this NgModule multiple times, once for each lazy-loaded bundle.\n * However, only one `Router` service can be active.\n * To ensure this, there are two ways to register routes when importing this module:\n *\n * * The `forRoot()` method creates an `NgModule` that contains all the directives, the given\n * routes, and the `Router` service itself.\n * * The `forChild()` method creates an `NgModule` that contains all the directives and the given\n * routes, but does not include the `Router` service.\n *\n * @see [Routing and Navigation guide](guide/router) for an\n * overview of how the `Router` service should be used.\n *\n * @publicApi\n */\n@NgModule({\n declarations: ROUTER_DIRECTIVES,\n exports: ROUTER_DIRECTIVES,\n entryComponents: [EmptyOutletComponent]\n})\nexport class RouterModule {\n // Note: We are injecting the Router so it gets created eagerly...\n constructor(@Optional() @Inject(ROUTER_FORROOT_GUARD) guard: any, @Optional() router: Router) {}\n\n /**\n * Creates and configures a module with all the router providers and directives.\n * Optionally sets up an application listener to perform an initial navigation.\n *\n * When registering the NgModule at the root, import as follows:\n *\n * ```\n * @NgModule({\n * imports: [RouterModule.forRoot(ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * @param routes An array of `Route` objects that define the navigation paths for the application.\n * @param config An `ExtraOptions` configuration object that controls how navigation is performed.\n * @return The new `NgModule`.\n *\n */\n static forRoot(routes: Routes, config?: ExtraOptions): ModuleWithProviders {\n return {\n ngModule: RouterModule,\n providers: [\n ROUTER_PROVIDERS,\n provideRoutes(routes),\n {\n provide: ROUTER_FORROOT_GUARD,\n useFactory: provideForRootGuard,\n deps: [[Router, new Optional(), new SkipSelf()]]\n },\n {provide: ROUTER_CONFIGURATION, useValue: config ? config : {}},\n {\n provide: LocationStrategy,\n useFactory: provideLocationStrategy,\n deps:\n [PlatformLocation, [new Inject(APP_BASE_HREF), new Optional()], ROUTER_CONFIGURATION]\n },\n {\n provide: RouterScroller,\n useFactory: createRouterScroller,\n deps: [Router, ViewportScroller, ROUTER_CONFIGURATION]\n },\n {\n provide: PreloadingStrategy,\n useExisting: config && config.preloadingStrategy ? config.preloadingStrategy :\n NoPreloading\n },\n {provide: NgProbeToken, multi: true, useFactory: routerNgProbeToken},\n provideRouterInitializer(),\n ],\n };\n }\n\n /**\n * Creates a module with all the router directives and a provider registering routes,\n * without creating a new Router service.\n * When registering for submodules and lazy-loaded submodules, create the NgModule as follows:\n *\n * ```\n * @NgModule({\n * imports: [RouterModule.forChild(ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * @param routes An array of `Route` objects that define the navigation paths for the submodule.\n * @return The new NgModule.\n *\n */\n static forChild(routes: Routes): ModuleWithProviders {\n return {ngModule: RouterModule, providers: [provideRoutes(routes)]};\n }\n}\n\nexport function createRouterScroller(\n router: Router, viewportScroller: ViewportScroller, config: ExtraOptions): RouterScroller {\n if (config.scrollOffset) {\n viewportScroller.setOffset(config.scrollOffset);\n }\n return new RouterScroller(router, viewportScroller, config);\n}\n\nexport function provideLocationStrategy(\n platformLocationStrategy: PlatformLocation, baseHref: string, options: ExtraOptions = {}) {\n return options.useHash ? new HashLocationStrategy(platformLocationStrategy, baseHref) :\n new PathLocationStrategy(platformLocationStrategy, baseHref);\n}\n\nexport function provideForRootGuard(router: Router): any {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && router) {\n throw new Error(\n `RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.`);\n }\n return 'guarded';\n}\n\n/**\n * Registers a [DI provider](guide/glossary#provider) for a set of routes.\n * @param routes The route configuration to provide.\n *\n * @usageNotes\n *\n * ```\n * @NgModule({\n * imports: [RouterModule.forChild(ROUTES)],\n * providers: [provideRoutes(EXTRA_ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * @publicApi\n */\nexport function provideRoutes(routes: Routes): any {\n return [\n {provide: ANALYZE_FOR_ENTRY_COMPONENTS, multi: true, useValue: routes},\n {provide: ROUTES, multi: true, useValue: routes},\n ];\n}\n\n/**\n * Allowed values in an `ExtraOptions` object that configure\n * when the router performs the initial navigation operation.\n *\n * * 'enabledNonBlocking' - (default) The initial navigation starts after the\n * root component has been created. The bootstrap is not blocked on the completion of the initial\n * navigation.\n * * 'enabledBlocking' - The initial navigation starts before the root component is created.\n * The bootstrap is blocked until the initial navigation is complete. This value is required\n * for [server-side rendering](guide/universal) to work.\n * * 'disabled' - The initial navigation is not performed. The location listener is set up before\n * the root component gets created. Use if there is a reason to have\n * more control over when the router starts its initial navigation due to some complex\n * initialization logic.\n *\n * The following values have been [deprecated](guide/releases#deprecation-practices) since v11,\n * and should not be used for new applications.\n *\n * * 'enabled' - This option is 1:1 replaceable with `enabledBlocking`.\n *\n * @see `forRoot()`\n *\n * @publicApi\n */\nexport type InitialNavigation = 'disabled'|'enabled'|'enabledBlocking'|'enabledNonBlocking';\n\n/**\n * A set of configuration options for a router module, provided in the\n * `forRoot()` method.\n *\n * @see `forRoot()`\n *\n *\n * @publicApi\n */\nexport interface ExtraOptions {\n /**\n * When true, log all internal navigation events to the console.\n * Use for debugging.\n */\n enableTracing?: boolean;\n\n /**\n * When true, enable the location strategy that uses the URL fragment\n * instead of the history API.\n */\n useHash?: boolean;\n\n /**\n * One of `enabled`, `enabledBlocking`, `enabledNonBlocking` or `disabled`.\n * When set to `enabled` or `enabledBlocking`, the initial navigation starts before the root\n * component is created. The bootstrap is blocked until the initial navigation is complete. This\n * value is required for [server-side rendering](guide/universal) to work. When set to\n * `enabledNonBlocking`, the initial navigation starts after the root component has been created.\n * The bootstrap is not blocked on the completion of the initial navigation. When set to\n * `disabled`, the initial navigation is not performed. The location listener is set up before the\n * root component gets created. Use if there is a reason to have more control over when the router\n * starts its initial navigation due to some complex initialization logic.\n */\n initialNavigation?: InitialNavigation;\n\n /**\n * A custom error handler for failed navigations.\n * If the handler returns a value, the navigation Promise is resolved with this value.\n * If the handler throws an exception, the navigation Promise is rejected with the exception.\n *\n */\n errorHandler?: ErrorHandler;\n\n /**\n * Configures a preloading strategy.\n * One of `PreloadAllModules` or `NoPreloading` (the default).\n */\n preloadingStrategy?: any;\n\n /**\n * Define what the router should do if it receives a navigation request to the current URL.\n * Default is `ignore`, which causes the router ignores the navigation.\n * This can disable features such as a \"refresh\" button.\n * Use this option to configure the behavior when navigating to the\n * current URL. Default is 'ignore'.\n */\n onSameUrlNavigation?: 'reload'|'ignore';\n\n /**\n * Configures if the scroll position needs to be restored when navigating back.\n *\n * * 'disabled'- (Default) Does nothing. Scroll position is maintained on navigation.\n * * 'top'- Sets the scroll position to x = 0, y = 0 on all navigation.\n * * 'enabled'- Restores the previous scroll position on backward navigation, else sets the\n * position to the anchor if one is provided, or sets the scroll position to [0, 0] (forward\n * navigation). This option will be the default in the future.\n *\n * You can implement custom scroll restoration behavior by adapting the enabled behavior as\n * in the following example.\n *\n * ```typescript\n * class AppModule {\n * constructor(router: Router, viewportScroller: ViewportScroller) {\n * router.events.pipe(\n * filter((e: Event): e is Scroll => e instanceof Scroll)\n * ).subscribe(e => {\n * if (e.position) {\n * // backward navigation\n * viewportScroller.scrollToPosition(e.position);\n * } else if (e.anchor) {\n * // anchor navigation\n * viewportScroller.scrollToAnchor(e.anchor);\n * } else {\n * // forward navigation\n * viewportScroller.scrollToPosition([0, 0]);\n * }\n * });\n * }\n * }\n * ```\n */\n scrollPositionRestoration?: 'disabled'|'enabled'|'top';\n\n /**\n * When set to 'enabled', scrolls to the anchor element when the URL has a fragment.\n * Anchor scrolling is disabled by default.\n *\n * Anchor scrolling does not happen on 'popstate'. Instead, we restore the position\n * that we stored or scroll to the top.\n */\n anchorScrolling?: 'disabled'|'enabled';\n\n /**\n * Configures the scroll offset the router will use when scrolling to an element.\n *\n * When given a tuple with x and y position value,\n * the router uses that offset each time it scrolls.\n * When given a function, the router invokes the function every time\n * it restores scroll position.\n */\n scrollOffset?: [number, number]|(() => [number, number]);\n\n /**\n * Defines how the router merges parameters, data, and resolved data from parent to child\n * routes. By default ('emptyOnly'), inherits parent parameters only for\n * path-less or component-less routes.\n *\n * Set to 'always' to enable unconditional inheritance of parent parameters.\n *\n * Note that when dealing with matrix parameters, \"parent\" refers to the parent `Route`\n * config which does not necessarily mean the \"URL segment to the left\". When the `Route` `path`\n * contains multiple segments, the matrix parameters must appear on the last segment. For example,\n * matrix parameters for `{path: 'a/b', component: MyComp}` should appear as `a/b;foo=bar` and not\n * `a;foo=bar/b`.\n *\n */\n paramsInheritanceStrategy?: 'emptyOnly'|'always';\n\n /**\n * A custom handler for malformed URI errors. The handler is invoked when `encodedURI` contains\n * invalid character sequences.\n * The default implementation is to redirect to the root URL, dropping\n * any path or parameter information. The function takes three parameters:\n *\n * - `'URIError'` - Error thrown when parsing a bad URL.\n * - `'UrlSerializer'` - UrlSerializer that’s configured with the router.\n * - `'url'` - The malformed URL that caused the URIError\n * */\n malformedUriErrorHandler?:\n (error: URIError, urlSerializer: UrlSerializer, url: string) => UrlTree;\n\n /**\n * Defines when the router updates the browser URL. By default ('deferred'),\n * update after successful navigation.\n * Set to 'eager' if prefer to update the URL at the beginning of navigation.\n * Updating the URL early allows you to handle a failure of navigation by\n * showing an error message with the URL that failed.\n */\n urlUpdateStrategy?: 'deferred'|'eager';\n\n /**\n * Enables a bug fix that corrects relative link resolution in components with empty paths.\n * Example:\n *\n * ```\n * const routes = [\n * {\n * path: '',\n * component: ContainerComponent,\n * children: [\n * { path: 'a', component: AComponent },\n * { path: 'b', component: BComponent },\n * ]\n * }\n * ];\n * ```\n *\n * From the `ContainerComponent`, you should be able to navigate to `AComponent` using\n * the following `routerLink`, but it will not work if `relativeLinkResolution` is set\n * to `'legacy'`:\n *\n * `Link to A`\n *\n * However, this will work:\n *\n * `Link to A`\n *\n * In other words, you're required to use `../` rather than `./` when the relative link\n * resolution is set to `'legacy'`.\n *\n * The default in v11 is `corrected`.\n */\n relativeLinkResolution?: 'legacy'|'corrected';\n}\n\nexport function setupRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler, config: Route[][],\n opts: ExtraOptions = {}, urlHandlingStrategy?: UrlHandlingStrategy,\n routeReuseStrategy?: RouteReuseStrategy) {\n const router = new Router(\n null, urlSerializer, contexts, location, injector, loader, compiler, flatten(config));\n\n if (urlHandlingStrategy) {\n router.urlHandlingStrategy = urlHandlingStrategy;\n }\n\n if (routeReuseStrategy) {\n router.routeReuseStrategy = routeReuseStrategy;\n }\n\n assignExtraOptionsToRouter(opts, router);\n\n if (opts.enableTracing) {\n router.events.subscribe((e: Event) => {\n // tslint:disable:no-console\n console.group?.(`Router Event: ${(e.constructor).name}`);\n console.log(e.toString());\n console.log(e);\n console.groupEnd?.();\n // tslint:enable:no-console\n });\n }\n\n return router;\n}\n\nexport function assignExtraOptionsToRouter(opts: ExtraOptions, router: Router): void {\n if (opts.errorHandler) {\n router.errorHandler = opts.errorHandler;\n }\n\n if (opts.malformedUriErrorHandler) {\n router.malformedUriErrorHandler = opts.malformedUriErrorHandler;\n }\n\n if (opts.onSameUrlNavigation) {\n router.onSameUrlNavigation = opts.onSameUrlNavigation;\n }\n\n if (opts.paramsInheritanceStrategy) {\n router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;\n }\n\n if (opts.relativeLinkResolution) {\n router.relativeLinkResolution = opts.relativeLinkResolution;\n }\n\n if (opts.urlUpdateStrategy) {\n router.urlUpdateStrategy = opts.urlUpdateStrategy;\n }\n}\n\nexport function rootRoute(router: Router): ActivatedRoute {\n return router.routerState.root;\n}\n\n/**\n * Router initialization requires two steps:\n *\n * First, we start the navigation in a `APP_INITIALIZER` to block the bootstrap if\n * a resolver or a guard executes asynchronously.\n *\n * Next, we actually run activation in a `BOOTSTRAP_LISTENER`, using the\n * `afterPreactivation` hook provided by the router.\n * The router navigation starts, reaches the point when preactivation is done, and then\n * pauses. It waits for the hook to be resolved. We then resolve it only in a bootstrap listener.\n */\n@Injectable()\nexport class RouterInitializer implements OnDestroy {\n private initNavigation = false;\n private destroyed = false;\n private resultOfPreactivationDone = new Subject();\n\n constructor(private injector: Injector) {}\n\n appInitializer(): Promise {\n const p: Promise = this.injector.get(LOCATION_INITIALIZED, Promise.resolve(null));\n return p.then(() => {\n // If the injector was destroyed, the DI lookups below will fail.\n if (this.destroyed) {\n return Promise.resolve(true);\n }\n\n let resolve: Function = null!;\n const res = new Promise(r => resolve = r);\n const router = this.injector.get(Router);\n const opts = this.injector.get(ROUTER_CONFIGURATION);\n\n if (opts.initialNavigation === 'disabled') {\n router.setUpLocationChangeListener();\n resolve(true);\n } else if (\n // TODO: enabled is deprecated as of v11, can be removed in v13\n opts.initialNavigation === 'enabled' || opts.initialNavigation === 'enabledBlocking') {\n router.hooks.afterPreactivation = () => {\n // only the initial navigation should be delayed\n if (!this.initNavigation) {\n this.initNavigation = true;\n resolve(true);\n return this.resultOfPreactivationDone;\n\n // subsequent navigations should not be delayed\n } else {\n return of(null) as any;\n }\n };\n router.initialNavigation();\n } else {\n resolve(true);\n }\n\n return res;\n });\n }\n\n bootstrapListener(bootstrappedComponentRef: ComponentRef): void {\n const opts = this.injector.get(ROUTER_CONFIGURATION);\n const preloader = this.injector.get(RouterPreloader);\n const routerScroller = this.injector.get(RouterScroller);\n const router = this.injector.get(Router);\n const ref = this.injector.get(ApplicationRef);\n\n if (bootstrappedComponentRef !== ref.components[0]) {\n return;\n }\n\n // Default case\n if (opts.initialNavigation === 'enabledNonBlocking' || opts.initialNavigation === undefined) {\n router.initialNavigation();\n }\n\n preloader.setUpPreloading();\n routerScroller.init();\n router.resetRootComponentType(ref.componentTypes[0]);\n this.resultOfPreactivationDone.next(null!);\n this.resultOfPreactivationDone.complete();\n }\n\n ngOnDestroy() {\n this.destroyed = true;\n }\n}\n\nexport function getAppInitializer(r: RouterInitializer) {\n return r.appInitializer.bind(r);\n}\n\nexport function getBootstrapListener(r: RouterInitializer) {\n return r.bootstrapListener.bind(r);\n}\n\n/**\n * A [DI token](guide/glossary/#di-token) for the router initializer that\n * is called after the app is bootstrapped.\n *\n * @publicApi\n */\nexport const ROUTER_INITIALIZER =\n new InjectionToken<(compRef: ComponentRef) => void>('Router Initializer');\n\nexport function provideRouterInitializer(): ReadonlyArray {\n return [\n RouterInitializer,\n {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: getAppInitializer,\n deps: [RouterInitializer]\n },\n {provide: ROUTER_INITIALIZER, useFactory: getBootstrapListener, deps: [RouterInitializer]},\n {provide: APP_BOOTSTRAP_LISTENER, multi: true, useExisting: ROUTER_INITIALIZER},\n ];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the router package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('12.2.13');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nexport {ɵEmptyOutletComponent} from './components/empty_outlet';\nexport {assignExtraOptionsToRouter as ɵassignExtraOptionsToRouter, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS} from './router_module';\nexport {flatten as ɵflatten} from './utils/collection';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nexport {Data, DeprecatedLoadChildren, LoadChildren, LoadChildrenCallback, QueryParamsHandling, ResolveData, Route, Routes, RunGuardsAndResolvers, UrlMatcher, UrlMatchResult} from './config';\nexport {RouterLink, RouterLinkWithHref} from './directives/router_link';\nexport {RouterLinkActive} from './directives/router_link_active';\nexport {RouterOutlet, RouterOutletContract} from './directives/router_outlet';\nexport {ActivationEnd, ActivationStart, ChildActivationEnd, ChildActivationStart, Event, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouterEvent, RoutesRecognized, Scroll} from './events';\nexport {CanActivate, CanActivateChild, CanDeactivate, CanLoad, Resolve} from './interfaces';\nexport {BaseRouteReuseStrategy, DetachedRouteHandle, RouteReuseStrategy} from './route_reuse_strategy';\nexport {Navigation, NavigationBehaviorOptions, NavigationExtras, Router, UrlCreationOptions} from './router';\nexport {ROUTES} from './router_config_loader';\nexport {ExtraOptions, InitialNavigation, provideRoutes, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, RouterModule} from './router_module';\nexport {ChildrenOutletContexts, OutletContext} from './router_outlet_context';\nexport {NoPreloading, PreloadAllModules, PreloadingStrategy, RouterPreloader} from './router_preloader';\nexport {ActivatedRoute, ActivatedRouteSnapshot, RouterState, RouterStateSnapshot} from './router_state';\nexport {convertToParamMap, ParamMap, Params, PRIMARY_OUTLET} from './shared';\nexport {UrlHandlingStrategy} from './url_handling_strategy';\nexport {DefaultUrlSerializer, IsActiveMatchOptions, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree} from './url_tree';\nexport {VERSION} from './version';\n\nexport * from './private_export';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/index';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {EmptyOutletComponent as ɵangular_packages_router_router_l} from './src/components/empty_outlet';\nexport {ROUTER_FORROOT_GUARD as ɵangular_packages_router_router_a,RouterInitializer as ɵangular_packages_router_router_h,createRouterScroller as ɵangular_packages_router_router_c,getAppInitializer as ɵangular_packages_router_router_i,getBootstrapListener as ɵangular_packages_router_router_j,provideForRootGuard as ɵangular_packages_router_router_e,provideLocationStrategy as ɵangular_packages_router_router_d,provideRouterInitializer as ɵangular_packages_router_router_k,rootRoute as ɵangular_packages_router_router_g,routerNgProbeToken as ɵangular_packages_router_router_b,setupRouter as ɵangular_packages_router_router_f} from './src/router_module';\nexport {RouterScroller as ɵangular_packages_router_router_o} from './src/router_scroller';\nexport {Tree as ɵangular_packages_router_router_m,TreeNode as ɵangular_packages_router_router_n} from './src/utils/tree';"],"names":["isObservable","isPromise","EmptyOutletComponent","noMatch","last","applyRedirects","applyRedirectsFn","NoMatch","recognize","recognizeFn","Console"],"mappings":";;;;;;;;;;;AAAA;;;;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;MAwBa,WAAW;IACtB;;IAEW,EAAU;;IAEV,GAAW;QAFX,OAAE,GAAF,EAAE,CAAQ;QAEV,QAAG,GAAH,GAAG,CAAQ;KAAI;CAC3B;AAED;;;;;MAKa,eAAgB,SAAQ,WAAW;IA8B9C;;IAEI,EAAU;;IAEV,GAAW;;IAEX,oBAA0D,YAAY;;IAEtE,gBAA+D,IAAI;QACrE,KAAK,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;KACpC;;IAGQ,QAAQ;QACf,OAAO,uBAAuB,IAAI,CAAC,EAAE,WAAW,IAAI,CAAC,GAAG,IAAI,CAAC;KAC9D;CACF;AAED;;;;;;;;;MASa,aAAc,SAAQ,WAAW;IAC5C;;IAEI,EAAU;;IAEV,GAAW;;IAEJ,iBAAyB;QAClC,KAAK,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QADN,sBAAiB,GAAjB,iBAAiB,CAAQ;KAEnC;;IAGQ,QAAQ;QACf,OAAO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