{"ast":null,"code":"import _defineProperty from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport _assertThisInitialized from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _createForOfIteratorHelper from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper\";\nimport _toConsumableArray from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport _inherits from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/createSuper\";\nimport _createClass from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/createClass\";\nimport _classCallCheck from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/classCallCheck\";\n\n/**\n * @license Angular v12.2.16\n * (c) 2010-2021 Google LLC. https://angular.io/\n * License: MIT\n */\nimport { Location, LocationStrategy, ViewportScroller, PlatformLocation, APP_BASE_HREF, HashLocationStrategy, PathLocationStrategy, LOCATION_INITIALIZED } from '@angular/common';\nimport { ɵisObservable, ɵisPromise, Component, NgModuleRef, InjectionToken, InjectFlags, NgModuleFactory, ɵConsole, NgZone, Injectable, Type, Injector, NgModuleFactoryLoader, Compiler, Directive, Attribute, Renderer2, ElementRef, Input, HostListener, HostBinding, ChangeDetectorRef, Optional, ContentChildren, EventEmitter, ViewContainerRef, ComponentFactoryResolver, Output, SystemJsNgModuleLoader, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, Inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, ApplicationRef, Version } from '@angular/core';\nimport { from, of, BehaviorSubject, combineLatest, Observable, EmptyError, concat, defer, EMPTY, ConnectableObservable, Subject } from 'rxjs';\nimport { map, switchMap, take, startWith, scan, filter, catchError, concatMap, last as last$1, first, mergeMap, tap, takeLast, refCount, finalize, mergeAll } from 'rxjs/operators';\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Base for events the router goes through, as opposed to events tied to a specific\n * route. Fired one time for any given navigation.\n *\n * The following code shows how a class subscribes to router events.\n *\n * ```ts\n * import {Event, RouterEvent, Router} from '@angular/router';\n *\n * class MyService {\n *   constructor(public router: Router) {\n *     router.events.pipe(\n *        filter((e: Event): e is RouterEvent => e instanceof RouterEvent)\n *     ).subscribe((e: RouterEvent) => {\n *       // Do something\n *     });\n *   }\n * }\n * ```\n *\n * @see `Event`\n * @see [Router events summary](guide/router-reference#router-events)\n * @publicApi\n */\n\nimport * as ɵngcc0 from '@angular/core';\nimport * as ɵngcc1 from '@angular/common';\n\nvar RouterEvent = /*#__PURE__*/_createClass(function RouterEvent(\n/** A unique ID that the router assigns to every router navigation. */\nid,\n/** The URL that is the destination for this navigation. */\nurl) {\n  _classCallCheck(this, RouterEvent);\n\n  this.id = id;\n  this.url = url;\n});\n/**\n * An event triggered when a navigation starts.\n *\n * @publicApi\n */\n\n\nvar NavigationStart = /*#__PURE__*/function (_RouterEvent) {\n  _inherits(NavigationStart, _RouterEvent);\n\n  var _super = _createSuper(NavigationStart);\n\n  function NavigationStart(\n  /** @docsNotRequired */\n  id,\n  /** @docsNotRequired */\n  url) {\n    var _this;\n\n    var navigationTrigger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'imperative';\n    var restoredState = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n    _classCallCheck(this, NavigationStart);\n\n    _this = _super.call(this, id, url);\n    _this.navigationTrigger = navigationTrigger;\n    _this.restoredState = restoredState;\n    return _this;\n  }\n  /** @docsNotRequired */\n\n\n  _createClass(NavigationStart, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"NavigationStart(id: \".concat(this.id, \", url: '\").concat(this.url, \"')\");\n    }\n  }]);\n\n  return NavigationStart;\n}(RouterEvent);\n/**\n * An event triggered when a navigation ends successfully.\n *\n * @see `NavigationStart`\n * @see `NavigationCancel`\n * @see `NavigationError`\n *\n * @publicApi\n */\n\n\nvar NavigationEnd = /*#__PURE__*/function (_RouterEvent2) {\n  _inherits(NavigationEnd, _RouterEvent2);\n\n  var _super2 = _createSuper(NavigationEnd);\n\n  function NavigationEnd(\n  /** @docsNotRequired */\n  id,\n  /** @docsNotRequired */\n  url,\n  /** @docsNotRequired */\n  urlAfterRedirects) {\n    var _this2;\n\n    _classCallCheck(this, NavigationEnd);\n\n    _this2 = _super2.call(this, id, url);\n    _this2.urlAfterRedirects = urlAfterRedirects;\n    return _this2;\n  }\n  /** @docsNotRequired */\n\n\n  _createClass(NavigationEnd, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"NavigationEnd(id: \".concat(this.id, \", url: '\").concat(this.url, \"', urlAfterRedirects: '\").concat(this.urlAfterRedirects, \"')\");\n    }\n  }]);\n\n  return NavigationEnd;\n}(RouterEvent);\n/**\n * An event triggered when a navigation is canceled, directly or indirectly.\n * This can happen for several reasons including when a route guard\n * returns `false` or initiates a redirect by returning a `UrlTree`.\n *\n * @see `NavigationStart`\n * @see `NavigationEnd`\n * @see `NavigationError`\n *\n * @publicApi\n */\n\n\nvar NavigationCancel = /*#__PURE__*/function (_RouterEvent3) {\n  _inherits(NavigationCancel, _RouterEvent3);\n\n  var _super3 = _createSuper(NavigationCancel);\n\n  function NavigationCancel(\n  /** @docsNotRequired */\n  id,\n  /** @docsNotRequired */\n  url,\n  /** @docsNotRequired */\n  reason) {\n    var _this3;\n\n    _classCallCheck(this, NavigationCancel);\n\n    _this3 = _super3.call(this, id, url);\n    _this3.reason = reason;\n    return _this3;\n  }\n  /** @docsNotRequired */\n\n\n  _createClass(NavigationCancel, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"NavigationCancel(id: \".concat(this.id, \", url: '\").concat(this.url, \"')\");\n    }\n  }]);\n\n  return NavigationCancel;\n}(RouterEvent);\n/**\n * An event triggered when a navigation fails due to an unexpected error.\n *\n * @see `NavigationStart`\n * @see `NavigationEnd`\n * @see `NavigationCancel`\n *\n * @publicApi\n */\n\n\nvar NavigationError = /*#__PURE__*/function (_RouterEvent4) {\n  _inherits(NavigationError, _RouterEvent4);\n\n  var _super4 = _createSuper(NavigationError);\n\n  function NavigationError(\n  /** @docsNotRequired */\n  id,\n  /** @docsNotRequired */\n  url,\n  /** @docsNotRequired */\n  error) {\n    var _this4;\n\n    _classCallCheck(this, NavigationError);\n\n    _this4 = _super4.call(this, id, url);\n    _this4.error = error;\n    return _this4;\n  }\n  /** @docsNotRequired */\n\n\n  _createClass(NavigationError, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"NavigationError(id: \".concat(this.id, \", url: '\").concat(this.url, \"', error: \").concat(this.error, \")\");\n    }\n  }]);\n\n  return NavigationError;\n}(RouterEvent);\n/**\n * An event triggered when routes are recognized.\n *\n * @publicApi\n */\n\n\nvar RoutesRecognized = /*#__PURE__*/function (_RouterEvent5) {\n  _inherits(RoutesRecognized, _RouterEvent5);\n\n  var _super5 = _createSuper(RoutesRecognized);\n\n  function RoutesRecognized(\n  /** @docsNotRequired */\n  id,\n  /** @docsNotRequired */\n  url,\n  /** @docsNotRequired */\n  urlAfterRedirects,\n  /** @docsNotRequired */\n  state) {\n    var _this5;\n\n    _classCallCheck(this, RoutesRecognized);\n\n    _this5 = _super5.call(this, id, url);\n    _this5.urlAfterRedirects = urlAfterRedirects;\n    _this5.state = state;\n    return _this5;\n  }\n  /** @docsNotRequired */\n\n\n  _createClass(RoutesRecognized, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"RoutesRecognized(id: \".concat(this.id, \", url: '\").concat(this.url, \"', urlAfterRedirects: '\").concat(this.urlAfterRedirects, \"', state: \").concat(this.state, \")\");\n    }\n  }]);\n\n  return RoutesRecognized;\n}(RouterEvent);\n/**\n * An event triggered at the start of the Guard phase of routing.\n *\n * @see `GuardsCheckEnd`\n *\n * @publicApi\n */\n\n\nvar GuardsCheckStart = /*#__PURE__*/function (_RouterEvent6) {\n  _inherits(GuardsCheckStart, _RouterEvent6);\n\n  var _super6 = _createSuper(GuardsCheckStart);\n\n  function GuardsCheckStart(\n  /** @docsNotRequired */\n  id,\n  /** @docsNotRequired */\n  url,\n  /** @docsNotRequired */\n  urlAfterRedirects,\n  /** @docsNotRequired */\n  state) {\n    var _this6;\n\n    _classCallCheck(this, GuardsCheckStart);\n\n    _this6 = _super6.call(this, id, url);\n    _this6.urlAfterRedirects = urlAfterRedirects;\n    _this6.state = state;\n    return _this6;\n  }\n\n  _createClass(GuardsCheckStart, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"GuardsCheckStart(id: \".concat(this.id, \", url: '\").concat(this.url, \"', urlAfterRedirects: '\").concat(this.urlAfterRedirects, \"', state: \").concat(this.state, \")\");\n    }\n  }]);\n\n  return GuardsCheckStart;\n}(RouterEvent);\n/**\n * An event triggered at the end of the Guard phase of routing.\n *\n * @see `GuardsCheckStart`\n *\n * @publicApi\n */\n\n\nvar GuardsCheckEnd = /*#__PURE__*/function (_RouterEvent7) {\n  _inherits(GuardsCheckEnd, _RouterEvent7);\n\n  var _super7 = _createSuper(GuardsCheckEnd);\n\n  function GuardsCheckEnd(\n  /** @docsNotRequired */\n  id,\n  /** @docsNotRequired */\n  url,\n  /** @docsNotRequired */\n  urlAfterRedirects,\n  /** @docsNotRequired */\n  state,\n  /** @docsNotRequired */\n  shouldActivate) {\n    var _this7;\n\n    _classCallCheck(this, GuardsCheckEnd);\n\n    _this7 = _super7.call(this, id, url);\n    _this7.urlAfterRedirects = urlAfterRedirects;\n    _this7.state = state;\n    _this7.shouldActivate = shouldActivate;\n    return _this7;\n  }\n\n  _createClass(GuardsCheckEnd, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"GuardsCheckEnd(id: \".concat(this.id, \", url: '\").concat(this.url, \"', urlAfterRedirects: '\").concat(this.urlAfterRedirects, \"', state: \").concat(this.state, \", shouldActivate: \").concat(this.shouldActivate, \")\");\n    }\n  }]);\n\n  return GuardsCheckEnd;\n}(RouterEvent);\n/**\n * An event triggered at the start of the Resolve phase of routing.\n *\n * Runs in the \"resolve\" phase whether or not there is anything to resolve.\n * In future, may change to only run when there are things to be resolved.\n *\n * @see `ResolveEnd`\n *\n * @publicApi\n */\n\n\nvar ResolveStart = /*#__PURE__*/function (_RouterEvent8) {\n  _inherits(ResolveStart, _RouterEvent8);\n\n  var _super8 = _createSuper(ResolveStart);\n\n  function ResolveStart(\n  /** @docsNotRequired */\n  id,\n  /** @docsNotRequired */\n  url,\n  /** @docsNotRequired */\n  urlAfterRedirects,\n  /** @docsNotRequired */\n  state) {\n    var _this8;\n\n    _classCallCheck(this, ResolveStart);\n\n    _this8 = _super8.call(this, id, url);\n    _this8.urlAfterRedirects = urlAfterRedirects;\n    _this8.state = state;\n    return _this8;\n  }\n\n  _createClass(ResolveStart, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"ResolveStart(id: \".concat(this.id, \", url: '\").concat(this.url, \"', urlAfterRedirects: '\").concat(this.urlAfterRedirects, \"', state: \").concat(this.state, \")\");\n    }\n  }]);\n\n  return ResolveStart;\n}(RouterEvent);\n/**\n * An event triggered at the end of the Resolve phase of routing.\n * @see `ResolveStart`.\n *\n * @publicApi\n */\n\n\nvar ResolveEnd = /*#__PURE__*/function (_RouterEvent9) {\n  _inherits(ResolveEnd, _RouterEvent9);\n\n  var _super9 = _createSuper(ResolveEnd);\n\n  function ResolveEnd(\n  /** @docsNotRequired */\n  id,\n  /** @docsNotRequired */\n  url,\n  /** @docsNotRequired */\n  urlAfterRedirects,\n  /** @docsNotRequired */\n  state) {\n    var _this9;\n\n    _classCallCheck(this, ResolveEnd);\n\n    _this9 = _super9.call(this, id, url);\n    _this9.urlAfterRedirects = urlAfterRedirects;\n    _this9.state = state;\n    return _this9;\n  }\n\n  _createClass(ResolveEnd, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"ResolveEnd(id: \".concat(this.id, \", url: '\").concat(this.url, \"', urlAfterRedirects: '\").concat(this.urlAfterRedirects, \"', state: \").concat(this.state, \")\");\n    }\n  }]);\n\n  return ResolveEnd;\n}(RouterEvent);\n/**\n * An event triggered before lazy loading a route configuration.\n *\n * @see `RouteConfigLoadEnd`\n *\n * @publicApi\n */\n\n\nvar RouteConfigLoadStart = /*#__PURE__*/function () {\n  function RouteConfigLoadStart(\n  /** @docsNotRequired */\n  route) {\n    _classCallCheck(this, RouteConfigLoadStart);\n\n    this.route = route;\n  }\n\n  _createClass(RouteConfigLoadStart, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"RouteConfigLoadStart(path: \".concat(this.route.path, \")\");\n    }\n  }]);\n\n  return RouteConfigLoadStart;\n}();\n/**\n * An event triggered when a route has been lazy loaded.\n *\n * @see `RouteConfigLoadStart`\n *\n * @publicApi\n */\n\n\nvar RouteConfigLoadEnd = /*#__PURE__*/function () {\n  function RouteConfigLoadEnd(\n  /** @docsNotRequired */\n  route) {\n    _classCallCheck(this, RouteConfigLoadEnd);\n\n    this.route = route;\n  }\n\n  _createClass(RouteConfigLoadEnd, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"RouteConfigLoadEnd(path: \".concat(this.route.path, \")\");\n    }\n  }]);\n\n  return RouteConfigLoadEnd;\n}();\n/**\n * An event triggered at the start of the child-activation\n * part of the Resolve phase of routing.\n * @see  `ChildActivationEnd`\n * @see `ResolveStart`\n *\n * @publicApi\n */\n\n\nvar ChildActivationStart = /*#__PURE__*/function () {\n  function ChildActivationStart(\n  /** @docsNotRequired */\n  snapshot) {\n    _classCallCheck(this, ChildActivationStart);\n\n    this.snapshot = snapshot;\n  }\n\n  _createClass(ChildActivationStart, [{\n    key: \"toString\",\n    value: function toString() {\n      var path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n      return \"ChildActivationStart(path: '\".concat(path, \"')\");\n    }\n  }]);\n\n  return ChildActivationStart;\n}();\n/**\n * An event triggered at the end of the child-activation part\n * of the Resolve phase of routing.\n * @see `ChildActivationStart`\n * @see `ResolveStart`\n * @publicApi\n */\n\n\nvar ChildActivationEnd = /*#__PURE__*/function () {\n  function ChildActivationEnd(\n  /** @docsNotRequired */\n  snapshot) {\n    _classCallCheck(this, ChildActivationEnd);\n\n    this.snapshot = snapshot;\n  }\n\n  _createClass(ChildActivationEnd, [{\n    key: \"toString\",\n    value: function toString() {\n      var path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n      return \"ChildActivationEnd(path: '\".concat(path, \"')\");\n    }\n  }]);\n\n  return ChildActivationEnd;\n}();\n/**\n * An event triggered at the start of the activation part\n * of the Resolve phase of routing.\n * @see `ActivationEnd`\n * @see `ResolveStart`\n *\n * @publicApi\n */\n\n\nvar ActivationStart = /*#__PURE__*/function () {\n  function ActivationStart(\n  /** @docsNotRequired */\n  snapshot) {\n    _classCallCheck(this, ActivationStart);\n\n    this.snapshot = snapshot;\n  }\n\n  _createClass(ActivationStart, [{\n    key: \"toString\",\n    value: function toString() {\n      var path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n      return \"ActivationStart(path: '\".concat(path, \"')\");\n    }\n  }]);\n\n  return ActivationStart;\n}();\n/**\n * An event triggered at the end of the activation part\n * of the Resolve phase of routing.\n * @see `ActivationStart`\n * @see `ResolveStart`\n *\n * @publicApi\n */\n\n\nvar ActivationEnd = /*#__PURE__*/function () {\n  function ActivationEnd(\n  /** @docsNotRequired */\n  snapshot) {\n    _classCallCheck(this, ActivationEnd);\n\n    this.snapshot = snapshot;\n  }\n\n  _createClass(ActivationEnd, [{\n    key: \"toString\",\n    value: function toString() {\n      var path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';\n      return \"ActivationEnd(path: '\".concat(path, \"')\");\n    }\n  }]);\n\n  return ActivationEnd;\n}();\n/**\n * An event triggered by scrolling.\n *\n * @publicApi\n */\n\n\nvar Scroll = /*#__PURE__*/function () {\n  function Scroll(\n  /** @docsNotRequired */\n  routerEvent,\n  /** @docsNotRequired */\n  position,\n  /** @docsNotRequired */\n  anchor) {\n    _classCallCheck(this, Scroll);\n\n    this.routerEvent = routerEvent;\n    this.position = position;\n    this.anchor = anchor;\n  }\n\n  _createClass(Scroll, [{\n    key: \"toString\",\n    value: function toString() {\n      var pos = this.position ? \"\".concat(this.position[0], \", \").concat(this.position[1]) : null;\n      return \"Scroll(anchor: '\".concat(this.anchor, \"', position: '\").concat(pos, \"')\");\n    }\n  }]);\n\n  return Scroll;\n}();\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * The primary routing outlet.\n *\n * @publicApi\n */\n\n\nvar PRIMARY_OUTLET = 'primary';\n\nvar ParamsAsMap = /*#__PURE__*/function () {\n  function ParamsAsMap(params) {\n    _classCallCheck(this, ParamsAsMap);\n\n    this.params = params || {};\n  }\n\n  _createClass(ParamsAsMap, [{\n    key: \"has\",\n    value: function has(name) {\n      return Object.prototype.hasOwnProperty.call(this.params, name);\n    }\n  }, {\n    key: \"get\",\n    value: function get(name) {\n      if (this.has(name)) {\n        var v = this.params[name];\n        return Array.isArray(v) ? v[0] : v;\n      }\n\n      return null;\n    }\n  }, {\n    key: \"getAll\",\n    value: function getAll(name) {\n      if (this.has(name)) {\n        var v = this.params[name];\n        return Array.isArray(v) ? v : [v];\n      }\n\n      return [];\n    }\n  }, {\n    key: \"keys\",\n    get: function get() {\n      return Object.keys(this.params);\n    }\n  }]);\n\n  return ParamsAsMap;\n}();\n/**\n * Converts a `Params` instance to a `ParamMap`.\n * @param params The instance to convert.\n * @returns The new map instance.\n *\n * @publicApi\n */\n\n\nfunction convertToParamMap(params) {\n  return new ParamsAsMap(params);\n}\n\nvar NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';\n\nfunction navigationCancelingError(message) {\n  var error = Error('NavigationCancelingError: ' + message);\n  error[NAVIGATION_CANCELING_ERROR] = true;\n  return error;\n}\n\nfunction isNavigationCancelingError(error) {\n  return error && error[NAVIGATION_CANCELING_ERROR];\n} // Matches the route configuration (`route`) against the actual URL (`segments`).\n\n\nfunction defaultUrlMatcher(segments, segmentGroup, route) {\n  var 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' && (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  var posParams = {}; // Check each config part against the actual URL\n\n  for (var index = 0; index < parts.length; index++) {\n    var part = parts[index];\n    var segment = segments[index];\n    var isParameter = part.startsWith(':');\n\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 {\n    consumed: segments.slice(0, parts.length),\n    posParams: posParams\n  };\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nfunction shallowEqualArrays(a, b) {\n  if (a.length !== b.length) return false;\n\n  for (var i = 0; i < a.length; ++i) {\n    if (!shallowEqual(a[i], b[i])) return false;\n  }\n\n  return true;\n}\n\nfunction shallowEqual(a, b) {\n  // While `undefined` should never be possible, it would sometimes be the case in IE 11\n  // and pre-chromium Edge. The check below accounts for this edge case.\n  var k1 = a ? Object.keys(a) : undefined;\n  var k2 = b ? Object.keys(b) : undefined;\n\n  if (!k1 || !k2 || k1.length != k2.length) {\n    return false;\n  }\n\n  var key;\n\n  for (var i = 0; i < k1.length; i++) {\n    key = k1[i];\n\n    if (!equalArraysOrString(a[key], b[key])) {\n      return false;\n    }\n  }\n\n  return true;\n}\n/**\n * Test equality for arrays of strings or a string.\n */\n\n\nfunction equalArraysOrString(a, b) {\n  if (Array.isArray(a) && Array.isArray(b)) {\n    if (a.length !== b.length) return false;\n\n    var aSorted = _toConsumableArray(a).sort();\n\n    var bSorted = _toConsumableArray(b).sort();\n\n    return aSorted.every(function (val, index) {\n      return bSorted[index] === val;\n    });\n  } else {\n    return a === b;\n  }\n}\n/**\n * Flattens single-level nested arrays.\n */\n\n\nfunction flatten(arr) {\n  return Array.prototype.concat.apply([], arr);\n}\n/**\n * Return the last element of an array.\n */\n\n\nfunction last(a) {\n  return a.length > 0 ? a[a.length - 1] : null;\n}\n/**\n * Verifys all booleans in an array are `true`.\n */\n\n\nfunction and(bools) {\n  return !bools.some(function (v) {\n    return !v;\n  });\n}\n\nfunction forEach(map, callback) {\n  for (var prop in map) {\n    if (map.hasOwnProperty(prop)) {\n      callback(map[prop], prop);\n    }\n  }\n}\n\nfunction wrapIntoObservable(value) {\n  if (ɵisObservable(value)) {\n    return value;\n  }\n\n  if (ɵisPromise(value)) {\n    // Use `Promise.resolve()` to wrap promise-like instances.\n    // Required ie when a Resolver returns a AngularJS `$q` promise to correctly trigger the\n    // change detection.\n    return from(Promise.resolve(value));\n  }\n\n  return of(value);\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nfunction createEmptyUrlTree() {\n  return new UrlTree(new UrlSegmentGroup([], {}), {}, null);\n}\n\nvar pathCompareMap = {\n  'exact': equalSegmentGroups,\n  'subset': containsSegmentGroup\n};\nvar paramCompareMap = {\n  'exact': equalParams,\n  'subset': containsParams,\n  'ignored': function ignored() {\n    return true;\n  }\n};\n\nfunction containsTree(container, containee, options) {\n  return pathCompareMap[options.paths](container.root, containee.root, options.matrixParams) && paramCompareMap[options.queryParams](container.queryParams, containee.queryParams) && !(options.fragment === 'exact' && container.fragment !== containee.fragment);\n}\n\nfunction equalParams(container, containee) {\n  // TODO: This does not handle array params correctly.\n  return shallowEqual(container, containee);\n}\n\nfunction equalSegmentGroups(container, containee, matrixParams) {\n  if (!equalPath(container.segments, containee.segments)) return false;\n\n  if (!matrixParamsMatch(container.segments, containee.segments, matrixParams)) {\n    return false;\n  }\n\n  if (container.numberOfChildren !== containee.numberOfChildren) return false;\n\n  for (var c in containee.children) {\n    if (!container.children[c]) return false;\n    if (!equalSegmentGroups(container.children[c], containee.children[c], matrixParams)) return false;\n  }\n\n  return true;\n}\n\nfunction containsParams(container, containee) {\n  return Object.keys(containee).length <= Object.keys(container).length && Object.keys(containee).every(function (key) {\n    return equalArraysOrString(container[key], containee[key]);\n  });\n}\n\nfunction containsSegmentGroup(container, containee, matrixParams) {\n  return containsSegmentGroupHelper(container, containee, containee.segments, matrixParams);\n}\n\nfunction containsSegmentGroupHelper(container, containee, containeePaths, matrixParams) {\n  if (container.segments.length > containeePaths.length) {\n    var current = container.segments.slice(0, containeePaths.length);\n    if (!equalPath(current, containeePaths)) return false;\n    if (containee.hasChildren()) return false;\n    if (!matrixParamsMatch(current, containeePaths, matrixParams)) return false;\n    return true;\n  } else if (container.segments.length === containeePaths.length) {\n    if (!equalPath(container.segments, containeePaths)) return false;\n    if (!matrixParamsMatch(container.segments, containeePaths, matrixParams)) return false;\n\n    for (var c in containee.children) {\n      if (!container.children[c]) return false;\n\n      if (!containsSegmentGroup(container.children[c], containee.children[c], matrixParams)) {\n        return false;\n      }\n    }\n\n    return true;\n  } else {\n    var _current = containeePaths.slice(0, container.segments.length);\n\n    var next = containeePaths.slice(container.segments.length);\n    if (!equalPath(container.segments, _current)) return false;\n    if (!matrixParamsMatch(container.segments, _current, matrixParams)) return false;\n    if (!container.children[PRIMARY_OUTLET]) return false;\n    return containsSegmentGroupHelper(container.children[PRIMARY_OUTLET], containee, next, matrixParams);\n  }\n}\n\nfunction matrixParamsMatch(containerPaths, containeePaths, options) {\n  return containeePaths.every(function (containeeSegment, i) {\n    return paramCompareMap[options](containerPaths[i].parameters, containeeSegment.parameters);\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 */\n\n\nvar UrlTree = /*#__PURE__*/function () {\n  /** @internal */\n  function UrlTree(\n  /** The root segment group of the URL tree */\n  root,\n  /** The query params of the URL */\n  queryParams,\n  /** The fragment of the URL */\n  fragment) {\n    _classCallCheck(this, UrlTree);\n\n    this.root = root;\n    this.queryParams = queryParams;\n    this.fragment = fragment;\n  }\n\n  _createClass(UrlTree, [{\n    key: \"queryParamMap\",\n    get: function get() {\n      if (!this._queryParamMap) {\n        this._queryParamMap = convertToParamMap(this.queryParams);\n      }\n\n      return this._queryParamMap;\n    }\n    /** @docsNotRequired */\n\n  }, {\n    key: \"toString\",\n    value: function toString() {\n      return DEFAULT_SERIALIZER.serialize(this);\n    }\n  }]);\n\n  return UrlTree;\n}();\n/**\n * @description\n *\n * Represents the parsed URL segment group.\n *\n * See `UrlTree` for more information.\n *\n * @publicApi\n */\n\n\nvar UrlSegmentGroup = /*#__PURE__*/function () {\n  function UrlSegmentGroup(\n  /** The URL segments of this group. See `UrlSegment` for more information */\n  segments,\n  /** The list of children of this group */\n  children) {\n    var _this10 = this;\n\n    _classCallCheck(this, UrlSegmentGroup);\n\n    this.segments = segments;\n    this.children = children;\n    /** The parent node in the url tree */\n\n    this.parent = null;\n    forEach(children, function (v, k) {\n      return v.parent = _this10;\n    });\n  }\n  /** Whether the segment has child segments */\n\n\n  _createClass(UrlSegmentGroup, [{\n    key: \"hasChildren\",\n    value: function hasChildren() {\n      return this.numberOfChildren > 0;\n    }\n    /** Number of child segments */\n\n  }, {\n    key: \"numberOfChildren\",\n    get: function get() {\n      return Object.keys(this.children).length;\n    }\n    /** @docsNotRequired */\n\n  }, {\n    key: \"toString\",\n    value: function toString() {\n      return serializePaths(this);\n    }\n  }]);\n\n  return UrlSegmentGroup;\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 */\n\n\nvar UrlSegment = /*#__PURE__*/function () {\n  function UrlSegment(\n  /** The path part of a URL segment */\n  path,\n  /** The matrix parameters associated with a segment */\n  parameters) {\n    _classCallCheck(this, UrlSegment);\n\n    this.path = path;\n    this.parameters = parameters;\n  }\n\n  _createClass(UrlSegment, [{\n    key: \"parameterMap\",\n    get: function get() {\n      if (!this._parameterMap) {\n        this._parameterMap = convertToParamMap(this.parameters);\n      }\n\n      return this._parameterMap;\n    }\n    /** @docsNotRequired */\n\n  }, {\n    key: \"toString\",\n    value: function toString() {\n      return serializePath(this);\n    }\n  }]);\n\n  return UrlSegment;\n}();\n\nfunction equalSegments(as, bs) {\n  return equalPath(as, bs) && as.every(function (a, i) {\n    return shallowEqual(a.parameters, bs[i].parameters);\n  });\n}\n\nfunction equalPath(as, bs) {\n  if (as.length !== bs.length) return false;\n  return as.every(function (a, i) {\n    return a.path === bs[i].path;\n  });\n}\n\nfunction mapChildrenIntoArray(segment, fn) {\n  var res = [];\n  forEach(segment.children, function (child, childOutlet) {\n    if (childOutlet === PRIMARY_OUTLET) {\n      res = res.concat(fn(child, childOutlet));\n    }\n  });\n  forEach(segment.children, function (child, childOutlet) {\n    if (childOutlet !== PRIMARY_OUTLET) {\n      res = res.concat(fn(child, childOutlet));\n    }\n  });\n  return res;\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 */\n\n\nvar UrlSerializer = /*#__PURE__*/_createClass(function UrlSerializer() {\n  _classCallCheck(this, UrlSerializer);\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 */\n\n\nvar DefaultUrlSerializer = /*#__PURE__*/function () {\n  function DefaultUrlSerializer() {\n    _classCallCheck(this, DefaultUrlSerializer);\n  }\n\n  _createClass(DefaultUrlSerializer, [{\n    key: \"parse\",\n    value:\n    /** Parses a url into a `UrlTree` */\n    function parse(url) {\n      var p = new UrlParser(url);\n      return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n    }\n    /** Converts a `UrlTree` into a url */\n\n  }, {\n    key: \"serialize\",\n    value: function serialize(tree) {\n      var segment = \"/\".concat(serializeSegment(tree.root, true));\n      var query = serializeQueryParams(tree.queryParams);\n      var fragment = typeof tree.fragment === \"string\" ? \"#\".concat(encodeUriFragment(tree.fragment)) : '';\n      return \"\".concat(segment).concat(query).concat(fragment);\n    }\n  }]);\n\n  return DefaultUrlSerializer;\n}();\n\nvar DEFAULT_SERIALIZER = /*@__PURE__*/new DefaultUrlSerializer();\n\nfunction serializePaths(segment) {\n  return segment.segments.map(function (p) {\n    return serializePath(p);\n  }).join('/');\n}\n\nfunction serializeSegment(segment, root) {\n  if (!segment.hasChildren()) {\n    return serializePaths(segment);\n  }\n\n  if (root) {\n    var primary = segment.children[PRIMARY_OUTLET] ? serializeSegment(segment.children[PRIMARY_OUTLET], false) : '';\n    var children = [];\n    forEach(segment.children, function (v, k) {\n      if (k !== PRIMARY_OUTLET) {\n        children.push(\"\".concat(k, \":\").concat(serializeSegment(v, false)));\n      }\n    });\n    return children.length > 0 ? \"\".concat(primary, \"(\").concat(children.join('//'), \")\") : primary;\n  } else {\n    var _children = mapChildrenIntoArray(segment, function (v, k) {\n      if (k === PRIMARY_OUTLET) {\n        return [serializeSegment(segment.children[PRIMARY_OUTLET], false)];\n      }\n\n      return [\"\".concat(k, \":\").concat(serializeSegment(v, false))];\n    }); // use no parenthesis if the only child is a primary outlet route\n\n\n    if (Object.keys(segment.children).length === 1 && segment.children[PRIMARY_OUTLET] != null) {\n      return \"\".concat(serializePaths(segment), \"/\").concat(_children[0]);\n    }\n\n    return \"\".concat(serializePaths(segment), \"/(\").concat(_children.join('//'), \")\");\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 */\n\n\nfunction encodeUriString(s) {\n  return encodeURIComponent(s).replace(/%40/g, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',');\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 */\n\n\nfunction encodeUriQuery(s) {\n  return encodeUriString(s).replace(/%3B/gi, ';');\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 */\n\n\nfunction encodeUriFragment(s) {\n  return encodeURI(s);\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 */\n\n\nfunction encodeUriSegment(s) {\n  return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}\n\nfunction decode(s) {\n  return decodeURIComponent(s);\n} // Query keys/values should have the \"+\" replaced first, as \"+\" in a query string is \" \".\n// decodeURIComponent function will not decode \"+\" as a space.\n\n\nfunction decodeQuery(s) {\n  return decode(s.replace(/\\+/g, '%20'));\n}\n\nfunction serializePath(path) {\n  return \"\".concat(encodeUriSegment(path.path)).concat(serializeMatrixParams(path.parameters));\n}\n\nfunction serializeMatrixParams(params) {\n  return Object.keys(params).map(function (key) {\n    return \";\".concat(encodeUriSegment(key), \"=\").concat(encodeUriSegment(params[key]));\n  }).join('');\n}\n\nfunction serializeQueryParams(params) {\n  var strParams = Object.keys(params).map(function (name) {\n    var value = params[name];\n    return Array.isArray(value) ? value.map(function (v) {\n      return \"\".concat(encodeUriQuery(name), \"=\").concat(encodeUriQuery(v));\n    }).join('&') : \"\".concat(encodeUriQuery(name), \"=\").concat(encodeUriQuery(value));\n  }).filter(function (s) {\n    return !!s;\n  });\n  return strParams.length ? \"?\".concat(strParams.join('&')) : '';\n}\n\nvar SEGMENT_RE = /^[^\\/()?;=#]+/;\n\nfunction matchSegments(str) {\n  var match = str.match(SEGMENT_RE);\n  return match ? match[0] : '';\n}\n\nvar QUERY_PARAM_RE = /^[^=?&#]+/; // Return the name of the query param at the start of the string or an empty string\n\nfunction matchQueryParams(str) {\n  var match = str.match(QUERY_PARAM_RE);\n  return match ? match[0] : '';\n}\n\nvar QUERY_PARAM_VALUE_RE = /^[^?&#]+/; // Return the value of the query param at the start of the string or an empty string\n\nfunction matchUrlQueryParamValue(str) {\n  var match = str.match(QUERY_PARAM_VALUE_RE);\n  return match ? match[0] : '';\n}\n\nvar UrlParser = /*#__PURE__*/function () {\n  function UrlParser(url) {\n    _classCallCheck(this, UrlParser);\n\n    this.url = url;\n    this.remaining = url;\n  }\n\n  _createClass(UrlParser, [{\n    key: \"parseRootSegment\",\n    value: function parseRootSegment() {\n      this.consumeOptional('/');\n\n      if (this.remaining === '' || this.peekStartsWith('?') || this.peekStartsWith('#')) {\n        return new UrlSegmentGroup([], {});\n      } // The root segment group never has segments\n\n\n      return new UrlSegmentGroup([], this.parseChildren());\n    }\n  }, {\n    key: \"parseQueryParams\",\n    value: function parseQueryParams() {\n      var params = {};\n\n      if (this.consumeOptional('?')) {\n        do {\n          this.parseQueryParam(params);\n        } while (this.consumeOptional('&'));\n      }\n\n      return params;\n    }\n  }, {\n    key: \"parseFragment\",\n    value: function parseFragment() {\n      return this.consumeOptional('#') ? decodeURIComponent(this.remaining) : null;\n    }\n  }, {\n    key: \"parseChildren\",\n    value: function parseChildren() {\n      if (this.remaining === '') {\n        return {};\n      }\n\n      this.consumeOptional('/');\n      var segments = [];\n\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      var children = {};\n\n      if (this.peekStartsWith('/(')) {\n        this.capture('/');\n        children = this.parseParens(true);\n      }\n\n      var res = {};\n\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    } // parse a segment with its matrix parameters\n    // ie `name;k1=v1;k2`\n\n  }, {\n    key: \"parseSegment\",\n    value: function parseSegment() {\n      var path = matchSegments(this.remaining);\n\n      if (path === '' && this.peekStartsWith(';')) {\n        throw new Error(\"Empty path url segment cannot have parameters: '\".concat(this.remaining, \"'.\"));\n      }\n\n      this.capture(path);\n      return new UrlSegment(decode(path), this.parseMatrixParams());\n    }\n  }, {\n    key: \"parseMatrixParams\",\n    value: function parseMatrixParams() {\n      var params = {};\n\n      while (this.consumeOptional(';')) {\n        this.parseParam(params);\n      }\n\n      return params;\n    }\n  }, {\n    key: \"parseParam\",\n    value: function parseParam(params) {\n      var key = matchSegments(this.remaining);\n\n      if (!key) {\n        return;\n      }\n\n      this.capture(key);\n      var value = '';\n\n      if (this.consumeOptional('=')) {\n        var valueMatch = matchSegments(this.remaining);\n\n        if (valueMatch) {\n          value = valueMatch;\n          this.capture(value);\n        }\n      }\n\n      params[decode(key)] = decode(value);\n    } // Parse a single query parameter `name[=value]`\n\n  }, {\n    key: \"parseQueryParam\",\n    value: function parseQueryParam(params) {\n      var key = matchQueryParams(this.remaining);\n\n      if (!key) {\n        return;\n      }\n\n      this.capture(key);\n      var value = '';\n\n      if (this.consumeOptional('=')) {\n        var valueMatch = matchUrlQueryParamValue(this.remaining);\n\n        if (valueMatch) {\n          value = valueMatch;\n          this.capture(value);\n        }\n      }\n\n      var decodedKey = decodeQuery(key);\n      var decodedVal = decodeQuery(value);\n\n      if (params.hasOwnProperty(decodedKey)) {\n        // Append to existing values\n        var currentVal = params[decodedKey];\n\n        if (!Array.isArray(currentVal)) {\n          currentVal = [currentVal];\n          params[decodedKey] = currentVal;\n        }\n\n        currentVal.push(decodedVal);\n      } else {\n        // Create a new value\n        params[decodedKey] = decodedVal;\n      }\n    } // parse `(a/b//outlet_name:c/d)`\n\n  }, {\n    key: \"parseParens\",\n    value: function parseParens(allowPrimary) {\n      var segments = {};\n      this.capture('(');\n\n      while (!this.consumeOptional(')') && this.remaining.length > 0) {\n        var path = matchSegments(this.remaining);\n        var next = this.remaining[path.length]; // if is is not one of these characters, then the segment was unescaped\n        // or the group was not closed\n\n        if (next !== '/' && next !== ')' && next !== ';') {\n          throw new Error(\"Cannot parse url '\".concat(this.url, \"'\"));\n        }\n\n        var outletName = undefined;\n\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        var children = this.parseChildren();\n        segments[outletName] = Object.keys(children).length === 1 ? children[PRIMARY_OUTLET] : new UrlSegmentGroup([], children);\n        this.consumeOptional('//');\n      }\n\n      return segments;\n    }\n  }, {\n    key: \"peekStartsWith\",\n    value: function peekStartsWith(str) {\n      return this.remaining.startsWith(str);\n    } // Consumes the prefix when it is present and returns whether it has been consumed\n\n  }, {\n    key: \"consumeOptional\",\n    value: function consumeOptional(str) {\n      if (this.peekStartsWith(str)) {\n        this.remaining = this.remaining.substring(str.length);\n        return true;\n      }\n\n      return false;\n    }\n  }, {\n    key: \"capture\",\n    value: function capture(str) {\n      if (!this.consumeOptional(str)) {\n        throw new Error(\"Expected \\\"\".concat(str, \"\\\".\"));\n      }\n    }\n  }]);\n\n  return UrlParser;\n}();\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nvar Tree = /*#__PURE__*/function () {\n  function Tree(root) {\n    _classCallCheck(this, Tree);\n\n    this._root = root;\n  }\n\n  _createClass(Tree, [{\n    key: \"root\",\n    get: function get() {\n      return this._root.value;\n    }\n    /**\n     * @internal\n     */\n\n  }, {\n    key: \"parent\",\n    value: function parent(t) {\n      var p = this.pathFromRoot(t);\n      return p.length > 1 ? p[p.length - 2] : null;\n    }\n    /**\n     * @internal\n     */\n\n  }, {\n    key: \"children\",\n    value: function children(t) {\n      var n = findNode(t, this._root);\n      return n ? n.children.map(function (t) {\n        return t.value;\n      }) : [];\n    }\n    /**\n     * @internal\n     */\n\n  }, {\n    key: \"firstChild\",\n    value: function firstChild(t) {\n      var n = findNode(t, this._root);\n      return n && n.children.length > 0 ? n.children[0].value : null;\n    }\n    /**\n     * @internal\n     */\n\n  }, {\n    key: \"siblings\",\n    value: function siblings(t) {\n      var p = findPath(t, this._root);\n      if (p.length < 2) return [];\n      var c = p[p.length - 2].children.map(function (c) {\n        return c.value;\n      });\n      return c.filter(function (cc) {\n        return cc !== t;\n      });\n    }\n    /**\n     * @internal\n     */\n\n  }, {\n    key: \"pathFromRoot\",\n    value: function pathFromRoot(t) {\n      return findPath(t, this._root).map(function (s) {\n        return s.value;\n      });\n    }\n  }]);\n\n  return Tree;\n}(); // DFS for the node matching the value\n\n\nfunction findNode(value, node) {\n  if (value === node.value) return node;\n\n  var _iterator = _createForOfIteratorHelper(node.children),\n      _step;\n\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var child = _step.value;\n\n      var _node = findNode(value, child);\n\n      if (_node) return _node;\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n\n  return null;\n} // Return the path to the node with the given value using DFS\n\n\nfunction findPath(value, node) {\n  if (value === node.value) return [node];\n\n  var _iterator2 = _createForOfIteratorHelper(node.children),\n      _step2;\n\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var child = _step2.value;\n      var path = findPath(value, child);\n\n      if (path.length) {\n        path.unshift(node);\n        return path;\n      }\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n\n  return [];\n}\n\nvar TreeNode = /*#__PURE__*/function () {\n  function TreeNode(value, children) {\n    _classCallCheck(this, TreeNode);\n\n    this.value = value;\n    this.children = children;\n  }\n\n  _createClass(TreeNode, [{\n    key: \"toString\",\n    value: function toString() {\n      return \"TreeNode(\".concat(this.value, \")\");\n    }\n  }]);\n\n  return TreeNode;\n}(); // Return the list of T indexed by outlet name\n\n\nfunction nodeChildrenAsMap(node) {\n  var map = {};\n\n  if (node) {\n    node.children.forEach(function (child) {\n      return map[child.value.outlet] = child;\n    });\n  }\n\n  return map;\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Represents the state of the router as a tree of activated routes.\n *\n * @usageNotes\n *\n * Every node in the route tree is an `ActivatedRoute` instance\n * that knows about the \"consumed\" URL segments, the extracted parameters,\n * and the resolved data.\n * Use the `ActivatedRoute` properties to traverse the tree from any node.\n *\n * The following fragment shows how a component gets the root node\n * of the current state to establish its own route tree:\n *\n * ```\n * @Component({templateUrl:'template.html'})\n * class MyComponent {\n *   constructor(router: Router) {\n *     const state: RouterState = router.routerState;\n *     const root: ActivatedRoute = state.root;\n *     const child = root.firstChild;\n *     const id: Observable<string> = child.params.map(p => p.id);\n *     //...\n *   }\n * }\n * ```\n *\n * @see `ActivatedRoute`\n * @see [Getting route information](guide/router#getting-route-information)\n *\n * @publicApi\n */\n\n\nvar RouterState = /*#__PURE__*/function (_Tree) {\n  _inherits(RouterState, _Tree);\n\n  var _super10 = _createSuper(RouterState);\n\n  /** @internal */\n  function RouterState(root,\n  /** The current snapshot of the router state */\n  snapshot) {\n    var _this11;\n\n    _classCallCheck(this, RouterState);\n\n    _this11 = _super10.call(this, root);\n    _this11.snapshot = snapshot;\n    setRouterState(_assertThisInitialized(_this11), root);\n    return _this11;\n  }\n\n  _createClass(RouterState, [{\n    key: \"toString\",\n    value: function toString() {\n      return this.snapshot.toString();\n    }\n  }]);\n\n  return RouterState;\n}(Tree);\n\nfunction createEmptyState(urlTree, rootComponent) {\n  var snapshot = createEmptyStateSnapshot(urlTree, rootComponent);\n  var emptyUrl = new BehaviorSubject([new UrlSegment('', {})]);\n  var emptyParams = new BehaviorSubject({});\n  var emptyData = new BehaviorSubject({});\n  var emptyQueryParams = new BehaviorSubject({});\n  var fragment = new BehaviorSubject('');\n  var activated = new ActivatedRoute(emptyUrl, emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, snapshot.root);\n  activated.snapshot = snapshot.root;\n  return new RouterState(new TreeNode(activated, []), snapshot);\n}\n\nfunction createEmptyStateSnapshot(urlTree, rootComponent) {\n  var emptyParams = {};\n  var emptyData = {};\n  var emptyQueryParams = {};\n  var fragment = '';\n  var activated = new ActivatedRouteSnapshot([], emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, null, urlTree.root, -1, {});\n  return new RouterStateSnapshot('', new TreeNode(activated, []));\n}\n/**\n * Provides access to information about a route associated with a component\n * that is loaded in an outlet.\n * Use to traverse the `RouterState` tree and extract information from nodes.\n *\n * The following example shows how to construct a component using information from a\n * currently activated route.\n *\n * Note: the observables in this class only emit when the current and previous values differ based\n * on shallow equality. For example, changing deeply nested properties in resolved `data` will not\n * cause the `ActivatedRoute.data` `Observable` to emit a new value.\n *\n * {@example router/activated-route/module.ts region=\"activated-route\"\n *     header=\"activated-route.component.ts\"}\n *\n * @see [Getting route information](guide/router#getting-route-information)\n *\n * @publicApi\n */\n\n\nvar ActivatedRoute = /*#__PURE__*/function () {\n  /** @internal */\n  function ActivatedRoute(\n  /** An observable of the URL segments matched by this route. */\n  url,\n  /** An observable of the matrix parameters scoped to this route. */\n  params,\n  /** An observable of the query parameters shared by all the routes. */\n  queryParams,\n  /** An observable of the URL fragment shared by all the routes. */\n  fragment,\n  /** An observable of the static and resolved data of this route. */\n  data,\n  /** The outlet name of the route, a constant. */\n  outlet,\n  /** The component of the route, a constant. */\n  // TODO(vsavkin): remove |string\n  component, futureSnapshot) {\n    _classCallCheck(this, ActivatedRoute);\n\n    this.url = url;\n    this.params = params;\n    this.queryParams = queryParams;\n    this.fragment = fragment;\n    this.data = data;\n    this.outlet = outlet;\n    this.component = component;\n    this._futureSnapshot = futureSnapshot;\n  }\n  /** The configuration used to match this route. */\n\n\n  _createClass(ActivatedRoute, [{\n    key: \"routeConfig\",\n    get: function get() {\n      return this._futureSnapshot.routeConfig;\n    }\n    /** The root of the router state. */\n\n  }, {\n    key: \"root\",\n    get: function get() {\n      return this._routerState.root;\n    }\n    /** The parent of this route in the router state tree. */\n\n  }, {\n    key: \"parent\",\n    get: function get() {\n      return this._routerState.parent(this);\n    }\n    /** The first child of this route in the router state tree. */\n\n  }, {\n    key: \"firstChild\",\n    get: function get() {\n      return this._routerState.firstChild(this);\n    }\n    /** The children of this route in the router state tree. */\n\n  }, {\n    key: \"children\",\n    get: function get() {\n      return this._routerState.children(this);\n    }\n    /** The path from the root of the router state tree to this route. */\n\n  }, {\n    key: \"pathFromRoot\",\n    get: function get() {\n      return this._routerState.pathFromRoot(this);\n    }\n    /**\n     * An Observable that contains a map of the required and optional parameters\n     * specific to the route.\n     * The map supports retrieving single and multiple values from the same parameter.\n     */\n\n  }, {\n    key: \"paramMap\",\n    get: function get() {\n      if (!this._paramMap) {\n        this._paramMap = this.params.pipe(map(function (p) {\n          return convertToParamMap(p);\n        }));\n      }\n\n      return this._paramMap;\n    }\n    /**\n     * An Observable that contains a map of the query parameters available to all routes.\n     * The map supports retrieving single and multiple values from the query parameter.\n     */\n\n  }, {\n    key: \"queryParamMap\",\n    get: function get() {\n      if (!this._queryParamMap) {\n        this._queryParamMap = this.queryParams.pipe(map(function (p) {\n          return convertToParamMap(p);\n        }));\n      }\n\n      return this._queryParamMap;\n    }\n  }, {\n    key: \"toString\",\n    value: function toString() {\n      return this.snapshot ? this.snapshot.toString() : \"Future(\".concat(this._futureSnapshot, \")\");\n    }\n  }]);\n\n  return ActivatedRoute;\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 */\n\n\nfunction inheritedParamsDataResolve(route) {\n  var paramsInheritanceStrategy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'emptyOnly';\n  var pathFromRoot = route.pathFromRoot;\n  var inheritingStartingFrom = 0;\n\n  if (paramsInheritanceStrategy !== 'always') {\n    inheritingStartingFrom = pathFromRoot.length - 1;\n\n    while (inheritingStartingFrom >= 1) {\n      var current = pathFromRoot[inheritingStartingFrom];\n      var parent = pathFromRoot[inheritingStartingFrom - 1]; // current route is an empty path => inherits its parent's params and data\n\n      if (current.routeConfig && current.routeConfig.path === '') {\n        inheritingStartingFrom--; // parent is componentless => current route should inherit its params and data\n      } else if (!parent.component) {\n        inheritingStartingFrom--;\n      } else {\n        break;\n      }\n    }\n  }\n\n  return flattenInherited(pathFromRoot.slice(inheritingStartingFrom));\n}\n/** @internal */\n\n\nfunction flattenInherited(pathFromRoot) {\n  return pathFromRoot.reduce(function (res, curr) {\n    var params = Object.assign(Object.assign({}, res.params), curr.params);\n    var data = Object.assign(Object.assign({}, res.data), curr.data);\n    var resolve = Object.assign(Object.assign({}, res.resolve), curr._resolvedData);\n    return {\n      params: params,\n      data: data,\n      resolve: resolve\n    };\n  }, {\n    params: {},\n    data: {},\n    resolve: {}\n  });\n}\n/**\n * @description\n *\n * Contains the information about a route associated with a component loaded in an\n * outlet at a particular moment in time. ActivatedRouteSnapshot can also be used to\n * traverse the router state tree.\n *\n * The following example initializes a component with route information extracted\n * from the snapshot of the root node at the time of creation.\n *\n * ```\n * @Component({templateUrl:'./my-component.html'})\n * class MyComponent {\n *   constructor(route: ActivatedRoute) {\n *     const id: string = route.snapshot.params.id;\n *     const url: string = route.snapshot.url.join('');\n *     const user = route.snapshot.data.user;\n *   }\n * }\n * ```\n *\n * @publicApi\n */\n\n\nvar ActivatedRouteSnapshot = /*#__PURE__*/function () {\n  /** @internal */\n  function ActivatedRouteSnapshot(\n  /** The URL segments matched by this route */\n  url,\n  /**\n   *  The matrix parameters scoped to this route.\n   *\n   *  You can compute all params (or data) in the router state or to get params outside\n   *  of an activated component by traversing the `RouterState` tree as in the following\n   *  example:\n   *  ```\n   *  collectRouteParams(router: Router) {\n   *    let params = {};\n   *    let stack: ActivatedRouteSnapshot[] = [router.routerState.snapshot.root];\n   *    while (stack.length > 0) {\n   *      const route = stack.pop()!;\n   *      params = {...params, ...route.params};\n   *      stack.push(...route.children);\n   *    }\n   *    return params;\n   *  }\n   *  ```\n   */\n  params,\n  /** The query parameters shared by all the routes */\n  queryParams,\n  /** The URL fragment shared by all the routes */\n  fragment,\n  /** The static and resolved data of this route */\n  data,\n  /** The outlet name of the route */\n  outlet,\n  /** The component of the route */\n  component, routeConfig, urlSegment, lastPathIndex, resolve) {\n    _classCallCheck(this, ActivatedRouteSnapshot);\n\n    this.url = url;\n    this.params = params;\n    this.queryParams = queryParams;\n    this.fragment = fragment;\n    this.data = data;\n    this.outlet = outlet;\n    this.component = component;\n    this.routeConfig = routeConfig;\n    this._urlSegment = urlSegment;\n    this._lastPathIndex = lastPathIndex;\n    this._resolve = resolve;\n  }\n  /** The root of the router state */\n\n\n  _createClass(ActivatedRouteSnapshot, [{\n    key: \"root\",\n    get: function get() {\n      return this._routerState.root;\n    }\n    /** The parent of this route in the router state tree */\n\n  }, {\n    key: \"parent\",\n    get: function get() {\n      return this._routerState.parent(this);\n    }\n    /** The first child of this route in the router state tree */\n\n  }, {\n    key: \"firstChild\",\n    get: function get() {\n      return this._routerState.firstChild(this);\n    }\n    /** The children of this route in the router state tree */\n\n  }, {\n    key: \"children\",\n    get: function get() {\n      return this._routerState.children(this);\n    }\n    /** The path from the root of the router state tree to this route */\n\n  }, {\n    key: \"pathFromRoot\",\n    get: function get() {\n      return this._routerState.pathFromRoot(this);\n    }\n  }, {\n    key: \"paramMap\",\n    get: function get() {\n      if (!this._paramMap) {\n        this._paramMap = convertToParamMap(this.params);\n      }\n\n      return this._paramMap;\n    }\n  }, {\n    key: \"queryParamMap\",\n    get: function get() {\n      if (!this._queryParamMap) {\n        this._queryParamMap = convertToParamMap(this.queryParams);\n      }\n\n      return this._queryParamMap;\n    }\n  }, {\n    key: \"toString\",\n    value: function toString() {\n      var url = this.url.map(function (segment) {\n        return segment.toString();\n      }).join('/');\n      var matched = this.routeConfig ? this.routeConfig.path : '';\n      return \"Route(url:'\".concat(url, \"', path:'\").concat(matched, \"')\");\n    }\n  }]);\n\n  return ActivatedRouteSnapshot;\n}();\n/**\n * @description\n *\n * Represents the state of the router at a moment in time.\n *\n * This is a tree of activated route snapshots. Every node in this tree knows about\n * the \"consumed\" URL segments, the extracted parameters, and the resolved data.\n *\n * The following example shows how a component is initialized with information\n * from the snapshot of the root node's state at the time of creation.\n *\n * ```\n * @Component({templateUrl:'template.html'})\n * class MyComponent {\n *   constructor(router: Router) {\n *     const state: RouterState = router.routerState;\n *     const snapshot: RouterStateSnapshot = state.snapshot;\n *     const root: ActivatedRouteSnapshot = snapshot.root;\n *     const child = root.firstChild;\n *     const id: Observable<string> = child.params.map(p => p.id);\n *     //...\n *   }\n * }\n * ```\n *\n * @publicApi\n */\n\n\nvar RouterStateSnapshot = /*#__PURE__*/function (_Tree2) {\n  _inherits(RouterStateSnapshot, _Tree2);\n\n  var _super11 = _createSuper(RouterStateSnapshot);\n\n  /** @internal */\n  function RouterStateSnapshot(\n  /** The url from which this snapshot was created */\n  url, root) {\n    var _this12;\n\n    _classCallCheck(this, RouterStateSnapshot);\n\n    _this12 = _super11.call(this, root);\n    _this12.url = url;\n    setRouterState(_assertThisInitialized(_this12), root);\n    return _this12;\n  }\n\n  _createClass(RouterStateSnapshot, [{\n    key: \"toString\",\n    value: function toString() {\n      return serializeNode(this._root);\n    }\n  }]);\n\n  return RouterStateSnapshot;\n}(Tree);\n\nfunction setRouterState(state, node) {\n  node.value._routerState = state;\n  node.children.forEach(function (c) {\n    return setRouterState(state, c);\n  });\n}\n\nfunction serializeNode(node) {\n  var c = node.children.length > 0 ? \" { \".concat(node.children.map(serializeNode).join(', '), \" } \") : '';\n  return \"\".concat(node.value).concat(c);\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 */\n\n\nfunction advanceActivatedRoute(route) {\n  if (route.snapshot) {\n    var currentSnapshot = route.snapshot;\n    var nextSnapshot = route._futureSnapshot;\n    route.snapshot = nextSnapshot;\n\n    if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) {\n      route.queryParams.next(nextSnapshot.queryParams);\n    }\n\n    if (currentSnapshot.fragment !== nextSnapshot.fragment) {\n      route.fragment.next(nextSnapshot.fragment);\n    }\n\n    if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) {\n      route.params.next(nextSnapshot.params);\n    }\n\n    if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) {\n      route.url.next(nextSnapshot.url);\n    }\n\n    if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) {\n      route.data.next(nextSnapshot.data);\n    }\n  } else {\n    route.snapshot = route._futureSnapshot; // this is for resolved data\n\n    route.data.next(route._futureSnapshot.data);\n  }\n}\n\nfunction equalParamsAndUrlSegments(a, b) {\n  var equalUrlParams = shallowEqual(a.params, b.params) && equalSegments(a.url, b.url);\n  var parentsMismatch = !a.parent !== !b.parent;\n  return equalUrlParams && !parentsMismatch && (!a.parent || equalParamsAndUrlSegments(a.parent, b.parent));\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nfunction createRouterState(routeReuseStrategy, curr, prevState) {\n  var root = createNode(routeReuseStrategy, curr._root, prevState ? prevState._root : undefined);\n  return new RouterState(root, curr);\n}\n\nfunction createNode(routeReuseStrategy, curr, prevState) {\n  // reuse an activated route that is currently displayed on the screen\n  if (prevState && routeReuseStrategy.shouldReuseRoute(curr.value, prevState.value.snapshot)) {\n    var value = prevState.value;\n    value._futureSnapshot = curr.value;\n    var children = createOrReuseChildren(routeReuseStrategy, curr, prevState);\n    return new TreeNode(value, children);\n  } else {\n    if (routeReuseStrategy.shouldAttach(curr.value)) {\n      // retrieve an activated route that is used to be displayed, but is not currently displayed\n      var detachedRouteHandle = routeReuseStrategy.retrieve(curr.value);\n\n      if (detachedRouteHandle !== null) {\n        var _tree = detachedRouteHandle.route;\n        setFutureSnapshotsOfActivatedRoutes(curr, _tree);\n        return _tree;\n      }\n    }\n\n    var _value = createActivatedRoute(curr.value);\n\n    var _children2 = curr.children.map(function (c) {\n      return createNode(routeReuseStrategy, c);\n    });\n\n    return new TreeNode(_value, _children2);\n  }\n}\n\nfunction setFutureSnapshotsOfActivatedRoutes(curr, result) {\n  if (curr.value.routeConfig !== result.value.routeConfig) {\n    throw new Error('Cannot reattach ActivatedRouteSnapshot created from a different route');\n  }\n\n  if (curr.children.length !== result.children.length) {\n    throw new Error('Cannot reattach ActivatedRouteSnapshot with a different number of children');\n  }\n\n  result.value._futureSnapshot = curr.value;\n\n  for (var i = 0; i < curr.children.length; ++i) {\n    setFutureSnapshotsOfActivatedRoutes(curr.children[i], result.children[i]);\n  }\n}\n\nfunction createOrReuseChildren(routeReuseStrategy, curr, prevState) {\n  return curr.children.map(function (child) {\n    var _iterator3 = _createForOfIteratorHelper(prevState.children),\n        _step3;\n\n    try {\n      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n        var p = _step3.value;\n\n        if (routeReuseStrategy.shouldReuseRoute(child.value, p.value.snapshot)) {\n          return createNode(routeReuseStrategy, child, p);\n        }\n      }\n    } catch (err) {\n      _iterator3.e(err);\n    } finally {\n      _iterator3.f();\n    }\n\n    return createNode(routeReuseStrategy, child);\n  });\n}\n\nfunction createActivatedRoute(c) {\n  return new ActivatedRoute(new BehaviorSubject(c.url), new BehaviorSubject(c.params), new BehaviorSubject(c.queryParams), new BehaviorSubject(c.fragment), new BehaviorSubject(c.data), c.outlet, c.component, c);\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nfunction _createUrlTree(route, urlTree, commands, queryParams, fragment) {\n  if (commands.length === 0) {\n    return tree(urlTree.root, urlTree.root, urlTree, queryParams, fragment);\n  }\n\n  var nav = computeNavigation(commands);\n\n  if (nav.toRoot()) {\n    return tree(urlTree.root, new UrlSegmentGroup([], {}), urlTree, queryParams, fragment);\n  }\n\n  var startingPosition = findStartingPosition(nav, urlTree, route);\n  var segmentGroup = startingPosition.processChildren ? updateSegmentGroupChildren(startingPosition.segmentGroup, startingPosition.index, nav.commands) : updateSegmentGroup(startingPosition.segmentGroup, startingPosition.index, nav.commands);\n  return tree(startingPosition.segmentGroup, segmentGroup, urlTree, queryParams, fragment);\n}\n\nfunction isMatrixParams(command) {\n  return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath;\n}\n/**\n * Determines if a given command has an `outlets` map. When we encounter a command\n * with an outlets k/v map, we need to apply each outlet individually to the existing segment.\n */\n\n\nfunction isCommandWithOutlets(command) {\n  return typeof command === 'object' && command != null && command.outlets;\n}\n\nfunction tree(oldSegmentGroup, newSegmentGroup, urlTree, queryParams, fragment) {\n  var qp = {};\n\n  if (queryParams) {\n    forEach(queryParams, function (value, name) {\n      qp[name] = Array.isArray(value) ? value.map(function (v) {\n        return \"\".concat(v);\n      }) : \"\".concat(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(current, oldSegment, newSegment) {\n  var children = {};\n  forEach(current.children, function (c, outletName) {\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\nvar Navigation = /*#__PURE__*/function () {\n  function Navigation(isAbsolute, numberOfDoubleDots, commands) {\n    _classCallCheck(this, Navigation);\n\n    this.isAbsolute = isAbsolute;\n    this.numberOfDoubleDots = numberOfDoubleDots;\n    this.commands = commands;\n\n    if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {\n      throw new Error('Root segment cannot have matrix parameters');\n    }\n\n    var cmdWithOutlet = commands.find(isCommandWithOutlets);\n\n    if (cmdWithOutlet && cmdWithOutlet !== last(commands)) {\n      throw new Error('{outlets:{}} has to be the last command');\n    }\n  }\n\n  _createClass(Navigation, [{\n    key: \"toRoot\",\n    value: function toRoot() {\n      return this.isAbsolute && this.commands.length === 1 && this.commands[0] == '/';\n    }\n  }]);\n\n  return Navigation;\n}();\n/** Transforms commands to a normalized `Navigation` */\n\n\nfunction computeNavigation(commands) {\n  if (typeof commands[0] === 'string' && commands.length === 1 && commands[0] === '/') {\n    return new Navigation(true, 0, commands);\n  }\n\n  var numberOfDoubleDots = 0;\n  var isAbsolute = false;\n  var res = commands.reduce(function (res, cmd, cmdIdx) {\n    if (typeof cmd === 'object' && cmd != null) {\n      if (cmd.outlets) {\n        var outlets = {};\n        forEach(cmd.outlets, function (commands, name) {\n          outlets[name] = typeof commands === 'string' ? commands.split('/') : commands;\n        });\n        return [].concat(_toConsumableArray(res), [{\n          outlets: outlets\n        }]);\n      }\n\n      if (cmd.segmentPath) {\n        return [].concat(_toConsumableArray(res), [cmd.segmentPath]);\n      }\n    }\n\n    if (!(typeof cmd === 'string')) {\n      return [].concat(_toConsumableArray(res), [cmd]);\n    }\n\n    if (cmdIdx === 0) {\n      cmd.split('/').forEach(function (urlPart, partIndex) {\n        if (partIndex == 0 && urlPart === '.') {// skip './a'\n        } else if (partIndex == 0 && urlPart === '') {\n          //  '/a'\n          isAbsolute = true;\n        } else if (urlPart === '..') {\n          //  '../a'\n          numberOfDoubleDots++;\n        } else if (urlPart != '') {\n          res.push(urlPart);\n        }\n      });\n      return res;\n    }\n\n    return [].concat(_toConsumableArray(res), [cmd]);\n  }, []);\n  return new Navigation(isAbsolute, numberOfDoubleDots, res);\n}\n\nvar Position = /*#__PURE__*/_createClass(function Position(segmentGroup, processChildren, index) {\n  _classCallCheck(this, Position);\n\n  this.segmentGroup = segmentGroup;\n  this.processChildren = processChildren;\n  this.index = index;\n});\n\nfunction findStartingPosition(nav, tree, route) {\n  if (nav.isAbsolute) {\n    return new Position(tree.root, true, 0);\n  }\n\n  if (route.snapshot._lastPathIndex === -1) {\n    var segmentGroup = route.snapshot._urlSegment; // Pathless ActivatedRoute has _lastPathIndex === -1 but should not process children\n    // see issue #26224, #13011, #35687\n    // However, if the ActivatedRoute is the root we should process children like above.\n\n    var processChildren = segmentGroup === tree.root;\n    return new Position(segmentGroup, processChildren, 0);\n  }\n\n  var modifier = isMatrixParams(nav.commands[0]) ? 0 : 1;\n  var index = route.snapshot._lastPathIndex + modifier;\n  return createPositionApplyingDoubleDots(route.snapshot._urlSegment, index, nav.numberOfDoubleDots);\n}\n\nfunction createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) {\n  var g = group;\n  var ci = index;\n  var dd = numberOfDoubleDots;\n\n  while (dd > ci) {\n    dd -= ci;\n    g = g.parent;\n\n    if (!g) {\n      throw new Error('Invalid number of \\'../\\'');\n    }\n\n    ci = g.segments.length;\n  }\n\n  return new Position(g, false, ci - dd);\n}\n\nfunction getOutlets(commands) {\n  if (isCommandWithOutlets(commands[0])) {\n    return commands[0].outlets;\n  }\n\n  return _defineProperty({}, PRIMARY_OUTLET, commands);\n}\n\nfunction updateSegmentGroup(segmentGroup, startIndex, commands) {\n  if (!segmentGroup) {\n    segmentGroup = new UrlSegmentGroup([], {});\n  }\n\n  if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n    return updateSegmentGroupChildren(segmentGroup, startIndex, commands);\n  }\n\n  var m = prefixedWith(segmentGroup, startIndex, commands);\n  var slicedCommands = commands.slice(m.commandIndex);\n\n  if (m.match && m.pathIndex < segmentGroup.segments.length) {\n    var g = new UrlSegmentGroup(segmentGroup.segments.slice(0, m.pathIndex), {});\n    g.children[PRIMARY_OUTLET] = 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(segmentGroup, startIndex, commands) {\n  if (commands.length === 0) {\n    return new UrlSegmentGroup(segmentGroup.segments, {});\n  } else {\n    var outlets = getOutlets(commands);\n    var children = {};\n    forEach(outlets, function (commands, outlet) {\n      if (typeof commands === 'string') {\n        commands = [commands];\n      }\n\n      if (commands !== null) {\n        children[outlet] = updateSegmentGroup(segmentGroup.children[outlet], startIndex, commands);\n      }\n    });\n    forEach(segmentGroup.children, function (child, childOutlet) {\n      if (outlets[childOutlet] === undefined) {\n        children[childOutlet] = child;\n      }\n    });\n    return new UrlSegmentGroup(segmentGroup.segments, children);\n  }\n}\n\nfunction prefixedWith(segmentGroup, startIndex, commands) {\n  var currentCommandIndex = 0;\n  var currentPathIndex = startIndex;\n  var noMatch = {\n    match: false,\n    pathIndex: 0,\n    commandIndex: 0\n  };\n\n  while (currentPathIndex < segmentGroup.segments.length) {\n    if (currentCommandIndex >= commands.length) return noMatch;\n    var path = segmentGroup.segments[currentPathIndex];\n    var command = commands[currentCommandIndex]; // Do not try to consume command as part of the prefixing if it has outlets because it can\n    // contain outlets other than the one being processed. Consuming the outlets command would\n    // result in other outlets being ignored.\n\n    if (isCommandWithOutlets(command)) {\n      break;\n    }\n\n    var curr = \"\".concat(command);\n    var next = currentCommandIndex < commands.length - 1 ? commands[currentCommandIndex + 1] : null;\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\n    currentPathIndex++;\n  }\n\n  return {\n    match: true,\n    pathIndex: currentPathIndex,\n    commandIndex: currentCommandIndex\n  };\n}\n\nfunction createNewSegmentGroup(segmentGroup, startIndex, commands) {\n  var paths = segmentGroup.segments.slice(0, startIndex);\n  var i = 0;\n\n  while (i < commands.length) {\n    var command = commands[i];\n\n    if (isCommandWithOutlets(command)) {\n      var children = createNewSegmentChildren(command.outlets);\n      return new UrlSegmentGroup(paths, children);\n    } // if we start with an object literal, we need to reuse the path part from the segment\n\n\n    if (i === 0 && isMatrixParams(commands[0])) {\n      var p = segmentGroup.segments[startIndex];\n      paths.push(new UrlSegment(p.path, stringify(commands[0])));\n      i++;\n      continue;\n    }\n\n    var curr = isCommandWithOutlets(command) ? command.outlets[PRIMARY_OUTLET] : \"\".concat(command);\n    var next = i < commands.length - 1 ? commands[i + 1] : null;\n\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\n  return new UrlSegmentGroup(paths, {});\n}\n\nfunction createNewSegmentChildren(outlets) {\n  var children = {};\n  forEach(outlets, function (commands, outlet) {\n    if (typeof commands === 'string') {\n      commands = [commands];\n    }\n\n    if (commands !== null) {\n      children[outlet] = createNewSegmentGroup(new UrlSegmentGroup([], {}), 0, commands);\n    }\n  });\n  return children;\n}\n\nfunction stringify(params) {\n  var res = {};\n  forEach(params, function (v, k) {\n    return res[k] = \"\".concat(v);\n  });\n  return res;\n}\n\nfunction compare(path, params, segment) {\n  return path == segment.path && shallowEqual(params, segment.parameters);\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nvar activateRoutes = function activateRoutes(rootContexts, routeReuseStrategy, forwardEvent) {\n  return map(function (t) {\n    new ActivateRoutes(routeReuseStrategy, t.targetRouterState, t.currentRouterState, forwardEvent).activate(rootContexts);\n    return t;\n  });\n};\n\nvar ActivateRoutes = /*#__PURE__*/function () {\n  function ActivateRoutes(routeReuseStrategy, futureState, currState, forwardEvent) {\n    _classCallCheck(this, ActivateRoutes);\n\n    this.routeReuseStrategy = routeReuseStrategy;\n    this.futureState = futureState;\n    this.currState = currState;\n    this.forwardEvent = forwardEvent;\n  }\n\n  _createClass(ActivateRoutes, [{\n    key: \"activate\",\n    value: function activate(parentContexts) {\n      var futureRoot = this.futureState._root;\n      var currRoot = this.currState ? this.currState._root : null;\n      this.deactivateChildRoutes(futureRoot, currRoot, parentContexts);\n      advanceActivatedRoute(this.futureState.root);\n      this.activateChildRoutes(futureRoot, currRoot, parentContexts);\n    } // De-activate the child route that are not re-used for the future state\n\n  }, {\n    key: \"deactivateChildRoutes\",\n    value: function deactivateChildRoutes(futureNode, currNode, contexts) {\n      var _this13 = this;\n\n      var children = nodeChildrenAsMap(currNode); // Recurse on the routes active in the future state to de-activate deeper children\n\n      futureNode.children.forEach(function (futureChild) {\n        var childOutletName = futureChild.value.outlet;\n\n        _this13.deactivateRoutes(futureChild, children[childOutletName], contexts);\n\n        delete children[childOutletName];\n      }); // De-activate the routes that will not be re-used\n\n      forEach(children, function (v, childName) {\n        _this13.deactivateRouteAndItsChildren(v, contexts);\n      });\n    }\n  }, {\n    key: \"deactivateRoutes\",\n    value: function deactivateRoutes(futureNode, currNode, parentContext) {\n      var future = futureNode.value;\n      var 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          var context = parentContext.getContext(future.outlet);\n\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    key: \"deactivateRouteAndItsChildren\",\n    value: function deactivateRouteAndItsChildren(route, parentContexts) {\n      if (this.routeReuseStrategy.shouldDetach(route.value.snapshot)) {\n        this.detachAndStoreRouteSubtree(route, parentContexts);\n      } else {\n        this.deactivateRouteAndOutlet(route, parentContexts);\n      }\n    }\n  }, {\n    key: \"detachAndStoreRouteSubtree\",\n    value: function detachAndStoreRouteSubtree(route, parentContexts) {\n      var context = parentContexts.getContext(route.value.outlet);\n\n      if (context && context.outlet) {\n        var componentRef = context.outlet.detach();\n        var contexts = context.children.onOutletDeactivated();\n        this.routeReuseStrategy.store(route.value.snapshot, {\n          componentRef: componentRef,\n          route: route,\n          contexts: contexts\n        });\n      }\n    }\n  }, {\n    key: \"deactivateRouteAndOutlet\",\n    value: function deactivateRouteAndOutlet(route, parentContexts) {\n      var context = parentContexts.getContext(route.value.outlet); // The context could be `null` if we are on a componentless route but there may still be\n      // children that need deactivating.\n\n      var contexts = context && route.value.component ? context.children : parentContexts;\n      var children = nodeChildrenAsMap(route);\n\n      for (var _i = 0, _Object$keys = Object.keys(children); _i < _Object$keys.length; _i++) {\n        var childOutlet = _Object$keys[_i];\n        this.deactivateRouteAndItsChildren(children[childOutlet], contexts);\n      }\n\n      if (context && context.outlet) {\n        // Destroy the component\n        context.outlet.deactivate(); // Destroy the contexts for all the outlets that were in the component\n\n        context.children.onOutletDeactivated(); // Clear the information about the attached component on the context but keep the reference to\n        // the outlet.\n\n        context.attachRef = null;\n        context.resolver = null;\n        context.route = null;\n      }\n    }\n  }, {\n    key: \"activateChildRoutes\",\n    value: function activateChildRoutes(futureNode, currNode, contexts) {\n      var _this14 = this;\n\n      var children = nodeChildrenAsMap(currNode);\n      futureNode.children.forEach(function (c) {\n        _this14.activateRoutes(c, children[c.value.outlet], contexts);\n\n        _this14.forwardEvent(new ActivationEnd(c.value.snapshot));\n      });\n\n      if (futureNode.children.length) {\n        this.forwardEvent(new ChildActivationEnd(futureNode.value.snapshot));\n      }\n    }\n  }, {\n    key: \"activateRoutes\",\n    value: function activateRoutes(futureNode, currNode, parentContexts) {\n      var future = futureNode.value;\n      var curr = currNode ? currNode.value : null;\n      advanceActivatedRoute(future); // reusing the node\n\n      if (future === curr) {\n        if (future.component) {\n          // If we have a normal route, we need to go through an outlet.\n          var 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          var _context = parentContexts.getOrCreateContext(future.outlet);\n\n          if (this.routeReuseStrategy.shouldAttach(future.snapshot)) {\n            var stored = this.routeReuseStrategy.retrieve(future.snapshot);\n            this.routeReuseStrategy.store(future.snapshot, null);\n\n            _context.children.onOutletReAttached(stored.contexts);\n\n            _context.attachRef = stored.componentRef;\n            _context.route = stored.route.value;\n\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\n            advanceActivatedRouteNodeAndItsChildren(stored.route);\n          } else {\n            var config = parentLoadedConfig(future.snapshot);\n            var cmpFactoryResolver = config ? config.module.componentFactoryResolver : null;\n            _context.attachRef = null;\n            _context.route = future;\n            _context.resolver = cmpFactoryResolver;\n\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\n  return ActivateRoutes;\n}();\n\nfunction advanceActivatedRouteNodeAndItsChildren(node) {\n  advanceActivatedRoute(node.value);\n  node.children.forEach(advanceActivatedRouteNodeAndItsChildren);\n}\n\nfunction parentLoadedConfig(snapshot) {\n  for (var s = snapshot.parent; s; s = s.parent) {\n    var route = s.routeConfig;\n    if (route && route._loadedConfig) return route._loadedConfig;\n    if (route && route.component) return null;\n  }\n\n  return null;\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nvar LoadedRouterConfig = /*#__PURE__*/_createClass(function LoadedRouterConfig(routes, module) {\n  _classCallCheck(this, LoadedRouterConfig);\n\n  this.routes = routes;\n  this.module = module;\n});\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * 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 */\n\n\nfunction isFunction(v) {\n  return typeof v === 'function';\n}\n\nfunction isBoolean(v) {\n  return typeof v === 'boolean';\n}\n\nfunction isUrlTree(v) {\n  return v instanceof UrlTree;\n}\n\nfunction isCanLoad(guard) {\n  return guard && isFunction(guard.canLoad);\n}\n\nfunction isCanActivate(guard) {\n  return guard && isFunction(guard.canActivate);\n}\n\nfunction isCanActivateChild(guard) {\n  return guard && isFunction(guard.canActivateChild);\n}\n\nfunction isCanDeactivate(guard) {\n  return guard && isFunction(guard.canDeactivate);\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nvar INITIAL_VALUE = /*@__PURE__*/Symbol('INITIAL_VALUE');\n\nfunction prioritizedGuardValue() {\n  return switchMap(function (obs) {\n    return combineLatest(obs.map(function (o) {\n      return o.pipe(take(1), startWith(INITIAL_VALUE));\n    })).pipe(scan(function (acc, list) {\n      var isPending = false;\n      return list.reduce(function (innerAcc, val, i) {\n        if (innerAcc !== INITIAL_VALUE) return innerAcc; // Toggle pending flag if any values haven't been set yet\n\n        if (val === INITIAL_VALUE) isPending = true; // Any other return values are only valid if we haven't yet hit a pending\n        // call. This guarantees that in the case of a guard at the bottom of the\n        // tree that returns a redirect, we will wait for the higher priority\n        // guard at the top to finish before performing the redirect.\n\n        if (!isPending) {\n          // Early return when we hit a `false` value as that should always\n          // cancel navigation\n          if (val === false) return val;\n\n          if (i === list.length - 1 || isUrlTree(val)) {\n            return val;\n          }\n        }\n\n        return innerAcc;\n      }, acc);\n    }, INITIAL_VALUE), filter(function (item) {\n      return item !== INITIAL_VALUE;\n    }), map(function (item) {\n      return isUrlTree(item) ? item : item === true;\n    }), //\n    take(1));\n  });\n}\n\nvar ɵEmptyOutletComponent = /*@__PURE__*/function () {\n  var ɵEmptyOutletComponent = /*#__PURE__*/_createClass(function ɵEmptyOutletComponent() {\n    _classCallCheck(this, ɵEmptyOutletComponent);\n  });\n\n  ɵEmptyOutletComponent.ɵfac = function ɵEmptyOutletComponent_Factory(t) {\n    return new (t || ɵEmptyOutletComponent)();\n  };\n\n  ɵEmptyOutletComponent.ɵcmp =\n  /*@__PURE__*/\n\n  /*@__PURE__*/\n  ɵngcc0.ɵɵdefineComponent({\n    type: ɵEmptyOutletComponent,\n    selectors: [[\"ng-component\"]],\n    decls: 1,\n    vars: 0,\n    template: function ɵEmptyOutletComponent_Template(rf, ctx) {\n      if (rf & 1) {\n        ɵngcc0.ɵɵelement(0, \"router-outlet\");\n      }\n    },\n    directives: function directives() {\n      return [RouterOutlet];\n    },\n    encapsulation: 2\n  });\n  return ɵEmptyOutletComponent;\n}();\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nfunction validateConfig(config) {\n  var parentPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n  // forEach doesn't iterate undefined values\n  for (var i = 0; i < config.length; i++) {\n    var route = config[i];\n    var fullPath = getFullPath(parentPath, route);\n    validateNode(route, fullPath);\n  }\n}\n\nfunction validateNode(route, fullPath) {\n  if (typeof ngDevMode === 'undefined' || ngDevMode) {\n    if (!route) {\n      throw new Error(\"\\n      Invalid configuration of route '\".concat(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\n    if (Array.isArray(route)) {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"': Array cannot be specified\"));\n    }\n\n    if (!route.component && !route.children && !route.loadChildren && route.outlet && route.outlet !== PRIMARY_OUTLET) {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"': a componentless route without children or loadChildren cannot have a named outlet set\"));\n    }\n\n    if (route.redirectTo && route.children) {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"': redirectTo and children cannot be used together\"));\n    }\n\n    if (route.redirectTo && route.loadChildren) {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"': redirectTo and loadChildren cannot be used together\"));\n    }\n\n    if (route.children && route.loadChildren) {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"': children and loadChildren cannot be used together\"));\n    }\n\n    if (route.redirectTo && route.component) {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"': redirectTo and component cannot be used together\"));\n    }\n\n    if (route.redirectTo && route.canActivate) {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"': redirectTo and canActivate cannot be used together. Redirects happen before activation \") + \"so canActivate will never be executed.\");\n    }\n\n    if (route.path && route.matcher) {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"': path and matcher cannot be used together\"));\n    }\n\n    if (route.redirectTo === void 0 && !route.component && !route.children && !route.loadChildren) {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"'. One of the following must be provided: component, redirectTo, children or loadChildren\"));\n    }\n\n    if (route.path === void 0 && route.matcher === void 0) {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"': routes must have either a path or a matcher specified\"));\n    }\n\n    if (typeof route.path === 'string' && route.path.charAt(0) === '/') {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"': path cannot start with a slash\"));\n    }\n\n    if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) {\n      var exp = \"The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.\";\n      throw new Error(\"Invalid configuration of route '{path: \\\"\".concat(fullPath, \"\\\", redirectTo: \\\"\").concat(route.redirectTo, \"\\\"}': please provide 'pathMatch'. \").concat(exp));\n    }\n\n    if (route.pathMatch !== void 0 && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {\n      throw new Error(\"Invalid configuration of route '\".concat(fullPath, \"': pathMatch can only be set to 'prefix' or 'full'\"));\n    }\n  }\n\n  if (route.children) {\n    validateConfig(route.children, fullPath);\n  }\n}\n\nfunction getFullPath(parentPath, currentRoute) {\n  if (!currentRoute) {\n    return parentPath;\n  }\n\n  if (!parentPath && !currentRoute.path) {\n    return '';\n  } else if (parentPath && !currentRoute.path) {\n    return \"\".concat(parentPath, \"/\");\n  } else if (!parentPath && currentRoute.path) {\n    return currentRoute.path;\n  } else {\n    return \"\".concat(parentPath, \"/\").concat(currentRoute.path);\n  }\n}\n/**\n * Makes a copy of the config and adds any default required properties.\n */\n\n\nfunction standardizeConfig(r) {\n  var children = r.children && r.children.map(standardizeConfig);\n  var c = children ? Object.assign(Object.assign({}, r), {\n    children: children\n  }) : Object.assign({}, r);\n\n  if (!c.component && (children || c.loadChildren) && c.outlet && c.outlet !== PRIMARY_OUTLET) {\n    c.component = ɵEmptyOutletComponent;\n  }\n\n  return c;\n}\n/** Returns the `route.outlet` or PRIMARY_OUTLET if none exists. */\n\n\nfunction getOutlet(route) {\n  return route.outlet || PRIMARY_OUTLET;\n}\n/**\n * Sorts the `routes` such that the ones with an outlet matching `outletName` come first.\n * The order of the configs is otherwise preserved.\n */\n\n\nfunction sortByMatchingOutlets(routes, outletName) {\n  var sortedConfig = routes.filter(function (r) {\n    return getOutlet(r) === outletName;\n  });\n  sortedConfig.push.apply(sortedConfig, _toConsumableArray(routes.filter(function (r) {\n    return getOutlet(r) !== outletName;\n  })));\n  return sortedConfig;\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nvar noMatch = {\n  matched: false,\n  consumedSegments: [],\n  lastChild: 0,\n  parameters: {},\n  positionalParamSegments: {}\n};\n\nfunction match(segmentGroup, route, segments) {\n  var _a;\n\n  if (route.path === '') {\n    if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || segments.length > 0)) {\n      return Object.assign({}, noMatch);\n    }\n\n    return {\n      matched: true,\n      consumedSegments: [],\n      lastChild: 0,\n      parameters: {},\n      positionalParamSegments: {}\n    };\n  }\n\n  var matcher = route.matcher || defaultUrlMatcher;\n  var res = matcher(segments, segmentGroup, route);\n  if (!res) return Object.assign({}, noMatch);\n  var posParams = {};\n  forEach(res.posParams, function (v, k) {\n    posParams[k] = v.path;\n  });\n  var parameters = res.consumed.length > 0 ? Object.assign(Object.assign({}, posParams), res.consumed[res.consumed.length - 1].parameters) : posParams;\n  return {\n    matched: true,\n    consumedSegments: res.consumed,\n    lastChild: res.consumed.length,\n    // TODO(atscott): investigate combining parameters and positionalParamSegments\n    parameters: parameters,\n    positionalParamSegments: (_a = res.posParams) !== null && _a !== void 0 ? _a : {}\n  };\n}\n\nfunction split(segmentGroup, consumedSegments, slicedSegments, config) {\n  var relativeLinkResolution = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'corrected';\n\n  if (slicedSegments.length > 0 && containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, config)) {\n    var _s = new UrlSegmentGroup(consumedSegments, createChildrenForEmptyPaths(segmentGroup, consumedSegments, config, new UrlSegmentGroup(slicedSegments, segmentGroup.children)));\n\n    _s._sourceSegment = segmentGroup;\n    _s._segmentIndexShift = consumedSegments.length;\n    return {\n      segmentGroup: _s,\n      slicedSegments: []\n    };\n  }\n\n  if (slicedSegments.length === 0 && containsEmptyPathMatches(segmentGroup, slicedSegments, config)) {\n    var _s2 = new UrlSegmentGroup(segmentGroup.segments, addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, config, segmentGroup.children, relativeLinkResolution));\n\n    _s2._sourceSegment = segmentGroup;\n    _s2._segmentIndexShift = consumedSegments.length;\n    return {\n      segmentGroup: _s2,\n      slicedSegments: slicedSegments\n    };\n  }\n\n  var s = new UrlSegmentGroup(segmentGroup.segments, segmentGroup.children);\n  s._sourceSegment = segmentGroup;\n  s._segmentIndexShift = consumedSegments.length;\n  return {\n    segmentGroup: s,\n    slicedSegments: slicedSegments\n  };\n}\n\nfunction addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, routes, children, relativeLinkResolution) {\n  var res = {};\n\n  var _iterator4 = _createForOfIteratorHelper(routes),\n      _step4;\n\n  try {\n    for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n      var r = _step4.value;\n\n      if (emptyPathMatch(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) {\n        var s = new UrlSegmentGroup([], {});\n        s._sourceSegment = segmentGroup;\n\n        if (relativeLinkResolution === 'legacy') {\n          s._segmentIndexShift = segmentGroup.segments.length;\n        } else {\n          s._segmentIndexShift = consumedSegments.length;\n        }\n\n        res[getOutlet(r)] = s;\n      }\n    }\n  } catch (err) {\n    _iterator4.e(err);\n  } finally {\n    _iterator4.f();\n  }\n\n  return Object.assign(Object.assign({}, children), res);\n}\n\nfunction createChildrenForEmptyPaths(segmentGroup, consumedSegments, routes, primarySegment) {\n  var res = {};\n  res[PRIMARY_OUTLET] = primarySegment;\n  primarySegment._sourceSegment = segmentGroup;\n  primarySegment._segmentIndexShift = consumedSegments.length;\n\n  var _iterator5 = _createForOfIteratorHelper(routes),\n      _step5;\n\n  try {\n    for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n      var r = _step5.value;\n\n      if (r.path === '' && getOutlet(r) !== PRIMARY_OUTLET) {\n        var s = new UrlSegmentGroup([], {});\n        s._sourceSegment = segmentGroup;\n        s._segmentIndexShift = consumedSegments.length;\n        res[getOutlet(r)] = s;\n      }\n    }\n  } catch (err) {\n    _iterator5.e(err);\n  } finally {\n    _iterator5.f();\n  }\n\n  return res;\n}\n\nfunction containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, routes) {\n  return routes.some(function (r) {\n    return emptyPathMatch(segmentGroup, slicedSegments, r) && getOutlet(r) !== PRIMARY_OUTLET;\n  });\n}\n\nfunction containsEmptyPathMatches(segmentGroup, slicedSegments, routes) {\n  return routes.some(function (r) {\n    return emptyPathMatch(segmentGroup, slicedSegments, r);\n  });\n}\n\nfunction emptyPathMatch(segmentGroup, slicedSegments, r) {\n  if ((segmentGroup.hasChildren() || slicedSegments.length > 0) && r.pathMatch === 'full') {\n    return false;\n  }\n\n  return r.path === '';\n}\n/**\n * Determines if `route` is a path match for the `rawSegment`, `segments`, and `outlet` without\n * verifying that its children are a full match for the remainder of the `rawSegment` children as\n * well.\n */\n\n\nfunction isImmediateMatch(route, rawSegment, segments, outlet) {\n  // We allow matches to empty paths when the outlets differ so we can match a url like `/(b:b)` to\n  // a config like\n  // * `{path: '', children: [{path: 'b', outlet: 'b'}]}`\n  // or even\n  // * `{path: '', outlet: 'a', children: [{path: 'b', outlet: 'b'}]`\n  //\n  // The exception here is when the segment outlet is for the primary outlet. This would\n  // result in a match inside the named outlet because all children there are written as primary\n  // outlets. So we need to prevent child named outlet matches in a url like `/b` in a config like\n  // * `{path: '', outlet: 'x' children: [{path: 'b'}]}`\n  // This should only match if the url is `/(x:b)`.\n  if (getOutlet(route) !== outlet && (outlet === PRIMARY_OUTLET || !emptyPathMatch(rawSegment, segments, route))) {\n    return false;\n  }\n\n  if (route.path === '**') {\n    return true;\n  }\n\n  return match(rawSegment, route, segments).matched;\n}\n\nfunction noLeftoversInUrl(segmentGroup, segments, outlet) {\n  return segments.length === 0 && !segmentGroup.children[outlet];\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nvar NoMatch = /*#__PURE__*/_createClass(function NoMatch(segmentGroup) {\n  _classCallCheck(this, NoMatch);\n\n  this.segmentGroup = segmentGroup || null;\n});\n\nvar AbsoluteRedirect = /*#__PURE__*/_createClass(function AbsoluteRedirect(urlTree) {\n  _classCallCheck(this, AbsoluteRedirect);\n\n  this.urlTree = urlTree;\n});\n\nfunction noMatch$1(segmentGroup) {\n  return new Observable(function (obs) {\n    return obs.error(new NoMatch(segmentGroup));\n  });\n}\n\nfunction absoluteRedirect(newTree) {\n  return new Observable(function (obs) {\n    return obs.error(new AbsoluteRedirect(newTree));\n  });\n}\n\nfunction namedOutletsRedirect(redirectTo) {\n  return new Observable(function (obs) {\n    return obs.error(new Error(\"Only absolute redirects can have named outlets. redirectTo: '\".concat(redirectTo, \"'\")));\n  });\n}\n\nfunction canLoadFails(route) {\n  return new Observable(function (obs) {\n    return obs.error(navigationCancelingError(\"Cannot load children because the guard of the route \\\"path: '\".concat(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 */\n\n\nfunction applyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config) {\n  return new ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config).apply();\n}\n\nvar ApplyRedirects = /*#__PURE__*/function () {\n  function ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config) {\n    _classCallCheck(this, ApplyRedirects);\n\n    this.configLoader = configLoader;\n    this.urlSerializer = urlSerializer;\n    this.urlTree = urlTree;\n    this.config = config;\n    this.allowRedirects = true;\n    this.ngModule = moduleInjector.get(NgModuleRef);\n  }\n\n  _createClass(ApplyRedirects, [{\n    key: \"apply\",\n    value: function apply() {\n      var _this15 = this;\n\n      var splitGroup = split(this.urlTree.root, [], [], this.config).segmentGroup; // TODO(atscott): creating a new segment removes the _sourceSegment _segmentIndexShift, which is\n      // only necessary to prevent failures in tests which assert exact object matches. The `split` is\n      // now shared between `applyRedirects` and `recognize` but only the `recognize` step needs these\n      // properties. Before the implementations were merged, the `applyRedirects` would not assign\n      // them. We should be able to remove this logic as a \"breaking change\" but should do some more\n      // investigation into the failures first.\n\n      var rootSegmentGroup = new UrlSegmentGroup(splitGroup.segments, splitGroup.children);\n      var expanded$ = this.expandSegmentGroup(this.ngModule, this.config, rootSegmentGroup, PRIMARY_OUTLET);\n      var urlTrees$ = expanded$.pipe(map(function (rootSegmentGroup) {\n        return _this15.createUrlTree(squashSegmentGroup(rootSegmentGroup), _this15.urlTree.queryParams, _this15.urlTree.fragment);\n      }));\n      return urlTrees$.pipe(catchError(function (e) {\n        if (e instanceof AbsoluteRedirect) {\n          // After an absolute redirect we do not apply any more redirects!\n          // If this implementation changes, update the documentation note in `redirectTo`.\n          _this15.allowRedirects = false; // we need to run matching, so we can fetch all lazy-loaded modules\n\n          return _this15.match(e.urlTree);\n        }\n\n        if (e instanceof NoMatch) {\n          throw _this15.noMatchError(e);\n        }\n\n        throw e;\n      }));\n    }\n  }, {\n    key: \"match\",\n    value: function match(tree) {\n      var _this16 = this;\n\n      var expanded$ = this.expandSegmentGroup(this.ngModule, this.config, tree.root, PRIMARY_OUTLET);\n      var mapped$ = expanded$.pipe(map(function (rootSegmentGroup) {\n        return _this16.createUrlTree(squashSegmentGroup(rootSegmentGroup), tree.queryParams, tree.fragment);\n      }));\n      return mapped$.pipe(catchError(function (e) {\n        if (e instanceof NoMatch) {\n          throw _this16.noMatchError(e);\n        }\n\n        throw e;\n      }));\n    }\n  }, {\n    key: \"noMatchError\",\n    value: function noMatchError(e) {\n      return new Error(\"Cannot match any routes. URL Segment: '\".concat(e.segmentGroup, \"'\"));\n    }\n  }, {\n    key: \"createUrlTree\",\n    value: function createUrlTree(rootCandidate, queryParams, fragment) {\n      var root = rootCandidate.segments.length > 0 ? new UrlSegmentGroup([], _defineProperty({}, PRIMARY_OUTLET, rootCandidate)) : rootCandidate;\n      return new UrlTree(root, queryParams, fragment);\n    }\n  }, {\n    key: \"expandSegmentGroup\",\n    value: function expandSegmentGroup(ngModule, routes, segmentGroup, outlet) {\n      if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n        return this.expandChildren(ngModule, routes, segmentGroup).pipe(map(function (children) {\n          return new UrlSegmentGroup([], children);\n        }));\n      }\n\n      return this.expandSegment(ngModule, segmentGroup, routes, segmentGroup.segments, outlet, true);\n    } // Recursively expand segment groups for all the child outlets\n\n  }, {\n    key: \"expandChildren\",\n    value: function expandChildren(ngModule, routes, segmentGroup) {\n      var _this17 = this;\n\n      // Expand outlets one at a time, starting with the primary outlet. We need to do it this way\n      // because an absolute redirect from the primary outlet takes precedence.\n      var childOutlets = [];\n\n      for (var _i2 = 0, _Object$keys2 = Object.keys(segmentGroup.children); _i2 < _Object$keys2.length; _i2++) {\n        var child = _Object$keys2[_i2];\n\n        if (child === 'primary') {\n          childOutlets.unshift(child);\n        } else {\n          childOutlets.push(child);\n        }\n      }\n\n      return from(childOutlets).pipe(concatMap(function (childOutlet) {\n        var child = segmentGroup.children[childOutlet]; // Sort the routes so routes with outlets that match the segment appear\n        // first, followed by routes for other outlets, which might match if they have an\n        // empty path.\n\n        var sortedRoutes = sortByMatchingOutlets(routes, childOutlet);\n        return _this17.expandSegmentGroup(ngModule, sortedRoutes, child, childOutlet).pipe(map(function (s) {\n          return {\n            segment: s,\n            outlet: childOutlet\n          };\n        }));\n      }), scan(function (children, expandedChild) {\n        children[expandedChild.outlet] = expandedChild.segment;\n        return children;\n      }, {}), last$1());\n    }\n  }, {\n    key: \"expandSegment\",\n    value: function expandSegment(ngModule, segmentGroup, routes, segments, outlet, allowRedirects) {\n      var _this18 = this;\n\n      return from(routes).pipe(concatMap(function (r) {\n        var expanded$ = _this18.expandSegmentAgainstRoute(ngModule, segmentGroup, routes, r, segments, outlet, allowRedirects);\n\n        return expanded$.pipe(catchError(function (e) {\n          if (e instanceof NoMatch) {\n            return of(null);\n          }\n\n          throw e;\n        }));\n      }), first(function (s) {\n        return !!s;\n      }), catchError(function (e, _) {\n        if (e instanceof EmptyError || e.name === 'EmptyError') {\n          if (noLeftoversInUrl(segmentGroup, segments, outlet)) {\n            return of(new UrlSegmentGroup([], {}));\n          }\n\n          throw new NoMatch(segmentGroup);\n        }\n\n        throw e;\n      }));\n    }\n  }, {\n    key: \"expandSegmentAgainstRoute\",\n    value: function expandSegmentAgainstRoute(ngModule, segmentGroup, routes, route, paths, outlet, allowRedirects) {\n      if (!isImmediateMatch(route, segmentGroup, paths, outlet)) {\n        return noMatch$1(segmentGroup);\n      }\n\n      if (route.redirectTo === undefined) {\n        return this.matchSegmentAgainstRoute(ngModule, segmentGroup, route, paths, outlet);\n      }\n\n      if (allowRedirects && this.allowRedirects) {\n        return this.expandSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, paths, outlet);\n      }\n\n      return noMatch$1(segmentGroup);\n    }\n  }, {\n    key: \"expandSegmentAgainstRouteUsingRedirect\",\n    value: function expandSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet) {\n      if (route.path === '**') {\n        return this.expandWildCardWithParamsAgainstRouteUsingRedirect(ngModule, routes, route, outlet);\n      }\n\n      return this.expandRegularSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet);\n    }\n  }, {\n    key: \"expandWildCardWithParamsAgainstRouteUsingRedirect\",\n    value: function expandWildCardWithParamsAgainstRouteUsingRedirect(ngModule, routes, route, outlet) {\n      var _this19 = this;\n\n      var newTree = this.applyRedirectCommands([], route.redirectTo, {});\n\n      if (route.redirectTo.startsWith('/')) {\n        return absoluteRedirect(newTree);\n      }\n\n      return this.lineralizeSegments(route, newTree).pipe(mergeMap(function (newSegments) {\n        var group = new UrlSegmentGroup(newSegments, {});\n        return _this19.expandSegment(ngModule, group, routes, newSegments, outlet, false);\n      }));\n    }\n  }, {\n    key: \"expandRegularSegmentAgainstRouteUsingRedirect\",\n    value: function expandRegularSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet) {\n      var _this20 = this;\n\n      var _match = match(segmentGroup, route, segments),\n          matched = _match.matched,\n          consumedSegments = _match.consumedSegments,\n          lastChild = _match.lastChild,\n          positionalParamSegments = _match.positionalParamSegments;\n\n      if (!matched) return noMatch$1(segmentGroup);\n      var newTree = this.applyRedirectCommands(consumedSegments, route.redirectTo, positionalParamSegments);\n\n      if (route.redirectTo.startsWith('/')) {\n        return absoluteRedirect(newTree);\n      }\n\n      return this.lineralizeSegments(route, newTree).pipe(mergeMap(function (newSegments) {\n        return _this20.expandSegment(ngModule, segmentGroup, routes, newSegments.concat(segments.slice(lastChild)), outlet, false);\n      }));\n    }\n  }, {\n    key: \"matchSegmentAgainstRoute\",\n    value: function matchSegmentAgainstRoute(ngModule, rawSegmentGroup, route, segments, outlet) {\n      var _this21 = this;\n\n      if (route.path === '**') {\n        if (route.loadChildren) {\n          var loaded$ = route._loadedConfig ? of(route._loadedConfig) : this.configLoader.load(ngModule.injector, route);\n          return loaded$.pipe(map(function (cfg) {\n            route._loadedConfig = cfg;\n            return new UrlSegmentGroup(segments, {});\n          }));\n        }\n\n        return of(new UrlSegmentGroup(segments, {}));\n      }\n\n      var _match2 = match(rawSegmentGroup, route, segments),\n          matched = _match2.matched,\n          consumedSegments = _match2.consumedSegments,\n          lastChild = _match2.lastChild;\n\n      if (!matched) return noMatch$1(rawSegmentGroup);\n      var rawSlicedSegments = segments.slice(lastChild);\n      var childConfig$ = this.getChildConfig(ngModule, route, segments);\n      return childConfig$.pipe(mergeMap(function (routerConfig) {\n        var childModule = routerConfig.module;\n        var childConfig = routerConfig.routes;\n\n        var _split = split(rawSegmentGroup, consumedSegments, rawSlicedSegments, childConfig),\n            splitSegmentGroup = _split.segmentGroup,\n            slicedSegments = _split.slicedSegments; // See comment on the other call to `split` about why this is necessary.\n\n\n        var segmentGroup = new UrlSegmentGroup(splitSegmentGroup.segments, splitSegmentGroup.children);\n\n        if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {\n          var _expanded$ = _this21.expandChildren(childModule, childConfig, segmentGroup);\n\n          return _expanded$.pipe(map(function (children) {\n            return new UrlSegmentGroup(consumedSegments, children);\n          }));\n        }\n\n        if (childConfig.length === 0 && slicedSegments.length === 0) {\n          return of(new UrlSegmentGroup(consumedSegments, {}));\n        }\n\n        var matchedOnOutlet = getOutlet(route) === outlet;\n\n        var expanded$ = _this21.expandSegment(childModule, segmentGroup, childConfig, slicedSegments, matchedOnOutlet ? PRIMARY_OUTLET : outlet, true);\n\n        return expanded$.pipe(map(function (cs) {\n          return new UrlSegmentGroup(consumedSegments.concat(cs.segments), cs.children);\n        }));\n      }));\n    }\n  }, {\n    key: \"getChildConfig\",\n    value: function getChildConfig(ngModule, route, segments) {\n      var _this22 = this;\n\n      if (route.children) {\n        // The children belong to the same module\n        return of(new LoadedRouterConfig(route.children, ngModule));\n      }\n\n      if (route.loadChildren) {\n        // lazy children belong to the loaded module\n        if (route._loadedConfig !== undefined) {\n          return of(route._loadedConfig);\n        }\n\n        return this.runCanLoadGuards(ngModule.injector, route, segments).pipe(mergeMap(function (shouldLoadResult) {\n          if (shouldLoadResult) {\n            return _this22.configLoader.load(ngModule.injector, route).pipe(map(function (cfg) {\n              route._loadedConfig = cfg;\n              return cfg;\n            }));\n          }\n\n          return canLoadFails(route);\n        }));\n      }\n\n      return of(new LoadedRouterConfig([], ngModule));\n    }\n  }, {\n    key: \"runCanLoadGuards\",\n    value: function runCanLoadGuards(moduleInjector, route, segments) {\n      var _this23 = this;\n\n      var canLoad = route.canLoad;\n      if (!canLoad || canLoad.length === 0) return of(true);\n      var canLoadObservables = canLoad.map(function (injectionToken) {\n        var guard = moduleInjector.get(injectionToken);\n        var guardVal;\n\n        if (isCanLoad(guard)) {\n          guardVal = guard.canLoad(route, segments);\n        } else if (isFunction(guard)) {\n          guardVal = guard(route, segments);\n        } else {\n          throw new Error('Invalid CanLoad guard');\n        }\n\n        return wrapIntoObservable(guardVal);\n      });\n      return of(canLoadObservables).pipe(prioritizedGuardValue(), tap(function (result) {\n        if (!isUrlTree(result)) return;\n        var error = navigationCancelingError(\"Redirecting to \\\"\".concat(_this23.urlSerializer.serialize(result), \"\\\"\"));\n        error.url = result;\n        throw error;\n      }), map(function (result) {\n        return result === true;\n      }));\n    }\n  }, {\n    key: \"lineralizeSegments\",\n    value: function lineralizeSegments(route, urlTree) {\n      var res = [];\n      var c = urlTree.root;\n\n      while (true) {\n        res = res.concat(c.segments);\n\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    key: \"applyRedirectCommands\",\n    value: function applyRedirectCommands(segments, redirectTo, posParams) {\n      return this.applyRedirectCreatreUrlTree(redirectTo, this.urlSerializer.parse(redirectTo), segments, posParams);\n    }\n  }, {\n    key: \"applyRedirectCreatreUrlTree\",\n    value: function applyRedirectCreatreUrlTree(redirectTo, urlTree, segments, posParams) {\n      var newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams);\n      return new UrlTree(newRoot, this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams), urlTree.fragment);\n    }\n  }, {\n    key: \"createQueryParams\",\n    value: function createQueryParams(redirectToParams, actualParams) {\n      var res = {};\n      forEach(redirectToParams, function (v, k) {\n        var copySourceValue = typeof v === 'string' && v.startsWith(':');\n\n        if (copySourceValue) {\n          var sourceName = v.substring(1);\n          res[k] = actualParams[sourceName];\n        } else {\n          res[k] = v;\n        }\n      });\n      return res;\n    }\n  }, {\n    key: \"createSegmentGroup\",\n    value: function createSegmentGroup(redirectTo, group, segments, posParams) {\n      var _this24 = this;\n\n      var updatedSegments = this.createSegments(redirectTo, group.segments, segments, posParams);\n      var children = {};\n      forEach(group.children, function (child, name) {\n        children[name] = _this24.createSegmentGroup(redirectTo, child, segments, posParams);\n      });\n      return new UrlSegmentGroup(updatedSegments, children);\n    }\n  }, {\n    key: \"createSegments\",\n    value: function createSegments(redirectTo, redirectToSegments, actualSegments, posParams) {\n      var _this25 = this;\n\n      return redirectToSegments.map(function (s) {\n        return s.path.startsWith(':') ? _this25.findPosParam(redirectTo, s, posParams) : _this25.findOrReturn(s, actualSegments);\n      });\n    }\n  }, {\n    key: \"findPosParam\",\n    value: function findPosParam(redirectTo, redirectToUrlSegment, posParams) {\n      var pos = posParams[redirectToUrlSegment.path.substring(1)];\n      if (!pos) throw new Error(\"Cannot redirect to '\".concat(redirectTo, \"'. Cannot find '\").concat(redirectToUrlSegment.path, \"'.\"));\n      return pos;\n    }\n  }, {\n    key: \"findOrReturn\",\n    value: function findOrReturn(redirectToUrlSegment, actualSegments) {\n      var idx = 0;\n\n      var _iterator6 = _createForOfIteratorHelper(actualSegments),\n          _step6;\n\n      try {\n        for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n          var s = _step6.value;\n\n          if (s.path === redirectToUrlSegment.path) {\n            actualSegments.splice(idx);\n            return s;\n          }\n\n          idx++;\n        }\n      } catch (err) {\n        _iterator6.e(err);\n      } finally {\n        _iterator6.f();\n      }\n\n      return redirectToUrlSegment;\n    }\n  }]);\n\n  return ApplyRedirects;\n}();\n/**\n * When possible, merges the primary outlet child into the parent `UrlSegmentGroup`.\n *\n * When a segment group has only one child which is a primary outlet, merges that child into the\n * parent. That is, the child segment group's segments are merged into the `s` and the child's\n * children become the children of `s`. Think of this like a 'squash', merging the child segment\n * group into the parent.\n */\n\n\nfunction mergeTrivialChildren(s) {\n  if (s.numberOfChildren === 1 && s.children[PRIMARY_OUTLET]) {\n    var c = s.children[PRIMARY_OUTLET];\n    return new UrlSegmentGroup(s.segments.concat(c.segments), c.children);\n  }\n\n  return s;\n}\n/**\n * Recursively merges primary segment children into their parents and also drops empty children\n * (those which have no segments and no children themselves). The latter prevents serializing a\n * group into something like `/a(aux:)`, where `aux` is an empty child segment.\n */\n\n\nfunction squashSegmentGroup(segmentGroup) {\n  var newChildren = {};\n\n  for (var _i3 = 0, _Object$keys3 = Object.keys(segmentGroup.children); _i3 < _Object$keys3.length; _i3++) {\n    var childOutlet = _Object$keys3[_i3];\n    var child = segmentGroup.children[childOutlet];\n    var childCandidate = squashSegmentGroup(child); // don't add empty children\n\n    if (childCandidate.segments.length > 0 || childCandidate.hasChildren()) {\n      newChildren[childOutlet] = childCandidate;\n    }\n  }\n\n  var s = new UrlSegmentGroup(segmentGroup.segments, newChildren);\n  return mergeTrivialChildren(s);\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nfunction applyRedirects$1(moduleInjector, configLoader, urlSerializer, config) {\n  return switchMap(function (t) {\n    return applyRedirects(moduleInjector, configLoader, urlSerializer, t.extractedUrl, config).pipe(map(function (urlAfterRedirects) {\n      return Object.assign(Object.assign({}, t), {\n        urlAfterRedirects: urlAfterRedirects\n      });\n    }));\n  });\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nvar CanActivate = /*#__PURE__*/_createClass(function CanActivate(path) {\n  _classCallCheck(this, CanActivate);\n\n  this.path = path;\n  this.route = this.path[this.path.length - 1];\n});\n\nvar CanDeactivate = /*#__PURE__*/_createClass(function CanDeactivate(component, route) {\n  _classCallCheck(this, CanDeactivate);\n\n  this.component = component;\n  this.route = route;\n});\n\nfunction getAllRouteGuards(future, curr, parentContexts) {\n  var futureRoot = future._root;\n  var currRoot = curr ? curr._root : null;\n  return getChildRouteGuards(futureRoot, currRoot, parentContexts, [futureRoot.value]);\n}\n\nfunction getCanActivateChild(p) {\n  var canActivateChild = p.routeConfig ? p.routeConfig.canActivateChild : null;\n  if (!canActivateChild || canActivateChild.length === 0) return null;\n  return {\n    node: p,\n    guards: canActivateChild\n  };\n}\n\nfunction getToken(token, snapshot, moduleInjector) {\n  var config = getClosestLoadedConfig(snapshot);\n  var injector = config ? config.module.injector : moduleInjector;\n  return injector.get(token);\n}\n\nfunction getClosestLoadedConfig(snapshot) {\n  if (!snapshot) return null;\n\n  for (var s = snapshot.parent; s; s = s.parent) {\n    var route = s.routeConfig;\n    if (route && route._loadedConfig) return route._loadedConfig;\n  }\n\n  return null;\n}\n\nfunction getChildRouteGuards(futureNode, currNode, contexts, futurePath) {\n  var checks = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {\n    canDeactivateChecks: [],\n    canActivateChecks: []\n  };\n  var prevChildren = nodeChildrenAsMap(currNode); // Process the children of the future route\n\n  futureNode.children.forEach(function (c) {\n    getRouteGuards(c, prevChildren[c.value.outlet], contexts, futurePath.concat([c.value]), checks);\n    delete prevChildren[c.value.outlet];\n  }); // Process any children left from the current route (not active for the future route)\n\n  forEach(prevChildren, function (v, k) {\n    return deactivateRouteAndItsChildren(v, contexts.getContext(k), checks);\n  });\n  return checks;\n}\n\nfunction getRouteGuards(futureNode, currNode, parentContexts, futurePath) {\n  var checks = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {\n    canDeactivateChecks: [],\n    canActivateChecks: []\n  };\n  var future = futureNode.value;\n  var curr = currNode ? currNode.value : null;\n  var context = parentContexts ? parentContexts.getContext(futureNode.value.outlet) : null; // reusing the node\n\n  if (curr && future.routeConfig === curr.routeConfig) {\n    var shouldRun = shouldRunGuardsAndResolvers(curr, future, future.routeConfig.runGuardsAndResolvers);\n\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    } // If we have a component, we need to go through an outlet.\n\n\n    if (future.component) {\n      getChildRouteGuards(futureNode, currNode, context ? context.children : null, futurePath, checks); // if we have a componentless route, we recurse but keep the same outlet map.\n    } else {\n      getChildRouteGuards(futureNode, currNode, parentContexts, futurePath, checks);\n    }\n\n    if (shouldRun && context && context.outlet && context.outlet.isActivated) {\n      checks.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, curr));\n    }\n  } else {\n    if (curr) {\n      deactivateRouteAndItsChildren(currNode, context, checks);\n    }\n\n    checks.canActivateChecks.push(new CanActivate(futurePath)); // If we have a component, we need to go through an outlet.\n\n    if (future.component) {\n      getChildRouteGuards(futureNode, null, context ? context.children : null, futurePath, checks); // 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(curr, future, mode) {\n  if (typeof mode === 'function') {\n    return mode(curr, future);\n  }\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) || !shallowEqual(curr.queryParams, future.queryParams);\n\n    case 'always':\n      return true;\n\n    case 'paramsOrQueryParamsChange':\n      return !equalParamsAndUrlSegments(curr, future) || !shallowEqual(curr.queryParams, future.queryParams);\n\n    case 'paramsChange':\n    default:\n      return !equalParamsAndUrlSegments(curr, future);\n  }\n}\n\nfunction deactivateRouteAndItsChildren(route, context, checks) {\n  var children = nodeChildrenAsMap(route);\n  var r = route.value;\n  forEach(children, function (node, childName) {\n    if (!r.component) {\n      deactivateRouteAndItsChildren(node, context, checks);\n    } else if (context) {\n      deactivateRouteAndItsChildren(node, context.children.getContext(childName), checks);\n    } else {\n      deactivateRouteAndItsChildren(node, null, checks);\n    }\n  });\n\n  if (!r.component) {\n    checks.canDeactivateChecks.push(new CanDeactivate(null, r));\n  } else if (context && context.outlet && context.outlet.isActivated) {\n    checks.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, r));\n  } else {\n    checks.canDeactivateChecks.push(new CanDeactivate(null, r));\n  }\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nfunction checkGuards(moduleInjector, forwardEvent) {\n  return mergeMap(function (t) {\n    var targetSnapshot = t.targetSnapshot,\n        currentSnapshot = t.currentSnapshot,\n        _t$guards = t.guards,\n        canActivateChecks = _t$guards.canActivateChecks,\n        canDeactivateChecks = _t$guards.canDeactivateChecks;\n\n    if (canDeactivateChecks.length === 0 && canActivateChecks.length === 0) {\n      return of(Object.assign(Object.assign({}, t), {\n        guardsResult: true\n      }));\n    }\n\n    return runCanDeactivateChecks(canDeactivateChecks, targetSnapshot, currentSnapshot, moduleInjector).pipe(mergeMap(function (canDeactivate) {\n      return canDeactivate && isBoolean(canDeactivate) ? runCanActivateChecks(targetSnapshot, canActivateChecks, moduleInjector, forwardEvent) : of(canDeactivate);\n    }), map(function (guardsResult) {\n      return Object.assign(Object.assign({}, t), {\n        guardsResult: guardsResult\n      });\n    }));\n  });\n}\n\nfunction runCanDeactivateChecks(checks, futureRSS, currRSS, moduleInjector) {\n  return from(checks).pipe(mergeMap(function (check) {\n    return runCanDeactivate(check.component, check.route, currRSS, futureRSS, moduleInjector);\n  }), first(function (result) {\n    return result !== true;\n  }, true));\n}\n\nfunction runCanActivateChecks(futureSnapshot, checks, moduleInjector, forwardEvent) {\n  return from(checks).pipe(concatMap(function (check) {\n    return concat(fireChildActivationStart(check.route.parent, forwardEvent), fireActivationStart(check.route, forwardEvent), runCanActivateChild(futureSnapshot, check.path, moduleInjector), runCanActivate(futureSnapshot, check.route, moduleInjector));\n  }), first(function (result) {\n    return result !== true;\n  }, true));\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 */\n\n\nfunction fireActivationStart(snapshot, forwardEvent) {\n  if (snapshot !== null && forwardEvent) {\n    forwardEvent(new ActivationStart(snapshot));\n  }\n\n  return of(true);\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 */\n\n\nfunction fireChildActivationStart(snapshot, forwardEvent) {\n  if (snapshot !== null && forwardEvent) {\n    forwardEvent(new ChildActivationStart(snapshot));\n  }\n\n  return of(true);\n}\n\nfunction runCanActivate(futureRSS, futureARS, moduleInjector) {\n  var canActivate = futureARS.routeConfig ? futureARS.routeConfig.canActivate : null;\n  if (!canActivate || canActivate.length === 0) return of(true);\n  var canActivateObservables = canActivate.map(function (c) {\n    return defer(function () {\n      var guard = getToken(c, futureARS, moduleInjector);\n      var observable;\n\n      if (isCanActivate(guard)) {\n        observable = wrapIntoObservable(guard.canActivate(futureARS, futureRSS));\n      } else if (isFunction(guard)) {\n        observable = wrapIntoObservable(guard(futureARS, futureRSS));\n      } else {\n        throw new Error('Invalid CanActivate guard');\n      }\n\n      return observable.pipe(first());\n    });\n  });\n  return of(canActivateObservables).pipe(prioritizedGuardValue());\n}\n\nfunction runCanActivateChild(futureRSS, path, moduleInjector) {\n  var futureARS = path[path.length - 1];\n  var canActivateChildGuards = path.slice(0, path.length - 1).reverse().map(function (p) {\n    return getCanActivateChild(p);\n  }).filter(function (_) {\n    return _ !== null;\n  });\n  var canActivateChildGuardsMapped = canActivateChildGuards.map(function (d) {\n    return defer(function () {\n      var guardsMapped = d.guards.map(function (c) {\n        var guard = getToken(c, d.node, moduleInjector);\n        var observable;\n\n        if (isCanActivateChild(guard)) {\n          observable = wrapIntoObservable(guard.canActivateChild(futureARS, futureRSS));\n        } else if (isFunction(guard)) {\n          observable = wrapIntoObservable(guard(futureARS, futureRSS));\n        } else {\n          throw new Error('Invalid CanActivateChild guard');\n        }\n\n        return observable.pipe(first());\n      });\n      return of(guardsMapped).pipe(prioritizedGuardValue());\n    });\n  });\n  return of(canActivateChildGuardsMapped).pipe(prioritizedGuardValue());\n}\n\nfunction runCanDeactivate(component, currARS, currRSS, futureRSS, moduleInjector) {\n  var canDeactivate = currARS && currARS.routeConfig ? currARS.routeConfig.canDeactivate : null;\n  if (!canDeactivate || canDeactivate.length === 0) return of(true);\n  var canDeactivateObservables = canDeactivate.map(function (c) {\n    var guard = getToken(c, currARS, moduleInjector);\n    var observable;\n\n    if (isCanDeactivate(guard)) {\n      observable = wrapIntoObservable(guard.canDeactivate(component, currARS, currRSS, futureRSS));\n    } else if (isFunction(guard)) {\n      observable = wrapIntoObservable(guard(component, currARS, currRSS, futureRSS));\n    } else {\n      throw new Error('Invalid CanDeactivate guard');\n    }\n\n    return observable.pipe(first());\n  });\n  return of(canDeactivateObservables).pipe(prioritizedGuardValue());\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nvar NoMatch$1 = /*#__PURE__*/_createClass(function NoMatch$1() {\n  _classCallCheck(this, NoMatch$1);\n});\n\nfunction newObservableError(e) {\n  // TODO(atscott): This pattern is used throughout the router code and can be `throwError` instead.\n  return new Observable(function (obs) {\n    return obs.error(e);\n  });\n}\n\nfunction recognize(rootComponentType, config, urlTree, url) {\n  var paramsInheritanceStrategy = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'emptyOnly';\n  var relativeLinkResolution = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'legacy';\n\n  try {\n    var result = new Recognizer(rootComponentType, config, urlTree, url, paramsInheritanceStrategy, relativeLinkResolution).recognize();\n\n    if (result === null) {\n      return newObservableError(new NoMatch$1());\n    } else {\n      return of(result);\n    }\n  } catch (e) {\n    // Catch the potential error from recognize due to duplicate outlet matches and return as an\n    // `Observable` error instead.\n    return newObservableError(e);\n  }\n}\n\nvar Recognizer = /*#__PURE__*/function () {\n  function Recognizer(rootComponentType, config, urlTree, url, paramsInheritanceStrategy, relativeLinkResolution) {\n    _classCallCheck(this, Recognizer);\n\n    this.rootComponentType = rootComponentType;\n    this.config = config;\n    this.urlTree = urlTree;\n    this.url = url;\n    this.paramsInheritanceStrategy = paramsInheritanceStrategy;\n    this.relativeLinkResolution = relativeLinkResolution;\n  }\n\n  _createClass(Recognizer, [{\n    key: \"recognize\",\n    value: function recognize() {\n      var rootSegmentGroup = split(this.urlTree.root, [], [], this.config.filter(function (c) {\n        return c.redirectTo === undefined;\n      }), this.relativeLinkResolution).segmentGroup;\n      var children = this.processSegmentGroup(this.config, rootSegmentGroup, PRIMARY_OUTLET);\n\n      if (children === null) {\n        return null;\n      } // Use Object.freeze to prevent readers of the Router state from modifying it outside of a\n      // navigation, resulting in the router being out of sync with the browser.\n\n\n      var root = new ActivatedRouteSnapshot([], Object.freeze({}), Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, {}, PRIMARY_OUTLET, this.rootComponentType, null, this.urlTree.root, -1, {});\n      var rootNode = new TreeNode(root, children);\n      var routeState = new RouterStateSnapshot(this.url, rootNode);\n      this.inheritParamsAndData(routeState._root);\n      return routeState;\n    }\n  }, {\n    key: \"inheritParamsAndData\",\n    value: function inheritParamsAndData(routeNode) {\n      var _this26 = this;\n\n      var route = routeNode.value;\n      var i = inheritedParamsDataResolve(route, this.paramsInheritanceStrategy);\n      route.params = Object.freeze(i.params);\n      route.data = Object.freeze(i.data);\n      routeNode.children.forEach(function (n) {\n        return _this26.inheritParamsAndData(n);\n      });\n    }\n  }, {\n    key: \"processSegmentGroup\",\n    value: function processSegmentGroup(config, segmentGroup, outlet) {\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     * Matches every child outlet in the `segmentGroup` to a `Route` in the config. Returns `null` if\n     * we cannot find a match for _any_ of the children.\n     *\n     * @param config - The `Routes` to match against\n     * @param segmentGroup - The `UrlSegmentGroup` whose children need to be matched against the\n     *     config.\n     */\n\n  }, {\n    key: \"processChildren\",\n    value: function processChildren(config, segmentGroup) {\n      var children = [];\n\n      for (var _i4 = 0, _Object$keys4 = Object.keys(segmentGroup.children); _i4 < _Object$keys4.length; _i4++) {\n        var childOutlet = _Object$keys4[_i4];\n        var child = segmentGroup.children[childOutlet]; // Sort the config so that routes with outlets that match the one being activated appear\n        // first, followed by routes for other outlets, which might match if they have an empty path.\n\n        var sortedConfig = sortByMatchingOutlets(config, childOutlet);\n        var outletChildren = this.processSegmentGroup(sortedConfig, child, childOutlet);\n\n        if (outletChildren === null) {\n          // Configs must match all segment children so because we did not find a match for this\n          // outlet, return `null`.\n          return null;\n        }\n\n        children.push.apply(children, _toConsumableArray(outletChildren));\n      } // Because we may have matched two outlets to the same empty path segment, we can have multiple\n      // activated results for the same outlet. We should merge the children of these results so the\n      // final return value is only one `TreeNode` per outlet.\n\n\n      var mergedChildren = mergeEmptyPathMatches(children);\n\n      if (typeof ngDevMode === 'undefined' || ngDevMode) {\n        // This should really never happen - we are only taking the first match for each outlet and\n        // merge the empty path matches.\n        checkOutletNameUniqueness(mergedChildren);\n      }\n\n      sortActivatedRouteSnapshots(mergedChildren);\n      return mergedChildren;\n    }\n  }, {\n    key: \"processSegment\",\n    value: function processSegment(config, segmentGroup, segments, outlet) {\n      var _iterator7 = _createForOfIteratorHelper(config),\n          _step7;\n\n      try {\n        for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n          var r = _step7.value;\n          var children = this.processSegmentAgainstRoute(r, segmentGroup, segments, outlet);\n\n          if (children !== null) {\n            return children;\n          }\n        }\n      } catch (err) {\n        _iterator7.e(err);\n      } finally {\n        _iterator7.f();\n      }\n\n      if (noLeftoversInUrl(segmentGroup, segments, outlet)) {\n        return [];\n      }\n\n      return null;\n    }\n  }, {\n    key: \"processSegmentAgainstRoute\",\n    value: function processSegmentAgainstRoute(route, rawSegment, segments, outlet) {\n      if (route.redirectTo || !isImmediateMatch(route, rawSegment, segments, outlet)) return null;\n      var snapshot;\n      var consumedSegments = [];\n      var rawSlicedSegments = [];\n\n      if (route.path === '**') {\n        var params = segments.length > 0 ? last(segments).parameters : {};\n        snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + segments.length, getResolve(route));\n      } else {\n        var result = match(rawSegment, route, segments);\n\n        if (!result.matched) {\n          return null;\n        }\n\n        consumedSegments = result.consumedSegments;\n        rawSlicedSegments = segments.slice(result.lastChild);\n        snapshot = new ActivatedRouteSnapshot(consumedSegments, result.parameters, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));\n      }\n\n      var childConfig = getChildConfig(route);\n\n      var _split2 = split(rawSegment, consumedSegments, rawSlicedSegments, // Filter out routes with redirectTo because we are trying to create activated route\n      // snapshots and don't handle redirects here. That should have been done in\n      // `applyRedirects`.\n      childConfig.filter(function (c) {\n        return c.redirectTo === undefined;\n      }), this.relativeLinkResolution),\n          segmentGroup = _split2.segmentGroup,\n          slicedSegments = _split2.slicedSegments;\n\n      if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {\n        var _children3 = this.processChildren(childConfig, segmentGroup);\n\n        if (_children3 === null) {\n          return null;\n        }\n\n        return [new TreeNode(snapshot, _children3)];\n      }\n\n      if (childConfig.length === 0 && slicedSegments.length === 0) {\n        return [new TreeNode(snapshot, [])];\n      }\n\n      var matchedOnOutlet = getOutlet(route) === outlet; // If we matched a config due to empty path match on a different outlet, we need to continue\n      // passing the current outlet for the segment rather than switch to PRIMARY.\n      // Note that we switch to primary when we have a match because outlet configs look like this:\n      // {path: 'a', outlet: 'a', children: [\n      //  {path: 'b', component: B},\n      //  {path: 'c', component: C},\n      // ]}\n      // Notice that the children of the named outlet are configured with the primary outlet\n\n      var children = this.processSegment(childConfig, segmentGroup, slicedSegments, matchedOnOutlet ? PRIMARY_OUTLET : outlet);\n\n      if (children === null) {\n        return null;\n      }\n\n      return [new TreeNode(snapshot, children)];\n    }\n  }]);\n\n  return Recognizer;\n}();\n\nfunction sortActivatedRouteSnapshots(nodes) {\n  nodes.sort(function (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) {\n  if (route.children) {\n    return route.children;\n  }\n\n  if (route.loadChildren) {\n    return route._loadedConfig.routes;\n  }\n\n  return [];\n}\n\nfunction hasEmptyPathConfig(node) {\n  var config = node.value.routeConfig;\n  return config && config.path === '' && config.redirectTo === undefined;\n}\n/**\n * Finds `TreeNode`s with matching empty path route configs and merges them into `TreeNode` with the\n * children from each duplicate. This is necessary because different outlets can match a single\n * empty path route config and the results need to then be merged.\n */\n\n\nfunction mergeEmptyPathMatches(nodes) {\n  var result = []; // The set of nodes which contain children that were merged from two duplicate empty path nodes.\n\n  var mergedNodes = new Set();\n\n  var _iterator8 = _createForOfIteratorHelper(nodes),\n      _step8;\n\n  try {\n    var _loop = function _loop() {\n      var node = _step8.value;\n\n      if (!hasEmptyPathConfig(node)) {\n        result.push(node);\n        return \"continue\";\n      }\n\n      var duplicateEmptyPathNode = result.find(function (resultNode) {\n        return node.value.routeConfig === resultNode.value.routeConfig;\n      });\n\n      if (duplicateEmptyPathNode !== undefined) {\n        var _duplicateEmptyPathNo;\n\n        (_duplicateEmptyPathNo = duplicateEmptyPathNode.children).push.apply(_duplicateEmptyPathNo, _toConsumableArray(node.children));\n\n        mergedNodes.add(duplicateEmptyPathNode);\n      } else {\n        result.push(node);\n      }\n    };\n\n    for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n      var _ret = _loop();\n\n      if (_ret === \"continue\") continue;\n    } // For each node which has children from multiple sources, we need to recompute a new `TreeNode`\n    // by also merging those children. This is necessary when there are multiple empty path configs in\n    // a row. Put another way: whenever we combine children of two nodes, we need to also check if any\n    // of those children can be combined into a single node as well.\n\n  } catch (err) {\n    _iterator8.e(err);\n  } finally {\n    _iterator8.f();\n  }\n\n  var _iterator9 = _createForOfIteratorHelper(mergedNodes),\n      _step9;\n\n  try {\n    for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {\n      var mergedNode = _step9.value;\n      var mergedChildren = mergeEmptyPathMatches(mergedNode.children);\n      result.push(new TreeNode(mergedNode.value, mergedChildren));\n    }\n  } catch (err) {\n    _iterator9.e(err);\n  } finally {\n    _iterator9.f();\n  }\n\n  return result.filter(function (n) {\n    return !mergedNodes.has(n);\n  });\n}\n\nfunction checkOutletNameUniqueness(nodes) {\n  var names = {};\n  nodes.forEach(function (n) {\n    var routeWithSameOutletName = names[n.value.outlet];\n\n    if (routeWithSameOutletName) {\n      var p = routeWithSameOutletName.url.map(function (s) {\n        return s.toString();\n      }).join('/');\n      var c = n.value.url.map(function (s) {\n        return s.toString();\n      }).join('/');\n      throw new Error(\"Two segments cannot have the same outlet name: '\".concat(p, \"' and '\").concat(c, \"'.\"));\n    }\n\n    names[n.value.outlet] = n.value;\n  });\n}\n\nfunction getSourceSegmentGroup(segmentGroup) {\n  var s = segmentGroup;\n\n  while (s._sourceSegment) {\n    s = s._sourceSegment;\n  }\n\n  return s;\n}\n\nfunction getPathIndexShift(segmentGroup) {\n  var s = segmentGroup;\n  var res = s._segmentIndexShift ? s._segmentIndexShift : 0;\n\n  while (s._sourceSegment) {\n    s = s._sourceSegment;\n    res += s._segmentIndexShift ? s._segmentIndexShift : 0;\n  }\n\n  return res - 1;\n}\n\nfunction getData(route) {\n  return route.data || {};\n}\n\nfunction getResolve(route) {\n  return route.resolve || {};\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nfunction recognize$1(rootComponentType, config, serializer, paramsInheritanceStrategy, relativeLinkResolution) {\n  return mergeMap(function (t) {\n    return recognize(rootComponentType, config, t.urlAfterRedirects, serializer(t.urlAfterRedirects), paramsInheritanceStrategy, relativeLinkResolution).pipe(map(function (targetSnapshot) {\n      return Object.assign(Object.assign({}, t), {\n        targetSnapshot: targetSnapshot\n      });\n    }));\n  });\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nfunction resolveData(paramsInheritanceStrategy, moduleInjector) {\n  return mergeMap(function (t) {\n    var targetSnapshot = t.targetSnapshot,\n        canActivateChecks = t.guards.canActivateChecks;\n\n    if (!canActivateChecks.length) {\n      return of(t);\n    }\n\n    var canActivateChecksResolved = 0;\n    return from(canActivateChecks).pipe(concatMap(function (check) {\n      return runResolve(check.route, targetSnapshot, paramsInheritanceStrategy, moduleInjector);\n    }), tap(function () {\n      return canActivateChecksResolved++;\n    }), takeLast(1), mergeMap(function (_) {\n      return canActivateChecksResolved === canActivateChecks.length ? of(t) : EMPTY;\n    }));\n  });\n}\n\nfunction runResolve(futureARS, futureRSS, paramsInheritanceStrategy, moduleInjector) {\n  var resolve = futureARS._resolve;\n  return resolveNode(resolve, futureARS, futureRSS, moduleInjector).pipe(map(function (resolvedData) {\n    futureARS._resolvedData = resolvedData;\n    futureARS.data = Object.assign(Object.assign({}, futureARS.data), inheritedParamsDataResolve(futureARS, paramsInheritanceStrategy).resolve);\n    return null;\n  }));\n}\n\nfunction resolveNode(resolve, futureARS, futureRSS, moduleInjector) {\n  var keys = Object.keys(resolve);\n\n  if (keys.length === 0) {\n    return of({});\n  }\n\n  var data = {};\n  return from(keys).pipe(mergeMap(function (key) {\n    return getResolver(resolve[key], futureARS, futureRSS, moduleInjector).pipe(tap(function (value) {\n      data[key] = value;\n    }));\n  }), takeLast(1), mergeMap(function () {\n    // Ensure all resolvers returned values, otherwise don't emit any \"next\" and just complete\n    // the chain which will cancel navigation\n    if (Object.keys(data).length === keys.length) {\n      return of(data);\n    }\n\n    return EMPTY;\n  }));\n}\n\nfunction getResolver(injectionToken, futureARS, futureRSS, moduleInjector) {\n  var resolver = getToken(injectionToken, futureARS, moduleInjector);\n  return resolver.resolve ? wrapIntoObservable(resolver.resolve(futureARS, futureRSS)) : wrapIntoObservable(resolver(futureARS, futureRSS));\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\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 */\n\n\nfunction switchTap(next) {\n  return switchMap(function (v) {\n    var nextResult = next(v);\n\n    if (nextResult) {\n      return from(nextResult).pipe(map(function () {\n        return v;\n      }));\n    }\n\n    return of(v);\n  });\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @description\n *\n * Provides a way to customize when activated routes get reused.\n *\n * @publicApi\n */\n\n\nvar RouteReuseStrategy = /*#__PURE__*/_createClass(function RouteReuseStrategy() {\n  _classCallCheck(this, RouteReuseStrategy);\n});\n/**\n * @description\n *\n * This base route reuse strategy only reuses routes when the matched router configs are\n * identical. This prevents components from being destroyed and recreated\n * when just the fragment or query parameters change\n * (that is, the existing component is _reused_).\n *\n * This strategy does not store any routes for later reuse.\n *\n * Angular uses this strategy by default.\n *\n *\n * It can be used as a base class for custom route reuse strategies, i.e. you can create your own\n * class that extends the `BaseRouteReuseStrategy` one.\n * @publicApi\n */\n\n\nvar BaseRouteReuseStrategy = /*#__PURE__*/function () {\n  function BaseRouteReuseStrategy() {\n    _classCallCheck(this, BaseRouteReuseStrategy);\n  }\n\n  _createClass(BaseRouteReuseStrategy, [{\n    key: \"shouldDetach\",\n    value:\n    /**\n     * Whether the given route should detach for later reuse.\n     * Always returns false for `BaseRouteReuseStrategy`.\n     * */\n    function shouldDetach(route) {\n      return false;\n    }\n    /**\n     * A no-op; the route is never stored since this strategy never detaches routes for later re-use.\n     */\n\n  }, {\n    key: \"store\",\n    value: function store(route, detachedTree) {}\n    /** Returns `false`, meaning the route (and its subtree) is never reattached */\n\n  }, {\n    key: \"shouldAttach\",\n    value: function shouldAttach(route) {\n      return false;\n    }\n    /** Returns `null` because this strategy does not store routes for later re-use. */\n\n  }, {\n    key: \"retrieve\",\n    value: function retrieve(route) {\n      return null;\n    }\n    /**\n     * Determines if a route should be reused.\n     * This strategy returns `true` when the future route config and current route config are\n     * identical.\n     */\n\n  }, {\n    key: \"shouldReuseRoute\",\n    value: function shouldReuseRoute(future, curr) {\n      return future.routeConfig === curr.routeConfig;\n    }\n  }]);\n\n  return BaseRouteReuseStrategy;\n}();\n\nvar DefaultRouteReuseStrategy = /*#__PURE__*/function (_BaseRouteReuseStrate) {\n  _inherits(DefaultRouteReuseStrategy, _BaseRouteReuseStrate);\n\n  var _super12 = _createSuper(DefaultRouteReuseStrategy);\n\n  function DefaultRouteReuseStrategy() {\n    _classCallCheck(this, DefaultRouteReuseStrategy);\n\n    return _super12.apply(this, arguments);\n  }\n\n  return _createClass(DefaultRouteReuseStrategy);\n}(BaseRouteReuseStrategy);\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * The [DI token](guide/glossary/#di-token) for a router configuration.\n *\n * `ROUTES` is a low level API for router configuration via dependency injection.\n *\n * We recommend that in almost all cases to use higher level APIs such as `RouterModule.forRoot()`,\n * `RouterModule.forChild()`, `provideRoutes`, or `Router.resetConfig()`.\n *\n * @publicApi\n */\n\n\nvar ROUTES = /*@__PURE__*/new InjectionToken('ROUTES');\n\nvar RouterConfigLoader = /*#__PURE__*/function () {\n  function RouterConfigLoader(loader, compiler, onLoadStartListener, onLoadEndListener) {\n    _classCallCheck(this, RouterConfigLoader);\n\n    this.loader = loader;\n    this.compiler = compiler;\n    this.onLoadStartListener = onLoadStartListener;\n    this.onLoadEndListener = onLoadEndListener;\n  }\n\n  _createClass(RouterConfigLoader, [{\n    key: \"load\",\n    value: function load(parentInjector, route) {\n      var _this27 = this;\n\n      if (route._loader$) {\n        return route._loader$;\n      }\n\n      if (this.onLoadStartListener) {\n        this.onLoadStartListener(route);\n      }\n\n      var moduleFactory$ = this.loadModuleFactory(route.loadChildren);\n      var loadRunner = moduleFactory$.pipe(map(function (factory) {\n        if (_this27.onLoadEndListener) {\n          _this27.onLoadEndListener(route);\n        }\n\n        var module = factory.create(parentInjector); // When loading a module that doesn't provide `RouterModule.forChild()` preloader\n        // will get stuck in an infinite loop. The child module's Injector will look to\n        // its parent `Injector` when it doesn't find any ROUTES so it will return routes\n        // for it's parent module instead.\n\n        return new LoadedRouterConfig(flatten(module.injector.get(ROUTES, undefined, InjectFlags.Self | InjectFlags.Optional)).map(standardizeConfig), module);\n      }), catchError(function (err) {\n        route._loader$ = undefined;\n        throw err;\n      })); // Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much\n\n      route._loader$ = new ConnectableObservable(loadRunner, function () {\n        return new Subject();\n      }).pipe(refCount());\n      return route._loader$;\n    }\n  }, {\n    key: \"loadModuleFactory\",\n    value: function loadModuleFactory(loadChildren) {\n      var _this28 = this;\n\n      if (typeof loadChildren === 'string') {\n        return from(this.loader.load(loadChildren));\n      } else {\n        return wrapIntoObservable(loadChildren()).pipe(mergeMap(function (t) {\n          if (t instanceof NgModuleFactory) {\n            return of(t);\n          } else {\n            return from(_this28.compiler.compileModuleAsync(t));\n          }\n        }));\n      }\n    }\n  }]);\n\n  return RouterConfigLoader;\n}();\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Store contextual information about a `RouterOutlet`\n *\n * @publicApi\n */\n\n\nvar OutletContext = /*#__PURE__*/_createClass(function OutletContext() {\n  _classCallCheck(this, OutletContext);\n\n  this.outlet = null;\n  this.route = null;\n  this.resolver = null;\n  this.children = new ChildrenOutletContexts();\n  this.attachRef = null;\n});\n/**\n * Store contextual information about the children (= nested) `RouterOutlet`\n *\n * @publicApi\n */\n\n\nvar ChildrenOutletContexts = /*#__PURE__*/function () {\n  function ChildrenOutletContexts() {\n    _classCallCheck(this, ChildrenOutletContexts);\n\n    // contexts for child outlets, by name.\n    this.contexts = new Map();\n  }\n  /** Called when a `RouterOutlet` directive is instantiated */\n\n\n  _createClass(ChildrenOutletContexts, [{\n    key: \"onChildOutletCreated\",\n    value: function onChildOutletCreated(childName, outlet) {\n      var context = this.getOrCreateContext(childName);\n      context.outlet = outlet;\n      this.contexts.set(childName, context);\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\n  }, {\n    key: \"onChildOutletDestroyed\",\n    value: function onChildOutletDestroyed(childName) {\n      var context = this.getContext(childName);\n\n      if (context) {\n        context.outlet = null;\n        context.attachRef = null;\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\n  }, {\n    key: \"onOutletDeactivated\",\n    value: function onOutletDeactivated() {\n      var contexts = this.contexts;\n      this.contexts = new Map();\n      return contexts;\n    }\n  }, {\n    key: \"onOutletReAttached\",\n    value: function onOutletReAttached(contexts) {\n      this.contexts = contexts;\n    }\n  }, {\n    key: \"getOrCreateContext\",\n    value: function getOrCreateContext(childName) {\n      var 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    key: \"getContext\",\n    value: function getContext(childName) {\n      return this.contexts.get(childName) || null;\n    }\n  }]);\n\n  return ChildrenOutletContexts;\n}();\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @description\n *\n * Provides a way to migrate AngularJS applications to Angular.\n *\n * @publicApi\n */\n\n\nvar UrlHandlingStrategy = /*#__PURE__*/_createClass(function UrlHandlingStrategy() {\n  _classCallCheck(this, UrlHandlingStrategy);\n});\n/**\n * @publicApi\n */\n\n\nvar DefaultUrlHandlingStrategy = /*#__PURE__*/function () {\n  function DefaultUrlHandlingStrategy() {\n    _classCallCheck(this, DefaultUrlHandlingStrategy);\n  }\n\n  _createClass(DefaultUrlHandlingStrategy, [{\n    key: \"shouldProcessUrl\",\n    value: function shouldProcessUrl(url) {\n      return true;\n    }\n  }, {\n    key: \"extract\",\n    value: function extract(url) {\n      return url;\n    }\n  }, {\n    key: \"merge\",\n    value: function merge(newUrlPart, wholeUrl) {\n      return newUrlPart;\n    }\n  }]);\n\n  return DefaultUrlHandlingStrategy;\n}();\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nfunction defaultErrorHandler(error) {\n  throw error;\n}\n\nfunction defaultMalformedUriErrorHandler(error, urlSerializer, url) {\n  return urlSerializer.parse('/');\n}\n/**\n * @internal\n */\n\n\nfunction defaultRouterHook(snapshot, runExtras) {\n  return of(null);\n}\n/**\n * The equivalent `IsActiveMatchOptions` options for `Router.isActive` is called with `true`\n * (exact = true).\n */\n\n\nvar exactMatchOptions = {\n  paths: 'exact',\n  fragment: 'ignored',\n  matrixParams: 'ignored',\n  queryParams: 'exact'\n};\n/**\n * The equivalent `IsActiveMatchOptions` options for `Router.isActive` is called with `false`\n * (exact = false).\n */\n\nvar subsetMatchOptions = {\n  paths: 'subset',\n  fragment: 'ignored',\n  matrixParams: 'ignored',\n  queryParams: 'subset'\n};\n\nvar Router = /*@__PURE__*/function () {\n  var Router = /*#__PURE__*/function () {\n    /**\n     * Creates the router service.\n     */\n    // TODO: vsavkin make internal after the final is out.\n    function Router(rootComponentType, urlSerializer, rootContexts, location, injector, loader, compiler, config) {\n      var _this29 = this;\n\n      _classCallCheck(this, Router);\n\n      this.rootComponentType = rootComponentType;\n      this.urlSerializer = urlSerializer;\n      this.rootContexts = rootContexts;\n      this.location = location;\n      this.config = config;\n      this.lastSuccessfulNavigation = null;\n      this.currentNavigation = null;\n      this.disposed = false;\n      /**\n       * Tracks the previously seen location change from the location subscription so we can compare\n       * the two latest to see if they are duplicates. See setUpLocationChangeListener.\n       */\n\n      this.lastLocationChangeInfo = null;\n      this.navigationId = 0;\n      /**\n       * The id of the currently active page in the router.\n       * Updated to the transition's target id on a successful navigation.\n       *\n       * This is used to track what page the router last activated. When an attempted navigation fails,\n       * the router can then use this to compute how to restore the state back to the previously active\n       * page.\n       */\n\n      this.currentPageId = 0;\n      this.isNgZoneEnabled = false;\n      /**\n       * An event stream for routing events in this NgModule.\n       */\n\n      this.events = new Subject();\n      /**\n       * A handler for navigation errors in this NgModule.\n       */\n\n      this.errorHandler = defaultErrorHandler;\n      /**\n       * A handler for errors thrown by `Router.parseUrl(url)`\n       * when `url` contains an invalid character.\n       * The most common case is a `%` sign\n       * that's not encoded and is not part of a percent encoded sequence.\n       */\n\n      this.malformedUriErrorHandler = defaultMalformedUriErrorHandler;\n      /**\n       * True if at least one navigation event has occurred,\n       * false otherwise.\n       */\n\n      this.navigated = false;\n      this.lastSuccessfulId = -1;\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\n      this.hooks = {\n        beforePreactivation: defaultRouterHook,\n        afterPreactivation: defaultRouterHook\n      };\n      /**\n       * A strategy for extracting and merging URLs.\n       * Used for AngularJS to Angular migrations.\n       */\n\n      this.urlHandlingStrategy = new DefaultUrlHandlingStrategy();\n      /**\n       * A strategy for re-using routes.\n       */\n\n      this.routeReuseStrategy = new DefaultRouteReuseStrategy();\n      /**\n       * How to handle a navigation request to the current URL. One of:\n       *\n       * - `'ignore'` :  The router ignores the request.\n       * - `'reload'` : The router reloads the URL. Use to implement a \"refresh\" feature.\n       *\n       * Note that this only configures whether the Route reprocesses the URL and triggers related\n       * action and events like redirects, guards, and resolvers. By default, the router re-uses a\n       * component instance when it re-navigates to the same component type without visiting a different\n       * component first. This behavior is configured by the `RouteReuseStrategy`. In order to reload\n       * routed components on same url navigation, you need to set `onSameUrlNavigation` to `'reload'`\n       * _and_ provide a `RouteReuseStrategy` which returns `false` for `shouldReuseRoute`.\n       */\n\n      this.onSameUrlNavigation = 'ignore';\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\n      this.paramsInheritanceStrategy = 'emptyOnly';\n      /**\n       * Determines when the router updates the browser URL.\n       * By default (`\"deferred\"`), updates the browser URL after navigation has finished.\n       * Set to `'eager'` to update the browser URL at the beginning of navigation.\n       * You can choose to update early so that, if navigation fails,\n       * you can show an error message with the URL that failed.\n       */\n\n      this.urlUpdateStrategy = 'deferred';\n      /**\n       * Enables a bug fix that corrects relative link resolution in components with empty paths.\n       * @see `RouterModule`\n       */\n\n      this.relativeLinkResolution = 'corrected';\n      /**\n       * Configures how the Router attempts to restore state when a navigation is cancelled.\n       *\n       * 'replace' - Always uses `location.replaceState` to set the browser state to the state of the\n       * router before the navigation started.\n       *\n       * 'computed' - Will always return to the same state that corresponds to the actual Angular route\n       * when the navigation gets cancelled right after triggering a `popstate` event.\n       *\n       * The default value is `replace`\n       *\n       * @internal\n       */\n      // TODO(atscott): Determine how/when/if to make this public API\n      // This shouldn’t be an option at all but may need to be in order to allow migration without a\n      // breaking change. We need to determine if it should be made into public api (or if we forgo\n      // the option and release as a breaking change bug fix in a major version).\n\n      this.canceledNavigationResolution = 'replace';\n\n      var onLoadStart = function onLoadStart(r) {\n        return _this29.triggerEvent(new RouteConfigLoadStart(r));\n      };\n\n      var onLoadEnd = function onLoadEnd(r) {\n        return _this29.triggerEvent(new RouteConfigLoadEnd(r));\n      };\n\n      this.ngModule = injector.get(NgModuleRef);\n      this.console = injector.get(ɵConsole);\n      var ngZone = injector.get(NgZone);\n      this.isNgZoneEnabled = ngZone instanceof NgZone && NgZone.isInAngularZone();\n      this.resetConfig(config);\n      this.currentUrlTree = createEmptyUrlTree();\n      this.rawUrlTree = this.currentUrlTree;\n      this.browserUrlTree = this.currentUrlTree;\n      this.configLoader = new RouterConfigLoader(loader, compiler, onLoadStart, onLoadEnd);\n      this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType);\n      this.transitions = new BehaviorSubject({\n        id: 0,\n        targetPageId: 0,\n        currentUrlTree: this.currentUrlTree,\n        currentRawUrl: this.currentUrlTree,\n        extractedUrl: this.urlHandlingStrategy.extract(this.currentUrlTree),\n        urlAfterRedirects: this.urlHandlingStrategy.extract(this.currentUrlTree),\n        rawUrl: this.currentUrlTree,\n        extras: {},\n        resolve: null,\n        reject: null,\n        promise: Promise.resolve(true),\n        source: 'imperative',\n        restoredState: null,\n        currentSnapshot: this.routerState.snapshot,\n        targetSnapshot: null,\n        currentRouterState: this.routerState,\n        targetRouterState: null,\n        guards: {\n          canActivateChecks: [],\n          canDeactivateChecks: []\n        },\n        guardsResult: null\n      });\n      this.navigations = this.setupNavigations(this.transitions);\n      this.processNavigations();\n    }\n    /**\n     * The ɵrouterPageId of whatever page is currently active in the browser history. This is\n     * important for computing the target page id for new navigations because we need to ensure each\n     * page id in the browser history is 1 more than the previous entry.\n     */\n\n\n    _createClass(Router, [{\n      key: \"browserPageId\",\n      get: function get() {\n        var _a;\n\n        return (_a = this.location.getState()) === null || _a === void 0 ? void 0 : _a.ɵrouterPageId;\n      }\n    }, {\n      key: \"setupNavigations\",\n      value: function setupNavigations(transitions) {\n        var _this30 = this;\n\n        var eventsSubject = this.events;\n        return transitions.pipe(filter(function (t) {\n          return t.id !== 0;\n        }), // Extract URL\n        map(function (t) {\n          return Object.assign(Object.assign({}, t), {\n            extractedUrl: _this30.urlHandlingStrategy.extract(t.rawUrl)\n          });\n        }), // Using switchMap so we cancel executing navigations when a new one comes in\n        switchMap(function (t) {\n          var completed = false;\n          var errored = false;\n          return of(t).pipe( // Store the Navigation object\n          tap(function (t) {\n            _this30.currentNavigation = {\n              id: t.id,\n              initialUrl: t.currentRawUrl,\n              extractedUrl: t.extractedUrl,\n              trigger: t.source,\n              extras: t.extras,\n              previousNavigation: _this30.lastSuccessfulNavigation ? Object.assign(Object.assign({}, _this30.lastSuccessfulNavigation), {\n                previousNavigation: null\n              }) : null\n            };\n          }), switchMap(function (t) {\n            var browserUrlTree = _this30.browserUrlTree.toString();\n\n            var urlTransition = !_this30.navigated || t.extractedUrl.toString() !== browserUrlTree || // Navigations which succeed or ones which fail and are cleaned up\n            // correctly should result in `browserUrlTree` and `currentUrlTree`\n            // matching. If this is not the case, assume something went wrong and try\n            // processing the URL again.\n            browserUrlTree !== _this30.currentUrlTree.toString();\n\n            var processCurrentUrl = (_this30.onSameUrlNavigation === 'reload' ? true : urlTransition) && _this30.urlHandlingStrategy.shouldProcessUrl(t.rawUrl);\n\n            if (processCurrentUrl) {\n              // If the source of the navigation is from a browser event, the URL is\n              // already updated. We already need to sync the internal state.\n              if (isBrowserTriggeredNavigation(t.source)) {\n                _this30.browserUrlTree = t.extractedUrl;\n              }\n\n              return of(t).pipe( // Fire NavigationStart event\n              switchMap(function (t) {\n                var transition = _this30.transitions.getValue();\n\n                eventsSubject.next(new NavigationStart(t.id, _this30.serializeUrl(t.extractedUrl), t.source, t.restoredState));\n\n                if (transition !== _this30.transitions.getValue()) {\n                  return EMPTY;\n                } // This delay is required to match old behavior that forced\n                // navigation to always be async\n\n\n                return Promise.resolve(t);\n              }), // ApplyRedirects\n              applyRedirects$1(_this30.ngModule.injector, _this30.configLoader, _this30.urlSerializer, _this30.config), // Update the currentNavigation\n              tap(function (t) {\n                _this30.currentNavigation = Object.assign(Object.assign({}, _this30.currentNavigation), {\n                  finalUrl: t.urlAfterRedirects\n                });\n              }), // Recognize\n              recognize$1(_this30.rootComponentType, _this30.config, function (url) {\n                return _this30.serializeUrl(url);\n              }, _this30.paramsInheritanceStrategy, _this30.relativeLinkResolution), // Update URL if in `eager` update mode\n              tap(function (t) {\n                if (_this30.urlUpdateStrategy === 'eager') {\n                  if (!t.extras.skipLocationChange) {\n                    _this30.setBrowserUrl(t.urlAfterRedirects, t); // TODO(atscott): The above line is incorrect. It sets the url to\n                    // only the part that is handled by the router. It should merge\n                    // that with the rawUrl so the url includes segments not handled\n                    // by the router:\n                    //  const rawUrl = this.urlHandlingStrategy.merge(\n                    //      t.urlAfterRedirects, t.rawUrl);\n                    //  this.setBrowserUrl(rawUrl, t);\n\n                  }\n\n                  _this30.browserUrlTree = t.urlAfterRedirects;\n                } // Fire RoutesRecognized\n\n\n                var routesRecognized = new RoutesRecognized(t.id, _this30.serializeUrl(t.extractedUrl), _this30.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);\n                eventsSubject.next(routesRecognized);\n              }));\n            } else {\n              var processPreviousUrl = urlTransition && _this30.rawUrlTree && _this30.urlHandlingStrategy.shouldProcessUrl(_this30.rawUrlTree);\n              /* When the current URL shouldn't be processed, but the previous one was,\n               * we handle this \"error condition\" by navigating to the previously\n               * successful URL, but leaving the URL intact.*/\n\n\n              if (processPreviousUrl) {\n                var id = t.id,\n                    extractedUrl = t.extractedUrl,\n                    source = t.source,\n                    restoredState = t.restoredState,\n                    extras = t.extras;\n                var navStart = new NavigationStart(id, _this30.serializeUrl(extractedUrl), source, restoredState);\n                eventsSubject.next(navStart);\n                var targetSnapshot = createEmptyState(extractedUrl, _this30.rootComponentType).snapshot;\n                return of(Object.assign(Object.assign({}, t), {\n                  targetSnapshot: targetSnapshot,\n                  urlAfterRedirects: extractedUrl,\n                  extras: Object.assign(Object.assign({}, extras), {\n                    skipLocationChange: false,\n                    replaceUrl: false\n                  })\n                }));\n              } else {\n                /* When neither the current or previous URL can be processed, do nothing\n                 * other than update router's internal reference to the current \"settled\"\n                 * URL. This way the next navigation will be coming from the current URL\n                 * in the browser.\n                 */\n                _this30.rawUrlTree = t.rawUrl;\n                _this30.browserUrlTree = t.urlAfterRedirects;\n                t.resolve(null);\n                return EMPTY;\n              }\n            }\n          }), // Before Preactivation\n          switchTap(function (t) {\n            var targetSnapshot = t.targetSnapshot,\n                navigationId = t.id,\n                appliedUrlTree = t.extractedUrl,\n                rawUrlTree = t.rawUrl,\n                _t$extras = t.extras,\n                skipLocationChange = _t$extras.skipLocationChange,\n                replaceUrl = _t$extras.replaceUrl;\n            return _this30.hooks.beforePreactivation(targetSnapshot, {\n              navigationId: navigationId,\n              appliedUrlTree: appliedUrlTree,\n              rawUrlTree: rawUrlTree,\n              skipLocationChange: !!skipLocationChange,\n              replaceUrl: !!replaceUrl\n            });\n          }), // --- GUARDS ---\n          tap(function (t) {\n            var guardsStart = new GuardsCheckStart(t.id, _this30.serializeUrl(t.extractedUrl), _this30.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);\n\n            _this30.triggerEvent(guardsStart);\n          }), map(function (t) {\n            return Object.assign(Object.assign({}, t), {\n              guards: getAllRouteGuards(t.targetSnapshot, t.currentSnapshot, _this30.rootContexts)\n            });\n          }), checkGuards(_this30.ngModule.injector, function (evt) {\n            return _this30.triggerEvent(evt);\n          }), tap(function (t) {\n            if (isUrlTree(t.guardsResult)) {\n              var error = navigationCancelingError(\"Redirecting to \\\"\".concat(_this30.serializeUrl(t.guardsResult), \"\\\"\"));\n              error.url = t.guardsResult;\n              throw error;\n            }\n\n            var guardsEnd = new GuardsCheckEnd(t.id, _this30.serializeUrl(t.extractedUrl), _this30.serializeUrl(t.urlAfterRedirects), t.targetSnapshot, !!t.guardsResult);\n\n            _this30.triggerEvent(guardsEnd);\n          }), filter(function (t) {\n            if (!t.guardsResult) {\n              _this30.restoreHistory(t);\n\n              _this30.cancelNavigationTransition(t, '');\n\n              return false;\n            }\n\n            return true;\n          }), // --- RESOLVE ---\n          switchTap(function (t) {\n            if (t.guards.canActivateChecks.length) {\n              return of(t).pipe(tap(function (t) {\n                var resolveStart = new ResolveStart(t.id, _this30.serializeUrl(t.extractedUrl), _this30.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);\n\n                _this30.triggerEvent(resolveStart);\n              }), switchMap(function (t) {\n                var dataResolved = false;\n                return of(t).pipe(resolveData(_this30.paramsInheritanceStrategy, _this30.ngModule.injector), tap({\n                  next: function next() {\n                    return dataResolved = true;\n                  },\n                  complete: function complete() {\n                    if (!dataResolved) {\n                      _this30.restoreHistory(t);\n\n                      _this30.cancelNavigationTransition(t, \"At least one route resolver didn't emit any value.\");\n                    }\n                  }\n                }));\n              }), tap(function (t) {\n                var resolveEnd = new ResolveEnd(t.id, _this30.serializeUrl(t.extractedUrl), _this30.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);\n\n                _this30.triggerEvent(resolveEnd);\n              }));\n            }\n\n            return undefined;\n          }), // --- AFTER PREACTIVATION ---\n          switchTap(function (t) {\n            var targetSnapshot = t.targetSnapshot,\n                navigationId = t.id,\n                appliedUrlTree = t.extractedUrl,\n                rawUrlTree = t.rawUrl,\n                _t$extras2 = t.extras,\n                skipLocationChange = _t$extras2.skipLocationChange,\n                replaceUrl = _t$extras2.replaceUrl;\n            return _this30.hooks.afterPreactivation(targetSnapshot, {\n              navigationId: navigationId,\n              appliedUrlTree: appliedUrlTree,\n              rawUrlTree: rawUrlTree,\n              skipLocationChange: !!skipLocationChange,\n              replaceUrl: !!replaceUrl\n            });\n          }), map(function (t) {\n            var targetRouterState = createRouterState(_this30.routeReuseStrategy, t.targetSnapshot, t.currentRouterState);\n            return Object.assign(Object.assign({}, t), {\n              targetRouterState: targetRouterState\n            });\n          }),\n          /* Once here, we are about to activate syncronously. The assumption is this\n             will succeed, and user code may read from the Router service. Therefore\n             before activation, we need to update router properties storing the current\n             URL and the RouterState, as well as updated the browser URL. All this should\n             happen *before* activating. */\n          tap(function (t) {\n            _this30.currentUrlTree = t.urlAfterRedirects;\n            _this30.rawUrlTree = _this30.urlHandlingStrategy.merge(t.urlAfterRedirects, t.rawUrl);\n            _this30.routerState = t.targetRouterState;\n\n            if (_this30.urlUpdateStrategy === 'deferred') {\n              if (!t.extras.skipLocationChange) {\n                _this30.setBrowserUrl(_this30.rawUrlTree, t);\n              }\n\n              _this30.browserUrlTree = t.urlAfterRedirects;\n            }\n          }), activateRoutes(_this30.rootContexts, _this30.routeReuseStrategy, function (evt) {\n            return _this30.triggerEvent(evt);\n          }), tap({\n            next: function next() {\n              completed = true;\n            },\n            complete: function complete() {\n              completed = true;\n            }\n          }), finalize(function () {\n            var _a;\n            /* When the navigation stream finishes either through error or success, we\n             * set the `completed` or `errored` flag. However, there are some situations\n             * where we could get here without either of those being set. For instance, a\n             * redirect during NavigationStart. Therefore, this is a catch-all to make\n             * sure the NavigationCancel\n             * event is fired when a navigation gets cancelled but not caught by other\n             * means. */\n\n\n            if (!completed && !errored) {\n              var cancelationReason = \"Navigation ID \".concat(t.id, \" is not equal to the current navigation id \").concat(_this30.navigationId);\n\n              if (_this30.canceledNavigationResolution === 'replace') {\n                // Must reset to current URL tree here to ensure history.state is set. On\n                // a fresh page load, if a new navigation comes in before a successful\n                // navigation completes, there will be nothing in\n                // history.state.navigationId. This can cause sync problems with\n                // AngularJS sync code which looks for a value here in order to determine\n                // whether or not to handle a given popstate event or to leave it to the\n                // Angular router.\n                _this30.restoreHistory(t);\n\n                _this30.cancelNavigationTransition(t, cancelationReason);\n              } else {\n                // We cannot trigger a `location.historyGo` if the\n                // cancellation was due to a new navigation before the previous could\n                // complete. This is because `location.historyGo` triggers a `popstate`\n                // which would also trigger another navigation. Instead, treat this as a\n                // redirect and do not reset the state.\n                _this30.cancelNavigationTransition(t, cancelationReason); // TODO(atscott): The same problem happens here with a fresh page load\n                // and a new navigation before that completes where we won't set a page\n                // id.\n\n              }\n            } // Only clear current navigation if it is still set to the one that\n            // finalized.\n\n\n            if (((_a = _this30.currentNavigation) === null || _a === void 0 ? void 0 : _a.id) === t.id) {\n              _this30.currentNavigation = null;\n            }\n          }), catchError(function (e) {\n            // TODO(atscott): The NavigationTransition `t` used here does not accurately\n            // reflect the current state of the whole transition because some operations\n            // return a new object rather than modifying the one in the outermost\n            // `switchMap`.\n            //  The fix can likely be to:\n            //  1. Rename the outer `t` variable so it's not shadowed all the time and\n            //  confusing\n            //  2. Keep reassigning to the outer variable after each stage to ensure it\n            //  gets updated. Or change the implementations to not return a copy.\n            // Not changed yet because it affects existing code and would need to be\n            // tested more thoroughly.\n            errored = true;\n            /* This error type is issued during Redirect, and is handled as a\n             * cancellation rather than an error. */\n\n            if (isNavigationCancelingError(e)) {\n              var redirecting = isUrlTree(e.url);\n\n              if (!redirecting) {\n                // Set property only if we're not redirecting. If we landed on a page and\n                // redirect to `/` route, the new navigation is going to see the `/`\n                // isn't a change from the default currentUrlTree and won't navigate.\n                // This is only applicable with initial navigation, so setting\n                // `navigated` only when not redirecting resolves this scenario.\n                _this30.navigated = true;\n\n                _this30.restoreHistory(t, true);\n              }\n\n              var navCancel = new NavigationCancel(t.id, _this30.serializeUrl(t.extractedUrl), e.message);\n              eventsSubject.next(navCancel); // When redirecting, we need to delay resolving the navigation\n              // promise and push it to the redirect navigation\n\n              if (!redirecting) {\n                t.resolve(false);\n              } else {\n                // setTimeout is required so this navigation finishes with\n                // the return EMPTY below. If it isn't allowed to finish\n                // processing, there can be multiple navigations to the same\n                // URL.\n                setTimeout(function () {\n                  var mergedTree = _this30.urlHandlingStrategy.merge(e.url, _this30.rawUrlTree);\n\n                  var extras = {\n                    skipLocationChange: t.extras.skipLocationChange,\n                    // The URL is already updated at this point if we have 'eager' URL\n                    // updates or if the navigation was triggered by the browser (back\n                    // button, URL bar, etc). We want to replace that item in history if\n                    // the navigation is rejected.\n                    replaceUrl: _this30.urlUpdateStrategy === 'eager' || isBrowserTriggeredNavigation(t.source)\n                  };\n\n                  _this30.scheduleNavigation(mergedTree, 'imperative', null, extras, {\n                    resolve: t.resolve,\n                    reject: t.reject,\n                    promise: t.promise\n                  });\n                }, 0);\n              }\n              /* All other errors should reset to the router's internal URL reference to\n               * the pre-error state. */\n\n            } else {\n              _this30.restoreHistory(t, true);\n\n              var navError = new NavigationError(t.id, _this30.serializeUrl(t.extractedUrl), e);\n              eventsSubject.next(navError);\n\n              try {\n                t.resolve(_this30.errorHandler(e));\n              } catch (ee) {\n                t.reject(ee);\n              }\n            }\n\n            return EMPTY;\n          })); // TODO(jasonaden): remove cast once g3 is on updated TypeScript\n        }));\n      }\n      /**\n       * @internal\n       * TODO: this should be removed once the constructor of the router made internal\n       */\n\n    }, {\n      key: \"resetRootComponentType\",\n      value: function resetRootComponentType(rootComponentType) {\n        this.rootComponentType = rootComponentType; // TODO: vsavkin router 4.0 should make the root component set to null\n        // this will simplify the lifecycle of the router.\n\n        this.routerState.root.component = this.rootComponentType;\n      }\n    }, {\n      key: \"getTransition\",\n      value: function getTransition() {\n        var transition = this.transitions.value; // TODO(atscott): This comment doesn't make it clear why this value needs to be set. In the case\n        // described below (where we don't handle previous or current url), the `browserUrlTree` is set\n        // to the `urlAfterRedirects` value. However, these values *are already the same* because of the\n        // line below. So it seems that we should be able to remove the line below and the line where\n        // `browserUrlTree` is updated when we aren't handling any part of the navigation url.\n        // Run TGP to confirm that this can be done.\n        // 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\n        transition.urlAfterRedirects = this.browserUrlTree;\n        return transition;\n      }\n    }, {\n      key: \"setTransition\",\n      value: function setTransition(t) {\n        this.transitions.next(Object.assign(Object.assign({}, this.getTransition()), t));\n      }\n      /**\n       * Sets up the location change listener and performs the initial navigation.\n       */\n\n    }, {\n      key: \"initialNavigation\",\n      value: function initialNavigation() {\n        this.setUpLocationChangeListener();\n\n        if (this.navigationId === 0) {\n          this.navigateByUrl(this.location.path(true), {\n            replaceUrl: true\n          });\n        }\n      }\n      /**\n       * Sets up the location change listener. This listener detects navigations triggered from outside\n       * the Router (the browser back/forward buttons, for example) and schedules a corresponding Router\n       * navigation so that the correct events, guards, etc. are triggered.\n       */\n\n    }, {\n      key: \"setUpLocationChangeListener\",\n      value: function setUpLocationChangeListener() {\n        var _this31 = this;\n\n        // Don't need to use Zone.wrap any more, because zone.js\n        // already patch onPopState, so location change callback will\n        // run into ngZone\n        if (!this.locationSubscription) {\n          this.locationSubscription = this.location.subscribe(function (event) {\n            var currentChange = _this31.extractLocationChangeInfoFromEvent(event); // The `setTimeout` was added in #12160 and is likely to support Angular/AngularJS\n            // hybrid apps.\n\n\n            if (_this31.shouldScheduleNavigation(_this31.lastLocationChangeInfo, currentChange)) {\n              setTimeout(function () {\n                var source = currentChange.source,\n                    state = currentChange.state,\n                    urlTree = currentChange.urlTree;\n                var extras = {\n                  replaceUrl: true\n                };\n\n                if (state) {\n                  var stateCopy = Object.assign({}, state);\n                  delete stateCopy.navigationId;\n                  delete stateCopy.ɵrouterPageId;\n\n                  if (Object.keys(stateCopy).length !== 0) {\n                    extras.state = stateCopy;\n                  }\n                }\n\n                _this31.scheduleNavigation(urlTree, source, state, extras);\n              }, 0);\n            }\n\n            _this31.lastLocationChangeInfo = currentChange;\n          });\n        }\n      }\n      /** Extracts router-related information from a `PopStateEvent`. */\n\n    }, {\n      key: \"extractLocationChangeInfoFromEvent\",\n      value: function extractLocationChangeInfoFromEvent(change) {\n        var _a;\n\n        return {\n          source: change['type'] === 'popstate' ? 'popstate' : 'hashchange',\n          urlTree: this.parseUrl(change['url']),\n          // Navigations coming from Angular router have a navigationId state\n          // property. When this exists, restore the state.\n          state: ((_a = change.state) === null || _a === void 0 ? void 0 : _a.navigationId) ? change.state : null,\n          transitionId: this.getTransition().id\n        };\n      }\n      /**\n       * Determines whether two events triggered by the Location subscription are due to the same\n       * navigation. The location subscription can fire two events (popstate and hashchange) for a\n       * single navigation. The second one should be ignored, that is, we should not schedule another\n       * navigation in the Router.\n       */\n\n    }, {\n      key: \"shouldScheduleNavigation\",\n      value: function shouldScheduleNavigation(previous, current) {\n        if (!previous) return true;\n        var sameDestination = current.urlTree.toString() === previous.urlTree.toString();\n        var eventsOccurredAtSameTime = current.transitionId === previous.transitionId;\n\n        if (!eventsOccurredAtSameTime || !sameDestination) {\n          return true;\n        }\n\n        if (current.source === 'hashchange' && previous.source === 'popstate' || current.source === 'popstate' && previous.source === 'hashchange') {\n          return false;\n        }\n\n        return true;\n      }\n      /** The current URL. */\n\n    }, {\n      key: \"url\",\n      get: function get() {\n        return this.serializeUrl(this.currentUrlTree);\n      }\n      /**\n       * Returns the current `Navigation` object when the router is navigating,\n       * and `null` when idle.\n       */\n\n    }, {\n      key: \"getCurrentNavigation\",\n      value: function getCurrentNavigation() {\n        return this.currentNavigation;\n      }\n      /** @internal */\n\n    }, {\n      key: \"triggerEvent\",\n      value: function triggerEvent(event) {\n        this.events.next(event);\n      }\n      /**\n       * Resets the route configuration used for navigation and generating links.\n       *\n       * @param config The route array for the new configuration.\n       *\n       * @usageNotes\n       *\n       * ```\n       * router.resetConfig([\n       *  { path: 'team/:id', component: TeamCmp, children: [\n       *    { path: 'simple', component: SimpleCmp },\n       *    { path: 'user/:name', component: UserCmp }\n       *  ]}\n       * ]);\n       * ```\n       */\n\n    }, {\n      key: \"resetConfig\",\n      value: function resetConfig(config) {\n        validateConfig(config);\n        this.config = config.map(standardizeConfig);\n        this.navigated = false;\n        this.lastSuccessfulId = -1;\n      }\n      /** @nodoc */\n\n    }, {\n      key: \"ngOnDestroy\",\n      value: function ngOnDestroy() {\n        this.dispose();\n      }\n      /** Disposes of the router. */\n\n    }, {\n      key: \"dispose\",\n      value: function dispose() {\n        this.transitions.complete();\n\n        if (this.locationSubscription) {\n          this.locationSubscription.unsubscribe();\n          this.locationSubscription = undefined;\n        }\n\n        this.disposed = true;\n      }\n      /**\n       * Appends URL segments to the current URL tree to create a new URL tree.\n       *\n       * @param commands An array of URL fragments with which to construct the new URL tree.\n       * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path\n       * segments, followed by the parameters for each segment.\n       * The fragments are applied to the current URL tree or the one provided  in the `relativeTo`\n       * property of the options object, if supplied.\n       * @param navigationExtras Options that control the navigation strategy.\n       * @returns The new URL tree.\n       *\n       * @usageNotes\n       *\n       * ```\n       * // create /team/33/user/11\n       * router.createUrlTree(['/team', 33, 'user', 11]);\n       *\n       * // create /team/33;expand=true/user/11\n       * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);\n       *\n       * // you can collapse static segments like this (this works only with the first passed-in value):\n       * router.createUrlTree(['/team/33/user', userId]);\n       *\n       * // If the first segment can contain slashes, and you do not want the router to split it,\n       * // you can do the following:\n       * router.createUrlTree([{segmentPath: '/one/two'}]);\n       *\n       * // create /team/33/(user/11//right:chat)\n       * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);\n       *\n       * // remove the right secondary node\n       * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);\n       *\n       * // assuming the current url is `/team/33/user/11` and the route points to `user/11`\n       *\n       * // navigate to /team/33/user/11/details\n       * router.createUrlTree(['details'], {relativeTo: route});\n       *\n       * // navigate to /team/33/user/22\n       * router.createUrlTree(['../22'], {relativeTo: route});\n       *\n       * // navigate to /team/44/user/22\n       * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});\n       *\n       * Note that a value of `null` or `undefined` for `relativeTo` indicates that the\n       * tree should be created relative to the root.\n       * ```\n       */\n\n    }, {\n      key: \"createUrlTree\",\n      value: function createUrlTree(commands) {\n        var navigationExtras = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n        var relativeTo = navigationExtras.relativeTo,\n            queryParams = navigationExtras.queryParams,\n            fragment = navigationExtras.fragment,\n            queryParamsHandling = navigationExtras.queryParamsHandling,\n            preserveFragment = navigationExtras.preserveFragment;\n        var a = relativeTo || this.routerState.root;\n        var f = preserveFragment ? this.currentUrlTree.fragment : fragment;\n        var q = null;\n\n        switch (queryParamsHandling) {\n          case 'merge':\n            q = Object.assign(Object.assign({}, this.currentUrlTree.queryParams), queryParams);\n            break;\n\n          case 'preserve':\n            q = this.currentUrlTree.queryParams;\n            break;\n\n          default:\n            q = queryParams || null;\n        }\n\n        if (q !== null) {\n          q = this.removeEmptyProps(q);\n        }\n\n        return _createUrlTree(a, this.currentUrlTree, commands, q, f !== null && f !== void 0 ? f : null);\n      }\n      /**\n       * Navigates to a view using an absolute route path.\n       *\n       * @param url An absolute path for a defined route. The function does not apply any delta to the\n       *     current URL.\n       * @param extras An object containing properties that modify the navigation strategy.\n       *\n       * @returns A Promise that resolves to 'true' when navigation succeeds,\n       * to 'false' when navigation fails, or is rejected on error.\n       *\n       * @usageNotes\n       *\n       * The following calls request navigation to an absolute path.\n       *\n       * ```\n       * router.navigateByUrl(\"/team/33/user/11\");\n       *\n       * // Navigate without updating the URL\n       * router.navigateByUrl(\"/team/33/user/11\", { skipLocationChange: true });\n       * ```\n       *\n       * @see [Routing and Navigation guide](guide/router)\n       *\n       */\n\n    }, {\n      key: \"navigateByUrl\",\n      value: function navigateByUrl(url) {\n        var extras = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n          skipLocationChange: false\n        };\n\n        if (typeof ngDevMode === 'undefined' || ngDevMode && this.isNgZoneEnabled && !NgZone.isInAngularZone()) {\n          this.console.warn(\"Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?\");\n        }\n\n        var urlTree = isUrlTree(url) ? url : this.parseUrl(url);\n        var mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree);\n        return this.scheduleNavigation(mergedTree, 'imperative', null, extras);\n      }\n      /**\n       * Navigate based on the provided array of commands and a starting point.\n       * If no starting route is provided, the navigation is absolute.\n       *\n       * @param commands An array of URL fragments with which to construct the target URL.\n       * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path\n       * segments, followed by the parameters for each segment.\n       * The fragments are applied to the current URL or the one provided  in the `relativeTo` property\n       * of the options object, if supplied.\n       * @param extras An options object that determines how the URL should be constructed or\n       *     interpreted.\n       *\n       * @returns A Promise that resolves to `true` when navigation succeeds, to `false` when navigation\n       *     fails,\n       * or is rejected on error.\n       *\n       * @usageNotes\n       *\n       * The following calls request navigation to a dynamic route path relative to the current URL.\n       *\n       * ```\n       * router.navigate(['team', 33, 'user', 11], {relativeTo: route});\n       *\n       * // Navigate without updating the URL, overriding the default behavior\n       * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});\n       * ```\n       *\n       * @see [Routing and Navigation guide](guide/router)\n       *\n       */\n\n    }, {\n      key: \"navigate\",\n      value: function navigate(commands) {\n        var extras = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n          skipLocationChange: false\n        };\n        validateCommands(commands);\n        return this.navigateByUrl(this.createUrlTree(commands, extras), extras);\n      }\n      /** Serializes a `UrlTree` into a string */\n\n    }, {\n      key: \"serializeUrl\",\n      value: function serializeUrl(url) {\n        return this.urlSerializer.serialize(url);\n      }\n      /** Parses a string into a `UrlTree` */\n\n    }, {\n      key: \"parseUrl\",\n      value: function parseUrl(url) {\n        var urlTree;\n\n        try {\n          urlTree = this.urlSerializer.parse(url);\n        } catch (e) {\n          urlTree = this.malformedUriErrorHandler(e, this.urlSerializer, url);\n        }\n\n        return urlTree;\n      }\n    }, {\n      key: \"isActive\",\n      value: function isActive(url, matchOptions) {\n        var options;\n\n        if (matchOptions === true) {\n          options = Object.assign({}, exactMatchOptions);\n        } else if (matchOptions === false) {\n          options = Object.assign({}, subsetMatchOptions);\n        } else {\n          options = matchOptions;\n        }\n\n        if (isUrlTree(url)) {\n          return containsTree(this.currentUrlTree, url, options);\n        }\n\n        var urlTree = this.parseUrl(url);\n        return containsTree(this.currentUrlTree, urlTree, options);\n      }\n    }, {\n      key: \"removeEmptyProps\",\n      value: function removeEmptyProps(params) {\n        return Object.keys(params).reduce(function (result, key) {\n          var value = params[key];\n\n          if (value !== null && value !== undefined) {\n            result[key] = value;\n          }\n\n          return result;\n        }, {});\n      }\n    }, {\n      key: \"processNavigations\",\n      value: function processNavigations() {\n        var _this32 = this;\n\n        this.navigations.subscribe(function (t) {\n          _this32.navigated = true;\n          _this32.lastSuccessfulId = t.id;\n          _this32.currentPageId = t.targetPageId;\n\n          _this32.events.next(new NavigationEnd(t.id, _this32.serializeUrl(t.extractedUrl), _this32.serializeUrl(_this32.currentUrlTree)));\n\n          _this32.lastSuccessfulNavigation = _this32.currentNavigation;\n          t.resolve(true);\n        }, function (e) {\n          _this32.console.warn(\"Unhandled Navigation Error: \".concat(e));\n        });\n      }\n    }, {\n      key: \"scheduleNavigation\",\n      value: function scheduleNavigation(rawUrl, source, restoredState, extras, priorPromise) {\n        var _a, _b;\n\n        if (this.disposed) {\n          return Promise.resolve(false);\n        } // * Imperative navigations (router.navigate) might trigger additional navigations to the same\n        //   URL via a popstate event and the locationChangeListener. We should skip these duplicate\n        //   navs. Duplicates may also be triggered by attempts to sync AngularJS and Angular router\n        //   states.\n        // * Imperative navigations can be cancelled by router guards, meaning the URL won't change. If\n        //   the user follows that with a navigation using the back/forward button or manual URL change,\n        //   the destination may be the same as the previous imperative attempt. We should not skip\n        //   these navigations because it's a separate case from the one above -- it's not a duplicate\n        //   navigation.\n\n\n        var lastNavigation = this.getTransition(); // We don't want to skip duplicate successful navs if they're imperative because\n        // onSameUrlNavigation could be 'reload' (so the duplicate is intended).\n\n        var browserNavPrecededByRouterNav = isBrowserTriggeredNavigation(source) && lastNavigation && !isBrowserTriggeredNavigation(lastNavigation.source);\n        var lastNavigationSucceeded = this.lastSuccessfulId === lastNavigation.id; // If the last navigation succeeded or is in flight, we can use the rawUrl as the comparison.\n        // However, if it failed, we should compare to the final result (urlAfterRedirects).\n\n        var lastNavigationUrl = lastNavigationSucceeded || this.currentNavigation ? lastNavigation.rawUrl : lastNavigation.urlAfterRedirects;\n        var duplicateNav = lastNavigationUrl.toString() === rawUrl.toString();\n\n        if (browserNavPrecededByRouterNav && duplicateNav) {\n          return Promise.resolve(true); // return value is not used\n        }\n\n        var resolve;\n        var reject;\n        var promise;\n\n        if (priorPromise) {\n          resolve = priorPromise.resolve;\n          reject = priorPromise.reject;\n          promise = priorPromise.promise;\n        } else {\n          promise = new Promise(function (res, rej) {\n            resolve = res;\n            reject = rej;\n          });\n        }\n\n        var id = ++this.navigationId;\n        var targetPageId;\n\n        if (this.canceledNavigationResolution === 'computed') {\n          var isInitialPage = this.currentPageId === 0;\n\n          if (isInitialPage) {\n            restoredState = this.location.getState();\n          } // If the `ɵrouterPageId` exist in the state then `targetpageId` should have the value of\n          // `ɵrouterPageId`. This is the case for something like a page refresh where we assign the\n          // target id to the previously set value for that page.\n\n\n          if (restoredState && restoredState.ɵrouterPageId) {\n            targetPageId = restoredState.ɵrouterPageId;\n          } else {\n            // If we're replacing the URL or doing a silent navigation, we do not want to increment the\n            // page id because we aren't pushing a new entry to history.\n            if (extras.replaceUrl || extras.skipLocationChange) {\n              targetPageId = (_a = this.browserPageId) !== null && _a !== void 0 ? _a : 0;\n            } else {\n              targetPageId = ((_b = this.browserPageId) !== null && _b !== void 0 ? _b : 0) + 1;\n            }\n          }\n        } else {\n          // This is unused when `canceledNavigationResolution` is not computed.\n          targetPageId = 0;\n        }\n\n        this.setTransition({\n          id: id,\n          targetPageId: targetPageId,\n          source: source,\n          restoredState: restoredState,\n          currentUrlTree: this.currentUrlTree,\n          currentRawUrl: this.rawUrlTree,\n          rawUrl: rawUrl,\n          extras: extras,\n          resolve: resolve,\n          reject: reject,\n          promise: promise,\n          currentSnapshot: this.routerState.snapshot,\n          currentRouterState: this.routerState\n        }); // Make sure that the error is propagated even though `processNavigations` catch\n        // handler does not rethrow\n\n        return promise.catch(function (e) {\n          return Promise.reject(e);\n        });\n      }\n    }, {\n      key: \"setBrowserUrl\",\n      value: function setBrowserUrl(url, t) {\n        var path = this.urlSerializer.serialize(url);\n        var state = Object.assign(Object.assign({}, t.extras.state), this.generateNgRouterState(t.id, t.targetPageId));\n\n        if (this.location.isCurrentPathEqualTo(path) || !!t.extras.replaceUrl) {\n          this.location.replaceState(path, '', state);\n        } else {\n          this.location.go(path, '', state);\n        }\n      }\n      /**\n       * Performs the necessary rollback action to restore the browser URL to the\n       * state before the transition.\n       */\n\n    }, {\n      key: \"restoreHistory\",\n      value: function restoreHistory(t) {\n        var restoringFromCaughtError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n        var _a, _b;\n\n        if (this.canceledNavigationResolution === 'computed') {\n          var targetPagePosition = this.currentPageId - t.targetPageId; // The navigator change the location before triggered the browser event,\n          // so we need to go back to the current url if the navigation is canceled.\n          // Also, when navigation gets cancelled while using url update strategy eager, then we need to\n          // go back. Because, when `urlUpdateSrategy` is `eager`; `setBrowserUrl` method is called\n          // before any verification.\n\n          var browserUrlUpdateOccurred = t.source === 'popstate' || this.urlUpdateStrategy === 'eager' || this.currentUrlTree === ((_a = this.currentNavigation) === null || _a === void 0 ? void 0 : _a.finalUrl);\n\n          if (browserUrlUpdateOccurred && targetPagePosition !== 0) {\n            this.location.historyGo(targetPagePosition);\n          } else if (this.currentUrlTree === ((_b = this.currentNavigation) === null || _b === void 0 ? void 0 : _b.finalUrl) && targetPagePosition === 0) {\n            // We got to the activation stage (where currentUrlTree is set to the navigation's\n            // finalUrl), but we weren't moving anywhere in history (skipLocationChange or replaceUrl).\n            // We still need to reset the router state back to what it was when the navigation started.\n            this.resetState(t); // TODO(atscott): resetting the `browserUrlTree` should really be done in `resetState`.\n            // Investigate if this can be done by running TGP.\n\n            this.browserUrlTree = t.currentUrlTree;\n            this.resetUrlToCurrentUrlTree();\n          } else {// The browser URL and router state was not updated before the navigation cancelled so\n            // there's no restoration needed.\n          }\n        } else if (this.canceledNavigationResolution === 'replace') {\n          // TODO(atscott): It seems like we should _always_ reset the state here. It would be a no-op\n          // for `deferred` navigations that haven't change the internal state yet because guards\n          // reject. For 'eager' navigations, it seems like we also really should reset the state\n          // because the navigation was cancelled. Investigate if this can be done by running TGP.\n          if (restoringFromCaughtError) {\n            this.resetState(t);\n          }\n\n          this.resetUrlToCurrentUrlTree();\n        }\n      }\n    }, {\n      key: \"resetState\",\n      value: function resetState(t) {\n        this.routerState = t.currentRouterState;\n        this.currentUrlTree = t.currentUrlTree;\n        this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, t.rawUrl);\n      }\n    }, {\n      key: \"resetUrlToCurrentUrlTree\",\n      value: function resetUrlToCurrentUrlTree() {\n        this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree), '', this.generateNgRouterState(this.lastSuccessfulId, this.currentPageId));\n      }\n    }, {\n      key: \"cancelNavigationTransition\",\n      value: function cancelNavigationTransition(t, reason) {\n        var navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), reason);\n        this.triggerEvent(navCancel);\n        t.resolve(false);\n      }\n    }, {\n      key: \"generateNgRouterState\",\n      value: function generateNgRouterState(navigationId, routerPageId) {\n        if (this.canceledNavigationResolution === 'computed') {\n          return {\n            navigationId: navigationId,\n            ɵrouterPageId: routerPageId\n          };\n        }\n\n        return {\n          navigationId: navigationId\n        };\n      }\n    }]);\n\n    return Router;\n  }();\n\n  Router.ɵfac = function Router_Factory(t) {\n    return new (t || Router)(ɵngcc0.ɵɵinject(ɵngcc0.Type), ɵngcc0.ɵɵinject(UrlSerializer), ɵngcc0.ɵɵinject(ChildrenOutletContexts), ɵngcc0.ɵɵinject(ɵngcc1.Location), ɵngcc0.ɵɵinject(ɵngcc0.Injector), ɵngcc0.ɵɵinject(ɵngcc0.NgModuleFactoryLoader), ɵngcc0.ɵɵinject(ɵngcc0.Compiler), ɵngcc0.ɵɵinject(undefined));\n  };\n\n  Router.ɵprov =\n  /*@__PURE__*/\n\n  /*@__PURE__*/\n  ɵngcc0.ɵɵdefineInjectable({\n    token: Router,\n    factory: Router.ɵfac\n  });\n  return Router;\n}();\n\nfunction validateCommands(commands) {\n  for (var i = 0; i < commands.length; i++) {\n    var cmd = commands[i];\n\n    if (cmd == null) {\n      throw new Error(\"The requested path contains \".concat(cmd, \" segment at index \").concat(i));\n    }\n  }\n}\n\nfunction isBrowserTriggeredNavigation(source) {\n  return source !== 'imperative';\n}\n\nvar RouterLink = /*@__PURE__*/function () {\n  var RouterLink = /*#__PURE__*/function () {\n    function RouterLink(router, route, tabIndex, renderer, el) {\n      _classCallCheck(this, RouterLink);\n\n      this.router = router;\n      this.route = route;\n      this.commands = [];\n      /** @internal */\n\n      this.onChanges = new Subject();\n\n      if (tabIndex == null) {\n        renderer.setAttribute(el.nativeElement, 'tabindex', '0');\n      }\n    }\n    /** @nodoc */\n\n\n    _createClass(RouterLink, [{\n      key: \"ngOnChanges\",\n      value: function ngOnChanges(changes) {\n        // This is subscribed to by `RouterLinkActive` so that it knows to update when there are changes\n        // to the RouterLinks it's tracking.\n        this.onChanges.next(this);\n      }\n      /**\n       * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.\n       *   - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.\n       *   - **string**: shorthand for array of commands with just the string, i.e. `['/route']`\n       *   - **null|undefined**: shorthand for an empty array of commands, i.e. `[]`\n       * @see {@link Router#createUrlTree Router#createUrlTree}\n       */\n\n    }, {\n      key: \"routerLink\",\n      set: function set(commands) {\n        if (commands != null) {\n          this.commands = Array.isArray(commands) ? commands : [commands];\n        } else {\n          this.commands = [];\n        }\n      }\n      /** @nodoc */\n\n    }, {\n      key: \"onClick\",\n      value: function onClick() {\n        var extras = {\n          skipLocationChange: attrBoolValue(this.skipLocationChange),\n          replaceUrl: attrBoolValue(this.replaceUrl),\n          state: this.state\n        };\n        this.router.navigateByUrl(this.urlTree, extras);\n        return true;\n      }\n    }, {\n      key: \"urlTree\",\n      get: function get() {\n        return this.router.createUrlTree(this.commands, {\n          // If the `relativeTo` input is not defined, we want to use `this.route` by default.\n          // Otherwise, we should use the value provided by the user in the input.\n          relativeTo: this.relativeTo !== undefined ? this.relativeTo : this.route,\n          queryParams: this.queryParams,\n          fragment: this.fragment,\n          queryParamsHandling: this.queryParamsHandling,\n          preserveFragment: attrBoolValue(this.preserveFragment)\n        });\n      }\n    }]);\n\n    return RouterLink;\n  }();\n\n  RouterLink.ɵfac = function RouterLink_Factory(t) {\n    return new (t || RouterLink)(ɵngcc0.ɵɵdirectiveInject(Router), ɵngcc0.ɵɵdirectiveInject(ActivatedRoute), ɵngcc0.ɵɵinjectAttribute('tabindex'), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.Renderer2), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef));\n  };\n\n  RouterLink.ɵdir =\n  /*@__PURE__*/\n\n  /*@__PURE__*/\n  ɵngcc0.ɵɵdefineDirective({\n    type: RouterLink,\n    selectors: [[\"\", \"routerLink\", \"\", 5, \"a\", 5, \"area\"]],\n    hostBindings: function RouterLink_HostBindings(rf, ctx) {\n      if (rf & 1) {\n        ɵngcc0.ɵɵlistener(\"click\", function RouterLink_click_HostBindingHandler() {\n          return ctx.onClick();\n        });\n      }\n    },\n    inputs: {\n      routerLink: \"routerLink\",\n      queryParams: \"queryParams\",\n      fragment: \"fragment\",\n      queryParamsHandling: \"queryParamsHandling\",\n      preserveFragment: \"preserveFragment\",\n      skipLocationChange: \"skipLocationChange\",\n      replaceUrl: \"replaceUrl\",\n      state: \"state\",\n      relativeTo: \"relativeTo\"\n    },\n    features: [ɵngcc0.ɵɵNgOnChangesFeature]\n  });\n  return RouterLink;\n}();\n\nvar RouterLinkWithHref = /*@__PURE__*/function () {\n  var RouterLinkWithHref = /*#__PURE__*/function () {\n    function RouterLinkWithHref(router, route, locationStrategy) {\n      var _this33 = this;\n\n      _classCallCheck(this, RouterLinkWithHref);\n\n      this.router = router;\n      this.route = route;\n      this.locationStrategy = locationStrategy;\n      this.commands = [];\n      /** @internal */\n\n      this.onChanges = new Subject();\n      this.subscription = router.events.subscribe(function (s) {\n        if (s instanceof NavigationEnd) {\n          _this33.updateTargetUrlAndHref();\n        }\n      });\n    }\n    /**\n     * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.\n     *   - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.\n     *   - **string**: shorthand for array of commands with just the string, i.e. `['/route']`\n     *   - **null|undefined**: shorthand for an empty array of commands, i.e. `[]`\n     * @see {@link Router#createUrlTree Router#createUrlTree}\n     */\n\n\n    _createClass(RouterLinkWithHref, [{\n      key: \"routerLink\",\n      set: function set(commands) {\n        if (commands != null) {\n          this.commands = Array.isArray(commands) ? commands : [commands];\n        } else {\n          this.commands = [];\n        }\n      }\n      /** @nodoc */\n\n    }, {\n      key: \"ngOnChanges\",\n      value: function ngOnChanges(changes) {\n        this.updateTargetUrlAndHref();\n        this.onChanges.next(this);\n      }\n      /** @nodoc */\n\n    }, {\n      key: \"ngOnDestroy\",\n      value: function ngOnDestroy() {\n        this.subscription.unsubscribe();\n      }\n      /** @nodoc */\n\n    }, {\n      key: \"onClick\",\n      value: function onClick(button, ctrlKey, shiftKey, altKey, metaKey) {\n        if (button !== 0 || ctrlKey || shiftKey || altKey || metaKey) {\n          return true;\n        }\n\n        if (typeof this.target === 'string' && this.target != '_self') {\n          return true;\n        }\n\n        var 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      key: \"updateTargetUrlAndHref\",\n      value: function updateTargetUrlAndHref() {\n        this.href = this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree));\n      }\n    }, {\n      key: \"urlTree\",\n      get: function get() {\n        return this.router.createUrlTree(this.commands, {\n          // If the `relativeTo` input is not defined, we want to use `this.route` by default.\n          // Otherwise, we should use the value provided by the user in the input.\n          relativeTo: this.relativeTo !== undefined ? this.relativeTo : this.route,\n          queryParams: this.queryParams,\n          fragment: this.fragment,\n          queryParamsHandling: this.queryParamsHandling,\n          preserveFragment: attrBoolValue(this.preserveFragment)\n        });\n      }\n    }]);\n\n    return RouterLinkWithHref;\n  }();\n\n  RouterLinkWithHref.ɵfac = function RouterLinkWithHref_Factory(t) {\n    return new (t || RouterLinkWithHref)(ɵngcc0.ɵɵdirectiveInject(Router), ɵngcc0.ɵɵdirectiveInject(ActivatedRoute), ɵngcc0.ɵɵdirectiveInject(ɵngcc1.LocationStrategy));\n  };\n\n  RouterLinkWithHref.ɵdir =\n  /*@__PURE__*/\n\n  /*@__PURE__*/\n  ɵngcc0.ɵɵdefineDirective({\n    type: RouterLinkWithHref,\n    selectors: [[\"a\", \"routerLink\", \"\"], [\"area\", \"routerLink\", \"\"]],\n    hostVars: 2,\n    hostBindings: function RouterLinkWithHref_HostBindings(rf, ctx) {\n      if (rf & 1) {\n        ɵngcc0.ɵɵlistener(\"click\", function RouterLinkWithHref_click_HostBindingHandler($event) {\n          return ctx.onClick($event.button, $event.ctrlKey, $event.shiftKey, $event.altKey, $event.metaKey);\n        });\n      }\n\n      if (rf & 2) {\n        ɵngcc0.ɵɵhostProperty(\"href\", ctx.href, ɵngcc0.ɵɵsanitizeUrl);\n        ɵngcc0.ɵɵattribute(\"target\", ctx.target);\n      }\n    },\n    inputs: {\n      routerLink: \"routerLink\",\n      target: \"target\",\n      queryParams: \"queryParams\",\n      fragment: \"fragment\",\n      queryParamsHandling: \"queryParamsHandling\",\n      preserveFragment: \"preserveFragment\",\n      skipLocationChange: \"skipLocationChange\",\n      replaceUrl: \"replaceUrl\",\n      state: \"state\",\n      relativeTo: \"relativeTo\"\n    },\n    features: [ɵngcc0.ɵɵNgOnChangesFeature]\n  });\n  return RouterLinkWithHref;\n}();\n\nfunction attrBoolValue(s) {\n  return s === '' || !!s;\n}\n\nvar RouterLinkActive = /*@__PURE__*/function () {\n  var RouterLinkActive = /*#__PURE__*/function () {\n    function RouterLinkActive(router, element, renderer, cdr, link, linkWithHref) {\n      var _this34 = this;\n\n      _classCallCheck(this, RouterLinkActive);\n\n      this.router = router;\n      this.element = element;\n      this.renderer = renderer;\n      this.cdr = cdr;\n      this.link = link;\n      this.linkWithHref = linkWithHref;\n      this.classes = [];\n      this.isActive = false;\n      /**\n       * Options to configure how to determine if the router link is active.\n       *\n       * These options are passed to the `Router.isActive()` function.\n       *\n       * @see Router.isActive\n       */\n\n      this.routerLinkActiveOptions = {\n        exact: false\n      };\n      this.routerEventsSubscription = router.events.subscribe(function (s) {\n        if (s instanceof NavigationEnd) {\n          _this34.update();\n        }\n      });\n    }\n    /** @nodoc */\n\n\n    _createClass(RouterLinkActive, [{\n      key: \"ngAfterContentInit\",\n      value: function ngAfterContentInit() {\n        var _this35 = this;\n\n        // `of(null)` is used to force subscribe body to execute once immediately (like `startWith`).\n        of(this.links.changes, this.linksWithHrefs.changes, of(null)).pipe(mergeAll()).subscribe(function (_) {\n          _this35.update();\n\n          _this35.subscribeToEachLinkOnChanges();\n        });\n      }\n    }, {\n      key: \"subscribeToEachLinkOnChanges\",\n      value: function subscribeToEachLinkOnChanges() {\n        var _this36 = this;\n\n        var _a;\n\n        (_a = this.linkInputChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n        var allLinkChanges = [].concat(_toConsumableArray(this.links.toArray()), _toConsumableArray(this.linksWithHrefs.toArray()), [this.link, this.linkWithHref]).filter(function (link) {\n          return !!link;\n        }).map(function (link) {\n          return link.onChanges;\n        });\n        this.linkInputChangesSubscription = from(allLinkChanges).pipe(mergeAll()).subscribe(function (link) {\n          if (_this36.isActive !== _this36.isLinkActive(_this36.router)(link)) {\n            _this36.update();\n          }\n        });\n      }\n    }, {\n      key: \"routerLinkActive\",\n      set: function set(data) {\n        var classes = Array.isArray(data) ? data : data.split(' ');\n        this.classes = classes.filter(function (c) {\n          return !!c;\n        });\n      }\n      /** @nodoc */\n\n    }, {\n      key: \"ngOnChanges\",\n      value: function ngOnChanges(changes) {\n        this.update();\n      }\n      /** @nodoc */\n\n    }, {\n      key: \"ngOnDestroy\",\n      value: function ngOnDestroy() {\n        var _a;\n\n        this.routerEventsSubscription.unsubscribe();\n        (_a = this.linkInputChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n      }\n    }, {\n      key: \"update\",\n      value: function update() {\n        var _this37 = this;\n\n        if (!this.links || !this.linksWithHrefs || !this.router.navigated) return;\n        Promise.resolve().then(function () {\n          var hasActiveLinks = _this37.hasActiveLinks();\n\n          if (_this37.isActive !== hasActiveLinks) {\n            _this37.isActive = hasActiveLinks;\n\n            _this37.cdr.markForCheck();\n\n            _this37.classes.forEach(function (c) {\n              if (hasActiveLinks) {\n                _this37.renderer.addClass(_this37.element.nativeElement, c);\n              } else {\n                _this37.renderer.removeClass(_this37.element.nativeElement, c);\n              }\n            });\n          }\n        });\n      }\n    }, {\n      key: \"isLinkActive\",\n      value: function isLinkActive(router) {\n        var options = isActiveMatchOptions(this.routerLinkActiveOptions) ? this.routerLinkActiveOptions : // While the types should disallow `undefined` here, it's possible without strict inputs\n        this.routerLinkActiveOptions.exact || false;\n        return function (link) {\n          return router.isActive(link.urlTree, options);\n        };\n      }\n    }, {\n      key: \"hasActiveLinks\",\n      value: function hasActiveLinks() {\n        var isActiveCheckFn = this.isLinkActive(this.router);\n        return this.link && isActiveCheckFn(this.link) || this.linkWithHref && isActiveCheckFn(this.linkWithHref) || this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);\n      }\n    }]);\n\n    return RouterLinkActive;\n  }();\n\n  RouterLinkActive.ɵfac = function RouterLinkActive_Factory(t) {\n    return new (t || RouterLinkActive)(ɵngcc0.ɵɵdirectiveInject(Router), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.Renderer2), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ChangeDetectorRef), ɵngcc0.ɵɵdirectiveInject(RouterLink, 8), ɵngcc0.ɵɵdirectiveInject(RouterLinkWithHref, 8));\n  };\n\n  RouterLinkActive.ɵdir =\n  /*@__PURE__*/\n\n  /*@__PURE__*/\n  ɵngcc0.ɵɵdefineDirective({\n    type: RouterLinkActive,\n    selectors: [[\"\", \"routerLinkActive\", \"\"]],\n    contentQueries: function RouterLinkActive_ContentQueries(rf, ctx, dirIndex) {\n      if (rf & 1) {\n        ɵngcc0.ɵɵcontentQuery(dirIndex, RouterLink, 5);\n        ɵngcc0.ɵɵcontentQuery(dirIndex, RouterLinkWithHref, 5);\n      }\n\n      if (rf & 2) {\n        var _t;\n\n        ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx.links = _t);\n        ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx.linksWithHrefs = _t);\n      }\n    },\n    inputs: {\n      routerLinkActiveOptions: \"routerLinkActiveOptions\",\n      routerLinkActive: \"routerLinkActive\"\n    },\n    exportAs: [\"routerLinkActive\"],\n    features: [ɵngcc0.ɵɵNgOnChangesFeature]\n  });\n  return RouterLinkActive;\n}();\n/**\n * Use instead of `'paths' in options` to be compatible with property renaming\n */\n\n\nfunction isActiveMatchOptions(options) {\n  return !!options.paths;\n}\n\nvar RouterOutlet = /*@__PURE__*/function () {\n  var RouterOutlet = /*#__PURE__*/function () {\n    function RouterOutlet(parentContexts, location, resolver, name, changeDetector) {\n      _classCallCheck(this, RouterOutlet);\n\n      this.parentContexts = parentContexts;\n      this.location = location;\n      this.resolver = resolver;\n      this.changeDetector = changeDetector;\n      this.activated = null;\n      this._activatedRoute = null;\n      this.activateEvents = new EventEmitter();\n      this.deactivateEvents = new EventEmitter();\n      this.name = name || PRIMARY_OUTLET;\n      parentContexts.onChildOutletCreated(this.name, this);\n    }\n    /** @nodoc */\n\n\n    _createClass(RouterOutlet, [{\n      key: \"ngOnDestroy\",\n      value: function ngOnDestroy() {\n        this.parentContexts.onChildOutletDestroyed(this.name);\n      }\n      /** @nodoc */\n\n    }, {\n      key: \"ngOnInit\",\n      value: function ngOnInit() {\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          var context = this.parentContexts.getContext(this.name);\n\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      key: \"isActivated\",\n      get: function get() {\n        return !!this.activated;\n      }\n      /**\n       * @returns The currently activated component instance.\n       * @throws An error if the outlet is not activated.\n       */\n\n    }, {\n      key: \"component\",\n      get: function get() {\n        if (!this.activated) throw new Error('Outlet is not activated');\n        return this.activated.instance;\n      }\n    }, {\n      key: \"activatedRoute\",\n      get: function get() {\n        if (!this.activated) throw new Error('Outlet is not activated');\n        return this._activatedRoute;\n      }\n    }, {\n      key: \"activatedRouteData\",\n      get: function get() {\n        if (this._activatedRoute) {\n          return this._activatedRoute.snapshot.data;\n        }\n\n        return {};\n      }\n      /**\n       * Called when the `RouteReuseStrategy` instructs to detach the subtree\n       */\n\n    }, {\n      key: \"detach\",\n      value: function detach() {\n        if (!this.activated) throw new Error('Outlet is not activated');\n        this.location.detach();\n        var cmp = this.activated;\n        this.activated = null;\n        this._activatedRoute = null;\n        return cmp;\n      }\n      /**\n       * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree\n       */\n\n    }, {\n      key: \"attach\",\n      value: function attach(ref, activatedRoute) {\n        this.activated = ref;\n        this._activatedRoute = activatedRoute;\n        this.location.insert(ref.hostView);\n      }\n    }, {\n      key: \"deactivate\",\n      value: function deactivate() {\n        if (this.activated) {\n          var c = this.component;\n          this.activated.destroy();\n          this.activated = null;\n          this._activatedRoute = null;\n          this.deactivateEvents.emit(c);\n        }\n      }\n    }, {\n      key: \"activateWith\",\n      value: function activateWith(activatedRoute, resolver) {\n        if (this.isActivated) {\n          throw new Error('Cannot activate an already activated outlet');\n        }\n\n        this._activatedRoute = activatedRoute;\n        var snapshot = activatedRoute._futureSnapshot;\n        var component = snapshot.routeConfig.component;\n        resolver = resolver || this.resolver;\n        var factory = resolver.resolveComponentFactory(component);\n        var childContexts = this.parentContexts.getOrCreateContext(this.name).children;\n        var injector = new OutletInjector(activatedRoute, childContexts, this.location.injector);\n        this.activated = this.location.createComponent(factory, this.location.length, injector); // Calling `markForCheck` to make sure we will run the change detection when the\n        // `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.\n\n        this.changeDetector.markForCheck();\n        this.activateEvents.emit(this.activated.instance);\n      }\n    }]);\n\n    return RouterOutlet;\n  }();\n\n  RouterOutlet.ɵfac = function RouterOutlet_Factory(t) {\n    return new (t || RouterOutlet)(ɵngcc0.ɵɵdirectiveInject(ChildrenOutletContexts), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ViewContainerRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ComponentFactoryResolver), ɵngcc0.ɵɵinjectAttribute('name'), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ChangeDetectorRef));\n  };\n\n  RouterOutlet.ɵdir =\n  /*@__PURE__*/\n\n  /*@__PURE__*/\n  ɵngcc0.ɵɵdefineDirective({\n    type: RouterOutlet,\n    selectors: [[\"router-outlet\"]],\n    outputs: {\n      activateEvents: \"activate\",\n      deactivateEvents: \"deactivate\"\n    },\n    exportAs: [\"outlet\"]\n  });\n  return RouterOutlet;\n}();\n\nvar OutletInjector = /*#__PURE__*/function () {\n  function OutletInjector(route, childContexts, parent) {\n    _classCallCheck(this, OutletInjector);\n\n    this.route = route;\n    this.childContexts = childContexts;\n    this.parent = parent;\n  }\n\n  _createClass(OutletInjector, [{\n    key: \"get\",\n    value: function get(token, notFoundValue) {\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  return OutletInjector;\n}();\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @description\n *\n * Provides a preloading strategy.\n *\n * @publicApi\n */\n\n\nvar PreloadingStrategy = /*#__PURE__*/_createClass(function PreloadingStrategy() {\n  _classCallCheck(this, PreloadingStrategy);\n});\n/**\n * @description\n *\n * Provides a preloading strategy that preloads all modules as quickly as possible.\n *\n * ```\n * RouterModule.forRoot(ROUTES, {preloadingStrategy: PreloadAllModules})\n * ```\n *\n * @publicApi\n */\n\n\nvar PreloadAllModules = /*#__PURE__*/function () {\n  function PreloadAllModules() {\n    _classCallCheck(this, PreloadAllModules);\n  }\n\n  _createClass(PreloadAllModules, [{\n    key: \"preload\",\n    value: function preload(route, fn) {\n      return fn().pipe(catchError(function () {\n        return of(null);\n      }));\n    }\n  }]);\n\n  return PreloadAllModules;\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 */\n\n\nvar NoPreloading = /*#__PURE__*/function () {\n  function NoPreloading() {\n    _classCallCheck(this, NoPreloading);\n  }\n\n  _createClass(NoPreloading, [{\n    key: \"preload\",\n    value: function preload(route, fn) {\n      return of(null);\n    }\n  }]);\n\n  return NoPreloading;\n}();\n\nvar RouterPreloader = /*@__PURE__*/function () {\n  var RouterPreloader = /*#__PURE__*/function () {\n    function RouterPreloader(router, moduleLoader, compiler, injector, preloadingStrategy) {\n      _classCallCheck(this, RouterPreloader);\n\n      this.router = router;\n      this.injector = injector;\n      this.preloadingStrategy = preloadingStrategy;\n\n      var onStartLoad = function onStartLoad(r) {\n        return router.triggerEvent(new RouteConfigLoadStart(r));\n      };\n\n      var onEndLoad = function onEndLoad(r) {\n        return router.triggerEvent(new RouteConfigLoadEnd(r));\n      };\n\n      this.loader = new RouterConfigLoader(moduleLoader, compiler, onStartLoad, onEndLoad);\n    }\n\n    _createClass(RouterPreloader, [{\n      key: \"setUpPreloading\",\n      value: function setUpPreloading() {\n        var _this38 = this;\n\n        this.subscription = this.router.events.pipe(filter(function (e) {\n          return e instanceof NavigationEnd;\n        }), concatMap(function () {\n          return _this38.preload();\n        })).subscribe(function () {});\n      }\n    }, {\n      key: \"preload\",\n      value: function preload() {\n        var ngModule = this.injector.get(NgModuleRef);\n        return this.processRoutes(ngModule, this.router.config);\n      }\n      /** @nodoc */\n\n    }, {\n      key: \"ngOnDestroy\",\n      value: function ngOnDestroy() {\n        if (this.subscription) {\n          this.subscription.unsubscribe();\n        }\n      }\n    }, {\n      key: \"processRoutes\",\n      value: function processRoutes(ngModule, routes) {\n        var res = [];\n\n        var _iterator10 = _createForOfIteratorHelper(routes),\n            _step10;\n\n        try {\n          for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {\n            var route = _step10.value;\n\n            // we already have the config loaded, just recurse\n            if (route.loadChildren && !route.canLoad && route._loadedConfig) {\n              var childConfig = route._loadedConfig;\n              res.push(this.processRoutes(childConfig.module, childConfig.routes)); // no config loaded, fetch the config\n            } else if (route.loadChildren && !route.canLoad) {\n              res.push(this.preloadConfig(ngModule, route)); // recurse into children\n            } else if (route.children) {\n              res.push(this.processRoutes(ngModule, route.children));\n            }\n          }\n        } catch (err) {\n          _iterator10.e(err);\n        } finally {\n          _iterator10.f();\n        }\n\n        return from(res).pipe(mergeAll(), map(function (_) {\n          return void 0;\n        }));\n      }\n    }, {\n      key: \"preloadConfig\",\n      value: function preloadConfig(ngModule, route) {\n        var _this39 = this;\n\n        return this.preloadingStrategy.preload(route, function () {\n          var loaded$ = route._loadedConfig ? of(route._loadedConfig) : _this39.loader.load(ngModule.injector, route);\n          return loaded$.pipe(mergeMap(function (config) {\n            route._loadedConfig = config;\n            return _this39.processRoutes(config.module, config.routes);\n          }));\n        });\n      }\n    }]);\n\n    return RouterPreloader;\n  }();\n\n  RouterPreloader.ɵfac = function RouterPreloader_Factory(t) {\n    return new (t || RouterPreloader)(ɵngcc0.ɵɵinject(Router), ɵngcc0.ɵɵinject(ɵngcc0.NgModuleFactoryLoader), ɵngcc0.ɵɵinject(ɵngcc0.Compiler), ɵngcc0.ɵɵinject(ɵngcc0.Injector), ɵngcc0.ɵɵinject(PreloadingStrategy));\n  };\n\n  RouterPreloader.ɵprov =\n  /*@__PURE__*/\n\n  /*@__PURE__*/\n  ɵngcc0.ɵɵdefineInjectable({\n    token: RouterPreloader,\n    factory: RouterPreloader.ɵfac\n  });\n  return RouterPreloader;\n}();\n\nvar RouterScroller = /*@__PURE__*/function () {\n  var RouterScroller = /*#__PURE__*/function () {\n    function RouterScroller(router,\n    /** @docsNotRequired */\n    viewportScroller) {\n      var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n      _classCallCheck(this, RouterScroller);\n\n      this.router = router;\n      this.viewportScroller = viewportScroller;\n      this.options = options;\n      this.lastId = 0;\n      this.lastSource = 'imperative';\n      this.restoredId = 0;\n      this.store = {}; // Default both options to 'disabled'\n\n      options.scrollPositionRestoration = options.scrollPositionRestoration || 'disabled';\n      options.anchorScrolling = options.anchorScrolling || 'disabled';\n    }\n\n    _createClass(RouterScroller, [{\n      key: \"init\",\n      value: function init() {\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\n        this.routerEventsSubscription = this.createScrollEvents();\n        this.scrollEventsSubscription = this.consumeScrollEvents();\n      }\n    }, {\n      key: \"createScrollEvents\",\n      value: function createScrollEvents() {\n        var _this40 = this;\n\n        return this.router.events.subscribe(function (e) {\n          if (e instanceof NavigationStart) {\n            // store the scroll position of the current stable navigations.\n            _this40.store[_this40.lastId] = _this40.viewportScroller.getScrollPosition();\n            _this40.lastSource = e.navigationTrigger;\n            _this40.restoredId = e.restoredState ? e.restoredState.navigationId : 0;\n          } else if (e instanceof NavigationEnd) {\n            _this40.lastId = e.id;\n\n            _this40.scheduleScrollEvent(e, _this40.router.parseUrl(e.urlAfterRedirects).fragment);\n          }\n        });\n      }\n    }, {\n      key: \"consumeScrollEvents\",\n      value: function consumeScrollEvents() {\n        var _this41 = this;\n\n        return this.router.events.subscribe(function (e) {\n          if (!(e instanceof Scroll)) return; // a popstate event. The pop state event will always ignore anchor scrolling.\n\n          if (e.position) {\n            if (_this41.options.scrollPositionRestoration === 'top') {\n              _this41.viewportScroller.scrollToPosition([0, 0]);\n            } else if (_this41.options.scrollPositionRestoration === 'enabled') {\n              _this41.viewportScroller.scrollToPosition(e.position);\n            } // imperative navigation \"forward\"\n\n          } else {\n            if (e.anchor && _this41.options.anchorScrolling === 'enabled') {\n              _this41.viewportScroller.scrollToAnchor(e.anchor);\n            } else if (_this41.options.scrollPositionRestoration !== 'disabled') {\n              _this41.viewportScroller.scrollToPosition([0, 0]);\n            }\n          }\n        });\n      }\n    }, {\n      key: \"scheduleScrollEvent\",\n      value: function scheduleScrollEvent(routerEvent, anchor) {\n        this.router.triggerEvent(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor));\n      }\n      /** @nodoc */\n\n    }, {\n      key: \"ngOnDestroy\",\n      value: function ngOnDestroy() {\n        if (this.routerEventsSubscription) {\n          this.routerEventsSubscription.unsubscribe();\n        }\n\n        if (this.scrollEventsSubscription) {\n          this.scrollEventsSubscription.unsubscribe();\n        }\n      }\n    }]);\n\n    return RouterScroller;\n  }();\n\n  RouterScroller.ɵfac = function RouterScroller_Factory(t) {\n    return new (t || RouterScroller)(ɵngcc0.ɵɵinject(Router), ɵngcc0.ɵɵinject(ɵngcc1.ViewportScroller), ɵngcc0.ɵɵinject(undefined));\n  };\n\n  RouterScroller.ɵprov =\n  /*@__PURE__*/\n\n  /*@__PURE__*/\n  ɵngcc0.ɵɵdefineInjectable({\n    token: RouterScroller,\n    factory: RouterScroller.ɵfac\n  });\n  return RouterScroller;\n}();\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * The directives defined in the `RouterModule`.\n */\n\n\nvar ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent];\n/**\n * A [DI token](guide/glossary/#di-token) for the router service.\n *\n * @publicApi\n */\n\nvar ROUTER_CONFIGURATION = /*@__PURE__*/new InjectionToken('ROUTER_CONFIGURATION');\n/**\n * @docsNotRequired\n */\n\nvar ROUTER_FORROOT_GUARD = /*@__PURE__*/new InjectionToken('ROUTER_FORROOT_GUARD');\nvar ɵ0 = {\n  enableTracing: false\n};\nvar ROUTER_PROVIDERS = [Location, {\n  provide: UrlSerializer,\n  useClass: DefaultUrlSerializer\n}, {\n  provide: Router,\n  useFactory: setupRouter,\n  deps: [UrlSerializer, ChildrenOutletContexts, Location, Injector, NgModuleFactoryLoader, Compiler, ROUTES, ROUTER_CONFIGURATION, [UrlHandlingStrategy, /*@__PURE__*/new Optional()], [RouteReuseStrategy, /*@__PURE__*/new Optional()]]\n}, ChildrenOutletContexts, {\n  provide: ActivatedRoute,\n  useFactory: rootRoute,\n  deps: [Router]\n}, {\n  provide: NgModuleFactoryLoader,\n  useClass: SystemJsNgModuleLoader\n}, RouterPreloader, NoPreloading, PreloadAllModules, {\n  provide: ROUTER_CONFIGURATION,\n  useValue: ɵ0\n}];\n\nfunction routerNgProbeToken() {\n  return new NgProbeToken('Router', Router);\n}\n\nvar RouterModule = /*@__PURE__*/function () {\n  var RouterModule = /*#__PURE__*/function () {\n    // Note: We are injecting the Router so it gets created eagerly...\n    function RouterModule(guard, router) {\n      _classCallCheck(this, RouterModule);\n    }\n    /**\n     * Creates and configures a module with all the router providers and directives.\n     * Optionally sets up an application listener to perform an initial navigation.\n     *\n     * When registering the NgModule at the root, import as follows:\n     *\n     * ```\n     * @NgModule({\n     *   imports: [RouterModule.forRoot(ROUTES)]\n     * })\n     * class MyNgModule {}\n     * ```\n     *\n     * @param routes An array of `Route` objects that define the navigation paths for the application.\n     * @param config An `ExtraOptions` configuration object that controls how navigation is performed.\n     * @return The new `NgModule`.\n     *\n     */\n\n\n    _createClass(RouterModule, null, [{\n      key: \"forRoot\",\n      value: function forRoot(routes, config) {\n        return {\n          ngModule: RouterModule,\n          providers: [ROUTER_PROVIDERS, provideRoutes(routes), {\n            provide: ROUTER_FORROOT_GUARD,\n            useFactory: provideForRootGuard,\n            deps: [[Router, new Optional(), new SkipSelf()]]\n          }, {\n            provide: ROUTER_CONFIGURATION,\n            useValue: config ? config : {}\n          }, {\n            provide: LocationStrategy,\n            useFactory: provideLocationStrategy,\n            deps: [PlatformLocation, [new Inject(APP_BASE_HREF), new Optional()], ROUTER_CONFIGURATION]\n          }, {\n            provide: RouterScroller,\n            useFactory: createRouterScroller,\n            deps: [Router, ViewportScroller, ROUTER_CONFIGURATION]\n          }, {\n            provide: PreloadingStrategy,\n            useExisting: config && config.preloadingStrategy ? config.preloadingStrategy : NoPreloading\n          }, {\n            provide: NgProbeToken,\n            multi: true,\n            useFactory: routerNgProbeToken\n          }, provideRouterInitializer()]\n        };\n      }\n      /**\n       * Creates a module with all the router directives and a provider registering routes,\n       * without creating a new Router service.\n       * When registering for submodules and lazy-loaded submodules, create the NgModule as follows:\n       *\n       * ```\n       * @NgModule({\n       *   imports: [RouterModule.forChild(ROUTES)]\n       * })\n       * class MyNgModule {}\n       * ```\n       *\n       * @param routes An array of `Route` objects that define the navigation paths for the submodule.\n       * @return The new NgModule.\n       *\n       */\n\n    }, {\n      key: \"forChild\",\n      value: function forChild(routes) {\n        return {\n          ngModule: RouterModule,\n          providers: [provideRoutes(routes)]\n        };\n      }\n    }]);\n\n    return RouterModule;\n  }();\n\n  RouterModule.ɵfac = function RouterModule_Factory(t) {\n    return new (t || RouterModule)(ɵngcc0.ɵɵinject(ROUTER_FORROOT_GUARD, 8), ɵngcc0.ɵɵinject(Router, 8));\n  };\n\n  RouterModule.ɵmod =\n  /*@__PURE__*/\n\n  /*@__PURE__*/\n  ɵngcc0.ɵɵdefineNgModule({\n    type: RouterModule\n  });\n  RouterModule.ɵinj =\n  /*@__PURE__*/\n\n  /*@__PURE__*/\n  ɵngcc0.ɵɵdefineInjector({});\n  return RouterModule;\n}();\n/*@__PURE__*/\n\n\n(function () {\n  (typeof ngJitMode === \"undefined\" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(RouterModule, {\n    declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent],\n    exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent]\n  });\n})();\n\nfunction createRouterScroller(router, viewportScroller, config) {\n  if (config.scrollOffset) {\n    viewportScroller.setOffset(config.scrollOffset);\n  }\n\n  return new RouterScroller(router, viewportScroller, config);\n}\n\nfunction provideLocationStrategy(platformLocationStrategy, baseHref) {\n  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n  return options.useHash ? new HashLocationStrategy(platformLocationStrategy, baseHref) : new PathLocationStrategy(platformLocationStrategy, baseHref);\n}\n\nfunction provideForRootGuard(router) {\n  if ((typeof ngDevMode === 'undefined' || ngDevMode) && router) {\n    throw new Error(\"RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.\");\n  }\n\n  return 'guarded';\n}\n/**\n * Registers a [DI provider](guide/glossary#provider) for a set of routes.\n * @param routes The route configuration to provide.\n *\n * @usageNotes\n *\n * ```\n * @NgModule({\n *   imports: [RouterModule.forChild(ROUTES)],\n *   providers: [provideRoutes(EXTRA_ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * @publicApi\n */\n\n\nfunction provideRoutes(routes) {\n  return [{\n    provide: ANALYZE_FOR_ENTRY_COMPONENTS,\n    multi: true,\n    useValue: routes\n  }, {\n    provide: ROUTES,\n    multi: true,\n    useValue: routes\n  }];\n}\n\nfunction setupRouter(urlSerializer, contexts, location, injector, loader, compiler, config) {\n  var opts = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};\n  var urlHandlingStrategy = arguments.length > 8 ? arguments[8] : undefined;\n  var routeReuseStrategy = arguments.length > 9 ? arguments[9] : undefined;\n  var router = new Router(null, urlSerializer, contexts, location, injector, loader, compiler, flatten(config));\n\n  if (urlHandlingStrategy) {\n    router.urlHandlingStrategy = urlHandlingStrategy;\n  }\n\n  if (routeReuseStrategy) {\n    router.routeReuseStrategy = routeReuseStrategy;\n  }\n\n  assignExtraOptionsToRouter(opts, router);\n\n  if (opts.enableTracing) {\n    router.events.subscribe(function (e) {\n      var _a, _b; // tslint:disable:no-console\n\n\n      (_a = console.group) === null || _a === void 0 ? void 0 : _a.call(console, \"Router Event: \".concat(e.constructor.name));\n      console.log(e.toString());\n      console.log(e);\n      (_b = console.groupEnd) === null || _b === void 0 ? void 0 : _b.call(console); // tslint:enable:no-console\n    });\n  }\n\n  return router;\n}\n\nfunction assignExtraOptionsToRouter(opts, router) {\n  if (opts.errorHandler) {\n    router.errorHandler = opts.errorHandler;\n  }\n\n  if (opts.malformedUriErrorHandler) {\n    router.malformedUriErrorHandler = opts.malformedUriErrorHandler;\n  }\n\n  if (opts.onSameUrlNavigation) {\n    router.onSameUrlNavigation = opts.onSameUrlNavigation;\n  }\n\n  if (opts.paramsInheritanceStrategy) {\n    router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;\n  }\n\n  if (opts.relativeLinkResolution) {\n    router.relativeLinkResolution = opts.relativeLinkResolution;\n  }\n\n  if (opts.urlUpdateStrategy) {\n    router.urlUpdateStrategy = opts.urlUpdateStrategy;\n  }\n}\n\nfunction rootRoute(router) {\n  return router.routerState.root;\n}\n\nvar RouterInitializer = /*@__PURE__*/function () {\n  var RouterInitializer = /*#__PURE__*/function () {\n    function RouterInitializer(injector) {\n      _classCallCheck(this, RouterInitializer);\n\n      this.injector = injector;\n      this.initNavigation = false;\n      this.destroyed = false;\n      this.resultOfPreactivationDone = new Subject();\n    }\n\n    _createClass(RouterInitializer, [{\n      key: \"appInitializer\",\n      value: function appInitializer() {\n        var _this42 = this;\n\n        var p = this.injector.get(LOCATION_INITIALIZED, Promise.resolve(null));\n        return p.then(function () {\n          // If the injector was destroyed, the DI lookups below will fail.\n          if (_this42.destroyed) {\n            return Promise.resolve(true);\n          }\n\n          var resolve = null;\n          var res = new Promise(function (r) {\n            return resolve = r;\n          });\n\n          var router = _this42.injector.get(Router);\n\n          var opts = _this42.injector.get(ROUTER_CONFIGURATION);\n\n          if (opts.initialNavigation === 'disabled') {\n            router.setUpLocationChangeListener();\n            resolve(true);\n          } else if ( // TODO: enabled is deprecated as of v11, can be removed in v13\n          opts.initialNavigation === 'enabled' || opts.initialNavigation === 'enabledBlocking') {\n            router.hooks.afterPreactivation = function () {\n              // only the initial navigation should be delayed\n              if (!_this42.initNavigation) {\n                _this42.initNavigation = true;\n                resolve(true);\n                return _this42.resultOfPreactivationDone; // subsequent navigations should not be delayed\n              } else {\n                return of(null);\n              }\n            };\n\n            router.initialNavigation();\n          } else {\n            resolve(true);\n          }\n\n          return res;\n        });\n      }\n    }, {\n      key: \"bootstrapListener\",\n      value: function bootstrapListener(bootstrappedComponentRef) {\n        var opts = this.injector.get(ROUTER_CONFIGURATION);\n        var preloader = this.injector.get(RouterPreloader);\n        var routerScroller = this.injector.get(RouterScroller);\n        var router = this.injector.get(Router);\n        var ref = this.injector.get(ApplicationRef);\n\n        if (bootstrappedComponentRef !== ref.components[0]) {\n          return;\n        } // Default case\n\n\n        if (opts.initialNavigation === 'enabledNonBlocking' || opts.initialNavigation === undefined) {\n          router.initialNavigation();\n        }\n\n        preloader.setUpPreloading();\n        routerScroller.init();\n        router.resetRootComponentType(ref.componentTypes[0]);\n        this.resultOfPreactivationDone.next(null);\n        this.resultOfPreactivationDone.complete();\n      }\n    }, {\n      key: \"ngOnDestroy\",\n      value: function ngOnDestroy() {\n        this.destroyed = true;\n      }\n    }]);\n\n    return RouterInitializer;\n  }();\n\n  RouterInitializer.ɵfac = function RouterInitializer_Factory(t) {\n    return new (t || RouterInitializer)(ɵngcc0.ɵɵinject(ɵngcc0.Injector));\n  };\n\n  RouterInitializer.ɵprov =\n  /*@__PURE__*/\n\n  /*@__PURE__*/\n  ɵngcc0.ɵɵdefineInjectable({\n    token: RouterInitializer,\n    factory: RouterInitializer.ɵfac\n  });\n  return RouterInitializer;\n}();\n\nfunction getAppInitializer(r) {\n  return r.appInitializer.bind(r);\n}\n\nfunction getBootstrapListener(r) {\n  return r.bootstrapListener.bind(r);\n}\n/**\n * A [DI token](guide/glossary/#di-token) for the router initializer that\n * is called after the app is bootstrapped.\n *\n * @publicApi\n */\n\n\nvar ROUTER_INITIALIZER = /*@__PURE__*/new InjectionToken('Router Initializer');\n\nfunction provideRouterInitializer() {\n  return [RouterInitializer, {\n    provide: APP_INITIALIZER,\n    multi: true,\n    useFactory: getAppInitializer,\n    deps: [RouterInitializer]\n  }, {\n    provide: ROUTER_INITIALIZER,\n    useFactory: getBootstrapListener,\n    deps: [RouterInitializer]\n  }, {\n    provide: APP_BOOTSTRAP_LISTENER,\n    multi: true,\n    useExisting: ROUTER_INITIALIZER\n  }];\n}\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @publicApi\n */\n\n\nvar VERSION = /*@__PURE__*/new Version('12.2.16');\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// This file only reexports content of the `src` folder. Keep it that way.\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, provideRoutes, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, ROUTER_FORROOT_GUARD as ɵangular_packages_router_router_a, routerNgProbeToken as ɵangular_packages_router_router_b, createRouterScroller as ɵangular_packages_router_router_c, provideLocationStrategy as ɵangular_packages_router_router_d, provideForRootGuard as ɵangular_packages_router_router_e, setupRouter as ɵangular_packages_router_router_f, rootRoute as ɵangular_packages_router_router_g, RouterInitializer as ɵangular_packages_router_router_h, getAppInitializer as ɵangular_packages_router_router_i, getBootstrapListener as ɵangular_packages_router_router_j, provideRouterInitializer as ɵangular_packages_router_router_k, ɵEmptyOutletComponent as ɵangular_packages_router_router_l, Tree as ɵangular_packages_router_router_m, TreeNode as ɵangular_packages_router_router_n, RouterScroller as ɵangular_packages_router_router_o, assignExtraOptionsToRouter as ɵassignExtraOptionsToRouter, flatten as ɵflatten }; //# sourceMappingURL=router.js.map","map":null,"metadata":{},"sourceType":"module"}