blob: 59fff0b92297c3b43f417beb03b88aa77d87e341 [file] [log] [blame]
{"version":3,"file":"router.js","sources":["../../../../../../packages/router/src/events.ts","../../../../../../packages/router/src/components/empty_outlet.ts","../../../../../../packages/router/src/shared.ts","../../../../../../packages/router/src/config.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/utils/type_guards.ts","../../../../../../packages/router/src/apply_redirects.ts","../../../../../../packages/router/src/operators/apply_redirects.ts","../../../../../../packages/router/src/utils/preactivation.ts","../../../../../../packages/router/src/operators/prioritized_guard_value.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/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/router_outlet_context.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 Inc. 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 * @description\n *\n * Identifies the trigger of the 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 * @description\n *\n * Base for events the Router goes through, as opposed to events tied to a specific\n * Route. `RouterEvent`s will only be fired one time for any given navigation.\n *\n * Example:\n *\n * ```\n * class MyService {\n * constructor(public router: Router, logger: Logger) {\n * router.events.pipe(\n * filter(e => e instanceof RouterEvent)\n * ).subscribe(e => {\n * logger.log(e.id, e.url);\n * });\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport class RouterEvent {\n constructor(\n /** @docsNotRequired */\n public id: number,\n /** @docsNotRequired */\n public url: string) {}\n}\n\n/**\n * @description\n *\n * Represents an event triggered when a navigation starts.\n *\n * @publicApi\n */\nexport class NavigationStart extends RouterEvent {\n /**\n * Identifies the trigger of the 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 navigationTrigger?: 'imperative'|'popstate'|'hashchange';\n\n /**\n * This reflects the state object that was previously supplied to the pushState call. This is\n * not null only when the navigation is triggered by a popstate event.\n *\n * The router assigns a navigationId to every router transition/navigation. Even when the user\n * clicks on the back button in the browser, a new navigation id will be created. So from\n * the perspective of the router, the router never \"goes back\". By using the `restoredState`\n * and its navigationId, you can implement behavior that differentiates between creating new\n * states\n * and popstate events. In the latter case you can restore some remembered state (e.g., scroll\n * position).\n *\n * See {@link NavigationExtras} for more information.\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 toString(): string { return `NavigationStart(id: ${this.id}, url: '${this.url}')`; }\n}\n\n/**\n * @description\n *\n * Represents an event triggered when a navigation ends successfully.\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 toString(): string {\n return `NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`;\n }\n}\n\n/**\n * @description\n *\n * Represents an event triggered when a navigation is canceled.\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 toString(): string { return `NavigationCancel(id: ${this.id}, url: '${this.url}')`; }\n}\n\n/**\n * @description\n *\n * Represents an event triggered when a navigation fails due to an unexpected error.\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 toString(): string {\n return `NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`;\n }\n}\n\n/**\n * @description\n *\n * Represents 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 toString(): string {\n return `RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;\n }\n}\n\n/**\n * @description\n *\n * Represents the start of the Guard phase of routing.\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 toString(): string {\n return `GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;\n }\n}\n\n/**\n * @description\n *\n * Represents the end of the Guard phase of routing.\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 toString(): string {\n return `GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`;\n }\n}\n\n/**\n * @description\n *\n * Represents the start of the Resolve phase of routing. The timing of this\n * event may change, thus it's experimental. In the current iteration it will run\n * in the \"resolve\" phase whether there's things to resolve or not. In the future this\n * behavior may change to only run when there are things to be resolved.\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 toString(): string {\n return `ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;\n }\n}\n\n/**\n * @description\n *\n * Represents the end of the Resolve phase of routing. See note on\n * `ResolveStart` for use of this experimental API.\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 toString(): string {\n return `ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;\n }\n}\n\n/**\n * @description\n *\n * Represents an event triggered before lazy loading a route config.\n *\n * @publicApi\n */\nexport class RouteConfigLoadStart {\n constructor(\n /** @docsNotRequired */\n public route: Route) {}\n toString(): string { return `RouteConfigLoadStart(path: ${this.route.path})`; }\n}\n\n/**\n * @description\n *\n * Represents an event triggered when a route has been lazy loaded.\n *\n * @publicApi\n */\nexport class RouteConfigLoadEnd {\n constructor(\n /** @docsNotRequired */\n public route: Route) {}\n toString(): string { return `RouteConfigLoadEnd(path: ${this.route.path})`; }\n}\n\n/**\n * @description\n *\n * Represents the start of end of the Resolve phase of routing. See note on\n * `ChildActivationEnd` for use of this experimental API.\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 * @description\n *\n * Represents the start of end of the Resolve phase of routing. See note on\n * `ChildActivationStart` for use of this experimental API.\n *\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 * @description\n *\n * Represents the start of end of the Resolve phase of routing. See note on\n * `ActivationEnd` for use of this experimental API.\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 * @description\n *\n * Represents the start of end of the Resolve phase of routing. See note on\n * `ActivationStart` for use of this experimental API.\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 * @description\n *\n * Represents a scrolling event.\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 * @description\n *\n * Represents a router event, allowing you to track the lifecycle of the router.\n *\n * The sequence of router events is:\n *\n * - `NavigationStart`,\n * - `RouteConfigLoadStart`,\n * - `RouteConfigLoadEnd`,\n * - `RoutesRecognized`,\n * - `GuardsCheckStart`,\n * - `ChildActivationStart`,\n * - `ActivationStart`,\n * - `GuardsCheckEnd`,\n * - `ResolveStart`,\n * - `ResolveEnd`,\n * - `ActivationEnd`\n * - `ChildActivationEnd`\n * - `NavigationEnd`,\n * - `NavigationCancel`,\n * - `NavigationError`\n * - `Scroll`\n *\n * @publicApi\n */\nexport type Event = RouterEvent | RouteConfigLoadStart | RouteConfigLoadEnd | ChildActivationStart |\n ChildActivationEnd | ActivationStart | ActivationEnd | Scroll;\n","/**\n * @license\n * Copyright Google Inc. 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: `<router-outlet></router-outlet>`})\nexport class ɵEmptyOutletComponent {\n}\n\nexport {ɵEmptyOutletComponent as EmptyOutletComponent};\n","/**\n * @license\n * Copyright Google Inc. 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 * @description\n *\n * Name of the primary outlet.\n *\n * @publicApi\n */\nexport const PRIMARY_OUTLET = 'primary';\n\n/**\n * A collection of parameters.\n *\n * @publicApi\n */\nexport type Params = {\n [key: string]: any\n};\n\n/**\n * Matrix and Query parameters.\n *\n * `ParamMap` makes it easier to work with parameters as they could have either a single value or\n * multiple value. Because this should be known by the user, calling `get` or `getAll` returns the\n * correct type (either `string` or `string[]`).\n *\n * The API is inspired by the URLSearchParams interface.\n * see https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams\n *\n * @publicApi\n */\nexport interface ParamMap {\n has(name: string): boolean;\n /**\n * Return a single value for the given parameter name:\n * - the value when the parameter has a single value,\n * - the first value if the parameter has multiple values,\n * - `null` when there is no such parameter.\n */\n get(name: string): string|null;\n /**\n * Return an array of values for the given parameter name.\n *\n * If there is no such parameter, an empty array is returned.\n */\n getAll(name: string): string[];\n\n /** Name of the parameters */\n readonly keys: string[];\n}\n\nclass ParamsAsMap implements ParamMap {\n private params: Params;\n\n constructor(params: Params) { this.params = params || {}; }\n\n has(name: string): boolean { return this.params.hasOwnProperty(name); }\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[] { return Object.keys(this.params); }\n}\n\n/**\n * Convert a `Params` instance to a `ParamMap`.\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 Inc. 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 {EmptyOutletComponent} from './components/empty_outlet';\nimport {ActivatedRouteSnapshot} from './router_state';\nimport {PRIMARY_OUTLET} from './shared';\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 * @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[]; 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.\n *\n * @param segments An array of URL segments.\n * @param group A segment group.\n * @param route The route to match against.\n * @returns The match-result,\n *\n * @usageNotes\n *\n * The following matcher 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;\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 * \n * Often this function will be implemented using an ES dynamic `import()` expression. For example:\n * \n * ```\n * [{\n * path: 'lazy',\n * loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),\n * }];\n * ```\n * \n * This function _must_ match the form above: an arrow function of the form\n * `() => import('...').then(mod => mod.MODULE)`.\n *\n * @see `Route#loadChildren`.\n * @publicApi\n */\nexport type LoadChildrenCallback = () => Type<any>| NgModuleFactory<any>| Observable<Type<any>>|\n Promise<NgModuleFactory<any>|Type<any>|any>;\n\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 * or a function that returns such a set.\n *\n * The string form of `LoadChildren` is deprecated (see `DeprecatedLoadChildren`). The function\n * form (`LoadChildrenCallback`) should be used instead.\n *\n * @see `Route#loadChildren`.\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 `Route#loadChildren`\n * @publicApi\n * @deprecated the `string` form of `loadChildren` is deprecated in favor of the proposed ES dynamic\n * `import()` expression, which 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 `RouterLink#queryParamsHandling`.\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`\n * @publicApi\n */\nexport type RunGuardsAndResolvers = 'pathParamsChange' | 'pathParamsOrQueryParamsChange' |\n 'paramsChange' | 'paramsOrQueryParamsChange' | 'always' |\n ((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' `patchMatch` 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, 'ChildCmp' and 'AuxCmp' 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 instead of the `children` property.\n *\n * Given the following example route, the router uses the registered\n * `NgModuleFactoryLoader` to fetch an NgModule associated with 'team'.\n * It then extracts the set of routes defined in that NgModule,\n * and transparently adds those routes to the main configuration.\n *\n * ```\n * [{\n * path: 'team/:id',\n * component: Team,\n * loadChildren: 'team'\n * }]\n * ```\n *\n * @publicApi\n */\nexport interface Route {\n /**\n * The path to match against, 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 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 match. For example,\n * '/team/11/user' matches 'team/:id'.\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 URL-matching function to use as a custom strategy for path matching.\n * If present, supersedes `path` and `pathMatch`.\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<any>;\n /**\n * A URL to which to redirect when a the path matches.\n * Absolute if the URL begins with a slash (/), otherwise relative to the path URL.\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 * A `LoadChildren` 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\nexport class LoadedRouterConfig {\n constructor(public routes: Route[], public module: NgModuleRef<any>) {}\n}\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 (!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(\n `Invalid configuration of route '${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(\n `Invalid configuration of route '${fullPath}': redirectTo and children cannot be used together`);\n }\n if (route.redirectTo && route.loadChildren) {\n throw new Error(\n `Invalid configuration of route '${fullPath}': redirectTo and loadChildren cannot be used together`);\n }\n if (route.children && route.loadChildren) {\n throw new Error(\n `Invalid configuration of route '${fullPath}': children and loadChildren cannot be used together`);\n }\n if (route.redirectTo && route.component) {\n throw new Error(\n `Invalid configuration of route '${fullPath}': redirectTo and component cannot be used together`);\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(\n `Invalid configuration of route '${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(\n `Invalid configuration of route '${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(`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(\n `Invalid configuration of route '{path: \"${fullPath}\", redirectTo: \"${route.redirectTo}\"}': please provide 'pathMatch'. ${exp}`);\n }\n if (route.pathMatch !== void 0 && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {\n throw new Error(\n `Invalid configuration of route '${fullPath}': pathMatch can only be set to 'prefix' or 'full'`);\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 * @license\n * Copyright Google Inc. 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, ɵisObservable as isObservable, ɵisPromise as isPromise} from '@angular/core';\nimport {Observable, from, of } from 'rxjs';\nimport {concatAll, last as lastValue, map} from 'rxjs/operators';\n\nimport {PRIMARY_OUTLET} 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: {[x: string]: any}, b: {[x: string]: any}): boolean {\n // Casting Object.keys return values to include `undefined` as there are some cases\n // in IE 11 where this can happen. Cannot provide a test because the behavior only\n // exists in certain circumstances in IE 11, therefore doing this cast ensures the\n // logic is correct for when this edge case is hit.\n const k1 = Object.keys(a) as string[] | undefined;\n const k2 = Object.keys(b) as string[] | 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 (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Flattens single-level nested arrays.\n */\nexport function flatten<T>(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<T>(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<K, V>(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 waitForMap<A, B>(\n obj: {[k: string]: A}, fn: (k: string, a: A) => Observable<B>): Observable<{[k: string]: B}> {\n if (Object.keys(obj).length === 0) {\n return of ({});\n }\n\n const waitHead: Observable<B>[] = [];\n const waitTail: Observable<B>[] = [];\n const res: {[k: string]: B} = {};\n\n forEach(obj, (a: A, k: string) => {\n const mapped = fn(k, a).pipe(map((r: B) => res[k] = r));\n if (k === PRIMARY_OUTLET) {\n waitHead.push(mapped);\n } else {\n waitTail.push(mapped);\n }\n });\n\n // Closure compiler has problem with using spread operator here. So just using Array.concat.\n return of .apply(null, waitHead.concat(waitTail)).pipe(concatAll(), lastValue(), map(() => res));\n}\n\nexport function wrapIntoObservable<T>(value: T | NgModuleFactory<T>| Promise<T>| Observable<T>) {\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 Inc. 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 {PRIMARY_OUTLET, ParamMap, Params, convertToParamMap} from './shared';\nimport {forEach, shallowEqual} from './utils/collection';\n\nexport function createEmptyUrlTree() {\n return new UrlTree(new UrlSegmentGroup([], {}), {}, null);\n}\n\nexport function containsTree(container: UrlTree, containee: UrlTree, exact: boolean): boolean {\n if (exact) {\n return equalQueryParams(container.queryParams, containee.queryParams) &&\n equalSegmentGroups(container.root, containee.root);\n }\n\n return containsQueryParams(container.queryParams, containee.queryParams) &&\n containsSegmentGroup(container.root, containee.root);\n}\n\nfunction equalQueryParams(container: Params, containee: Params): boolean {\n // TODO: This does not handle array params correctly.\n return shallowEqual(container, containee);\n}\n\nfunction equalSegmentGroups(container: UrlSegmentGroup, containee: UrlSegmentGroup): boolean {\n if (!equalPath(container.segments, containee.segments)) return false;\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])) return false;\n }\n return true;\n}\n\nfunction containsQueryParams(container: Params, containee: Params): boolean {\n // TODO: This does not handle array params correctly.\n return Object.keys(containee).length <= Object.keys(container).length &&\n Object.keys(containee).every(key => containee[key] === container[key]);\n}\n\nfunction containsSegmentGroup(container: UrlSegmentGroup, containee: UrlSegmentGroup): boolean {\n return containsSegmentGroupHelper(container, containee, containee.segments);\n}\n\nfunction containsSegmentGroupHelper(\n container: UrlSegmentGroup, containee: UrlSegmentGroup, containeePaths: UrlSegment[]): 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 return true;\n\n } else if (container.segments.length === containeePaths.length) {\n if (!equalPath(container.segments, containeePaths)) 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])) return false;\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 (!container.children[PRIMARY_OUTLET]) return false;\n return containsSegmentGroupHelper(container.children[PRIMARY_OUTLET], containee, next);\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 { return DEFAULT_SERIALIZER.serialize(this); }\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 // TODO(issue/24571): remove '!'.\n _sourceSegment !: UrlSegmentGroup;\n /** @internal */\n // TODO(issue/24571): remove '!'.\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 { return this.numberOfChildren > 0; }\n\n /** Number of child segments */\n get numberOfChildren(): number { return Object.keys(this.children).length; }\n\n /** @docsNotRequired */\n toString(): string { return serializePaths(this); }\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 { return serializePath(this); }\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<T>(\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\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[] = Object.keys(params).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\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) { this.remaining = url; }\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]: any} {\n const params: {[key: string]: any} = {};\n while (this.consumeOptional(';')) {\n this.parseParam(params);\n }\n return params;\n }\n\n private parseParam(params: {[key: string]: any}): 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 { return this.remaining.startsWith(str); }\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 Inc. 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<T> {\n /** @internal */\n _root: TreeNode<T>;\n\n constructor(root: TreeNode<T>) { this._root = root; }\n\n get root(): T { return this._root.value; }\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[] { return findPath(t, this._root).map(s => s.value); }\n}\n\n\n// DFS for the node matching the value\nfunction findNode<T>(value: T, node: TreeNode<T>): TreeNode<T>|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<T>(value: T, node: TreeNode<T>): TreeNode<T>[] {\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<T> {\n constructor(public value: T, public children: TreeNode<T>[]) {}\n\n toString(): string { return `TreeNode(${this.value})`; }\n}\n\n// Return the list of T indexed by outlet name\nexport function nodeChildrenAsMap<T extends{outlet: string}>(node: TreeNode<T>| null) {\n const map: {[outlet: string]: TreeNode<T>} = {};\n\n if (node) {\n node.children.forEach(child => map[child.value.outlet] = child);\n }\n\n return map;\n}","/**\n * @license\n * Copyright Google Inc. 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 {PRIMARY_OUTLET, ParamMap, Params, convertToParamMap} from './shared';\nimport {UrlSegment, UrlSegmentGroup, UrlTree, equalSegments} from './url_tree';\nimport {shallowEqual, shallowEqualArrays} from './utils/collection';\nimport {Tree, TreeNode} from './utils/tree';\n\n\n\n/**\n * @description\n *\n * Represents the state of the router.\n *\n * RouterState is a tree of activated routes. Every node in this tree knows about the \"consumed\" URL\n * segments, the extracted parameters, and the resolved data.\n *\n * @usageNotes\n * ### Example\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<string> = child.params.map(p => p.id);\n * //...\n * }\n * }\n * ```\n *\n * See `ActivatedRoute` for more information.\n *\n * @publicApi\n */\nexport class RouterState extends Tree<ActivatedRoute> {\n /** @internal */\n constructor(\n root: TreeNode<ActivatedRoute>,\n /** The current snapshot of the router state */\n public snapshot: RouterStateSnapshot) {\n super(root);\n setRouterState(<RouterState>this, root);\n }\n\n toString(): string { return this.snapshot.toString(); }\n}\n\nexport function createEmptyState(urlTree: UrlTree, rootComponent: Type<any>| 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<ActivatedRoute>(activated, []), snapshot);\n}\n\nexport function createEmptyStateSnapshot(\n urlTree: UrlTree, rootComponent: Type<any>| 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<ActivatedRouteSnapshot>(activated, []));\n}\n\n/**\n * @description\n *\n * Contains the information about a route associated with a component loaded in an\n * outlet. An `ActivatedRoute` can also be used to traverse the router state tree.\n *\n * {@example router/activated-route/module.ts region=\"activated-route\"\n * header=\"activated-route.component.ts\" linenums=\"false\"}\n *\n * @publicApi\n */\nexport class ActivatedRoute {\n /** The current snapshot of this route */\n // TODO(issue/24571): remove '!'.\n snapshot !: ActivatedRouteSnapshot;\n /** @internal */\n _futureSnapshot: ActivatedRouteSnapshot;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _routerState !: RouterState;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _paramMap !: Observable<ParamMap>;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _queryParamMap !: Observable<ParamMap>;\n\n /** @internal */\n constructor(\n /** An observable of the URL segments matched by this route */\n public url: Observable<UrlSegment[]>,\n /** An observable of the matrix parameters scoped to this route */\n public params: Observable<Params>,\n /** An observable of the query parameters shared by all the routes */\n public queryParams: Observable<Params>,\n /** An observable of the URL fragment shared by all the routes */\n public fragment: Observable<string>,\n /** An observable of the static and resolved data of this route. */\n public data: Observable<Data>,\n /** The outlet name of the route. It's a constant */\n public outlet: string,\n /** The component of the route. It's a constant */\n // TODO(vsavkin): remove |string\n public component: Type<any>|string|null, futureSnapshot: ActivatedRouteSnapshot) {\n this._futureSnapshot = futureSnapshot;\n }\n\n /** The configuration used to match this route */\n get routeConfig(): Route|null { return this._futureSnapshot.routeConfig; }\n\n /** The root of the router state */\n get root(): ActivatedRoute { return this._routerState.root; }\n\n /** The parent of this route in the router state tree */\n get parent(): ActivatedRoute|null { return this._routerState.parent(this); }\n\n /** The first child of this route in the router state tree */\n get firstChild(): ActivatedRoute|null { return this._routerState.firstChild(this); }\n\n /** The children of this route in the router state tree */\n get children(): ActivatedRoute[] { return this._routerState.children(this); }\n\n /** The path from the root of the router state tree to this route */\n get pathFromRoot(): ActivatedRoute[] { return this._routerState.pathFromRoot(this); }\n\n get paramMap(): Observable<ParamMap> {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(map((p: Params): ParamMap => convertToParamMap(p)));\n }\n return this._paramMap;\n }\n\n get queryParamMap(): Observable<ParamMap> {\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 }, <any>{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 * ```\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 /** The matrix parameters scoped to this route */\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,\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<any>|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 { return this._routerState.root; }\n\n /** The parent of this route in the router state tree */\n get parent(): ActivatedRouteSnapshot|null { return this._routerState.parent(this); }\n\n /** The first child of this route in the router state tree */\n get firstChild(): ActivatedRouteSnapshot|null { return this._routerState.firstChild(this); }\n\n /** The children of this route in the router state tree */\n get children(): ActivatedRouteSnapshot[] { return this._routerState.children(this); }\n\n /** The path from the root of the router state tree to this route */\n get pathFromRoot(): ActivatedRouteSnapshot[] { return this._routerState.pathFromRoot(this); }\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 * @usageNotes\n * ### Example\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<string> = child.params.map(p => p.id);\n * //...\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport class RouterStateSnapshot extends Tree<ActivatedRouteSnapshot> {\n /** @internal */\n constructor(\n /** The url from which this snapshot was created */\n public url: string, root: TreeNode<ActivatedRouteSnapshot>) {\n super(root);\n setRouterState(<RouterStateSnapshot>this, root);\n }\n\n toString(): string { return serializeNode(this._root); }\n}\n\nfunction setRouterState<U, T extends{_routerState: U}>(state: U, node: TreeNode<T>): void {\n node.value._routerState = state;\n node.children.forEach(c => setRouterState(state, c));\n}\n\nfunction serializeNode(node: TreeNode<ActivatedRouteSnapshot>): 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 (<any>route.queryParams).next(nextSnapshot.queryParams);\n }\n if (currentSnapshot.fragment !== nextSnapshot.fragment) {\n (<any>route.fragment).next(nextSnapshot.fragment);\n }\n if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) {\n (<any>route.params).next(nextSnapshot.params);\n }\n if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) {\n (<any>route.url).next(nextSnapshot.url);\n }\n if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) {\n (<any>route.data).next(nextSnapshot.data);\n }\n } else {\n route.snapshot = route._futureSnapshot;\n\n // this is for resolved data\n (<any>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 Inc. 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<ActivatedRouteSnapshot>,\n prevState?: TreeNode<ActivatedRoute>): TreeNode<ActivatedRoute> {\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<ActivatedRoute>(value, children);\n\n // retrieve an activated route that is used to be displayed, but is not currently displayed\n } else {\n const detachedRouteHandle =\n <DetachedRouteHandleInternal>routeReuseStrategy.retrieve(curr.value);\n if (detachedRouteHandle) {\n const tree: TreeNode<ActivatedRoute> = detachedRouteHandle.route;\n setFutureSnapshotsOfActivatedRoutes(curr, tree);\n return tree;\n\n } else {\n const value = createActivatedRoute(curr.value);\n const children = curr.children.map(c => createNode(routeReuseStrategy, c));\n return new TreeNode<ActivatedRoute>(value, children);\n }\n }\n}\n\nfunction setFutureSnapshotsOfActivatedRoutes(\n curr: TreeNode<ActivatedRouteSnapshot>, result: TreeNode<ActivatedRoute>): 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<ActivatedRouteSnapshot>,\n prevState: TreeNode<ActivatedRoute>) {\n return curr.children.map(child => {\n for (const p of prevState.children) {\n if (routeReuseStrategy.shouldReuseRoute(p.value.snapshot, child.value)) {\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 Inc. 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 {PRIMARY_OUTLET, Params} 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,\n fragment: string): 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\nfunction tree(\n oldSegmentGroup: UrlSegmentGroup, newSegmentGroup: UrlSegmentGroup, urlTree: UrlTree,\n queryParams: Params, fragment: string): 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(c => typeof c === 'object' && c != null && c.outlets);\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 return new Position(route.snapshot._urlSegment, true, 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 getPath(command: any): any {\n if (typeof command === 'object' && command != null && command.outlets) {\n return command.outlets[PRIMARY_OUTLET];\n }\n return `${command}`;\n}\n\nfunction getOutlets(commands: any[]): {[k: string]: any[]} {\n if (!(typeof commands[0] === 'object')) return {[PRIMARY_OUTLET]: commands};\n if (commands[0].outlets === undefined) return {[PRIMARY_OUTLET]: commands};\n return commands[0].outlets;\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: any, outlet: string) => {\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 curr = getPath(commands[currentCommandIndex]);\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 if (typeof commands[i] === 'object' && commands[i].outlets !== undefined) {\n const children = createNewSegmentChildren(commands[i].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, commands[0]));\n i++;\n continue;\n }\n\n const curr = getPath(commands[i]);\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]: any}): any {\n const children: {[key: string]: UrlSegmentGroup} = {};\n forEach(outlets, (commands: any, outlet: string) => {\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 Inc. 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, RouterState, advanceActivatedRoute} from '../router_state';\nimport {forEach} from '../utils/collection';\nimport {TreeNode, nodeChildrenAsMap} from '../utils/tree';\n\nexport const activateRoutes =\n (rootContexts: ChildrenOutletContexts, routeReuseStrategy: RouteReuseStrategy,\n forwardEvent: (evt: Event) => void): MonoTypeOperatorFunction<NavigationTransition> =>\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<ActivatedRoute>, currNode: TreeNode<ActivatedRoute>|null,\n contexts: ChildrenOutletContexts): void {\n const children: {[outletName: string]: TreeNode<ActivatedRoute>} = 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<ActivatedRoute>, childName: string) => {\n this.deactivateRouteAndItsChildren(v, contexts);\n });\n }\n\n private deactivateRoutes(\n futureNode: TreeNode<ActivatedRoute>, currNode: TreeNode<ActivatedRoute>,\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<ActivatedRoute>, 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<ActivatedRoute>, 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<ActivatedRoute>, parentContexts: ChildrenOutletContexts): void {\n const context = parentContexts.getContext(route.value.outlet);\n\n if (context) {\n const children: {[outletName: string]: any} = nodeChildrenAsMap(route);\n const contexts = route.value.component ? context.children : parentContexts;\n\n forEach(children, (v: any, k: string) => this.deactivateRouteAndItsChildren(v, contexts));\n\n if (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 }\n }\n }\n\n private activateChildRoutes(\n futureNode: TreeNode<ActivatedRoute>, currNode: TreeNode<ActivatedRoute>|null,\n contexts: ChildrenOutletContexts): void {\n const children: {[outlet: string]: any} = 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<ActivatedRoute>, currNode: TreeNode<ActivatedRoute>,\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 (<DetachedRouteHandleInternal>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<ActivatedRoute>): 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 * @license\n * Copyright Google Inc. 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<product>(fn)) {\n * return fn(1, 2);\n * } else {\n * throw \"Must provide the `product` function\";\n * }\n */\nexport function isFunction<T>(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<CanLoad>(guard.canLoad);\n}\n\nexport function isCanActivate(guard: any): guard is CanActivate {\n return guard && isFunction<CanActivate>(guard.canActivate);\n}\n\nexport function isCanActivateChild(guard: any): guard is CanActivateChild {\n return guard && isFunction<CanActivateChild>(guard.canActivateChild);\n}\n\nexport function isCanDeactivate<T>(guard: any): guard is CanDeactivate<T> {\n return guard && isFunction<CanDeactivate<T>>(guard.canDeactivate);\n}\n","/**\n * @license\n * Copyright Google Inc. 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, Observable, Observer, from, of } from 'rxjs';\nimport {catchError, concatAll, every, first, map, mergeMap} from 'rxjs/operators';\n\nimport {LoadedRouterConfig, Route, Routes} from './config';\nimport {CanLoadFn} from './interfaces';\nimport {RouterConfigLoader} from './router_config_loader';\nimport {PRIMARY_OUTLET, Params, defaultUrlMatcher, navigationCancelingError} from './shared';\nimport {UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree} from './url_tree';\nimport {forEach, waitForMap, wrapIntoObservable} from './utils/collection';\nimport {isCanLoad, isFunction} from './utils/type_guards';\n\nclass NoMatch {\n public segmentGroup: UrlSegmentGroup|null;\n\n constructor(segmentGroup?: UrlSegmentGroup) { this.segmentGroup = segmentGroup || null; }\n}\n\nclass AbsoluteRedirect {\n constructor(public urlTree: UrlTree) {}\n}\n\nfunction noMatch(segmentGroup: UrlSegmentGroup): Observable<UrlSegmentGroup> {\n return new Observable<UrlSegmentGroup>(\n (obs: Observer<UrlSegmentGroup>) => obs.error(new NoMatch(segmentGroup)));\n}\n\nfunction absoluteRedirect(newTree: UrlTree): Observable<any> {\n return new Observable<UrlSegmentGroup>(\n (obs: Observer<UrlSegmentGroup>) => obs.error(new AbsoluteRedirect(newTree)));\n}\n\nfunction namedOutletsRedirect(redirectTo: string): Observable<any> {\n return new Observable<UrlSegmentGroup>(\n (obs: Observer<UrlSegmentGroup>) => obs.error(new Error(\n `Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`)));\n}\n\nfunction canLoadFails(route: Route): Observable<LoadedRouterConfig> {\n return new Observable<LoadedRouterConfig>(\n (obs: Observer<LoadedRouterConfig>) => obs.error(navigationCancelingError(\n `Cannot load children because the guard of the route \"path: '${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<UrlTree> {\n return new ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config).apply();\n}\n\nclass ApplyRedirects {\n private allowRedirects: boolean = true;\n private ngModule: NgModuleRef<any>;\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<UrlTree> {\n const expanded$ =\n this.expandSegmentGroup(this.ngModule, this.config, this.urlTree.root, PRIMARY_OUTLET);\n const urlTrees$ = expanded$.pipe(\n map((rootSegmentGroup: UrlSegmentGroup) => this.createUrlTree(\n rootSegmentGroup, this.urlTree.queryParams, this.urlTree.fragment !)));\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 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<UrlTree> {\n const expanded$ =\n this.expandSegmentGroup(this.ngModule, this.config, tree.root, PRIMARY_OUTLET);\n const mapped$ = expanded$.pipe(\n map((rootSegmentGroup: UrlSegmentGroup) =>\n this.createUrlTree(rootSegmentGroup, tree.queryParams, tree.fragment !)));\n return mapped$.pipe(catchError((e: any): Observable<UrlTree> => {\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):\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<any>, routes: Route[], segmentGroup: UrlSegmentGroup,\n outlet: string): Observable<UrlSegmentGroup> {\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<any>, routes: Route[],\n segmentGroup: UrlSegmentGroup): Observable<{[name: string]: UrlSegmentGroup}> {\n return waitForMap(\n segmentGroup.children,\n (childOutlet, child) => this.expandSegmentGroup(ngModule, routes, child, childOutlet));\n }\n\n private expandSegment(\n ngModule: NgModuleRef<any>, segmentGroup: UrlSegmentGroup, routes: Route[],\n segments: UrlSegment[], outlet: string,\n allowRedirects: boolean): Observable<UrlSegmentGroup> {\n return of (...routes).pipe(\n map((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 // TODO(i): this return type doesn't match the declared Observable<UrlSegmentGroup> -\n // talk to Jason\n return of (null) as any;\n }\n throw e;\n }));\n }),\n concatAll(), first((s: any) => !!s), catchError((e: any, _: any) => {\n if (e instanceof EmptyError || e.name === 'EmptyError') {\n if (this.noLeftoversInUrl(segmentGroup, segments, outlet)) {\n return of (new UrlSegmentGroup([], {}));\n }\n throw new NoMatch(segmentGroup);\n }\n throw e;\n }));\n }\n\n private noLeftoversInUrl(segmentGroup: UrlSegmentGroup, segments: UrlSegment[], outlet: string):\n boolean {\n return segments.length === 0 && !segmentGroup.children[outlet];\n }\n\n private expandSegmentAgainstRoute(\n ngModule: NgModuleRef<any>, segmentGroup: UrlSegmentGroup, routes: Route[], route: Route,\n paths: UrlSegment[], outlet: string, allowRedirects: boolean): Observable<UrlSegmentGroup> {\n if (getOutlet(route) !== outlet) {\n return noMatch(segmentGroup);\n }\n\n if (route.redirectTo === undefined) {\n return this.matchSegmentAgainstRoute(ngModule, segmentGroup, route, paths);\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<any>, segmentGroup: UrlSegmentGroup, routes: Route[], route: Route,\n segments: UrlSegment[], outlet: string): Observable<UrlSegmentGroup> {\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<any>, routes: Route[], route: Route,\n outlet: string): Observable<UrlSegmentGroup> {\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<any>, segmentGroup: UrlSegmentGroup, routes: Route[], route: Route,\n segments: UrlSegment[], outlet: string): Observable<UrlSegmentGroup> {\n const {matched, consumedSegments, lastChild, positionalParamSegments} =\n match(segmentGroup, route, segments);\n if (!matched) return noMatch(segmentGroup);\n\n const newTree = this.applyRedirectCommands(\n consumedSegments, route.redirectTo !, <any>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<any>, rawSegmentGroup: UrlSegmentGroup, route: Route,\n segments: UrlSegment[]): Observable<UrlSegmentGroup> {\n if (route.path === '**') {\n if (route.loadChildren) {\n return this.configLoader.load(ngModule.injector, route)\n .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, slicedSegments} =\n split(rawSegmentGroup, consumedSegments, rawSlicedSegments, childConfig);\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 expanded$ = this.expandSegment(\n childModule, segmentGroup, childConfig, slicedSegments, PRIMARY_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<any>, route: Route, segments: UrlSegment[]):\n Observable<LoadedRouterConfig> {\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 runCanLoadGuard(ngModule.injector, route, segments)\n .pipe(mergeMap((shouldLoad: boolean) => {\n if (shouldLoad) {\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 lineralizeSegments(route: Route, urlTree: UrlTree): Observable<UrlSegment[]> {\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\nfunction runCanLoadGuard(\n moduleInjector: Injector, route: Route, segments: UrlSegment[]): Observable<boolean> {\n const canLoad = route.canLoad;\n if (!canLoad || canLoad.length === 0) return of (true);\n\n const obs = from(canLoad).pipe(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<CanLoadFn>(guard)) {\n guardVal = guard(route, segments);\n } else {\n throw new Error('Invalid CanLoad guard');\n }\n return wrapIntoObservable(guardVal);\n }));\n\n return obs.pipe(concatAll(), every(result => result === true));\n}\n\nfunction match(segmentGroup: UrlSegmentGroup, route: Route, segments: UrlSegment[]): {\n matched: boolean,\n consumedSegments: UrlSegment[],\n lastChild: number,\n positionalParamSegments: {[k: string]: UrlSegment}\n} {\n if (route.path === '') {\n if ((route.pathMatch === 'full') && (segmentGroup.hasChildren() || segments.length > 0)) {\n return {matched: false, consumedSegments: [], lastChild: 0, positionalParamSegments: {}};\n }\n\n return {matched: true, consumedSegments: [], lastChild: 0, positionalParamSegments: {}};\n }\n\n const matcher = route.matcher || defaultUrlMatcher;\n const res = matcher(segments, segmentGroup, route);\n\n if (!res) {\n return {\n matched: false,\n consumedSegments: <any[]>[],\n lastChild: 0,\n positionalParamSegments: {},\n };\n }\n\n return {\n matched: true,\n consumedSegments: res.consumed !,\n lastChild: res.consumed.length !,\n positionalParamSegments: res.posParams !,\n };\n}\n\nfunction split(\n segmentGroup: UrlSegmentGroup, consumedSegments: UrlSegment[], slicedSegments: UrlSegment[],\n config: Route[]) {\n if (slicedSegments.length > 0 &&\n containsEmptyPathRedirectsWithNamedOutlets(segmentGroup, slicedSegments, config)) {\n const s = new UrlSegmentGroup(\n consumedSegments, createChildrenForEmptySegments(\n config, new UrlSegmentGroup(slicedSegments, segmentGroup.children)));\n return {segmentGroup: mergeTrivialChildren(s), slicedSegments: []};\n }\n\n if (slicedSegments.length === 0 &&\n containsEmptyPathRedirects(segmentGroup, slicedSegments, config)) {\n const s = new UrlSegmentGroup(\n segmentGroup.segments, addEmptySegmentsToChildrenIfNeeded(\n segmentGroup, slicedSegments, config, segmentGroup.children));\n return {segmentGroup: mergeTrivialChildren(s), slicedSegments};\n }\n\n return {segmentGroup, slicedSegments};\n}\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\nfunction addEmptySegmentsToChildrenIfNeeded(\n segmentGroup: UrlSegmentGroup, slicedSegments: UrlSegment[], routes: Route[],\n children: {[name: string]: UrlSegmentGroup}): {[name: string]: UrlSegmentGroup} {\n const res: {[name: string]: UrlSegmentGroup} = {};\n for (const r of routes) {\n if (isEmptyPathRedirect(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) {\n res[getOutlet(r)] = new UrlSegmentGroup([], {});\n }\n }\n return {...children, ...res};\n}\n\nfunction createChildrenForEmptySegments(\n routes: Route[], primarySegmentGroup: UrlSegmentGroup): {[name: string]: UrlSegmentGroup} {\n const res: {[name: string]: UrlSegmentGroup} = {};\n res[PRIMARY_OUTLET] = primarySegmentGroup;\n for (const r of routes) {\n if (r.path === '' && getOutlet(r) !== PRIMARY_OUTLET) {\n res[getOutlet(r)] = new UrlSegmentGroup([], {});\n }\n }\n return res;\n}\n\nfunction containsEmptyPathRedirectsWithNamedOutlets(\n segmentGroup: UrlSegmentGroup, segments: UrlSegment[], routes: Route[]): boolean {\n return routes.some(\n r => isEmptyPathRedirect(segmentGroup, segments, r) && getOutlet(r) !== PRIMARY_OUTLET);\n}\n\nfunction containsEmptyPathRedirects(\n segmentGroup: UrlSegmentGroup, segments: UrlSegment[], routes: Route[]): boolean {\n return routes.some(r => isEmptyPathRedirect(segmentGroup, segments, r));\n}\n\nfunction isEmptyPathRedirect(\n segmentGroup: UrlSegmentGroup, segments: UrlSegment[], r: Route): boolean {\n if ((segmentGroup.hasChildren() || segments.length > 0) && r.pathMatch === 'full') {\n return false;\n }\n\n return r.path === '' && r.redirectTo !== undefined;\n}\n\nfunction getOutlet(route: Route): string {\n return route.outlet || PRIMARY_OUTLET;\n}\n","/**\n * @license\n * Copyright Google Inc. 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, Observable} 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<NavigationTransition> {\n return function(source: Observable<NavigationTransition>) {\n return source.pipe(switchMap(\n t => applyRedirectsFn(moduleInjector, configLoader, urlSerializer, t.extractedUrl, config)\n .pipe(map(urlAfterRedirects => ({...t, urlAfterRedirects})))));\n };\n}\n","/**\n * @license\n * Copyright Google Inc. 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, RouterStateSnapshot, equalParamsAndUrlSegments} from '../router_state';\nimport {equalPath} from '../url_tree';\nimport {forEach, shallowEqual} from '../utils/collection';\nimport {TreeNode, nodeChildrenAsMap} 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<ActivatedRouteSnapshot>, currNode: TreeNode<ActivatedRouteSnapshot>| null,\n contexts: ChildrenOutletContexts | null, futurePath: ActivatedRouteSnapshot[],\n 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, (v: TreeNode<ActivatedRouteSnapshot>, k: string) =>\n deactivateRouteAndItsChildren(v, contexts !.getContext(k), checks));\n\n return checks;\n}\n\nfunction getRouteGuards(\n futureNode: TreeNode<ActivatedRouteSnapshot>, currNode: TreeNode<ActivatedRouteSnapshot>,\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) {\n const component = context && context.outlet && context.outlet.component || null;\n checks.canDeactivateChecks.push(new CanDeactivate(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<ActivatedRouteSnapshot>, context: OutletContext | null, checks: Checks): void {\n const children = nodeChildrenAsMap(route);\n const r = route.value;\n\n forEach(children, (node: TreeNode<ActivatedRouteSnapshot>, 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 Inc. 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 {Observable, OperatorFunction, combineLatest} 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<Observable<boolean|UrlTree>[], boolean|UrlTree> {\n return switchMap(obs => {\n return combineLatest(\n ...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 call.\n // This guarantees that in the case of a guard at the bottom of the tree that\n // returns a redirect, we will wait for the higher priority guard at the top to\n // finish before performing the redirect.\n if (!isPending) {\n // Early return when we hit a `false` value as that should always cancel\n // 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<boolean|UrlTree>;\n });\n}\n","/**\n * @license\n * Copyright Google Inc. 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, Observable, defer, from, of } from 'rxjs';\nimport {concatAll, 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<NavigationTransition> {\n return function(source: Observable<NavigationTransition>) {\n\n return source.pipe(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}\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 => { return result !== true; }, 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 from([\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 .pipe(concatAll(), first(result => {\n return result !== true;\n }, true as boolean | UrlTree));\n }),\n first(result => { return result !== true; }, 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<boolean> {\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<boolean> {\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<boolean|UrlTree> {\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<CanActivateFn>(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<boolean|UrlTree> {\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<CanActivateChildFn>(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<boolean|UrlTree> {\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 =\n wrapIntoObservable(guard.canDeactivate(component !, currARS, currRSS, futureRSS));\n } else if (isFunction<CanDeactivateFn<any>>(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 Inc. 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, ParamsInheritanceStrategy, RouterStateSnapshot, inheritedParamsDataResolve} from './router_state';\nimport {PRIMARY_OUTLET, defaultUrlMatcher} from './shared';\nimport {UrlSegment, UrlSegmentGroup, UrlTree, mapChildrenIntoArray} from './url_tree';\nimport {forEach, last} from './utils/collection';\nimport {TreeNode} from './utils/tree';\n\nclass NoMatch {}\n\nexport function recognize(\n rootComponentType: Type<any>| null, config: Routes, urlTree: UrlTree, url: string,\n paramsInheritanceStrategy: ParamsInheritanceStrategy = 'emptyOnly',\n relativeLinkResolution: 'legacy' | 'corrected' = 'legacy'): Observable<RouterStateSnapshot> {\n return new Recognizer(\n rootComponentType, config, urlTree, url, paramsInheritanceStrategy,\n relativeLinkResolution)\n .recognize();\n}\n\nclass Recognizer {\n constructor(\n private rootComponentType: Type<any>|null, private config: Routes, private urlTree: UrlTree,\n private url: string, private paramsInheritanceStrategy: ParamsInheritanceStrategy,\n private relativeLinkResolution: 'legacy'|'corrected') {}\n\n recognize(): Observable<RouterStateSnapshot> {\n try {\n const rootSegmentGroup =\n split(this.urlTree.root, [], [], this.config, this.relativeLinkResolution).segmentGroup;\n\n const children = this.processSegmentGroup(this.config, rootSegmentGroup, PRIMARY_OUTLET);\n\n const root = new ActivatedRouteSnapshot(\n [], Object.freeze({}), Object.freeze({...this.urlTree.queryParams}),\n this.urlTree.fragment !, {}, PRIMARY_OUTLET, this.rootComponentType, null,\n this.urlTree.root, -1, {});\n\n const rootNode = new TreeNode<ActivatedRouteSnapshot>(root, children);\n const routeState = new RouterStateSnapshot(this.url, rootNode);\n this.inheritParamsAndData(routeState._root);\n return of (routeState);\n\n } catch (e) {\n return new Observable<RouterStateSnapshot>(\n (obs: Observer<RouterStateSnapshot>) => obs.error(e));\n }\n }\n\n inheritParamsAndData(routeNode: TreeNode<ActivatedRouteSnapshot>): 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<ActivatedRouteSnapshot>[] {\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 processChildren(config: Route[], segmentGroup: UrlSegmentGroup):\n TreeNode<ActivatedRouteSnapshot>[] {\n const children = mapChildrenIntoArray(\n segmentGroup, (child, childOutlet) => this.processSegmentGroup(config, child, childOutlet));\n checkOutletNameUniqueness(children);\n sortActivatedRouteSnapshots(children);\n return children;\n }\n\n processSegment(\n config: Route[], segmentGroup: UrlSegmentGroup, segments: UrlSegment[],\n outlet: string): TreeNode<ActivatedRouteSnapshot>[] {\n for (const r of config) {\n try {\n return this.processSegmentAgainstRoute(r, segmentGroup, segments, outlet);\n } catch (e) {\n if (!(e instanceof NoMatch)) throw e;\n }\n }\n if (this.noLeftoversInUrl(segmentGroup, segments, outlet)) {\n return [];\n }\n\n throw new NoMatch();\n }\n\n private noLeftoversInUrl(segmentGroup: UrlSegmentGroup, segments: UrlSegment[], outlet: string):\n boolean {\n return segments.length === 0 && !segmentGroup.children[outlet];\n }\n\n processSegmentAgainstRoute(\n route: Route, rawSegment: UrlSegmentGroup, segments: UrlSegment[],\n outlet: string): TreeNode<ActivatedRouteSnapshot>[] {\n if (route.redirectTo) throw new NoMatch();\n\n if ((route.outlet || PRIMARY_OUTLET) !== outlet) throw new NoMatch();\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), outlet, route.component !, route, getSourceSegmentGroup(rawSegment),\n getPathIndexShift(rawSegment) + segments.length, getResolve(route));\n } else {\n const result: MatchResult = match(rawSegment, route, segments);\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), outlet, 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, childConfig, this.relativeLinkResolution);\n\n if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {\n const children = this.processChildren(childConfig, segmentGroup);\n return [new TreeNode<ActivatedRouteSnapshot>(snapshot, children)];\n }\n\n if (childConfig.length === 0 && slicedSegments.length === 0) {\n return [new TreeNode<ActivatedRouteSnapshot>(snapshot, [])];\n }\n\n const children = this.processSegment(childConfig, segmentGroup, slicedSegments, PRIMARY_OUTLET);\n return [new TreeNode<ActivatedRouteSnapshot>(snapshot, children)];\n }\n}\n\nfunction sortActivatedRouteSnapshots(nodes: TreeNode<ActivatedRouteSnapshot>[]): 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\ninterface MatchResult {\n consumedSegments: UrlSegment[];\n lastChild: number;\n parameters: any;\n}\n\nfunction match(segmentGroup: UrlSegmentGroup, route: Route, segments: UrlSegment[]): MatchResult {\n if (route.path === '') {\n if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || segments.length > 0)) {\n throw new NoMatch();\n }\n\n return {consumedSegments: [], lastChild: 0, parameters: {}};\n }\n\n const matcher = route.matcher || defaultUrlMatcher;\n const res = matcher(segments, segmentGroup, route);\n if (!res) throw new NoMatch();\n\n const posParams: {[n: string]: string} = {};\n forEach(res.posParams !, (v: UrlSegment, k: string) => { posParams[k] = v.path; });\n const parameters = res.consumed.length > 0 ?\n {...posParams, ...res.consumed[res.consumed.length - 1].parameters} :\n posParams;\n\n return {consumedSegments: res.consumed, lastChild: res.consumed.length, parameters};\n}\n\nfunction checkOutletNameUniqueness(nodes: TreeNode<ActivatedRouteSnapshot>[]): 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 split(\n segmentGroup: UrlSegmentGroup, consumedSegments: UrlSegment[], slicedSegments: UrlSegment[],\n config: Route[], relativeLinkResolution: 'legacy' | 'corrected') {\n if (slicedSegments.length > 0 &&\n containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, config)) {\n const s = new UrlSegmentGroup(\n consumedSegments, 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, addEmptyPathsToChildrenIfNeeded(\n segmentGroup, consumedSegments, slicedSegments, config,\n segmentGroup.children, 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 === '' && r.redirectTo === undefined;\n}\n\nfunction getOutlet(route: Route): string {\n return route.outlet || PRIMARY_OUTLET;\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 Inc. 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, Observable} 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<any>| null, config: Route[], serializer: (url: UrlTree) => string,\n paramsInheritanceStrategy: 'emptyOnly' | 'always', relativeLinkResolution: 'legacy' |\n 'corrected'): MonoTypeOperatorFunction<NavigationTransition> {\n return function(source: Observable<NavigationTransition>) {\n return source.pipe(mergeMap(\n t => recognizeFn(\n rootComponentType, config, t.urlAfterRedirects, serializer(t.urlAfterRedirects),\n paramsInheritanceStrategy, relativeLinkResolution)\n .pipe(map(targetSnapshot => ({...t, targetSnapshot})))));\n };\n}\n","/**\n * @license\n * Copyright Google Inc. 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, Observable, from, of } from 'rxjs';\nimport {concatMap, last, map, mergeMap, reduce} from 'rxjs/operators';\n\nimport {ResolveData} from '../config';\nimport {NavigationTransition} from '../router';\nimport {ActivatedRouteSnapshot, RouterStateSnapshot, inheritedParamsDataResolve} from '../router_state';\nimport {wrapIntoObservable} from '../utils/collection';\n\nimport {getToken} from '../utils/preactivation';\n\nexport function resolveData(\n paramsInheritanceStrategy: 'emptyOnly' | 'always',\n moduleInjector: Injector): MonoTypeOperatorFunction<NavigationTransition> {\n return function(source: Observable<NavigationTransition>) {\n return source.pipe(mergeMap(t => {\n const {targetSnapshot, guards: {canActivateChecks}} = t;\n\n if (!canActivateChecks.length) {\n return of (t);\n }\n\n return from(canActivateChecks)\n .pipe(\n concatMap(\n check => runResolve(\n check.route, targetSnapshot !, paramsInheritanceStrategy, moduleInjector)),\n reduce((_: any, __: any) => _), map(_ => t));\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 return null;\n }));\n}\n\nfunction resolveNode(\n resolve: ResolveData, futureARS: ActivatedRouteSnapshot, futureRSS: RouterStateSnapshot,\n moduleInjector: Injector): Observable<any> {\n const keys = Object.keys(resolve);\n if (keys.length === 0) {\n return of ({});\n }\n if (keys.length === 1) {\n const key = keys[0];\n return getResolver(resolve[key], futureARS, futureRSS, moduleInjector)\n .pipe(map((value: any) => { return {[key]: value}; }));\n }\n const data: {[k: string]: any} = {};\n const runningResolvers$ = from(keys).pipe(mergeMap((key: string) => {\n return getResolver(resolve[key], futureARS, futureRSS, moduleInjector)\n .pipe(map((value: any) => {\n data[key] = value;\n return value;\n }));\n }));\n return runningResolvers$.pipe(last(), map(() => data));\n}\n\nfunction getResolver(\n injectionToken: any, futureARS: ActivatedRouteSnapshot, futureRSS: RouterStateSnapshot,\n moduleInjector: Injector): Observable<any> {\n const resolver = getToken(injectionToken, futureARS, moduleInjector);\n return resolver.resolve ? wrapIntoObservable(resolver.resolve(futureARS, futureRSS)) :\n wrapIntoObservable(resolver(futureARS, futureRSS));\n}","/**\n * @license\n * Copyright Google Inc. 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, ObservableInput, from} 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<T>(next: (x: T) => void|ObservableInput<any>):\n MonoTypeOperatorFunction<T> {\n return function(source) {\n return source.pipe(switchMap(v => {\n const nextResult = next(v);\n if (nextResult) {\n return from(nextResult).pipe(map(() => v));\n }\n return from([v]);\n }));\n };\n}\n","/**\n * @license\n * Copyright Google Inc. 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<string, OutletContext>,\n componentRef: ComponentRef<any>,\n route: TreeNode<ActivatedRoute>,\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 * Does not detach any subtrees. Reuses routes as long as their route config is the same.\n */\nexport class DefaultRouteReuseStrategy implements RouteReuseStrategy {\n shouldDetach(route: ActivatedRouteSnapshot): boolean { return false; }\n store(route: ActivatedRouteSnapshot, detachedTree: DetachedRouteHandle): void {}\n shouldAttach(route: ActivatedRouteSnapshot): boolean { return false; }\n retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle|null { return null; }\n shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {\n return future.routeConfig === curr.routeConfig;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. 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, InjectionToken, Injector, NgModuleFactory, NgModuleFactoryLoader} from '@angular/core';\nimport {Observable, from, of } from 'rxjs';\nimport {map, mergeMap} from 'rxjs/operators';\nimport {LoadChildren, LoadedRouterConfig, Route, standardizeConfig} from './config';\nimport {flatten, wrapIntoObservable} from './utils/collection';\n\n/**\n * @docsNotRequired\n * @publicApi\n */\nexport const ROUTES = new InjectionToken<Route[][]>('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<LoadedRouterConfig> {\n if (this.onLoadStartListener) {\n this.onLoadStartListener(route);\n }\n\n const moduleFactory$ = this.loadModuleFactory(route.loadChildren !);\n\n return moduleFactory$.pipe(map((factory: NgModuleFactory<any>) => {\n if (this.onLoadEndListener) {\n this.onLoadEndListener(route);\n }\n\n const module = factory.create(parentInjector);\n\n return new LoadedRouterConfig(\n flatten(module.injector.get(ROUTES)).map(standardizeConfig), module);\n }));\n }\n\n private loadModuleFactory(loadChildren: LoadChildren): Observable<NgModuleFactory<any>> {\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 Inc. 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 { return true; }\n extract(url: UrlTree): UrlTree { return url; }\n merge(newUrlPart: UrlTree, wholeUrl: UrlTree): UrlTree { return newUrlPart; }\n}","/**\n * @license\n * Copyright Google Inc. 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} from '@angular/common';\nimport {Compiler, Injector, NgModuleFactoryLoader, NgModuleRef, NgZone, Type, isDevMode, ɵConsole as Console} from '@angular/core';\nimport {BehaviorSubject, EMPTY, Observable, Subject, Subscription, defer, of } from 'rxjs';\nimport {catchError, filter, finalize, map, switchMap, tap} from 'rxjs/operators';\n\nimport {QueryParamsHandling, Route, Routes, standardizeConfig, validateConfig} 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, RouterState, RouterStateSnapshot, createEmptyState} from './router_state';\nimport {Params, isNavigationCancelingError, navigationCancelingError} from './shared';\nimport {DefaultUrlHandlingStrategy, UrlHandlingStrategy} from './url_handling_strategy';\nimport {UrlSerializer, UrlTree, containsTree, createEmptyUrlTree} from './url_tree';\nimport {Checks, getAllRouteGuards} from './utils/preactivation';\nimport {isUrlTree} from './utils/type_guards';\n\n\n\n/**\n * @description\n *\n * Options that modify the navigation strategy.\n *\n * @publicApi\n */\nexport interface NavigationExtras {\n /**\n * Enables relative navigation from the current ActivatedRoute.\n *\n * Configuration:\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 * Navigate to list route from 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 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 * DEPRECATED: Use `queryParamsHandling` instead to preserve\n * query parameters for the next navigation.\n *\n * ```\n * // Preserve query params from /results?page=1 to /view?page=1\n * this.router.navigate(['/view'], { preserveQueryParams: true });\n * ```\n *\n * @deprecated since v4\n */\n preserveQueryParams?: boolean;\n\n /**\n * Configuration strategy for how to handle query parameters for the next navigation.\n *\n * ```\n * // from /results?page=1 to /view?page=1&page=2\n * this.router.navigate(['/view'], { queryParams: { page: 2 }, queryParamsHandling: \"merge\" });\n * ```\n */\n queryParamsHandling?: QueryParamsHandling|null;\n /**\n * Preserves the 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 * 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 * 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 * State passed to any navigation. This value will be accessible through the `extras` object\n * returned from `router.getCurrentNavigation()` while a navigation is executing. Once a\n * navigation completes, this value will be written to `history.state` when the `location.go`\n * or `location.replaceState` method is called before activating of this route. Note that\n * `history.state` will not pass an object equality test because the `navigationId` will be\n * added to the state before being written.\n *\n * While `history.state` can accept any type of value, because the router adds the `navigationId`\n * on each navigation, the `state` must always be an object.\n */\n state?: {[k: string]: any};\n}\n\n/**\n * @description\n *\n * Error handler that is invoked when a navigation errors.\n *\n * If the handler returns a value, the navigation promise will be resolved with this value.\n * If the handler throws an exception, the navigation promise will be 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; navigationId: number;\n};\n\n/**\n * @description\n *\n * Information about any given navigation. This information can be gotten from the router at\n * any time using the `router.getCurrentNavigation()` method.\n *\n * @publicApi\n */\nexport type Navigation = {\n /**\n * The ID of the current navigation.\n */\n id: number;\n /**\n * Target URL passed into the {@link 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 {@link UrlSerializer.extract()}.\n */\n extractedUrl: UrlTree;\n /**\n * Extracted URL after redirects have been applied. This URL may not be available immediately,\n * therefore this property can be `undefined`. It is guaranteed to be set after the\n * {@link RoutesRecognized} event fires.\n */\n finalUrl?: UrlTree;\n /**\n * Identifies the trigger of the 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 trigger: 'imperative' | 'popstate' | 'hashchange';\n /**\n * The NavigationExtras used in this navigation. See {@link NavigationExtras} for more info.\n */\n extras: NavigationExtras;\n /**\n * Previously successful Navigation object. Only a single previous Navigation is available,\n * therefore this previous Navigation will always have a `null` value for `previousNavigation`.\n */\n previousNavigation: Navigation | null;\n};\n\nexport type NavigationTransition = {\n id: 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<boolean>,\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<void>;\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<void> {\n return of (null) as any;\n}\n\n/**\n * @description\n *\n * An NgModule that provides navigation and URL manipulation capabilities.\n *\n * @see `Route`.\n * @see [Routing and Navigation Guide](guide/router).\n *\n * @ngModule RouterModule\n *\n * @publicApi\n */\nexport class Router {\n private currentUrlTree: UrlTree;\n private rawUrlTree: UrlTree;\n private browserUrlTree: UrlTree;\n private readonly transitions: BehaviorSubject<NavigationTransition>;\n private navigations: Observable<NavigationTransition>;\n private lastSuccessfulNavigation: Navigation|null = null;\n private currentNavigation: Navigation|null = null;\n\n // TODO(issue/24571): remove '!'.\n private locationSubscription !: Subscription;\n private navigationId: number = 0;\n private configLoader: RouterConfigLoader;\n private ngModule: NgModuleRef<any>;\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<Event> = new Subject<Event>();\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 * Malformed uri error handler is invoked when `Router.parseUrl(url)` throws an\n * error due to containing an invalid character. The most common case would be 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: {beforePreactivation: RouterHook, afterPreactivation: RouterHook} = {\n beforePreactivation: defaultRouterHook,\n afterPreactivation: defaultRouterHook\n };\n\n /**\n * Extracts and merges URLs. Used for AngularJS to Angular migrations.\n */\n urlHandlingStrategy: UrlHandlingStrategy = new DefaultUrlHandlingStrategy();\n\n /**\n * The 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 * - `'ignore'` : The router ignores the request.\n * - `'reload'` : The router reloads the URL. Use to implement a \"refresh\" feature.\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 * Defines when the router updates the browser URL. The default behavior is to update after\n * successful navigation. However, some applications may prefer a mode where the URL gets\n * updated at the beginning of navigation. The most common use case would be updating the\n * URL early so if navigation fails, you can show an error message with the URL that failed.\n * Available options are:\n *\n * - `'deferred'`, the default, updates the browser URL after navigation has finished.\n * - `'eager'`, updates browser URL at the beginning of navigation.\n */\n urlUpdateStrategy: 'deferred'|'eager' = 'deferred';\n\n /**\n * See {@link RouterModule} for more information.\n */\n relativeLinkResolution: 'legacy'|'corrected' = 'legacy';\n\n /**\n * Creates the router service.\n */\n // TODO: vsavkin make internal after the final is out.\n constructor(\n private rootComponentType: Type<any>|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;\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<NavigationTransition>({\n id: 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<NavigationTransition>):\n Observable<NavigationTransition> {\n const eventsSubject = (this.events as Subject<Event>);\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)\n } as 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 urlTransition =\n !this.navigated || t.extractedUrl.toString() !== this.browserUrlTree.toString();\n const processCurrentUrl =\n (this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&\n this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl);\n\n if (processCurrentUrl) {\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, t.restoredState));\n if (transition !== this.transitions.getValue()) {\n return EMPTY;\n }\n return [t];\n }),\n\n // This delay is required to match old behavior that forced navigation to\n // always be async\n switchMap(t => Promise.resolve(t)),\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, (url) => this.serializeUrl(url),\n this.paramsInheritanceStrategy, 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(\n t.urlAfterRedirects, !!t.extras.replaceUrl, t.id, t.extras.state);\n }\n this.browserUrlTree = t.urlAfterRedirects;\n }\n }),\n\n // Fire RoutesRecognized\n tap(t => {\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, we\n * handle this \"error condition\" by navigating to the previously successful URL,\n * 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 other\n * than update router's internal reference to the current \"settled\" URL. This\n * way the next navigation will be coming from the current URL 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), this.serializeUrl(t.urlAfterRedirects),\n t.targetSnapshot !);\n this.triggerEvent(guardsStart);\n }),\n\n map(t => ({\n ...t,\n guards:\n getAllRouteGuards(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\n tap(t => {\n const guardsEnd = new GuardsCheckEnd(\n t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects),\n t.targetSnapshot !, !!t.guardsResult);\n this.triggerEvent(guardsEnd);\n }),\n\n filter(t => {\n if (!t.guardsResult) {\n this.resetUrlToCurrentUrlTree();\n const navCancel =\n new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), '');\n eventsSubject.next(navCancel);\n t.resolve(false);\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 resolveData(\n this.paramsInheritanceStrategy,\n this.ngModule.injector), //\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 will\n succeed, and user code may read from the Router service. Therefore before\n activation, we need to update router properties storing the current URL and the\n RouterState, as well as updated the browser URL. All this should happen *before*\n activating. */\n tap((t: NavigationTransition) => {\n this.currentUrlTree = t.urlAfterRedirects;\n this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, 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(\n this.rawUrlTree, !!t.extras.replaceUrl, t.id, t.extras.state);\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({next() { completed = true; }, complete() { completed = true; }}),\n finalize(() => {\n /* When the navigation stream finishes either through error or success, we set the\n * `completed` or `errored` flag. However, there are some situations where we could\n * get here without either of those being set. For instance, a redirect during\n * NavigationStart. Therefore, this is a catch-all to make sure the NavigationCancel\n * event is fired when a navigation gets cancelled but not caught by other means. */\n if (!completed && !errored) {\n // Must reset to current URL tree here to ensure history.state is set. On a fresh\n // page load, if a new navigation comes in before a successful navigation\n // completes, there will be nothing in history.state.navigationId. This can cause\n // sync problems with AngularJS sync code which looks for a value here in order\n // to determine whether or not to handle a given popstate event or to leave it\n // to the Angualr router.\n this.resetUrlToCurrentUrlTree();\n const navCancel = new NavigationCancel(\n t.id, this.serializeUrl(t.extractedUrl),\n `Navigation ID ${t.id} is not equal to the current navigation id ${this.navigationId}`);\n eventsSubject.next(navCancel);\n t.resolve(false);\n }\n // currentNavigation should always be reset to null here. If navigation was\n // successful, lastSuccessfulTransition will have already been set. Therefore we\n // can safely set currentNavigation to null here.\n this.currentNavigation = null;\n }),\n catchError((e) => {\n errored = true;\n /* This error type is issued during Redirect, and is handled as a cancellation\n * 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 `/` isn't\n // a change from the default currentUrlTree and won't navigate. This is\n // only applicable with initial navigation, so setting `navigated` only when\n // not redirecting resolves this scenario.\n this.navigated = true;\n this.resetStateAndUrl(t.currentRouterState, t.currentUrlTree, t.rawUrl);\n }\n const navCancel =\n new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), e.message);\n eventsSubject.next(navCancel);\n t.resolve(false);\n\n if (redirecting) {\n this.navigateByUrl(e.url);\n }\n\n /* All other errors should reset to the router's internal URL reference to the\n * pre-error state. */\n } else {\n this.resetStateAndUrl(t.currentRouterState, t.currentUrlTree, t.rawUrl);\n const navError = 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<NavigationTransition>;\n }\n\n /**\n * @internal\n * TODO: this should be removed once the constructor of the router made internal\n */\n resetRootComponentType(rootComponentType: Type<any>): 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 // 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<NavigationTransition>): 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.\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 = <any>this.location.subscribe((change: any) => {\n let rawUrlTree = this.parseUrl(change['url']);\n const source: NavigationTrigger = change['type'] === 'popstate' ? 'popstate' : 'hashchange';\n // Navigations coming from Angular router have a navigationId state property. When this\n // exists, restore the state.\n const state = change.state && change.state.navigationId ? change.state : null;\n setTimeout(\n () => { this.scheduleNavigation(rawUrlTree, source, state, {replaceUrl: true}); }, 0);\n });\n }\n }\n\n /** The current URL. */\n get url(): string { return this.serializeUrl(this.currentUrlTree); }\n\n /** The current Navigation object if one exists */\n getCurrentNavigation(): Navigation|null { return this.currentNavigation; }\n\n /** @internal */\n triggerEvent(event: Event): void { (this.events as Subject<Event>).next(event); }\n\n /**\n * Resets the 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 /** @docsNotRequired */\n ngOnDestroy(): void { this.dispose(); }\n\n /** Disposes of the router. */\n dispose(): void {\n if (this.locationSubscription) {\n this.locationSubscription.unsubscribe();\n this.locationSubscription = null !;\n }\n }\n\n /**\n * Applies an array of commands to the current URL tree and creates a new URL tree.\n *\n * When given an activate route, applies the given commands starting from the route.\n * When not given a route, applies the given command starting from the root.\n *\n * @param commands An array of commands to apply.\n * @param navigationExtras\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, you\n * // can do the following:\n *\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 */\n createUrlTree(commands: any[], navigationExtras: NavigationExtras = {}): UrlTree {\n const {relativeTo, queryParams, fragment,\n preserveQueryParams, queryParamsHandling, preserveFragment} = navigationExtras;\n if (isDevMode() && preserveQueryParams && <any>console && <any>console.warn) {\n console.warn('preserveQueryParams is deprecated, use queryParamsHandling instead.');\n }\n const a = relativeTo || this.routerState.root;\n const f = preserveFragment ? this.currentUrlTree.fragment : fragment;\n let q: Params|null = null;\n if (queryParamsHandling) {\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 } else {\n q = preserveQueryParams ? this.currentUrlTree.queryParams : queryParams || null;\n }\n if (q !== null) {\n q = this.removeEmptyProps(q);\n }\n return createUrlTree(a, this.currentUrlTree, commands, q !, f !);\n }\n\n /**\n * Navigate based on the provided URL, which must be absolute.\n *\n * @param url An absolute URL. The function does not apply any delta to the current URL.\n * @param extras An object containing properties that modify the navigation strategy.\n * The function ignores any properties in the `NavigationExtras` that would change the\n * provided URL.\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 * ### Example\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 */\n navigateByUrl(url: string|UrlTree, extras: NavigationExtras = {skipLocationChange: false}):\n Promise<boolean> {\n if (isDevMode() && 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 * Returns a promise that:\n * - resolves to 'true' when navigation succeeds,\n * - resolves to 'false' when navigation fails,\n * - is rejected when an error happens.\n *\n * @usageNotes\n *\n * ### Example\n *\n * ```\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route});\n *\n * // Navigate without updating the URL\n * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});\n * ```\n *\n * The first parameter of `navigate()` is a delta to be applied to the current URL\n * or the one provided in the `relativeTo` property of the second parameter (the\n * `NavigationExtras`).\n *\n * In order to affect this browser's `history.state` entry, the `state`\n * parameter can be passed. This must be an object because the router\n * will add the `navigationId` property to this object before creating\n * the new history item.\n */\n navigate(commands: any[], extras: NavigationExtras = {skipLocationChange: false}):\n Promise<boolean> {\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 { return this.urlSerializer.serialize(url); }\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 /** Returns whether the url is activated */\n isActive(url: string|UrlTree, exact: boolean): boolean {\n if (isUrlTree(url)) {\n return containsTree(this.currentUrlTree, url, exact);\n }\n\n const urlTree = this.parseUrl(url);\n return containsTree(this.currentUrlTree, urlTree, exact);\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.events as Subject<Event>)\n .next(new NavigationEnd(\n t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(this.currentUrlTree)));\n this.lastSuccessfulNavigation = this.currentNavigation;\n this.currentNavigation = null;\n t.resolve(true);\n },\n e => { this.console.warn(`Unhandled Navigation Error: `); });\n }\n\n private scheduleNavigation(\n rawUrl: UrlTree, source: NavigationTrigger, restoredState: RestoredState|null,\n extras: NavigationExtras): Promise<boolean> {\n const lastNavigation = this.getTransition();\n // If the user triggers a navigation imperatively (e.g., by using navigateByUrl),\n // and that navigation results in 'replaceState' that leads to the same URL,\n // we should skip those.\n if (lastNavigation && source !== 'imperative' && lastNavigation.source === 'imperative' &&\n lastNavigation.rawUrl.toString() === rawUrl.toString()) {\n return Promise.resolve(true); // return value is not used\n }\n\n // Because of a bug in IE and Edge, the location class fires two events (popstate and\n // hashchange) every single time. The second one should be ignored. Otherwise, the URL will\n // flicker. Handles the case when a popstate was emitted first.\n if (lastNavigation && source == 'hashchange' && lastNavigation.source === 'popstate' &&\n lastNavigation.rawUrl.toString() === rawUrl.toString()) {\n return Promise.resolve(true); // return value is not used\n }\n // Because of a bug in IE and Edge, the location class fires two events (popstate and\n // hashchange) every single time. The second one should be ignored. Otherwise, the URL will\n // flicker. Handles the case when a hashchange was emitted first.\n if (lastNavigation && source == 'popstate' && lastNavigation.source === 'hashchange' &&\n lastNavigation.rawUrl.toString() === rawUrl.toString()) {\n return Promise.resolve(true); // return value is not used\n }\n\n let resolve: any = null;\n let reject: any = null;\n\n const promise = new Promise<boolean>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n const id = ++this.navigationId;\n this.setTransition({\n id,\n source,\n restoredState,\n currentUrlTree: this.currentUrlTree,\n currentRawUrl: this.rawUrlTree, rawUrl, extras, resolve, reject, 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) => { return Promise.reject(e); });\n }\n\n private setBrowserUrl(\n url: UrlTree, replaceUrl: boolean, id: number, state?: {[key: string]: any}) {\n const path = this.urlSerializer.serialize(url);\n state = state || {};\n if (this.location.isCurrentPathEqualTo(path) || replaceUrl) {\n // TODO(jasonaden): Remove first `navigationId` and rely on `ng` namespace.\n this.location.replaceState(path, '', {...state, navigationId: id});\n } else {\n this.location.go(path, '', {...state, navigationId: id});\n }\n }\n\n private resetStateAndUrl(storedState: RouterState, storedUrl: UrlTree, rawUrl: UrlTree): void {\n (this as{routerState: RouterState}).routerState = storedState;\n this.currentUrlTree = storedUrl;\n this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, rawUrl);\n this.resetUrlToCurrentUrlTree();\n }\n\n private resetUrlToCurrentUrlTree(): void {\n this.location.replaceState(\n this.urlSerializer.serialize(this.rawUrlTree), '', {navigationId: this.lastSuccessfulId});\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","/**\n * @license\n * Copyright Google Inc. 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, isDevMode} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {QueryParamsHandling} from '../config';\nimport {NavigationEnd, RouterEvent} from '../events';\nimport {Router} from '../router';\nimport {ActivatedRoute} from '../router_state';\nimport {UrlTree} from '../url_tree';\n\n\n/**\n * @description\n *\n * Lets you link to specific routes in your app.\n *\n * Consider the following route configuration:\n * `[{ path: 'user/:name', component: UserCmp }]`.\n * When linking to this `user/:name` route, you use the `RouterLink` directive.\n *\n * If the link is static, you can use the directive as follows:\n * `<a routerLink=\"/user/bob\">link to user component</a>`\n *\n * If you use dynamic values to generate the link, you can pass an array of path\n * segments, followed by the params for each segment.\n *\n * For instance `['/team', teamId, 'user', userName, {details: true}]`\n * means that we want to generate a link to `/team/11/user/bob;details=true`.\n *\n * Multiple static segments can be merged into one\n * (e.g., `['/team/11/user', userName, {details: true}]`).\n *\n * The first segment name can be prepended with `/`, `./`, or `../`:\n * * If the first segment begins with `/`, the router will look 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 will\n * instead look in the children of the current activated route.\n * * And if the first segment begins with `../`, the router will go up one level.\n *\n * You can set query params and fragment as follows:\n *\n * ```\n * <a [routerLink]=\"['/user/bob']\" [queryParams]=\"{debug: true}\" fragment=\"education\">\n * link to user component\n * </a>\n * ```\n * RouterLink will use these to generate this link: `/user/bob#education?debug=true`.\n *\n * (Deprecated in v4.0.0 use `queryParamsHandling` instead) You can also tell the\n * directive to preserve the current query params and fragment:\n *\n * ```\n * <a [routerLink]=\"['/user/bob']\" preserveQueryParams preserveFragment>\n * link to user component\n * </a>\n * ```\n *\n * You can tell the directive how to handle queryParams. Available options are:\n * - `'merge'`: merge the queryParams into the current queryParams\n * - `'preserve'`: preserve the current queryParams\n * - default/`''`: use the queryParams only\n *\n * Same options for {@link NavigationExtras#queryParamsHandling\n * NavigationExtras#queryParamsHandling}.\n *\n * ```\n * <a [routerLink]=\"['/user/bob']\" [queryParams]=\"{debug: true}\" queryParamsHandling=\"merge\">\n * link to user component\n * </a>\n * ```\n *\n * You can provide a `state` value to be persisted to the browser's History.state\n * property (See https://developer.mozilla.org/en-US/docs/Web/API/History#Properties). It's\n * used as follows:\n *\n * ```\n * <a [routerLink]=\"['/user/bob']\" [state]=\"{tracingId: 123}\">\n * link to user component\n * </a>\n * ```\n *\n * And later the value can be read from the router through `router.getCurrentNavigation`.\n * For example, to capture the `tracingId` above during the `NavigationStart` 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 * The router link directive always treats the provided input as a delta to the current url.\n *\n * For instance, if the current url is `/user/(box//aux:team)`.\n *\n * Then the following link `<a [routerLink]=\"['/user/jim']\">Jim</a>` will generate the link\n * `/user/(jim//aux:team)`.\n *\n * See {@link Router#createUrlTree createUrlTree} for more information.\n *\n * @ngModule RouterModule\n *\n * @publicApi\n */\n@Directive({selector: ':not(a):not(area)[routerLink]'})\nexport class RouterLink {\n // TODO(issue/24571): remove '!'.\n @Input() queryParams !: {[k: string]: any};\n // TODO(issue/24571): remove '!'.\n @Input() fragment !: string;\n // TODO(issue/24571): remove '!'.\n @Input() queryParamsHandling !: QueryParamsHandling;\n // TODO(issue/24571): remove '!'.\n @Input() preserveFragment !: boolean;\n // TODO(issue/24571): remove '!'.\n @Input() skipLocationChange !: boolean;\n // TODO(issue/24571): remove '!'.\n @Input() replaceUrl !: boolean;\n @Input() state?: {[k: string]: any};\n private commands: any[] = [];\n // TODO(issue/24571): remove '!'.\n private preserve !: boolean;\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 @Input()\n set routerLink(commands: any[]|string) {\n if (commands != null) {\n this.commands = Array.isArray(commands) ? commands : [commands];\n } else {\n this.commands = [];\n }\n }\n\n /**\n * @deprecated 4.0.0 use `queryParamsHandling` instead.\n */\n @Input()\n set preserveQueryParams(value: boolean) {\n if (isDevMode() && <any>console && <any>console.warn) {\n console.warn('preserveQueryParams is deprecated!, use queryParamsHandling instead.');\n }\n this.preserve = value;\n }\n\n @HostListener('click')\n onClick(): boolean {\n const extras = {\n skipLocationChange: attrBoolValue(this.skipLocationChange),\n replaceUrl: attrBoolValue(this.replaceUrl),\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 relativeTo: this.route,\n queryParams: this.queryParams,\n fragment: this.fragment,\n preserveQueryParams: attrBoolValue(this.preserve),\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 // TODO(issue/24571): remove '!'.\n @Input() queryParams !: {[k: string]: any};\n // TODO(issue/24571): remove '!'.\n @Input() fragment !: string;\n // TODO(issue/24571): remove '!'.\n @Input() queryParamsHandling !: QueryParamsHandling;\n // TODO(issue/24571): remove '!'.\n @Input() preserveFragment !: boolean;\n // TODO(issue/24571): remove '!'.\n @Input() skipLocationChange !: boolean;\n // TODO(issue/24571): remove '!'.\n @Input() replaceUrl !: boolean;\n @Input() state?: {[k: string]: any};\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 constructor(\n private router: Router, private route: ActivatedRoute,\n private locationStrategy: LocationStrategy) {\n this.subscription = router.events.subscribe((s: RouterEvent) => {\n if (s instanceof NavigationEnd) {\n this.updateTargetUrlAndHref();\n }\n });\n }\n\n @Input()\n set routerLink(commands: any[]|string) {\n if (commands != null) {\n this.commands = Array.isArray(commands) ? commands : [commands];\n } else {\n this.commands = [];\n }\n }\n\n @Input()\n set preserveQueryParams(value: boolean) {\n if (isDevMode() && <any>console && <any>console.warn) {\n console.warn('preserveQueryParams is deprecated, use queryParamsHandling instead.');\n }\n this.preserve = value;\n }\n\n ngOnChanges(changes: {}): any { this.updateTargetUrlAndHref(); }\n ngOnDestroy(): any { this.subscription.unsubscribe(); }\n\n @HostListener('click', ['$event.button', '$event.ctrlKey', '$event.metaKey', '$event.shiftKey'])\n onClick(button: number, ctrlKey: boolean, metaKey: boolean, shiftKey: boolean): boolean {\n if (button !== 0 || ctrlKey || metaKey || shiftKey) {\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 relativeTo: this.route,\n queryParams: this.queryParams,\n fragment: this.fragment,\n preserveQueryParams: attrBoolValue(this.preserve),\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 Inc. 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, ContentChildren, Directive, ElementRef, Input, OnChanges, OnDestroy, Optional, QueryList, Renderer2, SimpleChanges} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {NavigationEnd, RouterEvent} from '../events';\nimport {Router} from '../router';\n\nimport {RouterLink, RouterLinkWithHref} from './router_link';\n\n\n/**\n *\n * @description\n *\n * Lets you add a CSS class to an element when the link's route becomes active.\n *\n * This directive lets you add a CSS class to an element when the link's route\n * becomes active.\n *\n * Consider the following example:\n *\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive=\"active-link\">Bob</a>\n * ```\n *\n * When the url is either '/user' or '/user/bob', the active-link class will\n * be added to the `a` tag. If the url changes, the class will be removed.\n *\n * You can set more than one class, as follows:\n *\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive=\"class1 class2\">Bob</a>\n * <a routerLink=\"/user/bob\" [routerLinkActive]=\"['class1', 'class2']\">Bob</a>\n * ```\n *\n * You can configure RouterLinkActive by passing `exact: true`. This will add the classes\n * only when the url matches the link exactly.\n *\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive=\"active-link\" [routerLinkActiveOptions]=\"{exact:\n * true}\">Bob</a>\n * ```\n *\n * You can assign the RouterLinkActive instance to a template variable and directly check\n * the `isActive` status.\n * ```\n * <a routerLink=\"/user/bob\" routerLinkActive #rla=\"routerLinkActive\">\n * Bob {{ rla.isActive ? '(already open)' : ''}}\n * </a>\n * ```\n *\n * Finally, you can apply the RouterLinkActive directive to an ancestor of a RouterLink.\n *\n * ```\n * <div routerLinkActive=\"active-link\" [routerLinkActiveOptions]=\"{exact: true}\">\n * <a routerLink=\"/user/jim\">Jim</a>\n * <a routerLink=\"/user/bob\">Bob</a>\n * </div>\n * ```\n *\n * This will set the active-link class on the div tag if the url is either '/user/jim' or\n * '/user/bob'.\n *\n * @ngModule RouterModule\n *\n * @publicApi\n */\n@Directive({\n selector: '[routerLinkActive]',\n exportAs: 'routerLinkActive',\n})\nexport class RouterLinkActive implements OnChanges,\n OnDestroy, AfterContentInit {\n // TODO(issue/24571): remove '!'.\n @ContentChildren(RouterLink, {descendants: true})\n links !: QueryList<RouterLink>;\n // TODO(issue/24571): remove '!'.\n @ContentChildren(RouterLinkWithHref, {descendants: true})\n linksWithHrefs !: QueryList<RouterLinkWithHref>;\n\n private classes: string[] = [];\n private subscription: Subscription;\n public readonly isActive: boolean = false;\n\n @Input() routerLinkActiveOptions: {exact: boolean} = {exact: false};\n\n constructor(\n private router: Router, private element: ElementRef, private renderer: Renderer2,\n @Optional() private link?: RouterLink,\n @Optional() private linkWithHref?: RouterLinkWithHref) {\n this.subscription = router.events.subscribe((s: RouterEvent) => {\n if (s instanceof NavigationEnd) {\n this.update();\n }\n });\n }\n\n\n ngAfterContentInit(): void {\n this.links.changes.subscribe(_ => this.update());\n this.linksWithHrefs.changes.subscribe(_ => this.update());\n this.update();\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 ngOnChanges(changes: SimpleChanges): void { this.update(); }\n ngOnDestroy(): void { this.subscription.unsubscribe(); }\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.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 return (link: RouterLink | RouterLinkWithHref) =>\n router.isActive(link.urlTree, this.routerLinkActiveOptions.exact);\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 * @license\n * Copyright Google Inc. 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 {RouterOutlet} 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: RouterOutlet|null = null;\n route: ActivatedRoute|null = null;\n resolver: ComponentFactoryResolver|null = null;\n children = new ChildrenOutletContexts();\n attachRef: ComponentRef<any>|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<string, OutletContext>();\n\n /** Called when a `RouterOutlet` directive is instantiated */\n onChildOutletCreated(childName: string, outlet: RouterOutlet): 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 }\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<string, OutletContext> {\n const contexts = this.contexts;\n this.contexts = new Map();\n return contexts;\n }\n\n onOutletReAttached(contexts: Map<string, OutletContext>) { this.contexts = contexts; }\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 { return this.contexts.get(childName) || null; }\n}\n","/**\n * @license\n * Copyright Google Inc. 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';\n\nimport {Data} from '../config';\nimport {ChildrenOutletContexts} from '../router_outlet_context';\nimport {ActivatedRoute} from '../router_state';\nimport {PRIMARY_OUTLET} from '../shared';\n\n/**\n * @description\n *\n * Acts as a placeholder that Angular dynamically fills based on the current router state.\n *\n * ```\n * <router-outlet></router-outlet>\n * <router-outlet name='left'></router-outlet>\n * <router-outlet name='right'></router-outlet>\n * ```\n *\n * A router outlet will emit an activate event any time a new component is being instantiated,\n * and a deactivate event when it is being destroyed.\n *\n * ```\n * <router-outlet\n * (activate)='onActivate($event)'\n * (deactivate)='onDeactivate($event)'></router-outlet>\n * ```\n * @ngModule RouterModule\n *\n * @publicApi\n */\n@Directive({selector: 'router-outlet', exportAs: 'outlet'})\nexport class RouterOutlet implements OnDestroy, OnInit {\n private activated: ComponentRef<any>|null = null;\n private _activatedRoute: ActivatedRoute|null = null;\n private name: string;\n\n @Output('activate') activateEvents = new EventEmitter<any>();\n @Output('deactivate') deactivateEvents = new EventEmitter<any>();\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 ngOnDestroy(): void { this.parentContexts.onChildOutletDestroyed(this.name); }\n\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 { return !!this.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<any> {\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<any>, 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 = <any>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 Inc. 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 {Observable, Subscription, from, of } 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<any>): Observable<any>;\n}\n\n/**\n * @description\n *\n * Provides a preloading strategy that preloads all modules as quickly as possible.\n *\n * ```\n * RouteModule.forRoot(ROUTES, {preloadingStrategy: PreloadAllModules})\n * ```\n *\n * @publicApi\n */\nexport class PreloadAllModules implements PreloadingStrategy {\n preload(route: Route, fn: () => Observable<any>): Observable<any> {\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<any>): Observable<any> { return of (null); }\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 // TODO(issue/24571): remove '!'.\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<any> {\n const ngModule = this.injector.get(NgModuleRef);\n return this.processRoutes(ngModule, this.router.config);\n }\n\n // TODO(jasonaden): This class relies on code external to the class to call setUpPreloading. If\n // this hasn't been done, ngOnDestroy will fail as this.subscription will be undefined. This\n // should be refactored.\n ngOnDestroy(): void { this.subscription.unsubscribe(); }\n\n private processRoutes(ngModule: NgModuleRef<any>, routes: Routes): Observable<void> {\n const res: Observable<any>[] = [];\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<any>, route: Route): Observable<void> {\n return this.preloadingStrategy.preload(route, () => {\n const loaded$ = 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 Inc. 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 {OnDestroy} from '@angular/core';\nimport {Unsubscribable} from 'rxjs';\n\nimport {NavigationEnd, NavigationStart, Scroll} from './events';\nimport {Router} from './router';\n\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 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 Inc. 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_INITIALIZED, Location, 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, Optional, Provider, SkipSelf, SystemJsNgModuleLoader} from '@angular/core';\nimport {ɵgetDOM as getDOM} from '@angular/platform-browser';\nimport {Subject, of } 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 {RouterEvent} 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\n/**\n * @description\n *\n * Contains a list of directives\n *\n *\n */\nconst ROUTER_DIRECTIVES =\n [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, EmptyOutletComponent];\n\n/**\n * @description\n *\n * Is used in DI to configure the router.\n *\n * @publicApi\n */\nexport const ROUTER_CONFIGURATION = new InjectionToken<ExtraOptions>('ROUTER_CONFIGURATION');\n\n/**\n * @docsNotRequired\n */\nexport const ROUTER_FORROOT_GUARD = new InjectionToken<void>('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 ApplicationRef, UrlSerializer, ChildrenOutletContexts, Location, Injector,\n NgModuleFactoryLoader, Compiler, ROUTES, ROUTER_CONFIGURATION,\n [UrlHandlingStrategy, new Optional()], [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 * @usageNotes\n *\n * RouterModule can be imported multiple times: once per lazily-loaded bundle.\n * Since the router deals with a global shared resource--location, we cannot have\n * more than one router service active.\n *\n * That is why there are two ways to create the module: `RouterModule.forRoot` and\n * `RouterModule.forChild`.\n *\n * * `forRoot` creates a module that contains all the directives, the given routes, and the router\n * service itself.\n * * `forChild` creates a module that contains all the directives and the given routes, but does not\n * include the router service.\n *\n * When registered at the root, the module should be used as follows\n *\n * ```\n * @NgModule({\n * imports: [RouterModule.forRoot(ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * For submodules and lazy loaded submodules the module should be used as follows:\n *\n * ```\n * @NgModule({\n * imports: [RouterModule.forChild(ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * @description\n *\n * Adds router directives and providers.\n *\n * Managing state transitions is one of the hardest parts of building applications. This is\n * especially true on the web, where you also need to ensure that the state is reflected in the URL.\n * In addition, we often want to split applications into multiple bundles and load them on demand.\n * Doing this transparently is not trivial.\n *\n * The Angular router solves these problems. Using the router, you can declaratively specify\n * application states, manage state transitions while taking care of the URL, and load bundles on\n * demand.\n *\n * [Read this developer guide](https://angular.io/docs/ts/latest/guide/router.html) to get an\n * overview of how the router 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 a module with all the router providers and directives. It also optionally sets up an\n * application listener to perform an initial navigation.\n *\n * Configuration Options:\n *\n * * `enableTracing` Toggles whether the router should log all navigation events to the console.\n * * `useHash` Enables the location strategy that uses the URL fragment instead of the history\n * API.\n * * `initialNavigation` Disables the initial navigation.\n * * `errorHandler` Defines a custom error handler for failed navigations.\n * * `preloadingStrategy` Configures a preloading strategy. See `PreloadAllModules`.\n * * `onSameUrlNavigation` Define what the router should do if it receives a navigation request to\n * the current URL.\n * * `scrollPositionRestoration` Configures if the scroll position needs to be restored when\n * navigating back.\n * * `anchorScrolling` Configures if the router should scroll to the element when the url has a\n * fragment.\n * * `scrollOffset` Configures the scroll offset the router will use when scrolling to an element.\n * * `paramsInheritanceStrategy` Defines how the router merges params, data and resolved data from\n * parent to child routes.\n * * `malformedUriErrorHandler` Defines a custom malformed uri error handler function. This\n * handler is invoked when encodedURI contains invalid character sequences.\n * * `urlUpdateStrategy` Defines when the router updates the browser URL. The default behavior is\n * to update after successful navigation.\n * * `relativeLinkResolution` Enables the correct relative link resolution in components with\n * empty paths.\n *\n * See `ExtraOptions` for more details about the above options.\n */\n static forRoot(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterModule> {\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 {\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 */\n static forChild(routes: Routes): ModuleWithProviders<RouterModule> {\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 (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 * @description\n *\n * Registers routes.\n *\n * @usageNotes\n * ### Example\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 * @description\n *\n * Represents an option to configure when the initial navigation is performed.\n *\n * * 'enabled' - the initial navigation starts before the root component is created.\n * The bootstrap is blocked until the initial navigation is complete.\n * * 'disabled' - the initial navigation is not performed. The location listener is set up before\n * the root component gets created.\n * * 'legacy_enabled'- the initial navigation starts after the root component has been created.\n * The bootstrap is not blocked until the initial navigation is complete. @deprecated\n * * 'legacy_disabled'- the initial navigation is not performed. The location listener is set up\n * after @deprecated\n * the root component gets created.\n * * `true` - same as 'legacy_enabled'. @deprecated since v4\n * * `false` - same as 'legacy_disabled'. @deprecated since v4\n *\n * The 'enabled' option should be used for applications unless there is a reason to have\n * more control over when the router starts its initial navigation due to some complex\n * initialization logic. In this case, 'disabled' should be used.\n *\n * The 'legacy_enabled' and 'legacy_disabled' should not be used for new applications.\n *\n * @publicApi\n */\nexport type InitialNavigation =\n true | false | 'enabled' | 'disabled' | 'legacy_enabled' | 'legacy_disabled';\n\n/**\n * @description\n *\n * Represents options to configure the router.\n *\n * @publicApi\n */\nexport interface ExtraOptions {\n /**\n * Makes the router log all its internal events to the console.\n */\n enableTracing?: boolean;\n\n /**\n * Enables the location strategy that uses the URL fragment instead of the history API.\n */\n useHash?: boolean;\n\n /**\n * Disables the initial navigation.\n */\n initialNavigation?: InitialNavigation;\n\n /**\n * A custom error handler.\n */\n errorHandler?: ErrorHandler;\n\n /**\n * Configures a preloading strategy. See `PreloadAllModules`.\n */\n preloadingStrategy?: any;\n\n /**\n * Define what the router should do if it receives a navigation request to the current URL.\n * By default, the router will ignore this navigation. However, this prevents features such\n * as a \"refresh\" button. 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'--does nothing (default). Scroll position will be maintained on navigation.\n * * 'top'--set 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 * follows:\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 * Configures if the router should scroll to the element when the url has a fragment.\n *\n * * 'disabled'--does nothing (default).\n * * 'enabled'--scrolls to the element. This option will be the default in the future.\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 two numbers, the router will always use the numbers.\n * When given a function, the router will invoke the function every time it restores scroll\n * position.\n */\n scrollOffset?: [number, number]|(() => [number, number]);\n\n /**\n * Defines how the router merges params, data and resolved data from parent to child\n * routes. Available options are:\n *\n * - `'emptyOnly'`, the default, only inherits parent params for path-less or component-less\n * routes.\n * - `'always'`, enables unconditional inheritance of parent params.\n */\n paramsInheritanceStrategy?: 'emptyOnly'|'always';\n\n /**\n * A custom malformed uri error handler function. This handler is invoked when encodedURI contains\n * invalid character sequences. The default implementation is to redirect to the root url dropping\n * any path or param info. This function passes 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. The default behavior is to update after\n * successful navigation. However, some applications may prefer a mode where the URL gets\n * updated at the beginning of navigation. The most common use case would be updating the\n * URL early so if navigation fails, you can show an error message with the URL that failed.\n * Available options are:\n *\n * - `'deferred'`, the default, updates the browser URL after navigation has finished.\n * - `'eager'`, updates browser URL at the beginning of navigation.\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`, this will not work:\n *\n * `<a [routerLink]=\"['./a']\">Link to A</a>`\n *\n * However, this will work:\n *\n * `<a [routerLink]=\"['../a']\">Link to A</a>`\n *\n * In other words, you're required to use `../` rather than `./`. This is currently the default\n * behavior. Setting this option to `corrected` enables the fix.\n */\n relativeLinkResolution?: 'legacy'|'corrected';\n}\n\nexport function setupRouter(\n ref: ApplicationRef, urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts,\n location: Location, injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler,\n config: Route[][], 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 if (opts.errorHandler) {\n router.errorHandler = opts.errorHandler;\n }\n\n if (opts.malformedUriErrorHandler) {\n router.malformedUriErrorHandler = opts.malformedUriErrorHandler;\n }\n\n if (opts.enableTracing) {\n const dom = getDOM();\n router.events.subscribe((e: RouterEvent) => {\n dom.logGroup(`Router Event: ${(<any>e.constructor).name}`);\n dom.log(e.toString());\n dom.log(e);\n dom.logGroupEnd();\n });\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.urlUpdateStrategy) {\n router.urlUpdateStrategy = opts.urlUpdateStrategy;\n }\n\n if (opts.relativeLinkResolution) {\n router.relativeLinkResolution = opts.relativeLinkResolution;\n }\n\n return router;\n}\n\nexport function rootRoute(router: Router): ActivatedRoute {\n return router.routerState.root;\n}\n\n/**\n * To initialize the router properly we need to do in two steps:\n *\n * We need to start the navigation in a APP_INITIALIZER to block the bootstrap if\n * a resolver or a guards executes asynchronously. Second, we need to actually run\n * activation in a BOOTSTRAP_LISTENER. We utilize the afterPreactivation\n * hook provided by the router to do that.\n *\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 {\n private initNavigation: boolean = false;\n private resultOfPreactivationDone = new Subject<void>();\n\n constructor(private injector: Injector) {}\n\n appInitializer(): Promise<any> {\n const p: Promise<any> = this.injector.get(LOCATION_INITIALIZED, Promise.resolve(null));\n return p.then(() => {\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 (this.isLegacyDisabled(opts) || this.isLegacyEnabled(opts)) {\n resolve(true);\n\n } else if (opts.initialNavigation === 'disabled') {\n router.setUpLocationChangeListener();\n resolve(true);\n\n } else if (opts.initialNavigation === 'enabled') {\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\n } else {\n throw new Error(`Invalid initialNavigation options: '${opts.initialNavigation}'`);\n }\n\n return res;\n });\n }\n\n bootstrapListener(bootstrappedComponentRef: ComponentRef<any>): 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>(ApplicationRef);\n\n if (bootstrappedComponentRef !== ref.components[0]) {\n return;\n }\n\n if (this.isLegacyEnabled(opts)) {\n router.initialNavigation();\n } else if (this.isLegacyDisabled(opts)) {\n router.setUpLocationChangeListener();\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 private isLegacyEnabled(opts: ExtraOptions): boolean {\n return opts.initialNavigation === 'legacy_enabled' || opts.initialNavigation === true ||\n opts.initialNavigation === undefined;\n }\n\n private isLegacyDisabled(opts: ExtraOptions): boolean {\n return opts.initialNavigation === 'legacy_disabled' || opts.initialNavigation === false;\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 token for the router initializer that will be called after the app is bootstrapped.\n *\n * @publicApi\n */\nexport const ROUTER_INITIALIZER =\n new InjectionToken<(compRef: ComponentRef<any>) => void>('Router Initializer');\n\nexport function provideRouterInitializer() {\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 Inc. 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 common package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('8.1.1');\n","/**\n * @license\n * Copyright Google Inc. 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 {ROUTER_PROVIDERS as ɵROUTER_PROVIDERS} from './router_module';\nexport {flatten as ɵflatten} from './utils/collection';\n","/**\n * @license\n * Copyright Google Inc. 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, ResolveData, Route, Routes, RunGuardsAndResolvers, UrlMatchResult, UrlMatcher} from './config';\nexport {RouterLink, RouterLinkWithHref} from './directives/router_link';\nexport {RouterLinkActive} from './directives/router_link_active';\nexport {RouterOutlet} 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 {DetachedRouteHandle, RouteReuseStrategy} from './route_reuse_strategy';\nexport {Navigation, NavigationExtras, Router} from './router';\nexport {ROUTES} from './router_config_loader';\nexport {ExtraOptions, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, RouterModule, provideRoutes} 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 {PRIMARY_OUTLET, ParamMap, Params, convertToParamMap} from './shared';\nexport {UrlHandlingStrategy} from './url_handling_strategy';\nexport {DefaultUrlSerializer, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree} from './url_tree';\nexport {VERSION} from './version';\n\nexport * from './private_export';\n","/**\n * @license\n * Copyright Google Inc. 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 Inc. 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":["tslib_1.__extends","EmptyOutletComponent","lastValue","isObservable","isPromise","tslib_1.__values","applyRedirects","applyRedirectsFn","split","NoMatch","match","getOutlet","recognize","recognizeFn","last","Console","tslib_1.__assign","tslib_1.__decorate","tslib_1.__param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