@angular/router 5.2.2 → 5.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v5.2.2
2
+ * @license Angular v5.2.6
3
3
  * (c) 2010-2018 Google, Inc. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -39,6 +39,6 @@ function createUrlTree(route,urlTree,commands,queryParams,fragment){if(0===comma
39
39
  * found in the LICENSE file at https://angular.io/license
40
40
  */
41
41
  function defaultErrorHandler(error){throw error}function defaultRouterHook(snapshot){return rxjs_observable_of.of(null)}function advanceActivatedRouteNodeAndItsChildren(node){advanceActivatedRoute(node.value),node.children.forEach(advanceActivatedRouteNodeAndItsChildren)}function parentLoadedConfig(snapshot){for(var s=snapshot.parent;s;s=s.parent){var route=s.routeConfig;if(route&&route._loadedConfig)return route._loadedConfig;if(route&&route.component)return null}return null}function validateCommands(commands){for(var i=0;i<commands.length;i++){var cmd=commands[i];if(null==cmd)throw new Error("The requested path contains "+cmd+" segment at index "+i)}}function attrBoolValue(s){return""===s||!!s}function routerNgProbeToken(){return new _angular_core.NgProbeToken("Router",Router)}function provideLocationStrategy(platformLocationStrategy,baseHref,options){return void 0===options&&(options={}),options.useHash?new _angular_common.HashLocationStrategy(platformLocationStrategy,baseHref):new _angular_common.PathLocationStrategy(platformLocationStrategy,baseHref)}function provideForRootGuard(router){if(router)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function provideRoutes(routes){return[{provide:_angular_core.ANALYZE_FOR_ENTRY_COMPONENTS,multi:!0,useValue:routes},{provide:ROUTES,multi:!0,useValue:routes}]}function setupRouter(ref,urlSerializer,contexts,location,injector,loader,compiler,config,opts,urlHandlingStrategy,routeReuseStrategy){void 0===opts&&(opts={});var router=new Router(null,urlSerializer,contexts,location,injector,loader,compiler,flatten(config));if(urlHandlingStrategy&&(router.urlHandlingStrategy=urlHandlingStrategy),routeReuseStrategy&&(router.routeReuseStrategy=routeReuseStrategy),opts.errorHandler&&(router.errorHandler=opts.errorHandler),opts.enableTracing){var dom_1=_angular_platformBrowser.ɵgetDOM();router.events.subscribe(function(e){dom_1.logGroup("Router Event: "+e.constructor.name),dom_1.log(e.toString()),dom_1.log(e),dom_1.logGroupEnd()})}return opts.onSameUrlNavigation&&(router.onSameUrlNavigation=opts.onSameUrlNavigation),opts.paramsInheritanceStrategy&&(router.paramsInheritanceStrategy=opts.paramsInheritanceStrategy),router}function rootRoute(router){return router.routerState.root}function getAppInitializer(r){return r.appInitializer.bind(r)}function getBootstrapListener(r){return r.bootstrapListener.bind(r)}function provideRouterInitializer(){return[RouterInitializer,{provide:_angular_core.APP_INITIALIZER,multi:!0,useFactory:getAppInitializer,deps:[RouterInitializer]},{provide:ROUTER_INITIALIZER,useFactory:getBootstrapListener,deps:[RouterInitializer]},{provide:_angular_core.APP_BOOTSTRAP_LISTENER,multi:!0,useExisting:ROUTER_INITIALIZER}]}var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},RouterEvent=function(){function RouterEvent(id,url){this.id=id,this.url=url}return RouterEvent}(),NavigationStart=function(_super){function NavigationStart(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(NavigationStart,_super),NavigationStart.prototype.toString=function(){return"NavigationStart(id: "+this.id+", url: '"+this.url+"')"},NavigationStart}(RouterEvent),NavigationEnd=function(_super){function NavigationEnd(id,url,urlAfterRedirects){var _this=_super.call(this,id,url)||this;return _this.urlAfterRedirects=urlAfterRedirects,_this}return __extends(NavigationEnd,_super),NavigationEnd.prototype.toString=function(){return"NavigationEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"')"},NavigationEnd}(RouterEvent),NavigationCancel=function(_super){function NavigationCancel(id,url,reason){var _this=_super.call(this,id,url)||this;return _this.reason=reason,_this}return __extends(NavigationCancel,_super),NavigationCancel.prototype.toString=function(){return"NavigationCancel(id: "+this.id+", url: '"+this.url+"')"},NavigationCancel}(RouterEvent),NavigationError=function(_super){function NavigationError(id,url,error){var _this=_super.call(this,id,url)||this;return _this.error=error,_this}return __extends(NavigationError,_super),NavigationError.prototype.toString=function(){return"NavigationError(id: "+this.id+", url: '"+this.url+"', error: "+this.error+")"},NavigationError}(RouterEvent),RoutesRecognized=function(_super){function RoutesRecognized(id,url,urlAfterRedirects,state){var _this=_super.call(this,id,url)||this;return _this.urlAfterRedirects=urlAfterRedirects,_this.state=state,_this}return __extends(RoutesRecognized,_super),RoutesRecognized.prototype.toString=function(){return"RoutesRecognized(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},RoutesRecognized}(RouterEvent),GuardsCheckStart=function(_super){function GuardsCheckStart(id,url,urlAfterRedirects,state){var _this=_super.call(this,id,url)||this;return _this.urlAfterRedirects=urlAfterRedirects,_this.state=state,_this}return __extends(GuardsCheckStart,_super),GuardsCheckStart.prototype.toString=function(){return"GuardsCheckStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},GuardsCheckStart}(RouterEvent),GuardsCheckEnd=function(_super){function GuardsCheckEnd(id,url,urlAfterRedirects,state,shouldActivate){var _this=_super.call(this,id,url)||this;return _this.urlAfterRedirects=urlAfterRedirects,_this.state=state,_this.shouldActivate=shouldActivate,_this}return __extends(GuardsCheckEnd,_super),GuardsCheckEnd.prototype.toString=function(){return"GuardsCheckEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+", shouldActivate: "+this.shouldActivate+")"},GuardsCheckEnd}(RouterEvent),ResolveStart=function(_super){function ResolveStart(id,url,urlAfterRedirects,state){var _this=_super.call(this,id,url)||this;return _this.urlAfterRedirects=urlAfterRedirects,_this.state=state,_this}return __extends(ResolveStart,_super),ResolveStart.prototype.toString=function(){return"ResolveStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},ResolveStart}(RouterEvent),ResolveEnd=function(_super){function ResolveEnd(id,url,urlAfterRedirects,state){var _this=_super.call(this,id,url)||this;return _this.urlAfterRedirects=urlAfterRedirects,_this.state=state,_this}return __extends(ResolveEnd,_super),ResolveEnd.prototype.toString=function(){return"ResolveEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},ResolveEnd}(RouterEvent),RouteConfigLoadStart=function(){function RouteConfigLoadStart(route){this.route=route}return RouteConfigLoadStart.prototype.toString=function(){return"RouteConfigLoadStart(path: "+this.route.path+")"},RouteConfigLoadStart}(),RouteConfigLoadEnd=function(){function RouteConfigLoadEnd(route){this.route=route}return RouteConfigLoadEnd.prototype.toString=function(){return"RouteConfigLoadEnd(path: "+this.route.path+")"},RouteConfigLoadEnd}(),ChildActivationStart=function(){function ChildActivationStart(snapshot){this.snapshot=snapshot}return ChildActivationStart.prototype.toString=function(){return"ChildActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},ChildActivationStart}(),ChildActivationEnd=function(){function ChildActivationEnd(snapshot){this.snapshot=snapshot}return ChildActivationEnd.prototype.toString=function(){return"ChildActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},ChildActivationEnd}(),ActivationStart=function(){function ActivationStart(snapshot){this.snapshot=snapshot}return ActivationStart.prototype.toString=function(){return"ActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},ActivationStart}(),ActivationEnd=function(){function ActivationEnd(snapshot){this.snapshot=snapshot}return ActivationEnd.prototype.toString=function(){return"ActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},ActivationEnd}(),PRIMARY_OUTLET="primary",ParamsAsMap=function(){function ParamsAsMap(params){this.params=params||{}}return ParamsAsMap.prototype.has=function(name){return this.params.hasOwnProperty(name)},ParamsAsMap.prototype.get=function(name){if(this.has(name)){var v=this.params[name];return Array.isArray(v)?v[0]:v}return null},ParamsAsMap.prototype.getAll=function(name){if(this.has(name)){var v=this.params[name];return Array.isArray(v)?v:[v]}return[]},Object.defineProperty(ParamsAsMap.prototype,"keys",{get:function(){return Object.keys(this.params)},enumerable:!0,configurable:!0}),ParamsAsMap}(),NAVIGATION_CANCELING_ERROR="ngNavigationCancelingError",LoadedRouterConfig=function(){function LoadedRouterConfig(routes,module){this.routes=routes,this.module=module}return LoadedRouterConfig}(),UrlTree=function(){function UrlTree(root,queryParams,fragment){this.root=root,this.queryParams=queryParams,this.fragment=fragment}return Object.defineProperty(UrlTree.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=convertToParamMap(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),UrlTree.prototype.toString=function(){return DEFAULT_SERIALIZER.serialize(this)},UrlTree}(),UrlSegmentGroup=function(){function UrlSegmentGroup(segments,children){var _this=this;this.segments=segments,this.children=children,this.parent=null,forEach(children,function(v,k){return v.parent=_this})}return UrlSegmentGroup.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(UrlSegmentGroup.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),UrlSegmentGroup.prototype.toString=function(){return serializePaths(this)},UrlSegmentGroup}(),UrlSegment=function(){function UrlSegment(path,parameters){this.path=path,this.parameters=parameters}return Object.defineProperty(UrlSegment.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=convertToParamMap(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),UrlSegment.prototype.toString=function(){return serializePath(this)},UrlSegment}(),UrlSerializer=function(){function UrlSerializer(){}return UrlSerializer}(),DefaultUrlSerializer=function(){function DefaultUrlSerializer(){}return DefaultUrlSerializer.prototype.parse=function(url){var p=new UrlParser(url);return new UrlTree(p.parseRootSegment(),p.parseQueryParams(),p.parseFragment())},DefaultUrlSerializer.prototype.serialize=function(tree){return"/"+serializeSegment(tree.root,!0)+serializeQueryParams(tree.queryParams)+("string"==typeof tree.fragment?"#"+encodeURI(tree.fragment):"")},DefaultUrlSerializer}(),DEFAULT_SERIALIZER=new DefaultUrlSerializer,SEGMENT_RE=/^[^\/()?;=&#]+/,QUERY_PARAM_RE=/^[^=?&#]+/,QUERY_PARAM_VALUE_RE=/^[^?&#]+/,UrlParser=function(){function UrlParser(url){this.url=url,this.remaining=url}return UrlParser.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new UrlSegmentGroup([],{}):new UrlSegmentGroup([],this.parseChildren())},UrlParser.prototype.parseQueryParams=function(){var params={};if(this.consumeOptional("?"))do{this.parseQueryParam(params)}while(this.consumeOptional("&"));return params},UrlParser.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURI(this.remaining):null},UrlParser.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var segments=[];for(this.peekStartsWith("(")||segments.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),segments.push(this.parseSegment());var children={};this.peekStartsWith("/(")&&(this.capture("/"),children=this.parseParens(!0));var res={};return this.peekStartsWith("(")&&(res=this.parseParens(!1)),(segments.length>0||Object.keys(children).length>0)&&(res[PRIMARY_OUTLET]=new UrlSegmentGroup(segments,children)),res},UrlParser.prototype.parseSegment=function(){var path=matchSegments(this.remaining);if(""===path&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(path),new UrlSegment(decode(path),this.parseMatrixParams())},UrlParser.prototype.parseMatrixParams=function(){for(var params={};this.consumeOptional(";");)this.parseParam(params);return params},UrlParser.prototype.parseParam=function(params){var key=matchSegments(this.remaining);if(key){this.capture(key);var value="";if(this.consumeOptional("=")){var valueMatch=matchSegments(this.remaining);valueMatch&&(value=valueMatch,this.capture(value))}params[decode(key)]=decode(value)}},UrlParser.prototype.parseQueryParam=function(params){var key=matchQueryParams(this.remaining);if(key){this.capture(key);var value="";if(this.consumeOptional("=")){var valueMatch=matchUrlQueryParamValue(this.remaining);valueMatch&&(value=valueMatch,this.capture(value))}var decodedKey=decode(key),decodedVal=decode(value);if(params.hasOwnProperty(decodedKey)){var currentVal=params[decodedKey];Array.isArray(currentVal)||(currentVal=[currentVal],params[decodedKey]=currentVal),currentVal.push(decodedVal)}else params[decodedKey]=decodedVal}},UrlParser.prototype.parseParens=function(allowPrimary){var segments={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var path=matchSegments(this.remaining),next=this.remaining[path.length];if("/"!==next&&")"!==next&&";"!==next)throw new Error("Cannot parse url '"+this.url+"'");var outletName=void 0;path.indexOf(":")>-1?(outletName=path.substr(0,path.indexOf(":")),this.capture(outletName),this.capture(":")):allowPrimary&&(outletName=PRIMARY_OUTLET);var children=this.parseChildren();segments[outletName]=1===Object.keys(children).length?children[PRIMARY_OUTLET]:new UrlSegmentGroup([],children),this.consumeOptional("//")}return segments},UrlParser.prototype.peekStartsWith=function(str){return this.remaining.startsWith(str)},UrlParser.prototype.consumeOptional=function(str){return!!this.peekStartsWith(str)&&(this.remaining=this.remaining.substring(str.length),!0)},UrlParser.prototype.capture=function(str){if(!this.consumeOptional(str))throw new Error('Expected "'+str+'".')},UrlParser}(),NoMatch=function(){function NoMatch(segmentGroup){this.segmentGroup=segmentGroup||null}return NoMatch}(),AbsoluteRedirect=function(){function AbsoluteRedirect(urlTree){this.urlTree=urlTree}return AbsoluteRedirect}(),ApplyRedirects=function(){function ApplyRedirects(moduleInjector,configLoader,urlSerializer,urlTree,config){this.configLoader=configLoader,this.urlSerializer=urlSerializer,this.urlTree=urlTree,this.config=config,this.allowRedirects=!0,this.ngModule=moduleInjector.get(_angular_core.NgModuleRef)}return ApplyRedirects.prototype.apply=function(){var _this=this,expanded$=this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,PRIMARY_OUTLET),urlTrees$=rxjs_operator_map.map.call(expanded$,function(rootSegmentGroup){return _this.createUrlTree(rootSegmentGroup,_this.urlTree.queryParams,_this.urlTree.fragment)});return rxjs_operator_catch._catch.call(urlTrees$,function(e){if(e instanceof AbsoluteRedirect)return _this.allowRedirects=!1,_this.match(e.urlTree);if(e instanceof NoMatch)throw _this.noMatchError(e);throw e})},ApplyRedirects.prototype.match=function(tree){var _this=this,expanded$=this.expandSegmentGroup(this.ngModule,this.config,tree.root,PRIMARY_OUTLET),mapped$=rxjs_operator_map.map.call(expanded$,function(rootSegmentGroup){return _this.createUrlTree(rootSegmentGroup,tree.queryParams,tree.fragment)});return rxjs_operator_catch._catch.call(mapped$,function(e){if(e instanceof NoMatch)throw _this.noMatchError(e);throw e})},ApplyRedirects.prototype.noMatchError=function(e){return new Error("Cannot match any routes. URL Segment: '"+e.segmentGroup+"'")},ApplyRedirects.prototype.createUrlTree=function(rootCandidate,queryParams,fragment){var root=rootCandidate.segments.length>0?new UrlSegmentGroup([],(_a={},_a[PRIMARY_OUTLET]=rootCandidate,_a)):rootCandidate;return new UrlTree(root,queryParams,fragment);var _a},ApplyRedirects.prototype.expandSegmentGroup=function(ngModule,routes,segmentGroup,outlet){return 0===segmentGroup.segments.length&&segmentGroup.hasChildren()?rxjs_operator_map.map.call(this.expandChildren(ngModule,routes,segmentGroup),function(children){return new UrlSegmentGroup([],children)}):this.expandSegment(ngModule,segmentGroup,routes,segmentGroup.segments,outlet,!0)},ApplyRedirects.prototype.expandChildren=function(ngModule,routes,segmentGroup){var _this=this;return waitForMap(segmentGroup.children,function(childOutlet,child){return _this.expandSegmentGroup(ngModule,routes,child,childOutlet)})},ApplyRedirects.prototype.expandSegment=function(ngModule,segmentGroup,routes,segments,outlet,allowRedirects){var _this=this,routes$=rxjs_observable_of.of.apply(void 0,routes),processedRoutes$=rxjs_operator_map.map.call(routes$,function(r){var expanded$=_this.expandSegmentAgainstRoute(ngModule,segmentGroup,routes,r,segments,outlet,allowRedirects);return rxjs_operator_catch._catch.call(expanded$,function(e){if(e instanceof NoMatch)return rxjs_observable_of.of(null);throw e})}),concattedProcessedRoutes$=rxjs_operator_concatAll.concatAll.call(processedRoutes$),first$=rxjs_operator_first.first.call(concattedProcessedRoutes$,function(s){return!!s});return rxjs_operator_catch._catch.call(first$,function(e,_){if(e instanceof rxjs_util_EmptyError.EmptyError||"EmptyError"===e.name){if(_this.noLeftoversInUrl(segmentGroup,segments,outlet))return rxjs_observable_of.of(new UrlSegmentGroup([],{}));throw new NoMatch(segmentGroup)}throw e})},ApplyRedirects.prototype.noLeftoversInUrl=function(segmentGroup,segments,outlet){return 0===segments.length&&!segmentGroup.children[outlet]},ApplyRedirects.prototype.expandSegmentAgainstRoute=function(ngModule,segmentGroup,routes,route,paths,outlet,allowRedirects){return getOutlet(route)!==outlet?noMatch(segmentGroup):void 0===route.redirectTo?this.matchSegmentAgainstRoute(ngModule,segmentGroup,route,paths):allowRedirects&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(ngModule,segmentGroup,routes,route,paths,outlet):noMatch(segmentGroup)},ApplyRedirects.prototype.expandSegmentAgainstRouteUsingRedirect=function(ngModule,segmentGroup,routes,route,segments,outlet){return"**"===route.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(ngModule,routes,route,outlet):this.expandRegularSegmentAgainstRouteUsingRedirect(ngModule,segmentGroup,routes,route,segments,outlet)},ApplyRedirects.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(ngModule,routes,route,outlet){var _this=this,newTree=this.applyRedirectCommands([],route.redirectTo,{});return route.redirectTo.startsWith("/")?absoluteRedirect(newTree):rxjs_operator_mergeMap.mergeMap.call(this.lineralizeSegments(route,newTree),function(newSegments){var group=new UrlSegmentGroup(newSegments,{});return _this.expandSegment(ngModule,group,routes,newSegments,outlet,!1)})},ApplyRedirects.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(ngModule,segmentGroup,routes,route,segments,outlet){var _this=this,_a=match(segmentGroup,route,segments),matched=_a.matched,consumedSegments=_a.consumedSegments,lastChild=_a.lastChild,positionalParamSegments=_a.positionalParamSegments;if(!matched)return noMatch(segmentGroup);var newTree=this.applyRedirectCommands(consumedSegments,route.redirectTo,positionalParamSegments);return route.redirectTo.startsWith("/")?absoluteRedirect(newTree):rxjs_operator_mergeMap.mergeMap.call(this.lineralizeSegments(route,newTree),function(newSegments){return _this.expandSegment(ngModule,segmentGroup,routes,newSegments.concat(segments.slice(lastChild)),outlet,!1)})},ApplyRedirects.prototype.matchSegmentAgainstRoute=function(ngModule,rawSegmentGroup,route,segments){var _this=this;if("**"===route.path)return route.loadChildren?rxjs_operator_map.map.call(this.configLoader.load(ngModule.injector,route),function(cfg){return route._loadedConfig=cfg,new UrlSegmentGroup(segments,{})}):rxjs_observable_of.of(new UrlSegmentGroup(segments,{}));var _a=match(rawSegmentGroup,route,segments),matched=_a.matched,consumedSegments=_a.consumedSegments,lastChild=_a.lastChild;if(!matched)return noMatch(rawSegmentGroup);var rawSlicedSegments=segments.slice(lastChild),childConfig$=this.getChildConfig(ngModule,route);return rxjs_operator_mergeMap.mergeMap.call(childConfig$,function(routerConfig){var childModule=routerConfig.module,childConfig=routerConfig.routes,_a=split(rawSegmentGroup,consumedSegments,rawSlicedSegments,childConfig),segmentGroup=_a.segmentGroup,slicedSegments=_a.slicedSegments;if(0===slicedSegments.length&&segmentGroup.hasChildren()){var expanded$_1=_this.expandChildren(childModule,childConfig,segmentGroup);return rxjs_operator_map.map.call(expanded$_1,function(children){return new UrlSegmentGroup(consumedSegments,children)})}if(0===childConfig.length&&0===slicedSegments.length)return rxjs_observable_of.of(new UrlSegmentGroup(consumedSegments,{}));var expanded$=_this.expandSegment(childModule,segmentGroup,childConfig,slicedSegments,PRIMARY_OUTLET,!0);return rxjs_operator_map.map.call(expanded$,function(cs){return new UrlSegmentGroup(consumedSegments.concat(cs.segments),cs.children)})})},ApplyRedirects.prototype.getChildConfig=function(ngModule,route){var _this=this;return route.children?rxjs_observable_of.of(new LoadedRouterConfig(route.children,ngModule)):route.loadChildren?void 0!==route._loadedConfig?rxjs_observable_of.of(route._loadedConfig):rxjs_operator_mergeMap.mergeMap.call(runCanLoadGuard(ngModule.injector,route),function(shouldLoad){return shouldLoad?rxjs_operator_map.map.call(_this.configLoader.load(ngModule.injector,route),function(cfg){return route._loadedConfig=cfg,cfg}):canLoadFails(route)}):rxjs_observable_of.of(new LoadedRouterConfig([],ngModule))},ApplyRedirects.prototype.lineralizeSegments=function(route,urlTree){for(var res=[],c=urlTree.root;;){if(res=res.concat(c.segments),0===c.numberOfChildren)return rxjs_observable_of.of(res);if(c.numberOfChildren>1||!c.children[PRIMARY_OUTLET])return namedOutletsRedirect(route.redirectTo);c=c.children[PRIMARY_OUTLET]}},ApplyRedirects.prototype.applyRedirectCommands=function(segments,redirectTo,posParams){return this.applyRedirectCreatreUrlTree(redirectTo,this.urlSerializer.parse(redirectTo),segments,posParams)},ApplyRedirects.prototype.applyRedirectCreatreUrlTree=function(redirectTo,urlTree,segments,posParams){var newRoot=this.createSegmentGroup(redirectTo,urlTree.root,segments,posParams);return new UrlTree(newRoot,this.createQueryParams(urlTree.queryParams,this.urlTree.queryParams),urlTree.fragment)},ApplyRedirects.prototype.createQueryParams=function(redirectToParams,actualParams){var res={};return forEach(redirectToParams,function(v,k){if("string"==typeof v&&v.startsWith(":")){var sourceName=v.substring(1);res[k]=actualParams[sourceName]}else res[k]=v}),res},ApplyRedirects.prototype.createSegmentGroup=function(redirectTo,group,segments,posParams){var _this=this,updatedSegments=this.createSegments(redirectTo,group.segments,segments,posParams),children={};return forEach(group.children,function(child,name){children[name]=_this.createSegmentGroup(redirectTo,child,segments,posParams)}),new UrlSegmentGroup(updatedSegments,children)},ApplyRedirects.prototype.createSegments=function(redirectTo,redirectToSegments,actualSegments,posParams){var _this=this;return redirectToSegments.map(function(s){return s.path.startsWith(":")?_this.findPosParam(redirectTo,s,posParams):_this.findOrReturn(s,actualSegments)})},ApplyRedirects.prototype.findPosParam=function(redirectTo,redirectToUrlSegment,posParams){var pos=posParams[redirectToUrlSegment.path.substring(1)];if(!pos)throw new Error("Cannot redirect to '"+redirectTo+"'. Cannot find '"+redirectToUrlSegment.path+"'.");return pos},ApplyRedirects.prototype.findOrReturn=function(redirectToUrlSegment,actualSegments){for(var idx=0,_i=0,actualSegments_1=actualSegments;_i<actualSegments_1.length;_i++){var s=actualSegments_1[_i];if(s.path===redirectToUrlSegment.path)return actualSegments.splice(idx),s;idx++}return redirectToUrlSegment},ApplyRedirects}(),Tree=function(){function Tree(root){this._root=root}return Object.defineProperty(Tree.prototype,"root",{get:function(){return this._root.value},enumerable:!0,configurable:!0}),Tree.prototype.parent=function(t){var p=this.pathFromRoot(t);return p.length>1?p[p.length-2]:null},Tree.prototype.children=function(t){var n=findNode(t,this._root);return n?n.children.map(function(t){return t.value}):[]},Tree.prototype.firstChild=function(t){var n=findNode(t,this._root);return n&&n.children.length>0?n.children[0].value:null},Tree.prototype.siblings=function(t){var p=findPath(t,this._root);return p.length<2?[]:p[p.length-2].children.map(function(c){return c.value}).filter(function(cc){return cc!==t})},Tree.prototype.pathFromRoot=function(t){return findPath(t,this._root).map(function(s){return s.value})},Tree}(),TreeNode=function(){function TreeNode(value,children){this.value=value,this.children=children}return TreeNode.prototype.toString=function(){return"TreeNode("+this.value+")"},TreeNode}(),RouterState=function(_super){function RouterState(root,snapshot){var _this=_super.call(this,root)||this;return _this.snapshot=snapshot,setRouterState(_this,root),_this}return __extends(RouterState,_super),RouterState.prototype.toString=function(){return this.snapshot.toString()},RouterState}(Tree),ActivatedRoute=function(){function ActivatedRoute(url,params,queryParams,fragment,data,outlet,component,futureSnapshot){this.url=url,this.params=params,this.queryParams=queryParams,this.fragment=fragment,this.data=data,this.outlet=outlet,this.component=component,this._futureSnapshot=futureSnapshot}return Object.defineProperty(ActivatedRoute.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=rxjs_operator_map.map.call(this.params,function(p){return convertToParamMap(p)})),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=rxjs_operator_map.map.call(this.queryParams,function(p){return convertToParamMap(p)})),this._queryParamMap},enumerable:!0,configurable:!0}),ActivatedRoute.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},ActivatedRoute}(),ActivatedRouteSnapshot=function(){function ActivatedRouteSnapshot(url,params,queryParams,fragment,data,outlet,component,routeConfig,urlSegment,lastPathIndex,resolve){this.url=url,this.params=params,this.queryParams=queryParams,this.fragment=fragment,this.data=data,this.outlet=outlet,this.component=component,this.routeConfig=routeConfig,this._urlSegment=urlSegment,this._lastPathIndex=lastPathIndex,this._resolve=resolve}return Object.defineProperty(ActivatedRouteSnapshot.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=convertToParamMap(this.params)),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=convertToParamMap(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),ActivatedRouteSnapshot.prototype.toString=function(){return"Route(url:'"+this.url.map(function(segment){return segment.toString()}).join("/")+"', path:'"+(this.routeConfig?this.routeConfig.path:"")+"')"},ActivatedRouteSnapshot}(),RouterStateSnapshot=function(_super){function RouterStateSnapshot(url,root){var _this=_super.call(this,root)||this;return _this.url=url,setRouterState(_this,root),_this}return __extends(RouterStateSnapshot,_super),RouterStateSnapshot.prototype.toString=function(){return serializeNode(this._root)},RouterStateSnapshot}(Tree),Navigation=function(){function Navigation(isAbsolute,numberOfDoubleDots,commands){if(this.isAbsolute=isAbsolute,this.numberOfDoubleDots=numberOfDoubleDots,this.commands=commands,isAbsolute&&commands.length>0&&isMatrixParams(commands[0]))throw new Error("Root segment cannot have matrix parameters");var cmdWithOutlet=commands.find(function(c){return"object"==typeof c&&null!=c&&c.outlets});if(cmdWithOutlet&&cmdWithOutlet!==last$1(commands))throw new Error("{outlets:{}} has to be the last command")}return Navigation.prototype.toRoot=function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]},Navigation}(),Position=function(){function Position(segmentGroup,processChildren,index){this.segmentGroup=segmentGroup,this.processChildren=processChildren,this.index=index}return Position}(),CanActivate=function(){function CanActivate(path){this.path=path,this.route=this.path[this.path.length-1]}return CanActivate}(),CanDeactivate=function(){function CanDeactivate(component,route){this.component=component,this.route=route}return CanDeactivate}(),PreActivation=function(){function PreActivation(future,curr,moduleInjector,forwardEvent){this.future=future,this.curr=curr,this.moduleInjector=moduleInjector,this.forwardEvent=forwardEvent,this.canActivateChecks=[],this.canDeactivateChecks=[]}return PreActivation.prototype.initialize=function(parentContexts){var futureRoot=this.future._root,currRoot=this.curr?this.curr._root:null;this.setupChildRouteGuards(futureRoot,currRoot,parentContexts,[futureRoot.value])},PreActivation.prototype.checkGuards=function(){var _this=this;if(!this.isDeactivating()&&!this.isActivating())return rxjs_observable_of.of(!0);var canDeactivate$=this.runCanDeactivateChecks();return rxjs_operator_mergeMap.mergeMap.call(canDeactivate$,function(canDeactivate){return canDeactivate?_this.runCanActivateChecks():rxjs_observable_of.of(!1)})},PreActivation.prototype.resolveData=function(paramsInheritanceStrategy){
42
- var _this=this;if(!this.isActivating())return rxjs_observable_of.of(null);var checks$=rxjs_observable_from.from(this.canActivateChecks),runningChecks$=rxjs_operator_concatMap.concatMap.call(checks$,function(check){return _this.runResolve(check.route,paramsInheritanceStrategy)});return rxjs_operator_reduce.reduce.call(runningChecks$,function(_,__){return _})},PreActivation.prototype.isDeactivating=function(){return 0!==this.canDeactivateChecks.length},PreActivation.prototype.isActivating=function(){return 0!==this.canActivateChecks.length},PreActivation.prototype.setupChildRouteGuards=function(futureNode,currNode,contexts,futurePath){var _this=this,prevChildren=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(c){_this.setupRouteGuards(c,prevChildren[c.value.outlet],contexts,futurePath.concat([c.value])),delete prevChildren[c.value.outlet]}),forEach(prevChildren,function(v,k){return _this.deactivateRouteAndItsChildren(v,contexts.getContext(k))})},PreActivation.prototype.setupRouteGuards=function(futureNode,currNode,parentContexts,futurePath){var future=futureNode.value,curr=currNode?currNode.value:null,context=parentContexts?parentContexts.getContext(futureNode.value.outlet):null;if(curr&&future.routeConfig===curr.routeConfig){var shouldRunGuardsAndResolvers=this.shouldRunGuardsAndResolvers(curr,future,future.routeConfig.runGuardsAndResolvers);if(shouldRunGuardsAndResolvers?this.canActivateChecks.push(new CanActivate(futurePath)):(future.data=curr.data,future._resolvedData=curr._resolvedData),future.component?this.setupChildRouteGuards(futureNode,currNode,context?context.children:null,futurePath):this.setupChildRouteGuards(futureNode,currNode,parentContexts,futurePath),shouldRunGuardsAndResolvers){var outlet=context.outlet;this.canDeactivateChecks.push(new CanDeactivate(outlet.component,curr))}}else curr&&this.deactivateRouteAndItsChildren(currNode,context),this.canActivateChecks.push(new CanActivate(futurePath)),future.component?this.setupChildRouteGuards(futureNode,null,context?context.children:null,futurePath):this.setupChildRouteGuards(futureNode,null,parentContexts,futurePath)},PreActivation.prototype.shouldRunGuardsAndResolvers=function(curr,future,mode){switch(mode){case"always":return!0;case"paramsOrQueryParamsChange":return!equalParamsAndUrlSegments(curr,future)||!shallowEqual(curr.queryParams,future.queryParams);case"paramsChange":default:return!equalParamsAndUrlSegments(curr,future)}},PreActivation.prototype.deactivateRouteAndItsChildren=function(route,context){var _this=this,children=nodeChildrenAsMap(route),r=route.value;forEach(children,function(node,childName){r.component?context?_this.deactivateRouteAndItsChildren(node,context.children.getContext(childName)):_this.deactivateRouteAndItsChildren(node,null):_this.deactivateRouteAndItsChildren(node,context)}),r.component&&context&&context.outlet&&context.outlet.isActivated?this.canDeactivateChecks.push(new CanDeactivate(context.outlet.component,r)):this.canDeactivateChecks.push(new CanDeactivate(null,r))},PreActivation.prototype.runCanDeactivateChecks=function(){var _this=this,checks$=rxjs_observable_from.from(this.canDeactivateChecks),runningChecks$=rxjs_operator_mergeMap.mergeMap.call(checks$,function(check){return _this.runCanDeactivate(check.component,check.route)});return rxjs_operator_every.every.call(runningChecks$,function(result){return!0===result})},PreActivation.prototype.runCanActivateChecks=function(){var _this=this,checks$=rxjs_observable_from.from(this.canActivateChecks),runningChecks$=rxjs_operator_concatMap.concatMap.call(checks$,function(check){return andObservables(rxjs_observable_from.from([_this.fireChildActivationStart(check.route.parent),_this.fireActivationStart(check.route),_this.runCanActivateChild(check.path),_this.runCanActivate(check.route)]))});return rxjs_operator_every.every.call(runningChecks$,function(result){return!0===result})},PreActivation.prototype.fireActivationStart=function(snapshot){return null!==snapshot&&this.forwardEvent&&this.forwardEvent(new ActivationStart(snapshot)),rxjs_observable_of.of(!0)},PreActivation.prototype.fireChildActivationStart=function(snapshot){return null!==snapshot&&this.forwardEvent&&this.forwardEvent(new ChildActivationStart(snapshot)),rxjs_observable_of.of(!0)},PreActivation.prototype.runCanActivate=function(future){var _this=this,canActivate=future.routeConfig?future.routeConfig.canActivate:null;return canActivate&&0!==canActivate.length?andObservables(rxjs_operator_map.map.call(rxjs_observable_from.from(canActivate),function(c){var observable,guard=_this.getToken(c,future);return observable=wrapIntoObservable(guard.canActivate?guard.canActivate(future,_this.future):guard(future,_this.future)),rxjs_operator_first.first.call(observable)})):rxjs_observable_of.of(!0)},PreActivation.prototype.runCanActivateChild=function(path){var _this=this,future=path[path.length-1],canActivateChildGuards=path.slice(0,path.length-1).reverse().map(function(p){return _this.extractCanActivateChild(p)}).filter(function(_){return null!==_});return andObservables(rxjs_operator_map.map.call(rxjs_observable_from.from(canActivateChildGuards),function(d){return andObservables(rxjs_operator_map.map.call(rxjs_observable_from.from(d.guards),function(c){var observable,guard=_this.getToken(c,d.node);return observable=wrapIntoObservable(guard.canActivateChild?guard.canActivateChild(future,_this.future):guard(future,_this.future)),rxjs_operator_first.first.call(observable)}))}))},PreActivation.prototype.extractCanActivateChild=function(p){var canActivateChild=p.routeConfig?p.routeConfig.canActivateChild:null;return canActivateChild&&0!==canActivateChild.length?{node:p,guards:canActivateChild}:null},PreActivation.prototype.runCanDeactivate=function(component,curr){var _this=this,canDeactivate=curr&&curr.routeConfig?curr.routeConfig.canDeactivate:null;if(!canDeactivate||0===canDeactivate.length)return rxjs_observable_of.of(!0);var canDeactivate$=rxjs_operator_mergeMap.mergeMap.call(rxjs_observable_from.from(canDeactivate),function(c){var observable,guard=_this.getToken(c,curr);return observable=wrapIntoObservable(guard.canDeactivate?guard.canDeactivate(component,curr,_this.curr,_this.future):guard(component,curr,_this.curr,_this.future)),rxjs_operator_first.first.call(observable)});return rxjs_operator_every.every.call(canDeactivate$,function(result){return!0===result})},PreActivation.prototype.runResolve=function(future,paramsInheritanceStrategy){var resolve=future._resolve;return rxjs_operator_map.map.call(this.resolveNode(resolve,future),function(resolvedData){return future._resolvedData=resolvedData,future.data=__assign({},future.data,inheritedParamsDataResolve(future,paramsInheritanceStrategy).resolve),null})},PreActivation.prototype.resolveNode=function(resolve,future){var _this=this,keys=Object.keys(resolve);if(0===keys.length)return rxjs_observable_of.of({});if(1===keys.length){var key_1=keys[0];return rxjs_operator_map.map.call(this.getResolver(resolve[key_1],future),function(value){return _a={},_a[key_1]=value,_a;var _a})}var data={},runningResolvers$=rxjs_operator_mergeMap.mergeMap.call(rxjs_observable_from.from(keys),function(key){return rxjs_operator_map.map.call(_this.getResolver(resolve[key],future),function(value){return data[key]=value,value})});return rxjs_operator_map.map.call(rxjs_operator_last.last.call(runningResolvers$),function(){return data})},PreActivation.prototype.getResolver=function(injectionToken,future){var resolver=this.getToken(injectionToken,future);return wrapIntoObservable(resolver.resolve?resolver.resolve(future,this.future):resolver(future,this.future))},PreActivation.prototype.getToken=function(token,snapshot){var config=closestLoadedConfig(snapshot);return(config?config.module.injector:this.moduleInjector).get(token)},PreActivation}(),NoMatch$1=function(){function NoMatch(){}return NoMatch}(),Recognizer=function(){function Recognizer(rootComponentType,config,urlTree,url,paramsInheritanceStrategy){this.rootComponentType=rootComponentType,this.config=config,this.urlTree=urlTree,this.url=url,this.paramsInheritanceStrategy=paramsInheritanceStrategy}return Recognizer.prototype.recognize=function(){try{var rootSegmentGroup=split$1(this.urlTree.root,[],[],this.config).segmentGroup,children=this.processSegmentGroup(this.config,rootSegmentGroup,PRIMARY_OUTLET),root=new ActivatedRouteSnapshot([],Object.freeze({}),Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,{},PRIMARY_OUTLET,this.rootComponentType,null,this.urlTree.root,-1,{}),rootNode=new TreeNode(root,children),routeState=new RouterStateSnapshot(this.url,rootNode);return this.inheritParamsAndData(routeState._root),rxjs_observable_of.of(routeState)}catch(e){return new rxjs_Observable.Observable(function(obs){return obs.error(e)})}},Recognizer.prototype.inheritParamsAndData=function(routeNode){var _this=this,route=routeNode.value,i=inheritedParamsDataResolve(route,this.paramsInheritanceStrategy);route.params=Object.freeze(i.params),route.data=Object.freeze(i.data),routeNode.children.forEach(function(n){return _this.inheritParamsAndData(n)})},Recognizer.prototype.processSegmentGroup=function(config,segmentGroup,outlet){return 0===segmentGroup.segments.length&&segmentGroup.hasChildren()?this.processChildren(config,segmentGroup):this.processSegment(config,segmentGroup,segmentGroup.segments,outlet)},Recognizer.prototype.processChildren=function(config,segmentGroup){var _this=this,children=mapChildrenIntoArray(segmentGroup,function(child,childOutlet){return _this.processSegmentGroup(config,child,childOutlet)});return checkOutletNameUniqueness(children),sortActivatedRouteSnapshots(children),children},Recognizer.prototype.processSegment=function(config,segmentGroup,segments,outlet){for(var _i=0,config_1=config;_i<config_1.length;_i++){var r=config_1[_i];try{return this.processSegmentAgainstRoute(r,segmentGroup,segments,outlet)}catch(e){if(!(e instanceof NoMatch$1))throw e}}if(this.noLeftoversInUrl(segmentGroup,segments,outlet))return[];throw new NoMatch$1},Recognizer.prototype.noLeftoversInUrl=function(segmentGroup,segments,outlet){return 0===segments.length&&!segmentGroup.children[outlet]},Recognizer.prototype.processSegmentAgainstRoute=function(route,rawSegment,segments,outlet){if(route.redirectTo)throw new NoMatch$1;if((route.outlet||PRIMARY_OUTLET)!==outlet)throw new NoMatch$1;var snapshot,consumedSegments=[],rawSlicedSegments=[];if("**"===route.path){var params=segments.length>0?last$1(segments).parameters:{};snapshot=new ActivatedRouteSnapshot(segments,params,Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,getData(route),outlet,route.component,route,getSourceSegmentGroup(rawSegment),getPathIndexShift(rawSegment)+segments.length,getResolve(route))}else{var result=match$1(rawSegment,route,segments);consumedSegments=result.consumedSegments,rawSlicedSegments=segments.slice(result.lastChild),snapshot=new ActivatedRouteSnapshot(consumedSegments,result.parameters,Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,getData(route),outlet,route.component,route,getSourceSegmentGroup(rawSegment),getPathIndexShift(rawSegment)+consumedSegments.length,getResolve(route))}var childConfig=getChildConfig(route),_a=split$1(rawSegment,consumedSegments,rawSlicedSegments,childConfig),segmentGroup=_a.segmentGroup,slicedSegments=_a.slicedSegments;if(0===slicedSegments.length&&segmentGroup.hasChildren()){var children_1=this.processChildren(childConfig,segmentGroup);return[new TreeNode(snapshot,children_1)]}if(0===childConfig.length&&0===slicedSegments.length)return[new TreeNode(snapshot,[])];var children=this.processSegment(childConfig,segmentGroup,slicedSegments,PRIMARY_OUTLET);return[new TreeNode(snapshot,children)]},Recognizer}(),RouteReuseStrategy=function(){function RouteReuseStrategy(){}return RouteReuseStrategy}(),DefaultRouteReuseStrategy=function(){function DefaultRouteReuseStrategy(){}return DefaultRouteReuseStrategy.prototype.shouldDetach=function(route){return!1},DefaultRouteReuseStrategy.prototype.store=function(route,detachedTree){},DefaultRouteReuseStrategy.prototype.shouldAttach=function(route){return!1},DefaultRouteReuseStrategy.prototype.retrieve=function(route){return null},DefaultRouteReuseStrategy.prototype.shouldReuseRoute=function(future,curr){return future.routeConfig===curr.routeConfig},DefaultRouteReuseStrategy}(),ROUTES=new _angular_core.InjectionToken("ROUTES"),RouterConfigLoader=function(){function RouterConfigLoader(loader,compiler,onLoadStartListener,onLoadEndListener){this.loader=loader,this.compiler=compiler,this.onLoadStartListener=onLoadStartListener,this.onLoadEndListener=onLoadEndListener}return RouterConfigLoader.prototype.load=function(parentInjector,route){var _this=this;this.onLoadStartListener&&this.onLoadStartListener(route);var moduleFactory$=this.loadModuleFactory(route.loadChildren);return rxjs_operator_map.map.call(moduleFactory$,function(factory){_this.onLoadEndListener&&_this.onLoadEndListener(route);var module=factory.create(parentInjector);return new LoadedRouterConfig(flatten(module.injector.get(ROUTES)),module)})},RouterConfigLoader.prototype.loadModuleFactory=function(loadChildren){var _this=this;return"string"==typeof loadChildren?rxjs_observable_fromPromise.fromPromise(this.loader.load(loadChildren)):rxjs_operator_mergeMap.mergeMap.call(wrapIntoObservable(loadChildren()),function(t){return t instanceof _angular_core.NgModuleFactory?rxjs_observable_of.of(t):rxjs_observable_fromPromise.fromPromise(_this.compiler.compileModuleAsync(t))})},RouterConfigLoader}(),UrlHandlingStrategy=function(){function UrlHandlingStrategy(){}return UrlHandlingStrategy}(),DefaultUrlHandlingStrategy=function(){function DefaultUrlHandlingStrategy(){}return DefaultUrlHandlingStrategy.prototype.shouldProcessUrl=function(url){return!0},DefaultUrlHandlingStrategy.prototype.extract=function(url){return url},DefaultUrlHandlingStrategy.prototype.merge=function(newUrlPart,wholeUrl){return newUrlPart},DefaultUrlHandlingStrategy}(),Router=function(){function Router(rootComponentType,urlSerializer,rootContexts,location,injector,loader,compiler,config){var _this=this;this.rootComponentType=rootComponentType,this.urlSerializer=urlSerializer,this.rootContexts=rootContexts,this.location=location,this.config=config,this.navigations=new rxjs_BehaviorSubject.BehaviorSubject(null),this.navigationId=0,this.events=new rxjs_Subject.Subject,this.errorHandler=defaultErrorHandler,this.navigated=!1,this.hooks={beforePreactivation:defaultRouterHook,afterPreactivation:defaultRouterHook},this.urlHandlingStrategy=new DefaultUrlHandlingStrategy,this.routeReuseStrategy=new DefaultRouteReuseStrategy,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly";var onLoadStart=function(r){return _this.triggerEvent(new RouteConfigLoadStart(r))},onLoadEnd=function(r){return _this.triggerEvent(new RouteConfigLoadEnd(r))};this.ngModule=injector.get(_angular_core.NgModuleRef),this.resetConfig(config),this.currentUrlTree=createEmptyUrlTree(),this.rawUrlTree=this.currentUrlTree,this.configLoader=new RouterConfigLoader(loader,compiler,onLoadStart,onLoadEnd),this.routerState=createEmptyState(this.currentUrlTree,this.rootComponentType),this.processNavigations()}return Router.prototype.resetRootComponentType=function(rootComponentType){this.rootComponentType=rootComponentType,this.routerState.root.component=this.rootComponentType},Router.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},Router.prototype.setUpLocationChangeListener=function(){var _this=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe(Zone.current.wrap(function(change){var rawUrlTree=_this.urlSerializer.parse(change.url),source="popstate"===change.type?"popstate":"hashchange";setTimeout(function(){_this.scheduleNavigation(rawUrlTree,source,{replaceUrl:!0})},0)})))},Object.defineProperty(Router.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),Router.prototype.triggerEvent=function(e){this.events.next(e)},Router.prototype.resetConfig=function(config){validateConfig(config),this.config=config,this.navigated=!1},Router.prototype.ngOnDestroy=function(){this.dispose()},Router.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)},Router.prototype.createUrlTree=function(commands,navigationExtras){void 0===navigationExtras&&(navigationExtras={});var relativeTo=navigationExtras.relativeTo,queryParams=navigationExtras.queryParams,fragment=navigationExtras.fragment,preserveQueryParams=navigationExtras.preserveQueryParams,queryParamsHandling=navigationExtras.queryParamsHandling,preserveFragment=navigationExtras.preserveFragment;_angular_core.isDevMode()&&preserveQueryParams&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");var a=relativeTo||this.routerState.root,f=preserveFragment?this.currentUrlTree.fragment:fragment,q=null;if(queryParamsHandling)switch(queryParamsHandling){case"merge":q=__assign({},this.currentUrlTree.queryParams,queryParams);break;case"preserve":q=this.currentUrlTree.queryParams;break;default:q=queryParams||null}else q=preserveQueryParams?this.currentUrlTree.queryParams:queryParams||null;return null!==q&&(q=this.removeEmptyProps(q)),createUrlTree(a,this.currentUrlTree,commands,q,f)},Router.prototype.navigateByUrl=function(url,extras){void 0===extras&&(extras={skipLocationChange:!1});var urlTree=url instanceof UrlTree?url:this.parseUrl(url),mergedTree=this.urlHandlingStrategy.merge(urlTree,this.rawUrlTree);return this.scheduleNavigation(mergedTree,"imperative",extras)},Router.prototype.navigate=function(commands,extras){return void 0===extras&&(extras={skipLocationChange:!1}),validateCommands(commands),this.navigateByUrl(this.createUrlTree(commands,extras),extras)},Router.prototype.serializeUrl=function(url){return this.urlSerializer.serialize(url)},Router.prototype.parseUrl=function(url){return this.urlSerializer.parse(url)},Router.prototype.isActive=function(url,exact){if(url instanceof UrlTree)return containsTree(this.currentUrlTree,url,exact);var urlTree=this.urlSerializer.parse(url);return containsTree(this.currentUrlTree,urlTree,exact)},Router.prototype.removeEmptyProps=function(params){return Object.keys(params).reduce(function(result,key){var value=params[key];return null!==value&&void 0!==value&&(result[key]=value),result},{})},Router.prototype.processNavigations=function(){var _this=this;rxjs_operator_concatMap.concatMap.call(this.navigations,function(nav){return nav?(_this.executeScheduledNavigation(nav),nav.promise.catch(function(){})):rxjs_observable_of.of(null)}).subscribe(function(){})},Router.prototype.scheduleNavigation=function(rawUrl,source,extras){var lastNavigation=this.navigations.value;if(lastNavigation&&"imperative"!==source&&"imperative"===lastNavigation.source&&lastNavigation.rawUrl.toString()===rawUrl.toString())return Promise.resolve(!0);if(lastNavigation&&"hashchange"==source&&"popstate"===lastNavigation.source&&lastNavigation.rawUrl.toString()===rawUrl.toString())return Promise.resolve(!0);if(lastNavigation&&"popstate"==source&&"hashchange"===lastNavigation.source&&lastNavigation.rawUrl.toString()===rawUrl.toString())return Promise.resolve(!0);var resolve=null,reject=null,promise=new Promise(function(res,rej){resolve=res,reject=rej}),id=++this.navigationId;return this.navigations.next({id:id,source:source,rawUrl:rawUrl,extras:extras,resolve:resolve,reject:reject,promise:promise}),promise.catch(function(e){return Promise.reject(e)})},Router.prototype.executeScheduledNavigation=function(_a){var _this=this,id=_a.id,rawUrl=_a.rawUrl,extras=_a.extras,resolve=_a.resolve,reject=_a.reject,url=this.urlHandlingStrategy.extract(rawUrl),urlTransition=!this.navigated||url.toString()!==this.currentUrlTree.toString();("reload"===this.onSameUrlNavigation||urlTransition)&&this.urlHandlingStrategy.shouldProcessUrl(rawUrl)?(this.events.next(new NavigationStart(id,this.serializeUrl(url))),Promise.resolve().then(function(_){return _this.runNavigate(url,rawUrl,!!extras.skipLocationChange,!!extras.replaceUrl,id,null)}).then(resolve,reject)):urlTransition&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)?(this.events.next(new NavigationStart(id,this.serializeUrl(url))),Promise.resolve().then(function(_){return _this.runNavigate(url,rawUrl,!1,!1,id,createEmptyState(url,_this.rootComponentType).snapshot)}).then(resolve,reject)):(this.rawUrlTree=rawUrl,resolve(null))},Router.prototype.runNavigate=function(url,rawUrl,skipLocationChange,replaceUrl,id,precreatedState){var _this=this;return id!==this.navigationId?(this.events.next(new NavigationCancel(id,this.serializeUrl(url),"Navigation ID "+id+" is not equal to the current navigation id "+this.navigationId)),Promise.resolve(!1)):new Promise(function(resolvePromise,rejectPromise){var urlAndSnapshot$;if(precreatedState)urlAndSnapshot$=rxjs_observable_of.of({appliedUrl:url,snapshot:precreatedState});else{var moduleInjector=_this.ngModule.injector,redirectsApplied$=applyRedirects(moduleInjector,_this.configLoader,_this.urlSerializer,url,_this.config);urlAndSnapshot$=rxjs_operator_mergeMap.mergeMap.call(redirectsApplied$,function(appliedUrl){return rxjs_operator_map.map.call(recognize(_this.rootComponentType,_this.config,appliedUrl,_this.serializeUrl(appliedUrl),_this.paramsInheritanceStrategy),function(snapshot){return _this.events.next(new RoutesRecognized(id,_this.serializeUrl(url),_this.serializeUrl(appliedUrl),snapshot)),{appliedUrl:appliedUrl,snapshot:snapshot}})})}var preActivation,navigationIsSuccessful,beforePreactivationDone$=rxjs_operator_mergeMap.mergeMap.call(urlAndSnapshot$,function(p){return rxjs_operator_map.map.call(_this.hooks.beforePreactivation(p.snapshot),function(){return p})}),preactivationSetup$=rxjs_operator_map.map.call(beforePreactivationDone$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot,moduleInjector=_this.ngModule.injector;return preActivation=new PreActivation(snapshot,_this.routerState.snapshot,moduleInjector,function(evt){return _this.triggerEvent(evt)}),preActivation.initialize(_this.rootContexts),{appliedUrl:appliedUrl,snapshot:snapshot}}),preactivationCheckGuards$=rxjs_operator_mergeMap.mergeMap.call(preactivationSetup$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot;return _this.navigationId!==id?rxjs_observable_of.of(!1):(_this.triggerEvent(new GuardsCheckStart(id,_this.serializeUrl(url),appliedUrl,snapshot)),rxjs_operator_map.map.call(preActivation.checkGuards(),function(shouldActivate){return _this.triggerEvent(new GuardsCheckEnd(id,_this.serializeUrl(url),appliedUrl,snapshot,shouldActivate)),{appliedUrl:appliedUrl,snapshot:snapshot,shouldActivate:shouldActivate}}))}),preactivationResolveData$=rxjs_operator_mergeMap.mergeMap.call(preactivationCheckGuards$,function(p){return _this.navigationId!==id?rxjs_observable_of.of(!1):p.shouldActivate&&preActivation.isActivating()?(_this.triggerEvent(new ResolveStart(id,_this.serializeUrl(url),p.appliedUrl,p.snapshot)),rxjs_operator_map.map.call(preActivation.resolveData(_this.paramsInheritanceStrategy),function(){return _this.triggerEvent(new ResolveEnd(id,_this.serializeUrl(url),p.appliedUrl,p.snapshot)),p})):rxjs_observable_of.of(p)}),preactivationDone$=rxjs_operator_mergeMap.mergeMap.call(preactivationResolveData$,function(p){return rxjs_operator_map.map.call(_this.hooks.afterPreactivation(p.snapshot),function(){return p})}),routerState$=rxjs_operator_map.map.call(preactivationDone$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot,shouldActivate=_a.shouldActivate;if(shouldActivate){return{appliedUrl:appliedUrl,state:createRouterState(_this.routeReuseStrategy,snapshot,_this.routerState),shouldActivate:shouldActivate}}return{appliedUrl:appliedUrl,state:null,shouldActivate:shouldActivate}}),storedState=_this.routerState,storedUrl=_this.currentUrlTree;routerState$.forEach(function(_a){var appliedUrl=_a.appliedUrl,state=_a.state;if(!_a.shouldActivate||id!==_this.navigationId)return void(navigationIsSuccessful=!1);if(_this.currentUrlTree=appliedUrl,_this.rawUrlTree=_this.urlHandlingStrategy.merge(_this.currentUrlTree,rawUrl),_this.routerState=state,!skipLocationChange){var path=_this.urlSerializer.serialize(_this.rawUrlTree);_this.location.isCurrentPathEqualTo(path)||replaceUrl?_this.location.replaceState(path):_this.location.go(path)}new ActivateRoutes(_this.routeReuseStrategy,state,storedState,function(evt){return _this.triggerEvent(evt)}).activate(_this.rootContexts),navigationIsSuccessful=!0}).then(function(){navigationIsSuccessful?(_this.navigated=!0,_this.events.next(new NavigationEnd(id,_this.serializeUrl(url),_this.serializeUrl(_this.currentUrlTree))),resolvePromise(!0)):(_this.resetUrlToCurrentUrlTree(),_this.events.next(new NavigationCancel(id,_this.serializeUrl(url),"")),resolvePromise(!1))},function(e){if(isNavigationCancelingError(e))_this.navigated=!0,_this.resetStateAndUrl(storedState,storedUrl,rawUrl),_this.events.next(new NavigationCancel(id,_this.serializeUrl(url),e.message)),resolvePromise(!1);else{_this.resetStateAndUrl(storedState,storedUrl,rawUrl),_this.events.next(new NavigationError(id,_this.serializeUrl(url),e));try{resolvePromise(_this.errorHandler(e))}catch(ee){rejectPromise(ee)}}})})},Router.prototype.resetStateAndUrl=function(storedState,storedUrl,rawUrl){this.routerState=storedState,this.currentUrlTree=storedUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,rawUrl),this.resetUrlToCurrentUrlTree()},Router.prototype.resetUrlToCurrentUrlTree=function(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree))},Router}(),ActivateRoutes=function(){function ActivateRoutes(routeReuseStrategy,futureState,currState,forwardEvent){this.routeReuseStrategy=routeReuseStrategy,this.futureState=futureState,this.currState=currState,this.forwardEvent=forwardEvent}return ActivateRoutes.prototype.activate=function(parentContexts){var futureRoot=this.futureState._root,currRoot=this.currState?this.currState._root:null;this.deactivateChildRoutes(futureRoot,currRoot,parentContexts),advanceActivatedRoute(this.futureState.root),this.activateChildRoutes(futureRoot,currRoot,parentContexts)},ActivateRoutes.prototype.deactivateChildRoutes=function(futureNode,currNode,contexts){var _this=this,children=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(futureChild){var childOutletName=futureChild.value.outlet;_this.deactivateRoutes(futureChild,children[childOutletName],contexts),delete children[childOutletName]}),forEach(children,function(v,childName){_this.deactivateRouteAndItsChildren(v,contexts)})},ActivateRoutes.prototype.deactivateRoutes=function(futureNode,currNode,parentContext){var future=futureNode.value,curr=currNode?currNode.value:null;if(future===curr)if(future.component){var context=parentContext.getContext(future.outlet);context&&this.deactivateChildRoutes(futureNode,currNode,context.children)}else this.deactivateChildRoutes(futureNode,currNode,parentContext);else curr&&this.deactivateRouteAndItsChildren(currNode,parentContext)},ActivateRoutes.prototype.deactivateRouteAndItsChildren=function(route,parentContexts){this.routeReuseStrategy.shouldDetach(route.value.snapshot)?this.detachAndStoreRouteSubtree(route,parentContexts):this.deactivateRouteAndOutlet(route,parentContexts)},ActivateRoutes.prototype.detachAndStoreRouteSubtree=function(route,parentContexts){var context=parentContexts.getContext(route.value.outlet);if(context&&context.outlet){var componentRef=context.outlet.detach(),contexts=context.children.onOutletDeactivated();this.routeReuseStrategy.store(route.value.snapshot,{componentRef:componentRef,route:route,contexts:contexts})}},ActivateRoutes.prototype.deactivateRouteAndOutlet=function(route,parentContexts){var _this=this,context=parentContexts.getContext(route.value.outlet);if(context){var children=nodeChildrenAsMap(route),contexts_1=route.value.component?context.children:parentContexts;forEach(children,function(v,k){return _this.deactivateRouteAndItsChildren(v,contexts_1)}),context.outlet&&(context.outlet.deactivate(),context.children.onOutletDeactivated())}},ActivateRoutes.prototype.activateChildRoutes=function(futureNode,currNode,contexts){var _this=this,children=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(c){_this.activateRoutes(c,children[c.value.outlet],contexts),_this.forwardEvent(new ActivationEnd(c.value.snapshot))}),futureNode.children.length&&this.forwardEvent(new ChildActivationEnd(futureNode.value.snapshot))},ActivateRoutes.prototype.activateRoutes=function(futureNode,currNode,parentContexts){var future=futureNode.value,curr=currNode?currNode.value:null;if(advanceActivatedRoute(future),future===curr)if(future.component){var context=parentContexts.getOrCreateContext(future.outlet);this.activateChildRoutes(futureNode,currNode,context.children)}else this.activateChildRoutes(futureNode,currNode,parentContexts);else if(future.component){var context=parentContexts.getOrCreateContext(future.outlet);if(this.routeReuseStrategy.shouldAttach(future.snapshot)){var stored=this.routeReuseStrategy.retrieve(future.snapshot);this.routeReuseStrategy.store(future.snapshot,null),context.children.onOutletReAttached(stored.contexts),context.attachRef=stored.componentRef,context.route=stored.route.value,context.outlet&&context.outlet.attach(stored.componentRef,stored.route.value),advanceActivatedRouteNodeAndItsChildren(stored.route)}else{var config=parentLoadedConfig(future.snapshot),cmpFactoryResolver=config?config.module.componentFactoryResolver:null;context.route=future,context.resolver=cmpFactoryResolver,context.outlet&&context.outlet.activateWith(future,cmpFactoryResolver),this.activateChildRoutes(futureNode,null,context.children)}}else this.activateChildRoutes(futureNode,null,parentContexts)},ActivateRoutes}(),RouterLink=function(){function RouterLink(router,route,tabIndex,renderer,el){this.router=router,this.route=route,this.commands=[],null==tabIndex&&renderer.setAttribute(el.nativeElement,"tabindex","0")}return Object.defineProperty(RouterLink.prototype,"routerLink",{set:function(commands){this.commands=null!=commands?Array.isArray(commands)?commands:[commands]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(RouterLink.prototype,"preserveQueryParams",{set:function(value){_angular_core.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated!, use queryParamsHandling instead."),this.preserve=value},enumerable:!0,configurable:!0}),RouterLink.prototype.onClick=function(){var extras={skipLocationChange:attrBoolValue(this.skipLocationChange),replaceUrl:attrBoolValue(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,extras),!0},Object.defineProperty(RouterLink.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:attrBoolValue(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:attrBoolValue(this.preserveFragment)})},enumerable:!0,configurable:!0}),RouterLink.decorators=[{type:_angular_core.Directive,args:[{selector:":not(a)[routerLink]"}]}],RouterLink.ctorParameters=function(){return[{type:Router},{type:ActivatedRoute},{type:void 0,decorators:[{type:_angular_core.Attribute,args:["tabindex"]}]},{type:_angular_core.Renderer2},{type:_angular_core.ElementRef}]},RouterLink.propDecorators={queryParams:[{type:_angular_core.Input}],fragment:[{type:_angular_core.Input}],queryParamsHandling:[{type:_angular_core.Input}],preserveFragment:[{type:_angular_core.Input}],skipLocationChange:[{type:_angular_core.Input}],replaceUrl:[{type:_angular_core.Input}],routerLink:[{type:_angular_core.Input}],
43
- preserveQueryParams:[{type:_angular_core.Input}],onClick:[{type:_angular_core.HostListener,args:["click"]}]},RouterLink}(),RouterLinkWithHref=function(){function RouterLinkWithHref(router,route,locationStrategy){var _this=this;this.router=router,this.route=route,this.locationStrategy=locationStrategy,this.commands=[],this.subscription=router.events.subscribe(function(s){s instanceof NavigationEnd&&_this.updateTargetUrlAndHref()})}return Object.defineProperty(RouterLinkWithHref.prototype,"routerLink",{set:function(commands){this.commands=null!=commands?Array.isArray(commands)?commands:[commands]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(RouterLinkWithHref.prototype,"preserveQueryParams",{set:function(value){_angular_core.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead."),this.preserve=value},enumerable:!0,configurable:!0}),RouterLinkWithHref.prototype.ngOnChanges=function(changes){this.updateTargetUrlAndHref()},RouterLinkWithHref.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterLinkWithHref.prototype.onClick=function(button,ctrlKey,metaKey,shiftKey){if(0!==button||ctrlKey||metaKey||shiftKey)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;var extras={skipLocationChange:attrBoolValue(this.skipLocationChange),replaceUrl:attrBoolValue(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,extras),!1},RouterLinkWithHref.prototype.updateTargetUrlAndHref=function(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))},Object.defineProperty(RouterLinkWithHref.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:attrBoolValue(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:attrBoolValue(this.preserveFragment)})},enumerable:!0,configurable:!0}),RouterLinkWithHref.decorators=[{type:_angular_core.Directive,args:[{selector:"a[routerLink]"}]}],RouterLinkWithHref.ctorParameters=function(){return[{type:Router},{type:ActivatedRoute},{type:_angular_common.LocationStrategy}]},RouterLinkWithHref.propDecorators={target:[{type:_angular_core.HostBinding,args:["attr.target"]},{type:_angular_core.Input}],queryParams:[{type:_angular_core.Input}],fragment:[{type:_angular_core.Input}],queryParamsHandling:[{type:_angular_core.Input}],preserveFragment:[{type:_angular_core.Input}],skipLocationChange:[{type:_angular_core.Input}],replaceUrl:[{type:_angular_core.Input}],href:[{type:_angular_core.HostBinding}],routerLink:[{type:_angular_core.Input}],preserveQueryParams:[{type:_angular_core.Input}],onClick:[{type:_angular_core.HostListener,args:["click",["$event.button","$event.ctrlKey","$event.metaKey","$event.shiftKey"]]}]},RouterLinkWithHref}(),RouterLinkActive=function(){function RouterLinkActive(router,element,renderer,cdr){var _this=this;this.router=router,this.element=element,this.renderer=renderer,this.cdr=cdr,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.subscription=router.events.subscribe(function(s){s instanceof NavigationEnd&&_this.update()})}return RouterLinkActive.prototype.ngAfterContentInit=function(){var _this=this;this.links.changes.subscribe(function(_){return _this.update()}),this.linksWithHrefs.changes.subscribe(function(_){return _this.update()}),this.update()},Object.defineProperty(RouterLinkActive.prototype,"routerLinkActive",{set:function(data){var classes=Array.isArray(data)?data:data.split(" ");this.classes=classes.filter(function(c){return!!c})},enumerable:!0,configurable:!0}),RouterLinkActive.prototype.ngOnChanges=function(changes){this.update()},RouterLinkActive.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterLinkActive.prototype.update=function(){var _this=this;this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then(function(){var hasActiveLinks=_this.hasActiveLinks();_this.isActive!==hasActiveLinks&&(_this.isActive=hasActiveLinks,_this.classes.forEach(function(c){hasActiveLinks?_this.renderer.addClass(_this.element.nativeElement,c):_this.renderer.removeClass(_this.element.nativeElement,c)}))})},RouterLinkActive.prototype.isLinkActive=function(router){var _this=this;return function(link){return router.isActive(link.urlTree,_this.routerLinkActiveOptions.exact)}},RouterLinkActive.prototype.hasActiveLinks=function(){return this.links.some(this.isLinkActive(this.router))||this.linksWithHrefs.some(this.isLinkActive(this.router))},RouterLinkActive.decorators=[{type:_angular_core.Directive,args:[{selector:"[routerLinkActive]",exportAs:"routerLinkActive"}]}],RouterLinkActive.ctorParameters=function(){return[{type:Router},{type:_angular_core.ElementRef},{type:_angular_core.Renderer2},{type:_angular_core.ChangeDetectorRef}]},RouterLinkActive.propDecorators={links:[{type:_angular_core.ContentChildren,args:[RouterLink,{descendants:!0}]}],linksWithHrefs:[{type:_angular_core.ContentChildren,args:[RouterLinkWithHref,{descendants:!0}]}],routerLinkActiveOptions:[{type:_angular_core.Input}],routerLinkActive:[{type:_angular_core.Input}]},RouterLinkActive}(),OutletContext=function(){function OutletContext(){this.outlet=null,this.route=null,this.resolver=null,this.children=new ChildrenOutletContexts,this.attachRef=null}return OutletContext}(),ChildrenOutletContexts=function(){function ChildrenOutletContexts(){this.contexts=new Map}return ChildrenOutletContexts.prototype.onChildOutletCreated=function(childName,outlet){var context=this.getOrCreateContext(childName);context.outlet=outlet,this.contexts.set(childName,context)},ChildrenOutletContexts.prototype.onChildOutletDestroyed=function(childName){var context=this.getContext(childName);context&&(context.outlet=null)},ChildrenOutletContexts.prototype.onOutletDeactivated=function(){var contexts=this.contexts;return this.contexts=new Map,contexts},ChildrenOutletContexts.prototype.onOutletReAttached=function(contexts){this.contexts=contexts},ChildrenOutletContexts.prototype.getOrCreateContext=function(childName){var context=this.getContext(childName);return context||(context=new OutletContext,this.contexts.set(childName,context)),context},ChildrenOutletContexts.prototype.getContext=function(childName){return this.contexts.get(childName)||null},ChildrenOutletContexts}(),RouterOutlet=function(){function RouterOutlet(parentContexts,location,resolver,name,changeDetector){this.parentContexts=parentContexts,this.location=location,this.resolver=resolver,this.changeDetector=changeDetector,this.activated=null,this._activatedRoute=null,this.activateEvents=new _angular_core.EventEmitter,this.deactivateEvents=new _angular_core.EventEmitter,this.name=name||PRIMARY_OUTLET,parentContexts.onChildOutletCreated(this.name,this)}return RouterOutlet.prototype.ngOnDestroy=function(){this.parentContexts.onChildOutletDestroyed(this.name)},RouterOutlet.prototype.ngOnInit=function(){if(!this.activated){var context=this.parentContexts.getContext(this.name);context&&context.route&&(context.attachRef?this.attach(context.attachRef,context.route):this.activateWith(context.route,context.resolver||null))}},Object.defineProperty(RouterOutlet.prototype,"isActivated",{get:function(){return!!this.activated},enumerable:!0,configurable:!0}),Object.defineProperty(RouterOutlet.prototype,"component",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance},enumerable:!0,configurable:!0}),Object.defineProperty(RouterOutlet.prototype,"activatedRoute",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute},enumerable:!0,configurable:!0}),Object.defineProperty(RouterOutlet.prototype,"activatedRouteData",{get:function(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}},enumerable:!0,configurable:!0}),RouterOutlet.prototype.detach=function(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();var cmp=this.activated;return this.activated=null,this._activatedRoute=null,cmp},RouterOutlet.prototype.attach=function(ref,activatedRoute){this.activated=ref,this._activatedRoute=activatedRoute,this.location.insert(ref.hostView)},RouterOutlet.prototype.deactivate=function(){if(this.activated){var c=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(c)}},RouterOutlet.prototype.activateWith=function(activatedRoute,resolver){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=activatedRoute;var snapshot=activatedRoute._futureSnapshot,component=snapshot.routeConfig.component;resolver=resolver||this.resolver;var factory=resolver.resolveComponentFactory(component),childContexts=this.parentContexts.getOrCreateContext(this.name).children,injector=new OutletInjector(activatedRoute,childContexts,this.location.injector);this.activated=this.location.createComponent(factory,this.location.length,injector),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)},RouterOutlet.decorators=[{type:_angular_core.Directive,args:[{selector:"router-outlet",exportAs:"outlet"}]}],RouterOutlet.ctorParameters=function(){return[{type:ChildrenOutletContexts},{type:_angular_core.ViewContainerRef},{type:_angular_core.ComponentFactoryResolver},{type:void 0,decorators:[{type:_angular_core.Attribute,args:["name"]}]},{type:_angular_core.ChangeDetectorRef}]},RouterOutlet.propDecorators={activateEvents:[{type:_angular_core.Output,args:["activate"]}],deactivateEvents:[{type:_angular_core.Output,args:["deactivate"]}]},RouterOutlet}(),OutletInjector=function(){function OutletInjector(route,childContexts,parent){this.route=route,this.childContexts=childContexts,this.parent=parent}return OutletInjector.prototype.get=function(token,notFoundValue){return token===ActivatedRoute?this.route:token===ChildrenOutletContexts?this.childContexts:this.parent.get(token,notFoundValue)},OutletInjector}(),PreloadingStrategy=function(){function PreloadingStrategy(){}return PreloadingStrategy}(),PreloadAllModules=function(){function PreloadAllModules(){}return PreloadAllModules.prototype.preload=function(route,fn){return rxjs_operator_catch._catch.call(fn(),function(){return rxjs_observable_of.of(null)})},PreloadAllModules}(),NoPreloading=function(){function NoPreloading(){}return NoPreloading.prototype.preload=function(route,fn){return rxjs_observable_of.of(null)},NoPreloading}(),RouterPreloader=function(){function RouterPreloader(router,moduleLoader,compiler,injector,preloadingStrategy){this.router=router,this.injector=injector,this.preloadingStrategy=preloadingStrategy;var onStartLoad=function(r){return router.triggerEvent(new RouteConfigLoadStart(r))},onEndLoad=function(r){return router.triggerEvent(new RouteConfigLoadEnd(r))};this.loader=new RouterConfigLoader(moduleLoader,compiler,onStartLoad,onEndLoad)}return RouterPreloader.prototype.setUpPreloading=function(){var _this=this,navigations$=rxjs_operator_filter.filter.call(this.router.events,function(e){return e instanceof NavigationEnd});this.subscription=rxjs_operator_concatMap.concatMap.call(navigations$,function(){return _this.preload()}).subscribe(function(){})},RouterPreloader.prototype.preload=function(){var ngModule=this.injector.get(_angular_core.NgModuleRef);return this.processRoutes(ngModule,this.router.config)},RouterPreloader.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterPreloader.prototype.processRoutes=function(ngModule,routes){for(var res=[],_i=0,routes_1=routes;_i<routes_1.length;_i++){var route=routes_1[_i];if(route.loadChildren&&!route.canLoad&&route._loadedConfig){var childConfig=route._loadedConfig;res.push(this.processRoutes(childConfig.module,childConfig.routes))}else route.loadChildren&&!route.canLoad?res.push(this.preloadConfig(ngModule,route)):route.children&&res.push(this.processRoutes(ngModule,route.children))}return rxjs_operator_mergeAll.mergeAll.call(rxjs_observable_from.from(res))},RouterPreloader.prototype.preloadConfig=function(ngModule,route){var _this=this;return this.preloadingStrategy.preload(route,function(){var loaded$=_this.loader.load(ngModule.injector,route);return rxjs_operator_mergeMap.mergeMap.call(loaded$,function(config){return route._loadedConfig=config,_this.processRoutes(config.module,config.routes)})})},RouterPreloader.decorators=[{type:_angular_core.Injectable}],RouterPreloader.ctorParameters=function(){return[{type:Router},{type:_angular_core.NgModuleFactoryLoader},{type:_angular_core.Compiler},{type:_angular_core.Injector},{type:PreloadingStrategy}]},RouterPreloader}(),ROUTER_DIRECTIVES=[RouterOutlet,RouterLink,RouterLinkWithHref,RouterLinkActive],ROUTER_CONFIGURATION=new _angular_core.InjectionToken("ROUTER_CONFIGURATION"),ROUTER_FORROOT_GUARD=new _angular_core.InjectionToken("ROUTER_FORROOT_GUARD"),ROUTER_PROVIDERS=[_angular_common.Location,{provide:UrlSerializer,useClass:DefaultUrlSerializer},{provide:Router,useFactory:setupRouter,deps:[_angular_core.ApplicationRef,UrlSerializer,ChildrenOutletContexts,_angular_common.Location,_angular_core.Injector,_angular_core.NgModuleFactoryLoader,_angular_core.Compiler,ROUTES,ROUTER_CONFIGURATION,[UrlHandlingStrategy,new _angular_core.Optional],[RouteReuseStrategy,new _angular_core.Optional]]},ChildrenOutletContexts,{provide:ActivatedRoute,useFactory:rootRoute,deps:[Router]},{provide:_angular_core.NgModuleFactoryLoader,useClass:_angular_core.SystemJsNgModuleLoader},RouterPreloader,NoPreloading,PreloadAllModules,{provide:ROUTER_CONFIGURATION,useValue:{enableTracing:!1}}],RouterModule=function(){function RouterModule(guard,router){}return RouterModule.forRoot=function(routes,config){return{ngModule:RouterModule,providers:[ROUTER_PROVIDERS,provideRoutes(routes),{provide:ROUTER_FORROOT_GUARD,useFactory:provideForRootGuard,deps:[[Router,new _angular_core.Optional,new _angular_core.SkipSelf]]},{provide:ROUTER_CONFIGURATION,useValue:config||{}},{provide:_angular_common.LocationStrategy,useFactory:provideLocationStrategy,deps:[_angular_common.PlatformLocation,[new _angular_core.Inject(_angular_common.APP_BASE_HREF),new _angular_core.Optional],ROUTER_CONFIGURATION]},{provide:PreloadingStrategy,useExisting:config&&config.preloadingStrategy?config.preloadingStrategy:NoPreloading},{provide:_angular_core.NgProbeToken,multi:!0,useFactory:routerNgProbeToken},provideRouterInitializer()]}},RouterModule.forChild=function(routes){return{ngModule:RouterModule,providers:[provideRoutes(routes)]}},RouterModule.decorators=[{type:_angular_core.NgModule,args:[{declarations:ROUTER_DIRECTIVES,exports:ROUTER_DIRECTIVES}]}],RouterModule.ctorParameters=function(){return[{type:void 0,decorators:[{type:_angular_core.Optional},{type:_angular_core.Inject,args:[ROUTER_FORROOT_GUARD]}]},{type:Router,decorators:[{type:_angular_core.Optional}]}]},RouterModule}(),RouterInitializer=function(){function RouterInitializer(injector){this.injector=injector,this.initNavigation=!1,this.resultOfPreactivationDone=new rxjs_Subject.Subject}return RouterInitializer.prototype.appInitializer=function(){var _this=this;return this.injector.get(_angular_common.LOCATION_INITIALIZED,Promise.resolve(null)).then(function(){var resolve=null,res=new Promise(function(r){return resolve=r}),router=_this.injector.get(Router),opts=_this.injector.get(ROUTER_CONFIGURATION);if(_this.isLegacyDisabled(opts)||_this.isLegacyEnabled(opts))resolve(!0);else if("disabled"===opts.initialNavigation)router.setUpLocationChangeListener(),resolve(!0);else{if("enabled"!==opts.initialNavigation)throw new Error("Invalid initialNavigation options: '"+opts.initialNavigation+"'");router.hooks.afterPreactivation=function(){return _this.initNavigation?rxjs_observable_of.of(null):(_this.initNavigation=!0,resolve(!0),_this.resultOfPreactivationDone)},router.initialNavigation()}return res})},RouterInitializer.prototype.bootstrapListener=function(bootstrappedComponentRef){var opts=this.injector.get(ROUTER_CONFIGURATION),preloader=this.injector.get(RouterPreloader),router=this.injector.get(Router),ref=this.injector.get(_angular_core.ApplicationRef);bootstrappedComponentRef===ref.components[0]&&(this.isLegacyEnabled(opts)?router.initialNavigation():this.isLegacyDisabled(opts)&&router.setUpLocationChangeListener(),preloader.setUpPreloading(),router.resetRootComponentType(ref.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())},RouterInitializer.prototype.isLegacyEnabled=function(opts){return"legacy_enabled"===opts.initialNavigation||!0===opts.initialNavigation||void 0===opts.initialNavigation},RouterInitializer.prototype.isLegacyDisabled=function(opts){return"legacy_disabled"===opts.initialNavigation||!1===opts.initialNavigation},RouterInitializer.decorators=[{type:_angular_core.Injectable}],RouterInitializer.ctorParameters=function(){return[{type:_angular_core.Injector}]},RouterInitializer}(),ROUTER_INITIALIZER=new _angular_core.InjectionToken("Router Initializer"),VERSION=new _angular_core.Version("5.2.2");exports.RouterLink=RouterLink,exports.RouterLinkWithHref=RouterLinkWithHref,exports.RouterLinkActive=RouterLinkActive,exports.RouterOutlet=RouterOutlet,exports.ActivationEnd=ActivationEnd,exports.ActivationStart=ActivationStart,exports.ChildActivationEnd=ChildActivationEnd,exports.ChildActivationStart=ChildActivationStart,exports.GuardsCheckEnd=GuardsCheckEnd,exports.GuardsCheckStart=GuardsCheckStart,exports.NavigationCancel=NavigationCancel,exports.NavigationEnd=NavigationEnd,exports.NavigationError=NavigationError,exports.NavigationStart=NavigationStart,exports.ResolveEnd=ResolveEnd,exports.ResolveStart=ResolveStart,exports.RouteConfigLoadEnd=RouteConfigLoadEnd,exports.RouteConfigLoadStart=RouteConfigLoadStart,exports.RouterEvent=RouterEvent,exports.RoutesRecognized=RoutesRecognized,exports.RouteReuseStrategy=RouteReuseStrategy,exports.Router=Router,exports.ROUTES=ROUTES,exports.ROUTER_CONFIGURATION=ROUTER_CONFIGURATION,exports.ROUTER_INITIALIZER=ROUTER_INITIALIZER,exports.RouterModule=RouterModule,exports.provideRoutes=provideRoutes,exports.ChildrenOutletContexts=ChildrenOutletContexts,exports.OutletContext=OutletContext,exports.NoPreloading=NoPreloading,exports.PreloadAllModules=PreloadAllModules,exports.PreloadingStrategy=PreloadingStrategy,exports.RouterPreloader=RouterPreloader,exports.ActivatedRoute=ActivatedRoute,exports.ActivatedRouteSnapshot=ActivatedRouteSnapshot,exports.RouterState=RouterState,exports.RouterStateSnapshot=RouterStateSnapshot,exports.PRIMARY_OUTLET=PRIMARY_OUTLET,exports.convertToParamMap=convertToParamMap,exports.UrlHandlingStrategy=UrlHandlingStrategy,exports.DefaultUrlSerializer=DefaultUrlSerializer,exports.UrlSegment=UrlSegment,exports.UrlSegmentGroup=UrlSegmentGroup,exports.UrlSerializer=UrlSerializer,exports.UrlTree=UrlTree,exports.VERSION=VERSION,exports.ɵROUTER_PROVIDERS=ROUTER_PROVIDERS,exports.ɵflatten=flatten,exports.ɵa=ROUTER_FORROOT_GUARD,exports.ɵg=RouterInitializer,exports.ɵh=getAppInitializer,exports.ɵi=getBootstrapListener,exports.ɵd=provideForRootGuard,exports.ɵc=provideLocationStrategy,exports.ɵj=provideRouterInitializer,exports.ɵf=rootRoute,exports.ɵb=routerNgProbeToken,exports.ɵe=setupRouter,exports.ɵk=Tree,exports.ɵl=TreeNode,Object.defineProperty(exports,"__esModule",{value:!0})});
42
+ var _this=this;if(!this.isActivating())return rxjs_observable_of.of(null);var checks$=rxjs_observable_from.from(this.canActivateChecks),runningChecks$=rxjs_operator_concatMap.concatMap.call(checks$,function(check){return _this.runResolve(check.route,paramsInheritanceStrategy)});return rxjs_operator_reduce.reduce.call(runningChecks$,function(_,__){return _})},PreActivation.prototype.isDeactivating=function(){return 0!==this.canDeactivateChecks.length},PreActivation.prototype.isActivating=function(){return 0!==this.canActivateChecks.length},PreActivation.prototype.setupChildRouteGuards=function(futureNode,currNode,contexts,futurePath){var _this=this,prevChildren=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(c){_this.setupRouteGuards(c,prevChildren[c.value.outlet],contexts,futurePath.concat([c.value])),delete prevChildren[c.value.outlet]}),forEach(prevChildren,function(v,k){return _this.deactivateRouteAndItsChildren(v,contexts.getContext(k))})},PreActivation.prototype.setupRouteGuards=function(futureNode,currNode,parentContexts,futurePath){var future=futureNode.value,curr=currNode?currNode.value:null,context=parentContexts?parentContexts.getContext(futureNode.value.outlet):null;if(curr&&future.routeConfig===curr.routeConfig){var shouldRunGuardsAndResolvers=this.shouldRunGuardsAndResolvers(curr,future,future.routeConfig.runGuardsAndResolvers);if(shouldRunGuardsAndResolvers?this.canActivateChecks.push(new CanActivate(futurePath)):(future.data=curr.data,future._resolvedData=curr._resolvedData),future.component?this.setupChildRouteGuards(futureNode,currNode,context?context.children:null,futurePath):this.setupChildRouteGuards(futureNode,currNode,parentContexts,futurePath),shouldRunGuardsAndResolvers){var outlet=context.outlet;this.canDeactivateChecks.push(new CanDeactivate(outlet.component,curr))}}else curr&&this.deactivateRouteAndItsChildren(currNode,context),this.canActivateChecks.push(new CanActivate(futurePath)),future.component?this.setupChildRouteGuards(futureNode,null,context?context.children:null,futurePath):this.setupChildRouteGuards(futureNode,null,parentContexts,futurePath)},PreActivation.prototype.shouldRunGuardsAndResolvers=function(curr,future,mode){switch(mode){case"always":return!0;case"paramsOrQueryParamsChange":return!equalParamsAndUrlSegments(curr,future)||!shallowEqual(curr.queryParams,future.queryParams);case"paramsChange":default:return!equalParamsAndUrlSegments(curr,future)}},PreActivation.prototype.deactivateRouteAndItsChildren=function(route,context){var _this=this,children=nodeChildrenAsMap(route),r=route.value;forEach(children,function(node,childName){r.component?context?_this.deactivateRouteAndItsChildren(node,context.children.getContext(childName)):_this.deactivateRouteAndItsChildren(node,null):_this.deactivateRouteAndItsChildren(node,context)}),r.component&&context&&context.outlet&&context.outlet.isActivated?this.canDeactivateChecks.push(new CanDeactivate(context.outlet.component,r)):this.canDeactivateChecks.push(new CanDeactivate(null,r))},PreActivation.prototype.runCanDeactivateChecks=function(){var _this=this,checks$=rxjs_observable_from.from(this.canDeactivateChecks),runningChecks$=rxjs_operator_mergeMap.mergeMap.call(checks$,function(check){return _this.runCanDeactivate(check.component,check.route)});return rxjs_operator_every.every.call(runningChecks$,function(result){return!0===result})},PreActivation.prototype.runCanActivateChecks=function(){var _this=this,checks$=rxjs_observable_from.from(this.canActivateChecks),runningChecks$=rxjs_operator_concatMap.concatMap.call(checks$,function(check){return andObservables(rxjs_observable_from.from([_this.fireChildActivationStart(check.route.parent),_this.fireActivationStart(check.route),_this.runCanActivateChild(check.path),_this.runCanActivate(check.route)]))});return rxjs_operator_every.every.call(runningChecks$,function(result){return!0===result})},PreActivation.prototype.fireActivationStart=function(snapshot){return null!==snapshot&&this.forwardEvent&&this.forwardEvent(new ActivationStart(snapshot)),rxjs_observable_of.of(!0)},PreActivation.prototype.fireChildActivationStart=function(snapshot){return null!==snapshot&&this.forwardEvent&&this.forwardEvent(new ChildActivationStart(snapshot)),rxjs_observable_of.of(!0)},PreActivation.prototype.runCanActivate=function(future){var _this=this,canActivate=future.routeConfig?future.routeConfig.canActivate:null;return canActivate&&0!==canActivate.length?andObservables(rxjs_operator_map.map.call(rxjs_observable_from.from(canActivate),function(c){var observable,guard=_this.getToken(c,future);return observable=wrapIntoObservable(guard.canActivate?guard.canActivate(future,_this.future):guard(future,_this.future)),rxjs_operator_first.first.call(observable)})):rxjs_observable_of.of(!0)},PreActivation.prototype.runCanActivateChild=function(path){var _this=this,future=path[path.length-1],canActivateChildGuards=path.slice(0,path.length-1).reverse().map(function(p){return _this.extractCanActivateChild(p)}).filter(function(_){return null!==_});return andObservables(rxjs_operator_map.map.call(rxjs_observable_from.from(canActivateChildGuards),function(d){return andObservables(rxjs_operator_map.map.call(rxjs_observable_from.from(d.guards),function(c){var observable,guard=_this.getToken(c,d.node);return observable=wrapIntoObservable(guard.canActivateChild?guard.canActivateChild(future,_this.future):guard(future,_this.future)),rxjs_operator_first.first.call(observable)}))}))},PreActivation.prototype.extractCanActivateChild=function(p){var canActivateChild=p.routeConfig?p.routeConfig.canActivateChild:null;return canActivateChild&&0!==canActivateChild.length?{node:p,guards:canActivateChild}:null},PreActivation.prototype.runCanDeactivate=function(component,curr){var _this=this,canDeactivate=curr&&curr.routeConfig?curr.routeConfig.canDeactivate:null;if(!canDeactivate||0===canDeactivate.length)return rxjs_observable_of.of(!0);var canDeactivate$=rxjs_operator_mergeMap.mergeMap.call(rxjs_observable_from.from(canDeactivate),function(c){var observable,guard=_this.getToken(c,curr);return observable=wrapIntoObservable(guard.canDeactivate?guard.canDeactivate(component,curr,_this.curr,_this.future):guard(component,curr,_this.curr,_this.future)),rxjs_operator_first.first.call(observable)});return rxjs_operator_every.every.call(canDeactivate$,function(result){return!0===result})},PreActivation.prototype.runResolve=function(future,paramsInheritanceStrategy){var resolve=future._resolve;return rxjs_operator_map.map.call(this.resolveNode(resolve,future),function(resolvedData){return future._resolvedData=resolvedData,future.data=__assign({},future.data,inheritedParamsDataResolve(future,paramsInheritanceStrategy).resolve),null})},PreActivation.prototype.resolveNode=function(resolve,future){var _this=this,keys=Object.keys(resolve);if(0===keys.length)return rxjs_observable_of.of({});if(1===keys.length){var key_1=keys[0];return rxjs_operator_map.map.call(this.getResolver(resolve[key_1],future),function(value){return _a={},_a[key_1]=value,_a;var _a})}var data={},runningResolvers$=rxjs_operator_mergeMap.mergeMap.call(rxjs_observable_from.from(keys),function(key){return rxjs_operator_map.map.call(_this.getResolver(resolve[key],future),function(value){return data[key]=value,value})});return rxjs_operator_map.map.call(rxjs_operator_last.last.call(runningResolvers$),function(){return data})},PreActivation.prototype.getResolver=function(injectionToken,future){var resolver=this.getToken(injectionToken,future);return wrapIntoObservable(resolver.resolve?resolver.resolve(future,this.future):resolver(future,this.future))},PreActivation.prototype.getToken=function(token,snapshot){var config=closestLoadedConfig(snapshot);return(config?config.module.injector:this.moduleInjector).get(token)},PreActivation}(),NoMatch$1=function(){function NoMatch(){}return NoMatch}(),Recognizer=function(){function Recognizer(rootComponentType,config,urlTree,url,paramsInheritanceStrategy){this.rootComponentType=rootComponentType,this.config=config,this.urlTree=urlTree,this.url=url,this.paramsInheritanceStrategy=paramsInheritanceStrategy}return Recognizer.prototype.recognize=function(){try{var rootSegmentGroup=split$1(this.urlTree.root,[],[],this.config).segmentGroup,children=this.processSegmentGroup(this.config,rootSegmentGroup,PRIMARY_OUTLET),root=new ActivatedRouteSnapshot([],Object.freeze({}),Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,{},PRIMARY_OUTLET,this.rootComponentType,null,this.urlTree.root,-1,{}),rootNode=new TreeNode(root,children),routeState=new RouterStateSnapshot(this.url,rootNode);return this.inheritParamsAndData(routeState._root),rxjs_observable_of.of(routeState)}catch(e){return new rxjs_Observable.Observable(function(obs){return obs.error(e)})}},Recognizer.prototype.inheritParamsAndData=function(routeNode){var _this=this,route=routeNode.value,i=inheritedParamsDataResolve(route,this.paramsInheritanceStrategy);route.params=Object.freeze(i.params),route.data=Object.freeze(i.data),routeNode.children.forEach(function(n){return _this.inheritParamsAndData(n)})},Recognizer.prototype.processSegmentGroup=function(config,segmentGroup,outlet){return 0===segmentGroup.segments.length&&segmentGroup.hasChildren()?this.processChildren(config,segmentGroup):this.processSegment(config,segmentGroup,segmentGroup.segments,outlet)},Recognizer.prototype.processChildren=function(config,segmentGroup){var _this=this,children=mapChildrenIntoArray(segmentGroup,function(child,childOutlet){return _this.processSegmentGroup(config,child,childOutlet)});return checkOutletNameUniqueness(children),sortActivatedRouteSnapshots(children),children},Recognizer.prototype.processSegment=function(config,segmentGroup,segments,outlet){for(var _i=0,config_1=config;_i<config_1.length;_i++){var r=config_1[_i];try{return this.processSegmentAgainstRoute(r,segmentGroup,segments,outlet)}catch(e){if(!(e instanceof NoMatch$1))throw e}}if(this.noLeftoversInUrl(segmentGroup,segments,outlet))return[];throw new NoMatch$1},Recognizer.prototype.noLeftoversInUrl=function(segmentGroup,segments,outlet){return 0===segments.length&&!segmentGroup.children[outlet]},Recognizer.prototype.processSegmentAgainstRoute=function(route,rawSegment,segments,outlet){if(route.redirectTo)throw new NoMatch$1;if((route.outlet||PRIMARY_OUTLET)!==outlet)throw new NoMatch$1;var snapshot,consumedSegments=[],rawSlicedSegments=[];if("**"===route.path){var params=segments.length>0?last$1(segments).parameters:{};snapshot=new ActivatedRouteSnapshot(segments,params,Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,getData(route),outlet,route.component,route,getSourceSegmentGroup(rawSegment),getPathIndexShift(rawSegment)+segments.length,getResolve(route))}else{var result=match$1(rawSegment,route,segments);consumedSegments=result.consumedSegments,rawSlicedSegments=segments.slice(result.lastChild),snapshot=new ActivatedRouteSnapshot(consumedSegments,result.parameters,Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,getData(route),outlet,route.component,route,getSourceSegmentGroup(rawSegment),getPathIndexShift(rawSegment)+consumedSegments.length,getResolve(route))}var childConfig=getChildConfig(route),_a=split$1(rawSegment,consumedSegments,rawSlicedSegments,childConfig),segmentGroup=_a.segmentGroup,slicedSegments=_a.slicedSegments;if(0===slicedSegments.length&&segmentGroup.hasChildren()){var children_1=this.processChildren(childConfig,segmentGroup);return[new TreeNode(snapshot,children_1)]}if(0===childConfig.length&&0===slicedSegments.length)return[new TreeNode(snapshot,[])];var children=this.processSegment(childConfig,segmentGroup,slicedSegments,PRIMARY_OUTLET);return[new TreeNode(snapshot,children)]},Recognizer}(),RouteReuseStrategy=function(){function RouteReuseStrategy(){}return RouteReuseStrategy}(),DefaultRouteReuseStrategy=function(){function DefaultRouteReuseStrategy(){}return DefaultRouteReuseStrategy.prototype.shouldDetach=function(route){return!1},DefaultRouteReuseStrategy.prototype.store=function(route,detachedTree){},DefaultRouteReuseStrategy.prototype.shouldAttach=function(route){return!1},DefaultRouteReuseStrategy.prototype.retrieve=function(route){return null},DefaultRouteReuseStrategy.prototype.shouldReuseRoute=function(future,curr){return future.routeConfig===curr.routeConfig},DefaultRouteReuseStrategy}(),ROUTES=new _angular_core.InjectionToken("ROUTES"),RouterConfigLoader=function(){function RouterConfigLoader(loader,compiler,onLoadStartListener,onLoadEndListener){this.loader=loader,this.compiler=compiler,this.onLoadStartListener=onLoadStartListener,this.onLoadEndListener=onLoadEndListener}return RouterConfigLoader.prototype.load=function(parentInjector,route){var _this=this;this.onLoadStartListener&&this.onLoadStartListener(route);var moduleFactory$=this.loadModuleFactory(route.loadChildren);return rxjs_operator_map.map.call(moduleFactory$,function(factory){_this.onLoadEndListener&&_this.onLoadEndListener(route);var module=factory.create(parentInjector);return new LoadedRouterConfig(flatten(module.injector.get(ROUTES)),module)})},RouterConfigLoader.prototype.loadModuleFactory=function(loadChildren){var _this=this;return"string"==typeof loadChildren?rxjs_observable_fromPromise.fromPromise(this.loader.load(loadChildren)):rxjs_operator_mergeMap.mergeMap.call(wrapIntoObservable(loadChildren()),function(t){return t instanceof _angular_core.NgModuleFactory?rxjs_observable_of.of(t):rxjs_observable_fromPromise.fromPromise(_this.compiler.compileModuleAsync(t))})},RouterConfigLoader}(),UrlHandlingStrategy=function(){function UrlHandlingStrategy(){}return UrlHandlingStrategy}(),DefaultUrlHandlingStrategy=function(){function DefaultUrlHandlingStrategy(){}return DefaultUrlHandlingStrategy.prototype.shouldProcessUrl=function(url){return!0},DefaultUrlHandlingStrategy.prototype.extract=function(url){return url},DefaultUrlHandlingStrategy.prototype.merge=function(newUrlPart,wholeUrl){return newUrlPart},DefaultUrlHandlingStrategy}(),Router=function(){function Router(rootComponentType,urlSerializer,rootContexts,location,injector,loader,compiler,config){var _this=this;this.rootComponentType=rootComponentType,this.urlSerializer=urlSerializer,this.rootContexts=rootContexts,this.location=location,this.config=config,this.navigations=new rxjs_BehaviorSubject.BehaviorSubject(null),this.navigationId=0,this.events=new rxjs_Subject.Subject,this.errorHandler=defaultErrorHandler,this.navigated=!1,this.hooks={beforePreactivation:defaultRouterHook,afterPreactivation:defaultRouterHook},this.urlHandlingStrategy=new DefaultUrlHandlingStrategy,this.routeReuseStrategy=new DefaultRouteReuseStrategy,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly";var onLoadStart=function(r){return _this.triggerEvent(new RouteConfigLoadStart(r))},onLoadEnd=function(r){return _this.triggerEvent(new RouteConfigLoadEnd(r))};this.ngModule=injector.get(_angular_core.NgModuleRef),this.resetConfig(config),this.currentUrlTree=createEmptyUrlTree(),this.rawUrlTree=this.currentUrlTree,this.configLoader=new RouterConfigLoader(loader,compiler,onLoadStart,onLoadEnd),this.routerState=createEmptyState(this.currentUrlTree,this.rootComponentType),this.processNavigations()}return Router.prototype.resetRootComponentType=function(rootComponentType){this.rootComponentType=rootComponentType,this.routerState.root.component=this.rootComponentType},Router.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},Router.prototype.setUpLocationChangeListener=function(){var _this=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe(function(change){var rawUrlTree=_this.urlSerializer.parse(change.url),source="popstate"===change.type?"popstate":"hashchange";setTimeout(function(){_this.scheduleNavigation(rawUrlTree,source,{replaceUrl:!0})},0)}))},Object.defineProperty(Router.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),Router.prototype.triggerEvent=function(e){this.events.next(e)},Router.prototype.resetConfig=function(config){validateConfig(config),this.config=config,this.navigated=!1},Router.prototype.ngOnDestroy=function(){this.dispose()},Router.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)},Router.prototype.createUrlTree=function(commands,navigationExtras){void 0===navigationExtras&&(navigationExtras={});var relativeTo=navigationExtras.relativeTo,queryParams=navigationExtras.queryParams,fragment=navigationExtras.fragment,preserveQueryParams=navigationExtras.preserveQueryParams,queryParamsHandling=navigationExtras.queryParamsHandling,preserveFragment=navigationExtras.preserveFragment;_angular_core.isDevMode()&&preserveQueryParams&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");var a=relativeTo||this.routerState.root,f=preserveFragment?this.currentUrlTree.fragment:fragment,q=null;if(queryParamsHandling)switch(queryParamsHandling){case"merge":q=__assign({},this.currentUrlTree.queryParams,queryParams);break;case"preserve":q=this.currentUrlTree.queryParams;break;default:q=queryParams||null}else q=preserveQueryParams?this.currentUrlTree.queryParams:queryParams||null;return null!==q&&(q=this.removeEmptyProps(q)),createUrlTree(a,this.currentUrlTree,commands,q,f)},Router.prototype.navigateByUrl=function(url,extras){void 0===extras&&(extras={skipLocationChange:!1});var urlTree=url instanceof UrlTree?url:this.parseUrl(url),mergedTree=this.urlHandlingStrategy.merge(urlTree,this.rawUrlTree);return this.scheduleNavigation(mergedTree,"imperative",extras)},Router.prototype.navigate=function(commands,extras){return void 0===extras&&(extras={skipLocationChange:!1}),validateCommands(commands),this.navigateByUrl(this.createUrlTree(commands,extras),extras)},Router.prototype.serializeUrl=function(url){return this.urlSerializer.serialize(url)},Router.prototype.parseUrl=function(url){return this.urlSerializer.parse(url)},Router.prototype.isActive=function(url,exact){if(url instanceof UrlTree)return containsTree(this.currentUrlTree,url,exact);var urlTree=this.urlSerializer.parse(url);return containsTree(this.currentUrlTree,urlTree,exact)},Router.prototype.removeEmptyProps=function(params){return Object.keys(params).reduce(function(result,key){var value=params[key];return null!==value&&void 0!==value&&(result[key]=value),result},{})},Router.prototype.processNavigations=function(){var _this=this;rxjs_operator_concatMap.concatMap.call(this.navigations,function(nav){return nav?(_this.executeScheduledNavigation(nav),nav.promise.catch(function(){})):rxjs_observable_of.of(null)}).subscribe(function(){})},Router.prototype.scheduleNavigation=function(rawUrl,source,extras){var lastNavigation=this.navigations.value;if(lastNavigation&&"imperative"!==source&&"imperative"===lastNavigation.source&&lastNavigation.rawUrl.toString()===rawUrl.toString())return Promise.resolve(!0);if(lastNavigation&&"hashchange"==source&&"popstate"===lastNavigation.source&&lastNavigation.rawUrl.toString()===rawUrl.toString())return Promise.resolve(!0);if(lastNavigation&&"popstate"==source&&"hashchange"===lastNavigation.source&&lastNavigation.rawUrl.toString()===rawUrl.toString())return Promise.resolve(!0);var resolve=null,reject=null,promise=new Promise(function(res,rej){resolve=res,reject=rej}),id=++this.navigationId;return this.navigations.next({id:id,source:source,rawUrl:rawUrl,extras:extras,resolve:resolve,reject:reject,promise:promise}),promise.catch(function(e){return Promise.reject(e)})},Router.prototype.executeScheduledNavigation=function(_a){var _this=this,id=_a.id,rawUrl=_a.rawUrl,extras=_a.extras,resolve=_a.resolve,reject=_a.reject,url=this.urlHandlingStrategy.extract(rawUrl),urlTransition=!this.navigated||url.toString()!==this.currentUrlTree.toString();("reload"===this.onSameUrlNavigation||urlTransition)&&this.urlHandlingStrategy.shouldProcessUrl(rawUrl)?(this.events.next(new NavigationStart(id,this.serializeUrl(url))),Promise.resolve().then(function(_){return _this.runNavigate(url,rawUrl,!!extras.skipLocationChange,!!extras.replaceUrl,id,null)}).then(resolve,reject)):urlTransition&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)?(this.events.next(new NavigationStart(id,this.serializeUrl(url))),Promise.resolve().then(function(_){return _this.runNavigate(url,rawUrl,!1,!1,id,createEmptyState(url,_this.rootComponentType).snapshot)}).then(resolve,reject)):(this.rawUrlTree=rawUrl,resolve(null))},Router.prototype.runNavigate=function(url,rawUrl,skipLocationChange,replaceUrl,id,precreatedState){var _this=this;return id!==this.navigationId?(this.events.next(new NavigationCancel(id,this.serializeUrl(url),"Navigation ID "+id+" is not equal to the current navigation id "+this.navigationId)),Promise.resolve(!1)):new Promise(function(resolvePromise,rejectPromise){var urlAndSnapshot$;if(precreatedState)urlAndSnapshot$=rxjs_observable_of.of({appliedUrl:url,snapshot:precreatedState});else{var moduleInjector=_this.ngModule.injector,redirectsApplied$=applyRedirects(moduleInjector,_this.configLoader,_this.urlSerializer,url,_this.config);urlAndSnapshot$=rxjs_operator_mergeMap.mergeMap.call(redirectsApplied$,function(appliedUrl){return rxjs_operator_map.map.call(recognize(_this.rootComponentType,_this.config,appliedUrl,_this.serializeUrl(appliedUrl),_this.paramsInheritanceStrategy),function(snapshot){return _this.events.next(new RoutesRecognized(id,_this.serializeUrl(url),_this.serializeUrl(appliedUrl),snapshot)),{appliedUrl:appliedUrl,snapshot:snapshot}})})}var preActivation,beforePreactivationDone$=rxjs_operator_mergeMap.mergeMap.call(urlAndSnapshot$,function(p){return rxjs_operator_map.map.call(_this.hooks.beforePreactivation(p.snapshot),function(){return p})}),preactivationSetup$=rxjs_operator_map.map.call(beforePreactivationDone$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot,moduleInjector=_this.ngModule.injector;return preActivation=new PreActivation(snapshot,_this.routerState.snapshot,moduleInjector,function(evt){return _this.triggerEvent(evt)}),preActivation.initialize(_this.rootContexts),{appliedUrl:appliedUrl,snapshot:snapshot}}),preactivationCheckGuards$=rxjs_operator_mergeMap.mergeMap.call(preactivationSetup$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot;return _this.navigationId!==id?rxjs_observable_of.of(!1):(_this.triggerEvent(new GuardsCheckStart(id,_this.serializeUrl(url),appliedUrl,snapshot)),rxjs_operator_map.map.call(preActivation.checkGuards(),function(shouldActivate){return _this.triggerEvent(new GuardsCheckEnd(id,_this.serializeUrl(url),appliedUrl,snapshot,shouldActivate)),{appliedUrl:appliedUrl,snapshot:snapshot,shouldActivate:shouldActivate}}))}),preactivationResolveData$=rxjs_operator_mergeMap.mergeMap.call(preactivationCheckGuards$,function(p){return _this.navigationId!==id?rxjs_observable_of.of(!1):p.shouldActivate&&preActivation.isActivating()?(_this.triggerEvent(new ResolveStart(id,_this.serializeUrl(url),p.appliedUrl,p.snapshot)),rxjs_operator_map.map.call(preActivation.resolveData(_this.paramsInheritanceStrategy),function(){return _this.triggerEvent(new ResolveEnd(id,_this.serializeUrl(url),p.appliedUrl,p.snapshot)),p})):rxjs_observable_of.of(p)}),preactivationDone$=rxjs_operator_mergeMap.mergeMap.call(preactivationResolveData$,function(p){return rxjs_operator_map.map.call(_this.hooks.afterPreactivation(p.snapshot),function(){return p})}),routerState$=rxjs_operator_map.map.call(preactivationDone$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot,shouldActivate=_a.shouldActivate;if(shouldActivate){return{appliedUrl:appliedUrl,state:createRouterState(_this.routeReuseStrategy,snapshot,_this.routerState),shouldActivate:shouldActivate}}return{appliedUrl:appliedUrl,state:null,shouldActivate:shouldActivate}});_this.activateRoutes(routerState$,_this.routerState,_this.currentUrlTree,id,url,rawUrl,skipLocationChange,replaceUrl,resolvePromise,rejectPromise)})},Router.prototype.activateRoutes=function(state,storedState,storedUrl,id,url,rawUrl,skipLocationChange,replaceUrl,resolvePromise,rejectPromise){var navigationIsSuccessful,_this=this;state.forEach(function(_a){var appliedUrl=_a.appliedUrl,state=_a.state;if(!_a.shouldActivate||id!==_this.navigationId)return void(navigationIsSuccessful=!1);if(_this.currentUrlTree=appliedUrl,_this.rawUrlTree=_this.urlHandlingStrategy.merge(_this.currentUrlTree,rawUrl),_this.routerState=state,!skipLocationChange){var path=_this.urlSerializer.serialize(_this.rawUrlTree);_this.location.isCurrentPathEqualTo(path)||replaceUrl?_this.location.replaceState(path):_this.location.go(path)}new ActivateRoutes(_this.routeReuseStrategy,state,storedState,function(evt){return _this.triggerEvent(evt)}).activate(_this.rootContexts),navigationIsSuccessful=!0}).then(function(){navigationIsSuccessful?(_this.navigated=!0,_this.events.next(new NavigationEnd(id,_this.serializeUrl(url),_this.serializeUrl(_this.currentUrlTree))),resolvePromise(!0)):(_this.resetUrlToCurrentUrlTree(),_this.events.next(new NavigationCancel(id,_this.serializeUrl(url),"")),resolvePromise(!1))},function(e){if(isNavigationCancelingError(e))_this.navigated=!0,_this.resetStateAndUrl(storedState,storedUrl,rawUrl),_this.events.next(new NavigationCancel(id,_this.serializeUrl(url),e.message)),resolvePromise(!1);else{_this.resetStateAndUrl(storedState,storedUrl,rawUrl),_this.events.next(new NavigationError(id,_this.serializeUrl(url),e));try{resolvePromise(_this.errorHandler(e))}catch(ee){rejectPromise(ee)}}})},Router.prototype.resetStateAndUrl=function(storedState,storedUrl,rawUrl){this.routerState=storedState,this.currentUrlTree=storedUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,rawUrl),this.resetUrlToCurrentUrlTree()},Router.prototype.resetUrlToCurrentUrlTree=function(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree))},Router}(),ActivateRoutes=function(){function ActivateRoutes(routeReuseStrategy,futureState,currState,forwardEvent){this.routeReuseStrategy=routeReuseStrategy,this.futureState=futureState,this.currState=currState,this.forwardEvent=forwardEvent}return ActivateRoutes.prototype.activate=function(parentContexts){var futureRoot=this.futureState._root,currRoot=this.currState?this.currState._root:null;this.deactivateChildRoutes(futureRoot,currRoot,parentContexts),advanceActivatedRoute(this.futureState.root),this.activateChildRoutes(futureRoot,currRoot,parentContexts)},ActivateRoutes.prototype.deactivateChildRoutes=function(futureNode,currNode,contexts){var _this=this,children=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(futureChild){var childOutletName=futureChild.value.outlet;_this.deactivateRoutes(futureChild,children[childOutletName],contexts),delete children[childOutletName]}),forEach(children,function(v,childName){_this.deactivateRouteAndItsChildren(v,contexts)})},ActivateRoutes.prototype.deactivateRoutes=function(futureNode,currNode,parentContext){var future=futureNode.value,curr=currNode?currNode.value:null;if(future===curr)if(future.component){var context=parentContext.getContext(future.outlet);context&&this.deactivateChildRoutes(futureNode,currNode,context.children)}else this.deactivateChildRoutes(futureNode,currNode,parentContext);else curr&&this.deactivateRouteAndItsChildren(currNode,parentContext)},ActivateRoutes.prototype.deactivateRouteAndItsChildren=function(route,parentContexts){this.routeReuseStrategy.shouldDetach(route.value.snapshot)?this.detachAndStoreRouteSubtree(route,parentContexts):this.deactivateRouteAndOutlet(route,parentContexts)},ActivateRoutes.prototype.detachAndStoreRouteSubtree=function(route,parentContexts){var context=parentContexts.getContext(route.value.outlet);if(context&&context.outlet){var componentRef=context.outlet.detach(),contexts=context.children.onOutletDeactivated();this.routeReuseStrategy.store(route.value.snapshot,{componentRef:componentRef,route:route,contexts:contexts})}},ActivateRoutes.prototype.deactivateRouteAndOutlet=function(route,parentContexts){var _this=this,context=parentContexts.getContext(route.value.outlet);if(context){var children=nodeChildrenAsMap(route),contexts_1=route.value.component?context.children:parentContexts;forEach(children,function(v,k){return _this.deactivateRouteAndItsChildren(v,contexts_1)}),context.outlet&&(context.outlet.deactivate(),context.children.onOutletDeactivated())}},ActivateRoutes.prototype.activateChildRoutes=function(futureNode,currNode,contexts){var _this=this,children=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(c){_this.activateRoutes(c,children[c.value.outlet],contexts),_this.forwardEvent(new ActivationEnd(c.value.snapshot))}),futureNode.children.length&&this.forwardEvent(new ChildActivationEnd(futureNode.value.snapshot))},ActivateRoutes.prototype.activateRoutes=function(futureNode,currNode,parentContexts){var future=futureNode.value,curr=currNode?currNode.value:null;if(advanceActivatedRoute(future),future===curr)if(future.component){var context=parentContexts.getOrCreateContext(future.outlet);this.activateChildRoutes(futureNode,currNode,context.children)}else this.activateChildRoutes(futureNode,currNode,parentContexts);else if(future.component){var context=parentContexts.getOrCreateContext(future.outlet);if(this.routeReuseStrategy.shouldAttach(future.snapshot)){var stored=this.routeReuseStrategy.retrieve(future.snapshot);this.routeReuseStrategy.store(future.snapshot,null),context.children.onOutletReAttached(stored.contexts),context.attachRef=stored.componentRef,context.route=stored.route.value,context.outlet&&context.outlet.attach(stored.componentRef,stored.route.value),advanceActivatedRouteNodeAndItsChildren(stored.route)}else{var config=parentLoadedConfig(future.snapshot),cmpFactoryResolver=config?config.module.componentFactoryResolver:null;context.route=future,context.resolver=cmpFactoryResolver,context.outlet&&context.outlet.activateWith(future,cmpFactoryResolver),this.activateChildRoutes(futureNode,null,context.children)}}else this.activateChildRoutes(futureNode,null,parentContexts)},ActivateRoutes}(),RouterLink=function(){function RouterLink(router,route,tabIndex,renderer,el){this.router=router,this.route=route,this.commands=[],null==tabIndex&&renderer.setAttribute(el.nativeElement,"tabindex","0")}return Object.defineProperty(RouterLink.prototype,"routerLink",{set:function(commands){this.commands=null!=commands?Array.isArray(commands)?commands:[commands]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(RouterLink.prototype,"preserveQueryParams",{set:function(value){_angular_core.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated!, use queryParamsHandling instead."),this.preserve=value},enumerable:!0,configurable:!0}),RouterLink.prototype.onClick=function(){var extras={skipLocationChange:attrBoolValue(this.skipLocationChange),replaceUrl:attrBoolValue(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,extras),!0},Object.defineProperty(RouterLink.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:attrBoolValue(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:attrBoolValue(this.preserveFragment)})},enumerable:!0,configurable:!0}),RouterLink.decorators=[{type:_angular_core.Directive,args:[{selector:":not(a)[routerLink]"}]}],RouterLink.ctorParameters=function(){return[{type:Router},{type:ActivatedRoute},{type:void 0,decorators:[{type:_angular_core.Attribute,args:["tabindex"]}]},{type:_angular_core.Renderer2},{type:_angular_core.ElementRef}]},RouterLink.propDecorators={queryParams:[{type:_angular_core.Input}],fragment:[{type:_angular_core.Input}],
43
+ queryParamsHandling:[{type:_angular_core.Input}],preserveFragment:[{type:_angular_core.Input}],skipLocationChange:[{type:_angular_core.Input}],replaceUrl:[{type:_angular_core.Input}],routerLink:[{type:_angular_core.Input}],preserveQueryParams:[{type:_angular_core.Input}],onClick:[{type:_angular_core.HostListener,args:["click"]}]},RouterLink}(),RouterLinkWithHref=function(){function RouterLinkWithHref(router,route,locationStrategy){var _this=this;this.router=router,this.route=route,this.locationStrategy=locationStrategy,this.commands=[],this.subscription=router.events.subscribe(function(s){s instanceof NavigationEnd&&_this.updateTargetUrlAndHref()})}return Object.defineProperty(RouterLinkWithHref.prototype,"routerLink",{set:function(commands){this.commands=null!=commands?Array.isArray(commands)?commands:[commands]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(RouterLinkWithHref.prototype,"preserveQueryParams",{set:function(value){_angular_core.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead."),this.preserve=value},enumerable:!0,configurable:!0}),RouterLinkWithHref.prototype.ngOnChanges=function(changes){this.updateTargetUrlAndHref()},RouterLinkWithHref.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterLinkWithHref.prototype.onClick=function(button,ctrlKey,metaKey,shiftKey){if(0!==button||ctrlKey||metaKey||shiftKey)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;var extras={skipLocationChange:attrBoolValue(this.skipLocationChange),replaceUrl:attrBoolValue(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,extras),!1},RouterLinkWithHref.prototype.updateTargetUrlAndHref=function(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))},Object.defineProperty(RouterLinkWithHref.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:attrBoolValue(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:attrBoolValue(this.preserveFragment)})},enumerable:!0,configurable:!0}),RouterLinkWithHref.decorators=[{type:_angular_core.Directive,args:[{selector:"a[routerLink]"}]}],RouterLinkWithHref.ctorParameters=function(){return[{type:Router},{type:ActivatedRoute},{type:_angular_common.LocationStrategy}]},RouterLinkWithHref.propDecorators={target:[{type:_angular_core.HostBinding,args:["attr.target"]},{type:_angular_core.Input}],queryParams:[{type:_angular_core.Input}],fragment:[{type:_angular_core.Input}],queryParamsHandling:[{type:_angular_core.Input}],preserveFragment:[{type:_angular_core.Input}],skipLocationChange:[{type:_angular_core.Input}],replaceUrl:[{type:_angular_core.Input}],href:[{type:_angular_core.HostBinding}],routerLink:[{type:_angular_core.Input}],preserveQueryParams:[{type:_angular_core.Input}],onClick:[{type:_angular_core.HostListener,args:["click",["$event.button","$event.ctrlKey","$event.metaKey","$event.shiftKey"]]}]},RouterLinkWithHref}(),RouterLinkActive=function(){function RouterLinkActive(router,element,renderer,cdr){var _this=this;this.router=router,this.element=element,this.renderer=renderer,this.cdr=cdr,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.subscription=router.events.subscribe(function(s){s instanceof NavigationEnd&&_this.update()})}return RouterLinkActive.prototype.ngAfterContentInit=function(){var _this=this;this.links.changes.subscribe(function(_){return _this.update()}),this.linksWithHrefs.changes.subscribe(function(_){return _this.update()}),this.update()},Object.defineProperty(RouterLinkActive.prototype,"routerLinkActive",{set:function(data){var classes=Array.isArray(data)?data:data.split(" ");this.classes=classes.filter(function(c){return!!c})},enumerable:!0,configurable:!0}),RouterLinkActive.prototype.ngOnChanges=function(changes){this.update()},RouterLinkActive.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterLinkActive.prototype.update=function(){var _this=this;this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then(function(){var hasActiveLinks=_this.hasActiveLinks();_this.isActive!==hasActiveLinks&&(_this.isActive=hasActiveLinks,_this.classes.forEach(function(c){hasActiveLinks?_this.renderer.addClass(_this.element.nativeElement,c):_this.renderer.removeClass(_this.element.nativeElement,c)}))})},RouterLinkActive.prototype.isLinkActive=function(router){var _this=this;return function(link){return router.isActive(link.urlTree,_this.routerLinkActiveOptions.exact)}},RouterLinkActive.prototype.hasActiveLinks=function(){return this.links.some(this.isLinkActive(this.router))||this.linksWithHrefs.some(this.isLinkActive(this.router))},RouterLinkActive.decorators=[{type:_angular_core.Directive,args:[{selector:"[routerLinkActive]",exportAs:"routerLinkActive"}]}],RouterLinkActive.ctorParameters=function(){return[{type:Router},{type:_angular_core.ElementRef},{type:_angular_core.Renderer2},{type:_angular_core.ChangeDetectorRef}]},RouterLinkActive.propDecorators={links:[{type:_angular_core.ContentChildren,args:[RouterLink,{descendants:!0}]}],linksWithHrefs:[{type:_angular_core.ContentChildren,args:[RouterLinkWithHref,{descendants:!0}]}],routerLinkActiveOptions:[{type:_angular_core.Input}],routerLinkActive:[{type:_angular_core.Input}]},RouterLinkActive}(),OutletContext=function(){function OutletContext(){this.outlet=null,this.route=null,this.resolver=null,this.children=new ChildrenOutletContexts,this.attachRef=null}return OutletContext}(),ChildrenOutletContexts=function(){function ChildrenOutletContexts(){this.contexts=new Map}return ChildrenOutletContexts.prototype.onChildOutletCreated=function(childName,outlet){var context=this.getOrCreateContext(childName);context.outlet=outlet,this.contexts.set(childName,context)},ChildrenOutletContexts.prototype.onChildOutletDestroyed=function(childName){var context=this.getContext(childName);context&&(context.outlet=null)},ChildrenOutletContexts.prototype.onOutletDeactivated=function(){var contexts=this.contexts;return this.contexts=new Map,contexts},ChildrenOutletContexts.prototype.onOutletReAttached=function(contexts){this.contexts=contexts},ChildrenOutletContexts.prototype.getOrCreateContext=function(childName){var context=this.getContext(childName);return context||(context=new OutletContext,this.contexts.set(childName,context)),context},ChildrenOutletContexts.prototype.getContext=function(childName){return this.contexts.get(childName)||null},ChildrenOutletContexts}(),RouterOutlet=function(){function RouterOutlet(parentContexts,location,resolver,name,changeDetector){this.parentContexts=parentContexts,this.location=location,this.resolver=resolver,this.changeDetector=changeDetector,this.activated=null,this._activatedRoute=null,this.activateEvents=new _angular_core.EventEmitter,this.deactivateEvents=new _angular_core.EventEmitter,this.name=name||PRIMARY_OUTLET,parentContexts.onChildOutletCreated(this.name,this)}return RouterOutlet.prototype.ngOnDestroy=function(){this.parentContexts.onChildOutletDestroyed(this.name)},RouterOutlet.prototype.ngOnInit=function(){if(!this.activated){var context=this.parentContexts.getContext(this.name);context&&context.route&&(context.attachRef?this.attach(context.attachRef,context.route):this.activateWith(context.route,context.resolver||null))}},Object.defineProperty(RouterOutlet.prototype,"isActivated",{get:function(){return!!this.activated},enumerable:!0,configurable:!0}),Object.defineProperty(RouterOutlet.prototype,"component",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance},enumerable:!0,configurable:!0}),Object.defineProperty(RouterOutlet.prototype,"activatedRoute",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute},enumerable:!0,configurable:!0}),Object.defineProperty(RouterOutlet.prototype,"activatedRouteData",{get:function(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}},enumerable:!0,configurable:!0}),RouterOutlet.prototype.detach=function(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();var cmp=this.activated;return this.activated=null,this._activatedRoute=null,cmp},RouterOutlet.prototype.attach=function(ref,activatedRoute){this.activated=ref,this._activatedRoute=activatedRoute,this.location.insert(ref.hostView)},RouterOutlet.prototype.deactivate=function(){if(this.activated){var c=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(c)}},RouterOutlet.prototype.activateWith=function(activatedRoute,resolver){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=activatedRoute;var snapshot=activatedRoute._futureSnapshot,component=snapshot.routeConfig.component;resolver=resolver||this.resolver;var factory=resolver.resolveComponentFactory(component),childContexts=this.parentContexts.getOrCreateContext(this.name).children,injector=new OutletInjector(activatedRoute,childContexts,this.location.injector);this.activated=this.location.createComponent(factory,this.location.length,injector),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)},RouterOutlet.decorators=[{type:_angular_core.Directive,args:[{selector:"router-outlet",exportAs:"outlet"}]}],RouterOutlet.ctorParameters=function(){return[{type:ChildrenOutletContexts},{type:_angular_core.ViewContainerRef},{type:_angular_core.ComponentFactoryResolver},{type:void 0,decorators:[{type:_angular_core.Attribute,args:["name"]}]},{type:_angular_core.ChangeDetectorRef}]},RouterOutlet.propDecorators={activateEvents:[{type:_angular_core.Output,args:["activate"]}],deactivateEvents:[{type:_angular_core.Output,args:["deactivate"]}]},RouterOutlet}(),OutletInjector=function(){function OutletInjector(route,childContexts,parent){this.route=route,this.childContexts=childContexts,this.parent=parent}return OutletInjector.prototype.get=function(token,notFoundValue){return token===ActivatedRoute?this.route:token===ChildrenOutletContexts?this.childContexts:this.parent.get(token,notFoundValue)},OutletInjector}(),PreloadingStrategy=function(){function PreloadingStrategy(){}return PreloadingStrategy}(),PreloadAllModules=function(){function PreloadAllModules(){}return PreloadAllModules.prototype.preload=function(route,fn){return rxjs_operator_catch._catch.call(fn(),function(){return rxjs_observable_of.of(null)})},PreloadAllModules}(),NoPreloading=function(){function NoPreloading(){}return NoPreloading.prototype.preload=function(route,fn){return rxjs_observable_of.of(null)},NoPreloading}(),RouterPreloader=function(){function RouterPreloader(router,moduleLoader,compiler,injector,preloadingStrategy){this.router=router,this.injector=injector,this.preloadingStrategy=preloadingStrategy;var onStartLoad=function(r){return router.triggerEvent(new RouteConfigLoadStart(r))},onEndLoad=function(r){return router.triggerEvent(new RouteConfigLoadEnd(r))};this.loader=new RouterConfigLoader(moduleLoader,compiler,onStartLoad,onEndLoad)}return RouterPreloader.prototype.setUpPreloading=function(){var _this=this,navigations$=rxjs_operator_filter.filter.call(this.router.events,function(e){return e instanceof NavigationEnd});this.subscription=rxjs_operator_concatMap.concatMap.call(navigations$,function(){return _this.preload()}).subscribe(function(){})},RouterPreloader.prototype.preload=function(){var ngModule=this.injector.get(_angular_core.NgModuleRef);return this.processRoutes(ngModule,this.router.config)},RouterPreloader.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterPreloader.prototype.processRoutes=function(ngModule,routes){for(var res=[],_i=0,routes_1=routes;_i<routes_1.length;_i++){var route=routes_1[_i];if(route.loadChildren&&!route.canLoad&&route._loadedConfig){var childConfig=route._loadedConfig;res.push(this.processRoutes(childConfig.module,childConfig.routes))}else route.loadChildren&&!route.canLoad?res.push(this.preloadConfig(ngModule,route)):route.children&&res.push(this.processRoutes(ngModule,route.children))}return rxjs_operator_mergeAll.mergeAll.call(rxjs_observable_from.from(res))},RouterPreloader.prototype.preloadConfig=function(ngModule,route){var _this=this;return this.preloadingStrategy.preload(route,function(){var loaded$=_this.loader.load(ngModule.injector,route);return rxjs_operator_mergeMap.mergeMap.call(loaded$,function(config){return route._loadedConfig=config,_this.processRoutes(config.module,config.routes)})})},RouterPreloader.decorators=[{type:_angular_core.Injectable}],RouterPreloader.ctorParameters=function(){return[{type:Router},{type:_angular_core.NgModuleFactoryLoader},{type:_angular_core.Compiler},{type:_angular_core.Injector},{type:PreloadingStrategy}]},RouterPreloader}(),ROUTER_DIRECTIVES=[RouterOutlet,RouterLink,RouterLinkWithHref,RouterLinkActive],ROUTER_CONFIGURATION=new _angular_core.InjectionToken("ROUTER_CONFIGURATION"),ROUTER_FORROOT_GUARD=new _angular_core.InjectionToken("ROUTER_FORROOT_GUARD"),ROUTER_PROVIDERS=[_angular_common.Location,{provide:UrlSerializer,useClass:DefaultUrlSerializer},{provide:Router,useFactory:setupRouter,deps:[_angular_core.ApplicationRef,UrlSerializer,ChildrenOutletContexts,_angular_common.Location,_angular_core.Injector,_angular_core.NgModuleFactoryLoader,_angular_core.Compiler,ROUTES,ROUTER_CONFIGURATION,[UrlHandlingStrategy,new _angular_core.Optional],[RouteReuseStrategy,new _angular_core.Optional]]},ChildrenOutletContexts,{provide:ActivatedRoute,useFactory:rootRoute,deps:[Router]},{provide:_angular_core.NgModuleFactoryLoader,useClass:_angular_core.SystemJsNgModuleLoader},RouterPreloader,NoPreloading,PreloadAllModules,{provide:ROUTER_CONFIGURATION,useValue:{enableTracing:!1}}],RouterModule=function(){function RouterModule(guard,router){}return RouterModule.forRoot=function(routes,config){return{ngModule:RouterModule,providers:[ROUTER_PROVIDERS,provideRoutes(routes),{provide:ROUTER_FORROOT_GUARD,useFactory:provideForRootGuard,deps:[[Router,new _angular_core.Optional,new _angular_core.SkipSelf]]},{provide:ROUTER_CONFIGURATION,useValue:config||{}},{provide:_angular_common.LocationStrategy,useFactory:provideLocationStrategy,deps:[_angular_common.PlatformLocation,[new _angular_core.Inject(_angular_common.APP_BASE_HREF),new _angular_core.Optional],ROUTER_CONFIGURATION]},{provide:PreloadingStrategy,useExisting:config&&config.preloadingStrategy?config.preloadingStrategy:NoPreloading},{provide:_angular_core.NgProbeToken,multi:!0,useFactory:routerNgProbeToken},provideRouterInitializer()]}},RouterModule.forChild=function(routes){return{ngModule:RouterModule,providers:[provideRoutes(routes)]}},RouterModule.decorators=[{type:_angular_core.NgModule,args:[{declarations:ROUTER_DIRECTIVES,exports:ROUTER_DIRECTIVES}]}],RouterModule.ctorParameters=function(){return[{type:void 0,decorators:[{type:_angular_core.Optional},{type:_angular_core.Inject,args:[ROUTER_FORROOT_GUARD]}]},{type:Router,decorators:[{type:_angular_core.Optional}]}]},RouterModule}(),RouterInitializer=function(){function RouterInitializer(injector){this.injector=injector,this.initNavigation=!1,this.resultOfPreactivationDone=new rxjs_Subject.Subject}return RouterInitializer.prototype.appInitializer=function(){var _this=this;return this.injector.get(_angular_common.LOCATION_INITIALIZED,Promise.resolve(null)).then(function(){var resolve=null,res=new Promise(function(r){return resolve=r}),router=_this.injector.get(Router),opts=_this.injector.get(ROUTER_CONFIGURATION);if(_this.isLegacyDisabled(opts)||_this.isLegacyEnabled(opts))resolve(!0);else if("disabled"===opts.initialNavigation)router.setUpLocationChangeListener(),resolve(!0);else{if("enabled"!==opts.initialNavigation)throw new Error("Invalid initialNavigation options: '"+opts.initialNavigation+"'");router.hooks.afterPreactivation=function(){return _this.initNavigation?rxjs_observable_of.of(null):(_this.initNavigation=!0,resolve(!0),_this.resultOfPreactivationDone)},router.initialNavigation()}return res})},RouterInitializer.prototype.bootstrapListener=function(bootstrappedComponentRef){var opts=this.injector.get(ROUTER_CONFIGURATION),preloader=this.injector.get(RouterPreloader),router=this.injector.get(Router),ref=this.injector.get(_angular_core.ApplicationRef);bootstrappedComponentRef===ref.components[0]&&(this.isLegacyEnabled(opts)?router.initialNavigation():this.isLegacyDisabled(opts)&&router.setUpLocationChangeListener(),preloader.setUpPreloading(),router.resetRootComponentType(ref.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())},RouterInitializer.prototype.isLegacyEnabled=function(opts){return"legacy_enabled"===opts.initialNavigation||!0===opts.initialNavigation||void 0===opts.initialNavigation},RouterInitializer.prototype.isLegacyDisabled=function(opts){return"legacy_disabled"===opts.initialNavigation||!1===opts.initialNavigation},RouterInitializer.decorators=[{type:_angular_core.Injectable}],RouterInitializer.ctorParameters=function(){return[{type:_angular_core.Injector}]},RouterInitializer}(),ROUTER_INITIALIZER=new _angular_core.InjectionToken("Router Initializer"),VERSION=new _angular_core.Version("5.2.6");exports.RouterLink=RouterLink,exports.RouterLinkWithHref=RouterLinkWithHref,exports.RouterLinkActive=RouterLinkActive,exports.RouterOutlet=RouterOutlet,exports.ActivationEnd=ActivationEnd,exports.ActivationStart=ActivationStart,exports.ChildActivationEnd=ChildActivationEnd,exports.ChildActivationStart=ChildActivationStart,exports.GuardsCheckEnd=GuardsCheckEnd,exports.GuardsCheckStart=GuardsCheckStart,exports.NavigationCancel=NavigationCancel,exports.NavigationEnd=NavigationEnd,exports.NavigationError=NavigationError,exports.NavigationStart=NavigationStart,exports.ResolveEnd=ResolveEnd,exports.ResolveStart=ResolveStart,exports.RouteConfigLoadEnd=RouteConfigLoadEnd,exports.RouteConfigLoadStart=RouteConfigLoadStart,exports.RouterEvent=RouterEvent,exports.RoutesRecognized=RoutesRecognized,exports.RouteReuseStrategy=RouteReuseStrategy,exports.Router=Router,exports.ROUTES=ROUTES,exports.ROUTER_CONFIGURATION=ROUTER_CONFIGURATION,exports.ROUTER_INITIALIZER=ROUTER_INITIALIZER,exports.RouterModule=RouterModule,exports.provideRoutes=provideRoutes,exports.ChildrenOutletContexts=ChildrenOutletContexts,exports.OutletContext=OutletContext,exports.NoPreloading=NoPreloading,exports.PreloadAllModules=PreloadAllModules,exports.PreloadingStrategy=PreloadingStrategy,exports.RouterPreloader=RouterPreloader,exports.ActivatedRoute=ActivatedRoute,exports.ActivatedRouteSnapshot=ActivatedRouteSnapshot,exports.RouterState=RouterState,exports.RouterStateSnapshot=RouterStateSnapshot,exports.PRIMARY_OUTLET=PRIMARY_OUTLET,exports.convertToParamMap=convertToParamMap,exports.UrlHandlingStrategy=UrlHandlingStrategy,exports.DefaultUrlSerializer=DefaultUrlSerializer,exports.UrlSegment=UrlSegment,exports.UrlSegmentGroup=UrlSegmentGroup,exports.UrlSerializer=UrlSerializer,exports.UrlTree=UrlTree,exports.VERSION=VERSION,exports.ɵROUTER_PROVIDERS=ROUTER_PROVIDERS,exports.ɵflatten=flatten,exports.ɵa=ROUTER_FORROOT_GUARD,exports.ɵg=RouterInitializer,exports.ɵh=getAppInitializer,exports.ɵi=getBootstrapListener,exports.ɵd=provideForRootGuard,exports.ɵc=provideLocationStrategy,exports.ɵj=provideRouterInitializer,exports.ɵf=rootRoute,exports.ɵb=routerNgProbeToken,exports.ɵe=setupRouter,exports.ɵk=Tree,exports.ɵl=TreeNode,Object.defineProperty(exports,"__esModule",{value:!0})});
44
44
  //# sourceMappingURL=router.umd.min.js.map