router.umd.min.js
99.6 KB
/**
* @license Angular v3.4.5
* (c) 2010-2016 Google, Inc. https://angular.io/
* License: MIT
*/
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/common"),require("@angular/core"),require("rxjs/BehaviorSubject"),require("rxjs/Subject"),require("rxjs/observable/from"),require("rxjs/observable/of"),require("rxjs/operator/concatMap"),require("rxjs/operator/every"),require("rxjs/operator/first"),require("rxjs/operator/map"),require("rxjs/operator/mergeMap"),require("rxjs/operator/reduce"),require("rxjs/Observable"),require("rxjs/operator/catch"),require("rxjs/operator/concatAll"),require("rxjs/util/EmptyError"),require("rxjs/observable/fromPromise"),require("rxjs/operator/last"),require("rxjs/operator/mergeAll"),require("@angular/platform-browser"),require("rxjs/operator/filter")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core","rxjs/BehaviorSubject","rxjs/Subject","rxjs/observable/from","rxjs/observable/of","rxjs/operator/concatMap","rxjs/operator/every","rxjs/operator/first","rxjs/operator/map","rxjs/operator/mergeMap","rxjs/operator/reduce","rxjs/Observable","rxjs/operator/catch","rxjs/operator/concatAll","rxjs/util/EmptyError","rxjs/observable/fromPromise","rxjs/operator/last","rxjs/operator/mergeAll","@angular/platform-browser","rxjs/operator/filter"],factory):factory((global.ng=global.ng||{},global.ng.router=global.ng.router||{}),global.ng.common,global.ng.core,global.Rx,global.Rx,global.Rx.Observable,global.Rx.Observable,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx,global.Rx.Observable,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.ng.platformBrowser,global.Rx.Observable.prototype)}(this,function(exports,_angular_common,_angular_core,rxjs_BehaviorSubject,rxjs_Subject,rxjs_observable_from,rxjs_observable_of,rxjs_operator_concatMap,rxjs_operator_every,rxjs_operator_first,rxjs_operator_map,rxjs_operator_mergeMap,rxjs_operator_reduce,rxjs_Observable,rxjs_operator_catch,rxjs_operator_concatAll,rxjs_util_EmptyError,rxjs_observable_fromPromise,l,rxjs_operator_mergeAll,_angular_platformBrowser,rxjs_operator_filter){"use strict";function defaultUrlMatcher(segments,segmentGroup,route){for(var path=route.path,parts=path.split("/"),posParams={},consumed=[],currentIndex=0,i=0;i<parts.length;++i){if(currentIndex>=segments.length)return null;var current=segments[currentIndex],p=parts[i],isPosParam=p.startsWith(":");if(!isPosParam&&p!==current.path)return null;isPosParam&&(posParams[p.substring(1)]=current),consumed.push(current),currentIndex++}return"full"===route.pathMatch&&(segmentGroup.hasChildren()||currentIndex<segments.length)?null:{consumed:consumed,posParams:posParams}}function shallowEqualArrays(a,b){if(a.length!==b.length)return!1;for(var i=0;i<a.length;++i)if(!shallowEqual(a[i],b[i]))return!1;return!0}function shallowEqual(a,b){var k1=Object.keys(a),k2=Object.keys(b);if(k1.length!=k2.length)return!1;for(var key,i=0;i<k1.length;i++)if(key=k1[i],a[key]!==b[key])return!1;return!0}function flatten(a){for(var target=[],i=0;i<a.length;++i)for(var j=0;j<a[i].length;++j)target.push(a[i][j]);return target}function last(a){return a.length>0?a[a.length-1]:null}function merge(m1,m2){var m={};for(var attr in m1)m1.hasOwnProperty(attr)&&(m[attr]=m1[attr]);for(var attr in m2)m2.hasOwnProperty(attr)&&(m[attr]=m2[attr]);return m}function forEach(map,callback){for(var prop in map)map.hasOwnProperty(prop)&&callback(map[prop],prop)}function waitForMap(obj,fn){var waitFor=[],res={};if(forEach(obj,function(a,k){k===PRIMARY_OUTLET&&waitFor.push(rxjs_operator_map.map.call(fn(k,a),function(_){return res[k]=_,_}))}),forEach(obj,function(a,k){k!==PRIMARY_OUTLET&&waitFor.push(rxjs_operator_map.map.call(fn(k,a),function(_){return res[k]=_,_}))}),waitFor.length>0){var concatted$=rxjs_operator_concatAll.concatAll.call(rxjs_observable_of.of.apply(void 0,waitFor)),last$=l.last.call(concatted$);return rxjs_operator_map.map.call(last$,function(){return res})}return rxjs_observable_of.of(res)}function andObservables(observables){var merged$=rxjs_operator_mergeAll.mergeAll.call(observables);return rxjs_operator_every.every.call(merged$,function(result){return result===!0})}function wrapIntoObservable(value){return value instanceof rxjs_Observable.Observable?value:value instanceof Promise?rxjs_observable_fromPromise.fromPromise(value):rxjs_observable_of.of(value)}function createEmptyUrlTree(){return new UrlTree(new UrlSegmentGroup([],{}),{},null)}function containsTree(container,containee,exact){return exact?equalQueryParams(container.queryParams,containee.queryParams)&&equalSegmentGroups(container.root,containee.root):containsQueryParams(container.queryParams,containee.queryParams)&&containsSegmentGroup(container.root,containee.root)}function equalQueryParams(container,containee){return shallowEqual(container,containee)}function equalSegmentGroups(container,containee){if(!equalPath(container.segments,containee.segments))return!1;if(container.numberOfChildren!==containee.numberOfChildren)return!1;for(var c in containee.children){if(!container.children[c])return!1;if(!equalSegmentGroups(container.children[c],containee.children[c]))return!1}return!0}function containsQueryParams(container,containee){return Object.keys(containee).length<=Object.keys(container).length&&Object.keys(containee).every(function(key){return containee[key]===container[key]})}function containsSegmentGroup(container,containee){return containsSegmentGroupHelper(container,containee,containee.segments)}function containsSegmentGroupHelper(container,containee,containeePaths){if(container.segments.length>containeePaths.length){var current=container.segments.slice(0,containeePaths.length);return!!equalPath(current,containeePaths)&&!containee.hasChildren()}if(container.segments.length===containeePaths.length){if(!equalPath(container.segments,containeePaths))return!1;for(var c in containee.children){if(!container.children[c])return!1;if(!containsSegmentGroup(container.children[c],containee.children[c]))return!1}return!0}var current=containeePaths.slice(0,container.segments.length),next=containeePaths.slice(container.segments.length);return!!equalPath(container.segments,current)&&(!!container.children[PRIMARY_OUTLET]&&containsSegmentGroupHelper(container.children[PRIMARY_OUTLET],containee,next))}function equalSegments(a,b){if(a.length!==b.length)return!1;for(var i=0;i<a.length;++i){if(a[i].path!==b[i].path)return!1;if(!shallowEqual(a[i].parameters,b[i].parameters))return!1}return!0}function equalPath(a,b){if(a.length!==b.length)return!1;for(var i=0;i<a.length;++i)if(a[i].path!==b[i].path)return!1;return!0}function mapChildrenIntoArray(segment,fn){var res=[];return forEach(segment.children,function(child,childOutlet){childOutlet===PRIMARY_OUTLET&&(res=res.concat(fn(child,childOutlet)))}),forEach(segment.children,function(child,childOutlet){childOutlet!==PRIMARY_OUTLET&&(res=res.concat(fn(child,childOutlet)))}),res}function serializePaths(segment){return segment.segments.map(function(p){return serializePath(p)}).join("/")}function serializeSegment(segment,root){if(segment.hasChildren()&&root){var primary=segment.children[PRIMARY_OUTLET]?serializeSegment(segment.children[PRIMARY_OUTLET],!1):"",children_1=[];return forEach(segment.children,function(v,k){k!==PRIMARY_OUTLET&&children_1.push(k+":"+serializeSegment(v,!1))}),children_1.length>0?primary+"("+children_1.join("//")+")":""+primary}if(segment.hasChildren()&&!root){var children=mapChildrenIntoArray(segment,function(v,k){return k===PRIMARY_OUTLET?[serializeSegment(segment.children[PRIMARY_OUTLET],!1)]:[k+":"+serializeSegment(v,!1)]});return serializePaths(segment)+"/("+children.join("//")+")"}return serializePaths(segment)}function encode(s){return encodeURIComponent(s)}function decode(s){return decodeURIComponent(s)}function serializePath(path){return""+encode(path.path)+serializeParams(path.parameters)}function serializeParams(params){return pairs(params).map(function(p){return";"+encode(p.first)+"="+encode(p.second)}).join("")}function serializeQueryParams(params){var strParams=Object.keys(params).map(function(name){var value=params[name];return Array.isArray(value)?value.map(function(v){return encode(name)+"="+encode(v)}).join("&"):encode(name)+"="+encode(value)});return strParams.length?"?"+strParams.join("&"):""}function pairs(obj){var res=[];for(var prop in obj)obj.hasOwnProperty(prop)&&res.push(new Pair(prop,obj[prop]));return res}function matchSegments(str){SEGMENT_RE.lastIndex=0;var match=str.match(SEGMENT_RE);return match?match[0]:""}function matchQueryParams(str){QUERY_PARAM_RE.lastIndex=0;var match=str.match(SEGMENT_RE);return match?match[0]:""}function matchUrlQueryParamValue(str){QUERY_PARAM_VALUE_RE.lastIndex=0;var match=str.match(QUERY_PARAM_VALUE_RE);return match?match[0]:""}function noMatch(segmentGroup){return new rxjs_Observable.Observable(function(obs){return obs.error(new NoMatch(segmentGroup))})}function absoluteRedirect(newTree){return new rxjs_Observable.Observable(function(obs){return obs.error(new AbsoluteRedirect(newTree))})}function namedOutletsRedirect(redirectTo){return new rxjs_Observable.Observable(function(obs){return obs.error(new Error("Only absolute redirects can have named outlets. redirectTo: '"+redirectTo+"'"))})}function canLoadFails(route){return new rxjs_Observable.Observable(function(obs){return obs.error(new NavigationCancelingError("Cannot load children because the guard of the route \"path: '"+route.path+"'\" returned false"))})}function applyRedirects(injector,configLoader,urlSerializer,urlTree,config){return new ApplyRedirects(injector,configLoader,urlSerializer,urlTree,config).apply()}function runGuards(injector,route){var canLoad=route.canLoad;if(!canLoad||0===canLoad.length)return rxjs_observable_of.of(!0);var obs=rxjs_operator_map.map.call(rxjs_observable_from.from(canLoad),function(c){var guard=injector.get(c);return wrapIntoObservable(guard.canLoad?guard.canLoad(route):guard(route))});return andObservables(obs)}function match(segmentGroup,route,segments){var noMatch={matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}};if(""===route.path)return"full"===route.pathMatch&&(segmentGroup.hasChildren()||segments.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};var matcher=route.matcher||defaultUrlMatcher,res=matcher(segments,segmentGroup,route);return res?{matched:!0,consumedSegments:res.consumed,lastChild:res.consumed.length,positionalParamSegments:res.posParams}:noMatch}function split(segmentGroup,consumedSegments,slicedSegments,config){if(slicedSegments.length>0&&containsEmptyPathRedirectsWithNamedOutlets(segmentGroup,slicedSegments,config)){var s=new UrlSegmentGroup(consumedSegments,createChildrenForEmptySegments(config,new UrlSegmentGroup(slicedSegments,segmentGroup.children)));return{segmentGroup:mergeTrivialChildren(s),slicedSegments:[]}}if(0===slicedSegments.length&&containsEmptyPathRedirects(segmentGroup,slicedSegments,config)){var s=new UrlSegmentGroup(segmentGroup.segments,addEmptySegmentsToChildrenIfNeeded(segmentGroup,slicedSegments,config,segmentGroup.children));return{segmentGroup:mergeTrivialChildren(s),slicedSegments:slicedSegments}}return{segmentGroup:segmentGroup,slicedSegments:slicedSegments}}function mergeTrivialChildren(s){if(1===s.numberOfChildren&&s.children[PRIMARY_OUTLET]){var c=s.children[PRIMARY_OUTLET];return new UrlSegmentGroup(s.segments.concat(c.segments),c.children)}return s}function addEmptySegmentsToChildrenIfNeeded(segmentGroup,slicedSegments,routes,children){for(var res={},_i=0,routes_1=routes;_i<routes_1.length;_i++){var r=routes_1[_i];emptyPathRedirect(segmentGroup,slicedSegments,r)&&!children[getOutlet$1(r)]&&(res[getOutlet$1(r)]=new UrlSegmentGroup([],{}))}return merge(children,res)}function createChildrenForEmptySegments(routes,primarySegmentGroup){var res={};res[PRIMARY_OUTLET]=primarySegmentGroup;for(var _i=0,routes_2=routes;_i<routes_2.length;_i++){var r=routes_2[_i];""===r.path&&getOutlet$1(r)!==PRIMARY_OUTLET&&(res[getOutlet$1(r)]=new UrlSegmentGroup([],{}))}return res}function containsEmptyPathRedirectsWithNamedOutlets(segmentGroup,slicedSegments,routes){return routes.filter(function(r){return emptyPathRedirect(segmentGroup,slicedSegments,r)&&getOutlet$1(r)!==PRIMARY_OUTLET}).length>0}function containsEmptyPathRedirects(segmentGroup,slicedSegments,routes){return routes.filter(function(r){return emptyPathRedirect(segmentGroup,slicedSegments,r)}).length>0}function emptyPathRedirect(segmentGroup,slicedSegments,r){return(!(segmentGroup.hasChildren()||slicedSegments.length>0)||"full"!==r.pathMatch)&&(""===r.path&&void 0!==r.redirectTo)}function getOutlet$1(route){return route.outlet?route.outlet:PRIMARY_OUTLET}function validateConfig(config,parentPath){void 0===parentPath&&(parentPath="");for(var i=0;i<config.length;i++){var route=config[i],fullPath=getFullPath(parentPath,route);validateNode(route,fullPath)}}function validateNode(route,fullPath){if(!route)throw new Error("\n Invalid configuration of route '"+fullPath+"': Encountered undefined route.\n The reason might be an extra comma.\n \n Example: \n const routes: Routes = [\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n { path: 'dashboard', component: DashboardComponent },, << two commas\n { path: 'detail/:id', component: HeroDetailComponent }\n ];\n ");if(Array.isArray(route))throw new Error("Invalid configuration of route '"+fullPath+"': Array cannot be specified");if(!route.component&&route.outlet&&route.outlet!==PRIMARY_OUTLET)throw new Error("Invalid configuration of route '"+fullPath+"': a componentless route cannot have a named outlet set");if(route.redirectTo&&route.children)throw new Error("Invalid configuration of route '"+fullPath+"': redirectTo and children cannot be used together");if(route.redirectTo&&route.loadChildren)throw new Error("Invalid configuration of route '"+fullPath+"': redirectTo and loadChildren cannot be used together");if(route.children&&route.loadChildren)throw new Error("Invalid configuration of route '"+fullPath+"': children and loadChildren cannot be used together");if(route.redirectTo&&route.component)throw new Error("Invalid configuration of route '"+fullPath+"': redirectTo and component cannot be used together");if(route.path&&route.matcher)throw new Error("Invalid configuration of route '"+fullPath+"': path and matcher cannot be used together");if(void 0===route.redirectTo&&!route.component&&!route.children&&!route.loadChildren)throw new Error("Invalid configuration of route '"+fullPath+"'. One of the following must be provided: component, redirectTo, children or loadChildren");if(void 0===route.path&&void 0===route.matcher)throw new Error("Invalid configuration of route '"+fullPath+"': routes must have either a path or a matcher specified");if("string"==typeof route.path&&"/"===route.path.charAt(0))throw new Error("Invalid configuration of route '"+fullPath+"': path cannot start with a slash");if(""===route.path&&void 0!==route.redirectTo&&void 0===route.pathMatch){var exp="The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.";throw new Error("Invalid configuration of route '{path: \""+fullPath+'", redirectTo: "'+route.redirectTo+"\"}': please provide 'pathMatch'. "+exp)}if(void 0!==route.pathMatch&&"full"!==route.pathMatch&&"prefix"!==route.pathMatch)throw new Error("Invalid configuration of route '"+fullPath+"': pathMatch can only be set to 'prefix' or 'full'");route.children&&validateConfig(route.children,fullPath)}function getFullPath(parentPath,currentRoute){return currentRoute?parentPath||currentRoute.path?parentPath&&!currentRoute.path?parentPath+"/":!parentPath&¤tRoute.path?currentRoute.path:parentPath+"/"+currentRoute.path:"":parentPath}function findNode(expected,c){if(expected===c.value)return c;for(var _i=0,_a=c.children;_i<_a.length;_i++){var cc=_a[_i],r=findNode(expected,cc);if(r)return r}return null}function findPath(expected,c,collected){if(collected.push(c),expected===c.value)return collected;for(var _i=0,_a=c.children;_i<_a.length;_i++){var cc=_a[_i],cloned=collected.slice(0),r=findPath(expected,cc,cloned);if(r.length>0)return r}return[]}function createEmptyState(urlTree,rootComponent){var snapshot=createEmptyStateSnapshot(urlTree,rootComponent),emptyUrl=new rxjs_BehaviorSubject.BehaviorSubject([new UrlSegment("",{})]),emptyParams=new rxjs_BehaviorSubject.BehaviorSubject({}),emptyData=new rxjs_BehaviorSubject.BehaviorSubject({}),emptyQueryParams=new rxjs_BehaviorSubject.BehaviorSubject({}),fragment=new rxjs_BehaviorSubject.BehaviorSubject(""),activated=new ActivatedRoute(emptyUrl,emptyParams,emptyQueryParams,fragment,emptyData,PRIMARY_OUTLET,rootComponent,snapshot.root);return activated.snapshot=snapshot.root,new RouterState(new TreeNode(activated,[]),snapshot)}function createEmptyStateSnapshot(urlTree,rootComponent){var emptyParams={},emptyData={},emptyQueryParams={},fragment="",activated=new ActivatedRouteSnapshot([],emptyParams,emptyQueryParams,fragment,emptyData,PRIMARY_OUTLET,rootComponent,null,urlTree.root,(-1),{});return new RouterStateSnapshot("",new TreeNode(activated,[]))}function inheritedParamsDataResolve(route){for(var pathToRoot=route.pathFromRoot,inhertingStartingFrom=pathToRoot.length-1;inhertingStartingFrom>=1;){var current=pathToRoot[inhertingStartingFrom],parent_1=pathToRoot[inhertingStartingFrom-1];if(current.routeConfig&&""===current.routeConfig.path)inhertingStartingFrom--;else{if(parent_1.component)break;inhertingStartingFrom--}}return pathToRoot.slice(inhertingStartingFrom).reduce(function(res,curr){var params=merge(res.params,curr.params),data=merge(res.data,curr.data),resolve=merge(res.resolve,curr._resolvedData);return{params:params,data:data,resolve:resolve}},{params:{},data:{},resolve:{}})}function setRouterStateSnapshot(state,node){node.value._routerState=state,node.children.forEach(function(c){return setRouterStateSnapshot(state,c)})}function serializeNode(node){var c=node.children.length>0?" { "+node.children.map(serializeNode).join(", ")+" } ":"";return""+node.value+c}function advanceActivatedRoute(route){if(route.snapshot){var currentSnapshot=route.snapshot;route.snapshot=route._futureSnapshot,shallowEqual(currentSnapshot.queryParams,route._futureSnapshot.queryParams)||route.queryParams.next(route._futureSnapshot.queryParams),currentSnapshot.fragment!==route._futureSnapshot.fragment&&route.fragment.next(route._futureSnapshot.fragment),shallowEqual(currentSnapshot.params,route._futureSnapshot.params)||route.params.next(route._futureSnapshot.params),shallowEqualArrays(currentSnapshot.url,route._futureSnapshot.url)||route.url.next(route._futureSnapshot.url),equalParamsAndUrlSegments(currentSnapshot,route._futureSnapshot)||route.data.next(route._futureSnapshot.data)}else route.snapshot=route._futureSnapshot,route.data.next(route._futureSnapshot.data)}function equalParamsAndUrlSegments(a,b){return shallowEqual(a.params,b.params)&&equalSegments(a.url,b.url)}function createRouterState(routeReuseStrategy,curr,prevState){var root=createNode(routeReuseStrategy,curr._root,prevState?prevState._root:void 0);return new RouterState(root,curr)}function createNode(routeReuseStrategy,curr,prevState){if(prevState&&routeReuseStrategy.shouldReuseRoute(curr.value,prevState.value.snapshot)){var value=prevState.value;value._futureSnapshot=curr.value;var children=createOrReuseChildren(routeReuseStrategy,curr,prevState);return new TreeNode(value,children)}if(routeReuseStrategy.retrieve(curr.value)){var tree=routeReuseStrategy.retrieve(curr.value).route;return setFutureSnapshotsOfActivatedRoutes(curr,tree),tree}var value=createActivatedRoute(curr.value),children=curr.children.map(function(c){return createNode(routeReuseStrategy,c)});return new TreeNode(value,children)}function setFutureSnapshotsOfActivatedRoutes(curr,result){if(curr.value.routeConfig!==result.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(curr.children.length!==result.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");result.value._futureSnapshot=curr.value;for(var i=0;i<curr.children.length;++i)setFutureSnapshotsOfActivatedRoutes(curr.children[i],result.children[i])}function createOrReuseChildren(routeReuseStrategy,curr,prevState){return curr.children.map(function(child){for(var _i=0,_a=prevState.children;_i<_a.length;_i++){var p=_a[_i];if(routeReuseStrategy.shouldReuseRoute(p.value.snapshot,child.value))return createNode(routeReuseStrategy,child,p)}return createNode(routeReuseStrategy,child)})}function createActivatedRoute(c){return new ActivatedRoute(new rxjs_BehaviorSubject.BehaviorSubject(c.url),new rxjs_BehaviorSubject.BehaviorSubject(c.params),new rxjs_BehaviorSubject.BehaviorSubject(c.queryParams),new rxjs_BehaviorSubject.BehaviorSubject(c.fragment),new rxjs_BehaviorSubject.BehaviorSubject(c.data),c.outlet,c.component,c)}function createUrlTree(route,urlTree,commands,queryParams,fragment){if(0===commands.length)return tree(urlTree.root,urlTree.root,urlTree,queryParams,fragment);var nav=computeNavigation(commands);if(nav.toRoot())return tree(urlTree.root,new UrlSegmentGroup([],{}),urlTree,queryParams,fragment);var startingPosition=findStartingPosition(nav,urlTree,route),segmentGroup=startingPosition.processChildren?updateSegmentGroupChildren(startingPosition.segmentGroup,startingPosition.index,nav.commands):updateSegmentGroup(startingPosition.segmentGroup,startingPosition.index,nav.commands);return tree(startingPosition.segmentGroup,segmentGroup,urlTree,queryParams,fragment)}function isMatrixParams(command){return"object"==typeof command&&null!=command&&!command.outlets&&!command.segmentPath}function tree(oldSegmentGroup,newSegmentGroup,urlTree,queryParams,fragment){return urlTree.root===oldSegmentGroup?new UrlTree(newSegmentGroup,stringify(queryParams),fragment):new UrlTree(replaceSegment(urlTree.root,oldSegmentGroup,newSegmentGroup),stringify(queryParams),fragment)}function replaceSegment(current,oldSegment,newSegment){var children={};return forEach(current.children,function(c,outletName){c===oldSegment?children[outletName]=newSegment:children[outletName]=replaceSegment(c,oldSegment,newSegment)}),new UrlSegmentGroup(current.segments,children)}function computeNavigation(commands){if("string"==typeof commands[0]&&1===commands.length&&"/"===commands[0])return new Navigation((!0),0,commands);var numberOfDoubleDots=0,isAbsolute=!1,res=commands.reduce(function(res,cmd,cmdIdx){if("object"==typeof cmd&&null!=cmd){if(cmd.outlets){var outlets_1={};return forEach(cmd.outlets,function(commands,name){outlets_1[name]="string"==typeof commands?commands.split("/"):commands}),res.concat([{outlets:outlets_1}])}if(cmd.segmentPath)return res.concat([cmd.segmentPath])}return"string"!=typeof cmd?res.concat([cmd]):0===cmdIdx?(cmd.split("/").forEach(function(urlPart,partIndex){0==partIndex&&"."===urlPart||(0==partIndex&&""===urlPart?isAbsolute=!0:".."===urlPart?numberOfDoubleDots++:""!=urlPart&&res.push(urlPart))}),res):res.concat([cmd])},[]);return new Navigation(isAbsolute,numberOfDoubleDots,res)}function findStartingPosition(nav,tree,route){if(nav.isAbsolute)return new Position(tree.root,(!0),0);if(route.snapshot._lastPathIndex===-1)return new Position(route.snapshot._urlSegment,(!0),0);var modifier=isMatrixParams(nav.commands[0])?0:1,index=route.snapshot._lastPathIndex+modifier;return createPositionApplyingDoubleDots(route.snapshot._urlSegment,index,nav.numberOfDoubleDots)}function createPositionApplyingDoubleDots(group,index,numberOfDoubleDots){for(var g=group,ci=index,dd=numberOfDoubleDots;dd>ci;){if(dd-=ci,g=g.parent,!g)throw new Error("Invalid number of '../'");ci=g.segments.length}return new Position(g,(!1),ci-dd)}function getPath(command){return"object"==typeof command&&null!=command&&command.outlets?command.outlets[PRIMARY_OUTLET]:""+command}function getOutlets(commands){return"object"!=typeof commands[0]?(_a={},_a[PRIMARY_OUTLET]=commands,_a):void 0===commands[0].outlets?(_b={},_b[PRIMARY_OUTLET]=commands,_b):commands[0].outlets;var _a,_b}function updateSegmentGroup(segmentGroup,startIndex,commands){if(segmentGroup||(segmentGroup=new UrlSegmentGroup([],{})),0===segmentGroup.segments.length&&segmentGroup.hasChildren())return updateSegmentGroupChildren(segmentGroup,startIndex,commands);var m=prefixedWith(segmentGroup,startIndex,commands),slicedCommands=commands.slice(m.commandIndex);if(m.match&&m.pathIndex<segmentGroup.segments.length){var g=new UrlSegmentGroup(segmentGroup.segments.slice(0,m.pathIndex),{});return g.children[PRIMARY_OUTLET]=new UrlSegmentGroup(segmentGroup.segments.slice(m.pathIndex),segmentGroup.children),updateSegmentGroupChildren(g,0,slicedCommands)}return m.match&&0===slicedCommands.length?new UrlSegmentGroup(segmentGroup.segments,{}):m.match&&!segmentGroup.hasChildren()?createNewSegmentGroup(segmentGroup,startIndex,commands):m.match?updateSegmentGroupChildren(segmentGroup,0,slicedCommands):createNewSegmentGroup(segmentGroup,startIndex,commands)}function updateSegmentGroupChildren(segmentGroup,startIndex,commands){if(0===commands.length)return new UrlSegmentGroup(segmentGroup.segments,{});var outlets_2=getOutlets(commands),children_1={};return forEach(outlets_2,function(commands,outlet){null!==commands&&(children_1[outlet]=updateSegmentGroup(segmentGroup.children[outlet],startIndex,commands))}),forEach(segmentGroup.children,function(child,childOutlet){void 0===outlets_2[childOutlet]&&(children_1[childOutlet]=child)}),new UrlSegmentGroup(segmentGroup.segments,children_1)}function prefixedWith(segmentGroup,startIndex,commands){for(var currentCommandIndex=0,currentPathIndex=startIndex,noMatch={match:!1,pathIndex:0,commandIndex:0};currentPathIndex<segmentGroup.segments.length;){if(currentCommandIndex>=commands.length)return noMatch;var path=segmentGroup.segments[currentPathIndex],curr=getPath(commands[currentCommandIndex]),next=currentCommandIndex<commands.length-1?commands[currentCommandIndex+1]:null;if(currentPathIndex>0&&void 0===curr)break;if(curr&&next&&"object"==typeof next&&void 0===next.outlets){if(!compare(curr,next,path))return noMatch;currentCommandIndex+=2}else{if(!compare(curr,{},path))return noMatch;currentCommandIndex++}currentPathIndex++}return{match:!0,pathIndex:currentPathIndex,commandIndex:currentCommandIndex}}function createNewSegmentGroup(segmentGroup,startIndex,commands){for(var paths=segmentGroup.segments.slice(0,startIndex),i=0;i<commands.length;){if("object"==typeof commands[i]&&void 0!==commands[i].outlets){var children=createNewSegmentChildren(commands[i].outlets);return new UrlSegmentGroup(paths,children)}if(0===i&&isMatrixParams(commands[0])){var p=segmentGroup.segments[startIndex];paths.push(new UrlSegment(p.path,commands[0])),i++}else{var curr=getPath(commands[i]),next=i<commands.length-1?commands[i+1]:null;curr&&next&&isMatrixParams(next)?(paths.push(new UrlSegment(curr,stringify(next))),i+=2):(paths.push(new UrlSegment(curr,{})),i++)}}return new UrlSegmentGroup(paths,{})}function createNewSegmentChildren(outlets){var children={};return forEach(outlets,function(commands,outlet){null!==commands&&(children[outlet]=createNewSegmentGroup(new UrlSegmentGroup([],{}),0,commands))}),children}function stringify(params){var res={};return forEach(params,function(v,k){return res[k]=""+v}),res}function compare(path,params,segment){return path==segment.path&&shallowEqual(params,segment.parameters)}function recognize(rootComponentType,config,urlTree,url){return new Recognizer(rootComponentType,config,urlTree,url).recognize()}function sortActivatedRouteSnapshots(nodes){nodes.sort(function(a,b){return a.value.outlet===PRIMARY_OUTLET?-1:b.value.outlet===PRIMARY_OUTLET?1:a.value.outlet.localeCompare(b.value.outlet)})}function getChildConfig(route){return route.children?route.children:route.loadChildren?route._loadedConfig.routes:[]}function match$1(segmentGroup,route,segments){if(""===route.path){if("full"===route.pathMatch&&(segmentGroup.hasChildren()||segments.length>0))throw new NoMatch$1;return{consumedSegments:[],lastChild:0,parameters:{}}}var matcher=route.matcher||defaultUrlMatcher,res=matcher(segments,segmentGroup,route);if(!res)throw new NoMatch$1;var posParams={};forEach(res.posParams,function(v,k){posParams[k]=v.path});var parameters=merge(posParams,res.consumed[res.consumed.length-1].parameters);return{consumedSegments:res.consumed,lastChild:res.consumed.length,parameters:parameters}}function checkOutletNameUniqueness(nodes){var names={};nodes.forEach(function(n){var routeWithSameOutletName=names[n.value.outlet];if(routeWithSameOutletName){var p=routeWithSameOutletName.url.map(function(s){return s.toString()}).join("/"),c=n.value.url.map(function(s){return s.toString()}).join("/");throw new Error("Two segments cannot have the same outlet name: '"+p+"' and '"+c+"'.")}names[n.value.outlet]=n.value})}function getSourceSegmentGroup(segmentGroup){for(var s=segmentGroup;s._sourceSegment;)s=s._sourceSegment;return s}function getPathIndexShift(segmentGroup){for(var s=segmentGroup,res=s._segmentIndexShift?s._segmentIndexShift:0;s._sourceSegment;)s=s._sourceSegment,res+=s._segmentIndexShift?s._segmentIndexShift:0;return res-1}function split$1(segmentGroup,consumedSegments,slicedSegments,config){if(slicedSegments.length>0&&containsEmptyPathMatchesWithNamedOutlets(segmentGroup,slicedSegments,config)){var s=new UrlSegmentGroup(consumedSegments,createChildrenForEmptyPaths(segmentGroup,consumedSegments,config,new UrlSegmentGroup(slicedSegments,segmentGroup.children)));return s._sourceSegment=segmentGroup,s._segmentIndexShift=consumedSegments.length,{segmentGroup:s,slicedSegments:[]}}if(0===slicedSegments.length&&containsEmptyPathMatches(segmentGroup,slicedSegments,config)){var s=new UrlSegmentGroup(segmentGroup.segments,addEmptyPathsToChildrenIfNeeded(segmentGroup,slicedSegments,config,segmentGroup.children));return s._sourceSegment=segmentGroup,s._segmentIndexShift=consumedSegments.length,{segmentGroup:s,slicedSegments:slicedSegments}}var s=new UrlSegmentGroup(segmentGroup.segments,segmentGroup.children);return s._sourceSegment=segmentGroup,s._segmentIndexShift=consumedSegments.length,{segmentGroup:s,slicedSegments:slicedSegments}}function addEmptyPathsToChildrenIfNeeded(segmentGroup,slicedSegments,routes,children){for(var res={},_i=0,routes_1=routes;_i<routes_1.length;_i++){var r=routes_1[_i];if(emptyPathMatch(segmentGroup,slicedSegments,r)&&!children[getOutlet$2(r)]){var s=new UrlSegmentGroup([],{});s._sourceSegment=segmentGroup,s._segmentIndexShift=segmentGroup.segments.length,res[getOutlet$2(r)]=s}}return merge(children,res)}function createChildrenForEmptyPaths(segmentGroup,consumedSegments,routes,primarySegment){var res={};res[PRIMARY_OUTLET]=primarySegment,primarySegment._sourceSegment=segmentGroup,primarySegment._segmentIndexShift=consumedSegments.length;for(var _i=0,routes_2=routes;_i<routes_2.length;_i++){var r=routes_2[_i];if(""===r.path&&getOutlet$2(r)!==PRIMARY_OUTLET){var s=new UrlSegmentGroup([],{});s._sourceSegment=segmentGroup,s._segmentIndexShift=consumedSegments.length,res[getOutlet$2(r)]=s}}return res}function containsEmptyPathMatchesWithNamedOutlets(segmentGroup,slicedSegments,routes){return routes.filter(function(r){return emptyPathMatch(segmentGroup,slicedSegments,r)&&getOutlet$2(r)!==PRIMARY_OUTLET}).length>0}function containsEmptyPathMatches(segmentGroup,slicedSegments,routes){return routes.filter(function(r){return emptyPathMatch(segmentGroup,slicedSegments,r)}).length>0}function emptyPathMatch(segmentGroup,slicedSegments,r){return(!(segmentGroup.hasChildren()||slicedSegments.length>0)||"full"!==r.pathMatch)&&(""===r.path&&void 0===r.redirectTo);
}function getOutlet$2(route){return route.outlet?route.outlet:PRIMARY_OUTLET}function getData(route){return route.data?route.data:{}}function getResolve(route){return route.resolve?route.resolve:{}}function defaultErrorHandler(error){throw error}function advanceActivatedRouteNodeAndItsChildren(node){advanceActivatedRoute(node.value),node.children.forEach(advanceActivatedRouteNodeAndItsChildren)}function parentLoadedConfig(snapshot){for(var s=snapshot.parent;s;){var c=s._routeConfig;if(c&&c._loadedConfig)return c._loadedConfig;if(c&&c.component)return null;s=s.parent}return null}function closestLoadedConfig(snapshot){if(!snapshot)return null;for(var s=snapshot.parent;s;){var c=s._routeConfig;if(c&&c._loadedConfig)return c._loadedConfig;s=s.parent}return null}function nodeChildrenAsMap(node){return node?node.children.reduce(function(m,c){return m[c.value.outlet]=c,m},{}):{}}function getOutlet(outletMap,route){var outlet=outletMap._outlets[route.outlet];if(!outlet){var componentName=route.component.name;throw route.outlet===PRIMARY_OUTLET?new Error("Cannot find primary outlet to load '"+componentName+"'"):new Error("Cannot find the outlet "+route.outlet+" to load '"+componentName+"'")}return outlet}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,outletMap,location,injector,loader,compiler,config,opts,urlHandlingStrategy,routeReuseStrategy){void 0===opts&&(opts={});var router=new Router(null,urlSerializer,outletMap,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=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 router}function rootRoute(router){return router.routerState.root}function initialRouterNavigation(router,ref,preloader,opts){return function(bootstrappedComponentRef){bootstrappedComponentRef===ref.components[0]&&(router.resetRootComponentType(ref.componentTypes[0]),preloader.setUpPreloading(),opts.initialNavigation===!1?router.setUpLocationChangeListener():router.initialNavigation())}}function provideRouterInitializer(){return[{provide:ROUTER_INITIALIZER,useFactory:initialRouterNavigation,deps:[Router,_angular_core.ApplicationRef,RouterPreloader,ROUTER_CONFIGURATION]},{provide:_angular_core.APP_BOOTSTRAP_LISTENER,multi:!0,useExisting:ROUTER_INITIALIZER}]}/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},PRIMARY_OUTLET="primary",NavigationCancelingError=function(_super){function NavigationCancelingError(message){_super.call(this,message),this.message=message,this.stack=new Error(message).stack}return __extends(NavigationCancelingError,_super),NavigationCancelingError.prototype.toString=function(){return this.message},NavigationCancelingError}(Error),ROUTES=new _angular_core.OpaqueToken("ROUTES"),LoadedRouterConfig=function(){function LoadedRouterConfig(routes,injector,factoryResolver,injectorFactory){this.routes=routes,this.injector=injector,this.factoryResolver=factoryResolver,this.injectorFactory=injectorFactory}return LoadedRouterConfig}(),RouterConfigLoader=function(){function RouterConfigLoader(loader,compiler){this.loader=loader,this.compiler=compiler}return RouterConfigLoader.prototype.load=function(parentInjector,loadChildren){return rxjs_operator_map.map.call(this.loadModuleFactory(loadChildren),function(r){var ref=r.create(parentInjector),injectorFactory=function(parent){return r.create(parent).injector};return new LoadedRouterConfig(flatten(ref.injector.get(ROUTES)),ref.injector,ref.componentFactoryResolver,injectorFactory)})},RouterConfigLoader.prototype.loadModuleFactory=function(loadChildren){var _this=this;if("string"==typeof loadChildren)return rxjs_observable_fromPromise.fromPromise(this.loader.load(loadChildren));var offlineMode_1=this.compiler instanceof _angular_core.Compiler;return rxjs_operator_mergeMap.mergeMap.call(wrapIntoObservable(loadChildren()),function(t){return offlineMode_1?rxjs_observable_of.of(t):rxjs_observable_fromPromise.fromPromise(_this.compiler.compileModuleAsync(t))})},RouterConfigLoader}(),UrlTree=function(){function UrlTree(root,queryParams,fragment){this.root=root,this.queryParams=queryParams,this.fragment=fragment}return UrlTree.prototype.toString=function(){return(new DefaultUrlSerializer).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 UrlSegment.prototype.toString=function(){return serializePath(this)},UrlSegment}(),UrlSerializer=function(){function UrlSerializer(){}return UrlSerializer.prototype.parse=function(url){},UrlSerializer.prototype.serialize=function(tree){},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){var segment="/"+serializeSegment(tree.root,!0),query=serializeQueryParams(tree.queryParams),fragment=null!==tree.fragment&&void 0!==tree.fragment?"#"+encodeURI(tree.fragment):"";return""+segment+query+fragment},DefaultUrlSerializer}(),Pair=function(){function Pair(first,second){this.first=first,this.second=second}return Pair}(),SEGMENT_RE=/^[^\/()?;=&#]+/,QUERY_PARAM_RE=/^[^=?&#]+/,QUERY_PARAM_VALUE_RE=/^[^?&#]+/,UrlParser=function(){function UrlParser(url){this.url=url,this.remaining=url}return UrlParser.prototype.peekStartsWith=function(str){return this.remaining.startsWith(str)},UrlParser.prototype.capture=function(str){if(!this.remaining.startsWith(str))throw new Error('Expected "'+str+'".');this.remaining=this.remaining.substring(str.length)},UrlParser.prototype.parseRootSegment=function(){return this.remaining.startsWith("/")&&this.capture("/"),""===this.remaining||this.remaining.startsWith("?")||this.remaining.startsWith("#")?new UrlSegmentGroup([],{}):new UrlSegmentGroup([],this.parseChildren())},UrlParser.prototype.parseChildren=function(){if(0==this.remaining.length)return{};this.peekStartsWith("/")&&this.capture("/");var paths=[];for(this.peekStartsWith("(")||paths.push(this.parseSegments());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),paths.push(this.parseSegments());var children={};this.peekStartsWith("/(")&&(this.capture("/"),children=this.parseParens(!0));var res={};return this.peekStartsWith("(")&&(res=this.parseParens(!1)),(paths.length>0||Object.keys(children).length>0)&&(res[PRIMARY_OUTLET]=new UrlSegmentGroup(paths,children)),res},UrlParser.prototype.parseSegments=function(){var path=matchSegments(this.remaining);if(""===path&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");this.capture(path);var matrixParams={};return this.peekStartsWith(";")&&(matrixParams=this.parseMatrixParams()),new UrlSegment(decode(path),matrixParams)},UrlParser.prototype.parseQueryParams=function(){var params={};if(this.peekStartsWith("?"))for(this.capture("?"),this.parseQueryParam(params);this.remaining.length>0&&this.peekStartsWith("&");)this.capture("&"),this.parseQueryParam(params);return params},UrlParser.prototype.parseFragment=function(){return this.peekStartsWith("#")?decodeURI(this.remaining.substring(1)):null},UrlParser.prototype.parseMatrixParams=function(){for(var params={};this.remaining.length>0&&this.peekStartsWith(";");)this.capture(";"),this.parseParam(params);return params},UrlParser.prototype.parseParam=function(params){var key=matchSegments(this.remaining);if(key){this.capture(key);var value="";if(this.peekStartsWith("=")){this.capture("=");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.peekStartsWith("=")){this.capture("=");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.peekStartsWith(")")&&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.peekStartsWith("//")&&this.capture("//")}return this.capture(")"),segments},UrlParser}(),NoMatch=function(){function NoMatch(segmentGroup){void 0===segmentGroup&&(segmentGroup=null),this.segmentGroup=segmentGroup}return NoMatch}(),AbsoluteRedirect=function(){function AbsoluteRedirect(urlTree){this.urlTree=urlTree}return AbsoluteRedirect}(),ApplyRedirects=function(){function ApplyRedirects(injector,configLoader,urlSerializer,urlTree,config){this.injector=injector,this.configLoader=configLoader,this.urlSerializer=urlSerializer,this.urlTree=urlTree,this.config=config,this.allowRedirects=!0}return ApplyRedirects.prototype.apply=function(){var _this=this,expanded$=this.expandSegmentGroup(this.injector,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);throw e instanceof NoMatch?_this.noMatchError(e):e})},ApplyRedirects.prototype.match=function(tree){var _this=this,expanded$=this.expandSegmentGroup(this.injector,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){throw e instanceof NoMatch?_this.noMatchError(e):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(injector,routes,segmentGroup,outlet){return 0===segmentGroup.segments.length&&segmentGroup.hasChildren()?rxjs_operator_map.map.call(this.expandChildren(injector,routes,segmentGroup),function(children){return new UrlSegmentGroup([],children)}):this.expandSegment(injector,segmentGroup,routes,segmentGroup.segments,outlet,!0)},ApplyRedirects.prototype.expandChildren=function(injector,routes,segmentGroup){var _this=this;return waitForMap(segmentGroup.children,function(childOutlet,child){return _this.expandSegmentGroup(injector,routes,child,childOutlet)})},ApplyRedirects.prototype.expandSegment=function(injector,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(injector,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){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(injector,segmentGroup,routes,route,paths,outlet,allowRedirects){return getOutlet$1(route)!==outlet?noMatch(segmentGroup):void 0===route.redirectTo||allowRedirects&&this.allowRedirects?void 0===route.redirectTo?this.matchSegmentAgainstRoute(injector,segmentGroup,route,paths):this.expandSegmentAgainstRouteUsingRedirect(injector,segmentGroup,routes,route,paths,outlet):noMatch(segmentGroup)},ApplyRedirects.prototype.expandSegmentAgainstRouteUsingRedirect=function(injector,segmentGroup,routes,route,segments,outlet){return"**"===route.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(injector,routes,route,outlet):this.expandRegularSegmentAgainstRouteUsingRedirect(injector,segmentGroup,routes,route,segments,outlet)},ApplyRedirects.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(injector,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(injector,group,routes,newSegments,outlet,!1)})},ApplyRedirects.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(injector,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(injector,segmentGroup,routes,newSegments.concat(segments.slice(lastChild)),outlet,!1)})},ApplyRedirects.prototype.matchSegmentAgainstRoute=function(injector,rawSegmentGroup,route,segments){var _this=this;if("**"===route.path)return route.loadChildren?rxjs_operator_map.map.call(this.configLoader.load(injector,route.loadChildren),function(r){return route._loadedConfig=r,new UrlSegmentGroup(segments,{})}):rxjs_observable_of.of(new UrlSegmentGroup(segments,{}));var _a=match(rawSegmentGroup,route,segments),matched=_a.matched,consumedSegments_1=_a.consumedSegments,lastChild=_a.lastChild;if(!matched)return noMatch(rawSegmentGroup);var rawSlicedSegments_1=segments.slice(lastChild),childConfig$=this.getChildConfig(injector,route);return rxjs_operator_mergeMap.mergeMap.call(childConfig$,function(routerConfig){var childInjector=routerConfig.injector,childConfig=routerConfig.routes,_a=split(rawSegmentGroup,consumedSegments_1,rawSlicedSegments_1,childConfig),segmentGroup=_a.segmentGroup,slicedSegments=_a.slicedSegments;if(0===slicedSegments.length&&segmentGroup.hasChildren()){var expanded$=_this.expandChildren(childInjector,childConfig,segmentGroup);return rxjs_operator_map.map.call(expanded$,function(children){return new UrlSegmentGroup(consumedSegments_1,children)})}if(0===childConfig.length&&0===slicedSegments.length)return rxjs_observable_of.of(new UrlSegmentGroup(consumedSegments_1,{}));var expanded$=_this.expandSegment(childInjector,segmentGroup,childConfig,slicedSegments,PRIMARY_OUTLET,!0);return rxjs_operator_map.map.call(expanded$,function(cs){return new UrlSegmentGroup(consumedSegments_1.concat(cs.segments),cs.children)})})},ApplyRedirects.prototype.getChildConfig=function(injector,route){var _this=this;return route.children?rxjs_observable_of.of(new LoadedRouterConfig(route.children,injector,null,null)):route.loadChildren?rxjs_operator_mergeMap.mergeMap.call(runGuards(injector,route),function(shouldLoad){return shouldLoad?route._loadedConfig?rxjs_observable_of.of(route._loadedConfig):rxjs_operator_map.map.call(_this.configLoader.load(injector,route.loadChildren),function(r){return route._loadedConfig=r,r}):canLoadFails(route)}):rxjs_observable_of.of(new LoadedRouterConfig([],injector,null,null))},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){this.urlSerializer.parse(redirectTo);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){v.startsWith(":")?res[k]=actualParams[v.substring(1)]: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,[]);if(p.length<2)return[];var c=p[p.length-2].children.map(function(c){return c.value});return c.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}(),__extends$1=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},RouterState=function(_super){function RouterState(root,snapshot){_super.call(this,root),this.snapshot=snapshot,setRouterStateSnapshot(this,root)}return __extends$1(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}),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,"routeConfig",{get:function(){return this._routeConfig},enumerable:!0,configurable:!0}),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}),ActivatedRouteSnapshot.prototype.toString=function(){var url=this.url.map(function(segment){return segment.toString()}).join("/"),matched=this._routeConfig?this._routeConfig.path:"";return"Route(url:'"+url+"', path:'"+matched+"')"},ActivatedRouteSnapshot}(),RouterStateSnapshot=function(_super){function RouterStateSnapshot(url,root){_super.call(this,root),this.url=url,setRouterStateSnapshot(this,root)}return __extends$1(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(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}(),NoMatch$1=function(){function NoMatch(){}return NoMatch}(),Recognizer=function(){function Recognizer(rootComponentType,config,urlTree,url){this.rootComponentType=rootComponentType,this.config=config,this.urlTree=urlTree,this.url=url}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.inheriteParamsAndData(routeState._root),rxjs_observable_of.of(routeState)}catch(e){return new rxjs_Observable.Observable(function(obs){return obs.error(e)})}},Recognizer.prototype.inheriteParamsAndData=function(routeNode){var _this=this,route=routeNode.value,i=inheritedParamsDataResolve(route);route.params=Object.freeze(i.params),route.data=Object.freeze(i.data),routeNode.children.forEach(function(n){return _this.inheriteParamsAndData(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?route.outlet:PRIMARY_OUTLET)!==outlet)throw new NoMatch$1;if("**"===route.path){var params=segments.length>0?last(segments).parameters:{},snapshot_1=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));return[new TreeNode(snapshot_1,[])]}var _a=match$1(rawSegment,route,segments),consumedSegments=_a.consumedSegments,parameters=_a.parameters,lastChild=_a.lastChild,rawSlicedSegments=segments.slice(lastChild),childConfig=getChildConfig(route),_b=split$1(rawSegment,consumedSegments,rawSlicedSegments,childConfig),segmentGroup=_b.segmentGroup,slicedSegments=_b.slicedSegments,snapshot=new ActivatedRouteSnapshot(consumedSegments,parameters,Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,getData(route),outlet,route.component,route,getSourceSegmentGroup(rawSegment),getPathIndexShift(rawSegment)+consumedSegments.length,getResolve(route));if(0===slicedSegments.length&&segmentGroup.hasChildren()){var children=this.processChildren(childConfig,segmentGroup);return[new TreeNode(snapshot,children)]}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}(),RouterOutletMap=function(){function RouterOutletMap(){this._outlets={}}return RouterOutletMap.prototype.registerOutlet=function(name,outlet){this._outlets[name]=outlet},RouterOutletMap.prototype.removeOutlet=function(name){this._outlets[name]=void 0},RouterOutletMap}(),UrlHandlingStrategy=function(){function UrlHandlingStrategy(){}return UrlHandlingStrategy.prototype.shouldProcessUrl=function(url){},UrlHandlingStrategy.prototype.extract=function(url){},UrlHandlingStrategy.prototype.merge=function(newUrlPart,rawUrl){},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}(),NavigationStart=function(){function NavigationStart(id,url){this.id=id,this.url=url}return NavigationStart.prototype.toString=function(){return"NavigationStart(id: "+this.id+", url: '"+this.url+"')"},NavigationStart}(),NavigationEnd=function(){function NavigationEnd(id,url,urlAfterRedirects){this.id=id,this.url=url,this.urlAfterRedirects=urlAfterRedirects}return NavigationEnd.prototype.toString=function(){return"NavigationEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"')"},NavigationEnd}(),NavigationCancel=function(){function NavigationCancel(id,url,reason){this.id=id,this.url=url,this.reason=reason}return NavigationCancel.prototype.toString=function(){return"NavigationCancel(id: "+this.id+", url: '"+this.url+"')"},NavigationCancel}(),NavigationError=function(){function NavigationError(id,url,error){this.id=id,this.url=url,this.error=error}return NavigationError.prototype.toString=function(){return"NavigationError(id: "+this.id+", url: '"+this.url+"', error: "+this.error+")"},NavigationError}(),RoutesRecognized=function(){function RoutesRecognized(id,url,urlAfterRedirects,state){this.id=id,this.url=url,this.urlAfterRedirects=urlAfterRedirects,this.state=state}return RoutesRecognized.prototype.toString=function(){return"RoutesRecognized(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},RoutesRecognized}(),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}(),Router=function(){function Router(rootComponentType,urlSerializer,outletMap,location,injector,loader,compiler,config){this.rootComponentType=rootComponentType,this.urlSerializer=urlSerializer,this.outletMap=outletMap,this.location=location,this.injector=injector,this.config=config,this.navigations=new rxjs_BehaviorSubject.BehaviorSubject(null),this.routerEvents=new rxjs_Subject.Subject,this.navigationId=0,this.errorHandler=defaultErrorHandler,this.navigated=!1,this.urlHandlingStrategy=new DefaultUrlHandlingStrategy,this.routeReuseStrategy=new DefaultRouteReuseStrategy,this.resetConfig(config),this.currentUrlTree=createEmptyUrlTree(),this.rawUrlTree=this.currentUrlTree,this.configLoader=new RouterConfigLoader(loader,compiler),this.currentRouterState=createEmptyState(this.currentUrlTree,this.rootComponentType),this.processNavigations()}return Router.prototype.resetRootComponentType=function(rootComponentType){this.rootComponentType=rootComponentType,this.currentRouterState.root.component=this.rootComponentType},Router.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),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,"routerState",{get:function(){return this.currentRouterState},enumerable:!0,configurable:!0}),Object.defineProperty(Router.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),Object.defineProperty(Router.prototype,"events",{get:function(){return this.routerEvents},enumerable:!0,configurable:!0}),Router.prototype.resetConfig=function(config){validateConfig(config),this.config=config},Router.prototype.ngOnDestroy=function(){this.dispose()},Router.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)},Router.prototype.createUrlTree=function(commands,_a){var _b=void 0===_a?{}:_a,relativeTo=_b.relativeTo,queryParams=_b.queryParams,fragment=_b.fragment,preserveQueryParams=_b.preserveQueryParams,preserveFragment=_b.preserveFragment,a=relativeTo||this.routerState.root,q=preserveQueryParams?this.currentUrlTree.queryParams:queryParams,f=preserveFragment?this.currentUrlTree.fragment:fragment;
return createUrlTree(a,this.currentUrlTree,commands,q,f)},Router.prototype.navigateByUrl=function(url,extras){if(void 0===extras&&(extras={skipLocationChange:!1}),url instanceof UrlTree)return this.scheduleNavigation(this.urlHandlingStrategy.merge(url,this.rawUrlTree),"imperative",extras);var urlTree=this.urlSerializer.parse(url);return this.scheduleNavigation(this.urlHandlingStrategy.merge(urlTree,this.rawUrlTree),"imperative",extras)},Router.prototype.navigate=function(commands,extras){return void 0===extras&&(extras={skipLocationChange:!1}),validateCommands(commands),"object"==typeof extras.queryParams&&null!==extras.queryParams&&(extras.queryParams=this.removeEmptyProps(extras.queryParams)),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 null;if(lastNavigation&&"hashchange"==source&&"popstate"===lastNavigation.source&&lastNavigation.rawUrl.toString()===rawUrl.toString())return null;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();urlTransition&&this.urlHandlingStrategy.shouldProcessUrl(rawUrl)?(this.routerEvents.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.routerEvents.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,shouldPreventPushState,shouldReplaceUrl,id,precreatedState){var _this=this;return id!==this.navigationId?(this.location.go(this.urlSerializer.serialize(this.currentUrlTree)),this.routerEvents.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 redirectsApplied$=applyRedirects(_this.injector,_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)),function(snapshot){return _this.routerEvents.next(new RoutesRecognized(id,_this.serializeUrl(url),_this.serializeUrl(appliedUrl),snapshot)),{appliedUrl:appliedUrl,snapshot:snapshot}})})}var preActivation,navigationIsSuccessful,preactivationTraverse$=rxjs_operator_map.map.call(urlAndSnapshot$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot;return preActivation=new PreActivation(snapshot,_this.currentRouterState.snapshot,_this.injector),preActivation.traverse(_this.outletMap),{appliedUrl:appliedUrl,snapshot:snapshot}}),preactivationCheckGuards=rxjs_operator_mergeMap.mergeMap.call(preactivationTraverse$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot;return _this.navigationId!==id?rxjs_observable_of.of(!1):rxjs_operator_map.map.call(preActivation.checkGuards(),function(shouldActivate){return{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?rxjs_operator_map.map.call(preActivation.resolveData(),function(){return p}):rxjs_observable_of.of(p)}),routerState$=rxjs_operator_map.map.call(preactivationResolveData$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot,shouldActivate=_a.shouldActivate;if(shouldActivate){var state=createRouterState(_this.routeReuseStrategy,snapshot,_this.currentRouterState);return{appliedUrl:appliedUrl,state:state,shouldActivate:shouldActivate}}return{appliedUrl:appliedUrl,state:null,shouldActivate:shouldActivate}}),storedState=_this.currentRouterState,storedUrl=_this.currentUrlTree;routerState$.forEach(function(_a){var appliedUrl=_a.appliedUrl,state=_a.state,shouldActivate=_a.shouldActivate;if(!shouldActivate||id!==_this.navigationId)return void(navigationIsSuccessful=!1);if(_this.currentUrlTree=appliedUrl,_this.rawUrlTree=_this.urlHandlingStrategy.merge(_this.currentUrlTree,rawUrl),_this.currentRouterState=state,!shouldPreventPushState){var path=_this.urlSerializer.serialize(_this.rawUrlTree);_this.location.isCurrentPathEqualTo(path)||shouldReplaceUrl?_this.location.replaceState(path):_this.location.go(path)}new ActivateRoutes(_this.routeReuseStrategy,state,storedState).activate(_this.outletMap),navigationIsSuccessful=!0}).then(function(){_this.navigated=!0,navigationIsSuccessful?(_this.routerEvents.next(new NavigationEnd(id,_this.serializeUrl(url),_this.serializeUrl(_this.currentUrlTree))),resolvePromise(!0)):(_this.resetUrlToCurrentUrlTree(),_this.routerEvents.next(new NavigationCancel(id,_this.serializeUrl(url),"")),resolvePromise(!1))},function(e){if(e instanceof NavigationCancelingError)_this.resetUrlToCurrentUrlTree(),_this.navigated=!0,_this.routerEvents.next(new NavigationCancel(id,_this.serializeUrl(url),e.message)),resolvePromise(!1);else{_this.routerEvents.next(new NavigationError(id,_this.serializeUrl(url),e));try{resolvePromise(_this.errorHandler(e))}catch(ee){rejectPromise(ee)}}_this.currentRouterState=storedState,_this.currentUrlTree=storedUrl,_this.rawUrlTree=_this.urlHandlingStrategy.merge(_this.currentUrlTree,rawUrl),_this.location.replaceState(_this.serializeUrl(_this.rawUrlTree))})})},Router.prototype.resetUrlToCurrentUrlTree=function(){var path=this.urlSerializer.serialize(this.rawUrlTree);this.location.replaceState(path)},Router}(),CanActivate=function(){function CanActivate(path){this.path=path}return Object.defineProperty(CanActivate.prototype,"route",{get:function(){return this.path[this.path.length-1]},enumerable:!0,configurable:!0}),CanActivate}(),CanDeactivate=function(){function CanDeactivate(component,route){this.component=component,this.route=route}return CanDeactivate}(),PreActivation=function(){function PreActivation(future,curr,injector){this.future=future,this.curr=curr,this.injector=injector,this.checks=[]}return PreActivation.prototype.traverse=function(parentOutletMap){var futureRoot=this.future._root,currRoot=this.curr?this.curr._root:null;this.traverseChildRoutes(futureRoot,currRoot,parentOutletMap,[futureRoot.value])},PreActivation.prototype.checkGuards=function(){var _this=this;if(0===this.checks.length)return rxjs_observable_of.of(!0);var checks$=rxjs_observable_from.from(this.checks),runningChecks$=rxjs_operator_mergeMap.mergeMap.call(checks$,function(s){if(s instanceof CanActivate)return andObservables(rxjs_observable_from.from([_this.runCanActivateChild(s.path),_this.runCanActivate(s.route)]));if(s instanceof CanDeactivate){var s2=s;return _this.runCanDeactivate(s2.component,s2.route)}throw new Error("Cannot be reached")});return rxjs_operator_every.every.call(runningChecks$,function(result){return result===!0})},PreActivation.prototype.resolveData=function(){var _this=this;if(0===this.checks.length)return rxjs_observable_of.of(null);var checks$=rxjs_observable_from.from(this.checks),runningChecks$=rxjs_operator_concatMap.concatMap.call(checks$,function(s){return s instanceof CanActivate?_this.runResolve(s.route):rxjs_observable_of.of(null)});return rxjs_operator_reduce.reduce.call(runningChecks$,function(_,__){return _})},PreActivation.prototype.traverseChildRoutes=function(futureNode,currNode,outletMap,futurePath){var _this=this,prevChildren=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(c){_this.traverseRoutes(c,prevChildren[c.value.outlet],outletMap,futurePath.concat([c.value])),delete prevChildren[c.value.outlet]}),forEach(prevChildren,function(v,k){return _this.deactiveRouteAndItsChildren(v,outletMap._outlets[k])})},PreActivation.prototype.traverseRoutes=function(futureNode,currNode,parentOutletMap,futurePath){var future=futureNode.value,curr=currNode?currNode.value:null,outlet=parentOutletMap?parentOutletMap._outlets[futureNode.value.outlet]:null;curr&&future._routeConfig===curr._routeConfig?(equalParamsAndUrlSegments(future,curr)?(future.data=curr.data,future._resolvedData=curr._resolvedData):this.checks.push(new CanDeactivate(outlet.component,curr),new CanActivate(futurePath)),future.component?this.traverseChildRoutes(futureNode,currNode,outlet?outlet.outletMap:null,futurePath):this.traverseChildRoutes(futureNode,currNode,parentOutletMap,futurePath)):(curr&&this.deactiveRouteAndItsChildren(currNode,outlet),this.checks.push(new CanActivate(futurePath)),future.component?this.traverseChildRoutes(futureNode,null,outlet?outlet.outletMap:null,futurePath):this.traverseChildRoutes(futureNode,null,parentOutletMap,futurePath))},PreActivation.prototype.deactiveRouteAndItsChildren=function(route,outlet){var _this=this,prevChildren=nodeChildrenAsMap(route),r=route.value;forEach(prevChildren,function(v,k){r.component?outlet?_this.deactiveRouteAndItsChildren(v,outlet.outletMap._outlets[k]):_this.deactiveRouteAndItsChildren(v,null):_this.deactiveRouteAndItsChildren(v,outlet)}),r.component&&outlet&&outlet.isActivated?this.checks.push(new CanDeactivate(outlet.component,r)):this.checks.push(new CanDeactivate(null,r))},PreActivation.prototype.runCanActivate=function(future){var _this=this,canActivate=future._routeConfig?future._routeConfig.canActivate:null;if(!canActivate||0===canActivate.length)return rxjs_observable_of.of(!0);var obs=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)});return andObservables(obs)},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){var obs=rxjs_operator_map.map.call(rxjs_observable_from.from(d.guards),function(c){var observable,guard=_this.getToken(c,c.node);return observable=wrapIntoObservable(guard.canActivateChild?guard.canActivateChild(future,_this.future):guard(future,_this.future)),rxjs_operator_first.first.call(observable)});return andObservables(obs)}))},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):guard(component,curr,_this.curr)),rxjs_operator_first.first.call(observable)});return rxjs_operator_every.every.call(canDeactivate$,function(result){return result===!0})},PreActivation.prototype.runResolve=function(future){var resolve=future._resolve;return rxjs_operator_map.map.call(this.resolveNode(resolve,future),function(resolvedData){return future._resolvedData=resolvedData,future.data=merge(future.data,inheritedParamsDataResolve(future).resolve),null})},PreActivation.prototype.resolveNode=function(resolve,future){var _this=this;return waitForMap(resolve,function(k,v){var resolver=_this.getToken(v,future);return wrapIntoObservable(resolver.resolve?resolver.resolve(future,_this.future):resolver(future,_this.future))})},PreActivation.prototype.getToken=function(token,snapshot){var config=closestLoadedConfig(snapshot),injector=config?config.injector:this.injector;return injector.get(token)},PreActivation}(),ActivateRoutes=function(){function ActivateRoutes(routeReuseStrategy,futureState,currState){this.routeReuseStrategy=routeReuseStrategy,this.futureState=futureState,this.currState=currState}return ActivateRoutes.prototype.activate=function(parentOutletMap){var futureRoot=this.futureState._root,currRoot=this.currState?this.currState._root:null;this.deactivateChildRoutes(futureRoot,currRoot,parentOutletMap),advanceActivatedRoute(this.futureState.root),this.activateChildRoutes(futureRoot,currRoot,parentOutletMap)},ActivateRoutes.prototype.deactivateChildRoutes=function(futureNode,currNode,outletMap){var _this=this,prevChildren=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(c){_this.deactivateRoutes(c,prevChildren[c.value.outlet],outletMap),delete prevChildren[c.value.outlet]}),forEach(prevChildren,function(v,k){return _this.deactiveRouteAndItsChildren(v,outletMap)})},ActivateRoutes.prototype.activateChildRoutes=function(futureNode,currNode,outletMap){var _this=this,prevChildren=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(c){_this.activateRoutes(c,prevChildren[c.value.outlet],outletMap)})},ActivateRoutes.prototype.deactivateRoutes=function(futureNode,currNode,parentOutletMap){var future=futureNode.value,curr=currNode?currNode.value:null;if(future===curr)if(future.component){var outlet=getOutlet(parentOutletMap,future);this.deactivateChildRoutes(futureNode,currNode,outlet.outletMap)}else this.deactivateChildRoutes(futureNode,currNode,parentOutletMap);else curr&&this.deactiveRouteAndItsChildren(currNode,parentOutletMap)},ActivateRoutes.prototype.activateRoutes=function(futureNode,currNode,parentOutletMap){var future=futureNode.value,curr=currNode?currNode.value:null;if(future===curr)if(advanceActivatedRoute(future),future.component){var outlet=getOutlet(parentOutletMap,future);this.activateChildRoutes(futureNode,currNode,outlet.outletMap)}else this.activateChildRoutes(futureNode,currNode,parentOutletMap);else if(future.component){advanceActivatedRoute(future);var outlet=getOutlet(parentOutletMap,futureNode.value);if(this.routeReuseStrategy.shouldAttach(future.snapshot)){var stored=this.routeReuseStrategy.retrieve(future.snapshot);this.routeReuseStrategy.store(future.snapshot,null),outlet.attach(stored.componentRef,stored.route.value),advanceActivatedRouteNodeAndItsChildren(stored.route)}else{var outletMap=new RouterOutletMap;this.placeComponentIntoOutlet(outletMap,future,outlet),this.activateChildRoutes(futureNode,null,outletMap)}}else advanceActivatedRoute(future),this.activateChildRoutes(futureNode,null,parentOutletMap)},ActivateRoutes.prototype.placeComponentIntoOutlet=function(outletMap,future,outlet){var resolved=[{provide:ActivatedRoute,useValue:future},{provide:RouterOutletMap,useValue:outletMap}],config=parentLoadedConfig(future.snapshot),resolver=null,injector=null;config?(injector=config.injectorFactory(outlet.locationInjector),resolver=config.factoryResolver,resolved.push({provide:_angular_core.ComponentFactoryResolver,useValue:resolver})):(injector=outlet.locationInjector,resolver=outlet.locationFactoryResolver),outlet.activate(future,resolver,injector,_angular_core.ReflectiveInjector.resolve(resolved),outletMap)},ActivateRoutes.prototype.deactiveRouteAndItsChildren=function(route,parentOutletMap){this.routeReuseStrategy.shouldDetach(route.value.snapshot)?this.detachAndStoreRouteSubtree(route,parentOutletMap):this.deactiveRouteAndOutlet(route,parentOutletMap)},ActivateRoutes.prototype.detachAndStoreRouteSubtree=function(route,parentOutletMap){var outlet=getOutlet(parentOutletMap,route.value),componentRef=outlet.detach();this.routeReuseStrategy.store(route.value.snapshot,{componentRef:componentRef,route:route})},ActivateRoutes.prototype.deactiveRouteAndOutlet=function(route,parentOutletMap){var _this=this,prevChildren=nodeChildrenAsMap(route),outlet=null;try{outlet=getOutlet(parentOutletMap,route.value)}catch(e){return}var childOutletMap=outlet.outletMap;forEach(prevChildren,function(v,k){route.value.component?_this.deactiveRouteAndItsChildren(v,childOutletMap):_this.deactiveRouteAndItsChildren(v,parentOutletMap)}),outlet&&outlet.isActivated&&outlet.deactivate()},ActivateRoutes}(),RouterLink=function(){function RouterLink(router,route){this.router=router,this.route=route,this.commands=[]}return Object.defineProperty(RouterLink.prototype,"routerLink",{set:function(commands){null!=commands?this.commands=Array.isArray(commands)?commands:[commands]:this.commands=[]},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.preserveQueryParams),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}]},RouterLink.propDecorators={queryParams:[{type:_angular_core.Input}],fragment:[{type:_angular_core.Input}],preserveQueryParams:[{type:_angular_core.Input}],preserveFragment:[{type:_angular_core.Input}],skipLocationChange:[{type:_angular_core.Input}],replaceUrl:[{type:_angular_core.Input}],routerLink:[{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){null!=commands?this.commands=Array.isArray(commands)?commands:[commands]:this.commands=[]},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){if(0!==button||ctrlKey||metaKey)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.preserveQueryParams),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}],preserveQueryParams:[{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}],onClick:[{type:_angular_core.HostListener,args:["click",["$event.button","$event.ctrlKey","$event.metaKey"]]}]},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.active=!1,this.routerLinkActiveOptions={exact:!1},this.subscription=router.events.subscribe(function(s){s instanceof NavigationEnd&&_this.update()})}return Object.defineProperty(RouterLinkActive.prototype,"isActive",{get:function(){return this.active},enumerable:!0,configurable:!0}),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;if(this.links&&this.linksWithHrefs&&this.router.navigated){var hasActiveLinks=this.hasActiveLinks();this.active!==hasActiveLinks&&(this.active=hasActiveLinks,this.classes.forEach(function(c){return _this.renderer.setElementClass(_this.element.nativeElement,c,hasActiveLinks)}),this.cdr.detectChanges())}},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.Renderer},{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}(),RouterOutlet=function(){function RouterOutlet(parentOutletMap,location,resolver,name){this.parentOutletMap=parentOutletMap,this.location=location,this.resolver=resolver,this.name=name,this.activateEvents=new _angular_core.EventEmitter,this.deactivateEvents=new _angular_core.EventEmitter,parentOutletMap.registerOutlet(name?name:PRIMARY_OUTLET,this)}return RouterOutlet.prototype.ngOnDestroy=function(){this.parentOutletMap.removeOutlet(this.name?this.name:PRIMARY_OUTLET)},Object.defineProperty(RouterOutlet.prototype,"locationInjector",{get:function(){return this.location.injector},enumerable:!0,configurable:!0}),Object.defineProperty(RouterOutlet.prototype,"locationFactoryResolver",{get:function(){return this.resolver},enumerable:!0,configurable:!0}),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}),RouterOutlet.prototype.detach=function(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();var r=this.activated;return this.activated=null,this._activatedRoute=null,r},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.activate=function(activatedRoute,resolver,injector,providers,outletMap){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this.outletMap=outletMap,this._activatedRoute=activatedRoute;var snapshot=activatedRoute._futureSnapshot,component=snapshot._routeConfig.component,factory=resolver.resolveComponentFactory(component),inj=_angular_core.ReflectiveInjector.fromResolvedProviders(providers,injector);this.activated=this.location.createComponent(factory,this.location.length,inj,[]),this.activated.changeDetectorRef.detectChanges(),this.activateEvents.emit(this.activated.instance)},RouterOutlet.decorators=[{type:_angular_core.Directive,args:[{selector:"router-outlet"}]}],RouterOutlet.ctorParameters=function(){return[{type:RouterOutletMap},{type:_angular_core.ViewContainerRef},{type:_angular_core.ComponentFactoryResolver},{type:void 0,decorators:[{type:_angular_core.Attribute,args:["name"]}]}]},RouterOutlet.propDecorators={activateEvents:[{type:_angular_core.Output,args:["activate"]}],deactivateEvents:[{type:_angular_core.Output,args:["deactivate"]}]},RouterOutlet}(),RouteReuseStrategy=function(){function RouteReuseStrategy(){}return RouteReuseStrategy.prototype.shouldDetach=function(route){},RouteReuseStrategy.prototype.store=function(route,handle){},RouteReuseStrategy.prototype.shouldAttach=function(route){},RouteReuseStrategy.prototype.retrieve=function(route){},RouteReuseStrategy.prototype.shouldReuseRoute=function(future,curr){},RouteReuseStrategy}(),getDOM=_angular_platformBrowser.__platform_browser_private__.getDOM,PreloadingStrategy=function(){function PreloadingStrategy(){}return PreloadingStrategy.prototype.preload=function(route,fn){},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,this.loader=new RouterConfigLoader(moduleLoader,compiler)}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(v){})},RouterPreloader.prototype.preload=function(){return this.processRoutes(this.injector,this.router.config)},RouterPreloader.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterPreloader.prototype.processRoutes=function(injector,routes){for(var res=[],_i=0,routes_1=routes;_i<routes_1.length;_i++){var c=routes_1[_i];if(c.loadChildren&&!c.canLoad&&c._loadedConfig){var childConfig=c._loadedConfig;res.push(this.processRoutes(childConfig.injector,childConfig.routes))}else c.loadChildren&&!c.canLoad?res.push(this.preloadConfig(injector,c)):c.children&&res.push(this.processRoutes(injector,c.children))}return rxjs_operator_mergeAll.mergeAll.call(rxjs_observable_from.from(res))},RouterPreloader.prototype.preloadConfig=function(injector,route){var _this=this;return this.preloadingStrategy.preload(route,function(){var loaded=_this.loader.load(injector,route.loadChildren);return rxjs_operator_mergeMap.mergeMap.call(loaded,function(config){var c=route;return c._loadedConfig=config,_this.processRoutes(config.injector,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.OpaqueToken("ROUTER_CONFIGURATION"),ROUTER_FORROOT_GUARD=new _angular_core.OpaqueToken("ROUTER_FORROOT_GUARD"),ROUTER_PROVIDERS=[_angular_common.Location,{provide:UrlSerializer,useClass:DefaultUrlSerializer},{provide:Router,useFactory:setupRouter,deps:[_angular_core.ApplicationRef,UrlSerializer,RouterOutletMap,_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]]},RouterOutletMap,{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){}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?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]}]}]},RouterModule}(),ROUTER_INITIALIZER=new _angular_core.OpaqueToken("Router Initializer"),VERSION=new _angular_core.Version("3.4.5"),__router_private__={ROUTER_PROVIDERS:ROUTER_PROVIDERS,ROUTES:ROUTES,flatten:flatten};exports.RouterLink=RouterLink,exports.RouterLinkWithHref=RouterLinkWithHref,exports.RouterLinkActive=RouterLinkActive,exports.RouterOutlet=RouterOutlet,exports.RouteReuseStrategy=RouteReuseStrategy,exports.NavigationCancel=NavigationCancel,exports.NavigationEnd=NavigationEnd,exports.NavigationError=NavigationError,exports.NavigationStart=NavigationStart,exports.Router=Router,exports.RoutesRecognized=RoutesRecognized,exports.ROUTER_CONFIGURATION=ROUTER_CONFIGURATION,exports.ROUTER_INITIALIZER=ROUTER_INITIALIZER,exports.RouterModule=RouterModule,exports.provideRoutes=provideRoutes,exports.RouterOutletMap=RouterOutletMap,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.UrlHandlingStrategy=UrlHandlingStrategy,exports.DefaultUrlSerializer=DefaultUrlSerializer,exports.UrlSegment=UrlSegment,exports.UrlSegmentGroup=UrlSegmentGroup,exports.UrlSerializer=UrlSerializer,exports.UrlTree=UrlTree,exports.VERSION=VERSION,exports.__router_private__=__router_private__});