Bones/node_modules/angular2/bundles/router.min.js
SOUTHERNCO\x2mjbyrn 7efe7605b8 Template Upload
2017-05-17 13:45:25 -04:00

3 lines
75 KiB
JavaScript

"format register";System.register("angular2/src/router/directives/router_link_transform",["angular2/compiler","angular2/src/core/change_detection/parser/ast","angular2/src/facade/exceptions","angular2/core","angular2/src/core/change_detection/parser/parser"],!0,function(t,e,r){function n(t,e){var r=new _(t,e.trim()).tokenize();return new v(r).generate()}var a=System.global,o=a.define;a.define=void 0;var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},s=this&&this.__decorate||function(t,e,r,n){var a,o=arguments.length,i=3>o?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(3>o?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i},u=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},c=t("angular2/compiler"),l=t("angular2/src/core/change_detection/parser/ast"),p=t("angular2/src/facade/exceptions"),f=t("angular2/core"),h=t("angular2/src/core/change_detection/parser/parser"),g=function(){function t(t){this.value=t}return t}(),d=function(){function t(){}return t}(),m=function(){function t(){}return t}(),y=function(){function t(t){this.ast=t}return t}(),_=function(){function t(t,e){this.parser=t,this.exp=e,this.index=0}return t.prototype.tokenize=function(){for(var t=[];this.index<this.exp.length;)t.push(this._parseToken());return t},t.prototype._parseToken=function(){var t=this.exp[this.index];return"["==t?(this.index++,new d):"]"==t?(this.index++,new m):"("==t?this._parseParams():"/"==t&&0!==this.index?(this.index++,this._parseFixedPart()):this._parseFixedPart()},t.prototype._parseParams=function(){for(var t=this.index;this.index<this.exp.length;++this.index){var e=this.exp[this.index];if(")"==e){var r=this.exp.substring(t+1,this.index);return this.index++,new y(this.parser.parseBinding("{"+r+"}",null).ast)}}throw new p.BaseException("Cannot find ')'")},t.prototype._parseFixedPart=function(){for(var t=this.index,e=!1;this.index<this.exp.length;++this.index){var r=this.exp[this.index];if("("==r||"["==r||"]"==r||"/"==r&&e)break;"."!=r&&"/"!=r&&(e=!0)}var n=this.exp.substring(t,this.index);if(t===this.index||!e||n.startsWith("//"))throw new p.BaseException("Invalid router link");return new g(n)},t}(),v=function(){function t(t){this.tokens=t,this.index=0}return t.prototype.generate=function(){return this._genAuxiliary()},t.prototype._genAuxiliary=function(){for(var t=[];this.index<this.tokens.length;this.index++){var e=this.tokens[this.index];if(e instanceof g)t.push(new l.LiteralPrimitive(e.value));else if(e instanceof y)t.push(e.ast);else{if(e instanceof m)break;e instanceof d&&(this.index++,t.push(this._genAuxiliary()))}}return new l.LiteralArray(t)},t}(),R=function(t){function e(e){t.call(this),this.parser=e}return i(e,t),e.prototype.visitQuote=function(e){return"route"==e.prefix?n(this.parser,e.uninterpretedExpression):t.prototype.visitQuote.call(this,e)},e}(l.AstTransformer);e.parseRouterLinkExpression=n;var P=function(){function t(t){this.astTransformer=new R(t)}return t.prototype.visitNgContent=function(t,e){return t},t.prototype.visitEmbeddedTemplate=function(t,e){return t},t.prototype.visitElement=function(t,e){var r=this,n=t.children.map(function(t){return t.visit(r,e)}),a=t.inputs.map(function(t){return t.visit(r,e)}),o=t.directives.map(function(t){return t.visit(r,e)});return new c.ElementAst(t.name,t.attrs,a,t.outputs,t.exportAsVars,o,n,t.ngContentIndex,t.sourceSpan)},t.prototype.visitVariable=function(t,e){return t},t.prototype.visitEvent=function(t,e){return t},t.prototype.visitElementProperty=function(t,e){return t},t.prototype.visitAttr=function(t,e){return t},t.prototype.visitBoundText=function(t,e){return t},t.prototype.visitText=function(t,e){return t},t.prototype.visitDirective=function(t,e){var r=this,n=t.inputs.map(function(t){return t.visit(r,e)});return new c.DirectiveAst(t.directive,n,t.hostProperties,t.hostEvents,t.exportAsVars,t.sourceSpan)},t.prototype.visitDirectiveProperty=function(t,e){var r=t.value.visit(this.astTransformer);return new c.BoundDirectivePropertyAst(t.directiveName,t.templateName,r,t.sourceSpan)},t=s([f.Injectable(),u("design:paramtypes",[h.Parser])],t)}();return e.RouterLinkTransform=P,a.define=o,r.exports}),System.register("angular2/router/router_link_dsl",["angular2/compiler","angular2/core","angular2/src/router/directives/router_link_transform","angular2/src/facade/lang","angular2/src/router/directives/router_link_transform"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=t("angular2/compiler"),i=t("angular2/core"),s=t("angular2/src/router/directives/router_link_transform"),u=t("angular2/src/facade/lang"),c=t("angular2/src/router/directives/router_link_transform");return e.RouterLinkTransform=c.RouterLinkTransform,e.ROUTER_LINK_DSL_PROVIDER=u.CONST_EXPR(new i.Provider(o.TEMPLATE_TRANSFORMS,{useClass:s.RouterLinkTransform,multi:!0})),n.define=a,r.exports}),System.register("angular2/src/router/route_config/route_config_impl",["angular2/src/facade/lang"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=this&&this.__decorate||function(t,e,r,n){var a,o=arguments.length,i=3>o?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(3>o?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i},s=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},u=t("angular2/src/facade/lang"),c=function(){function t(t){this.configs=t}return t=i([u.CONST(),s("design:paramtypes",[Array])],t)}();e.RouteConfig=c;var l=function(){function t(t){var e=t.name,r=t.useAsDefault,n=t.path,a=t.regex,o=t.serializer,i=t.data;this.name=e,this.useAsDefault=r,this.path=n,this.regex=a,this.serializer=o,this.data=i}return t=i([u.CONST(),s("design:paramtypes",[Object])],t)}();e.AbstractRoute=l;var p=function(t){function e(e){var r=e.name,n=e.useAsDefault,a=e.path,o=e.regex,i=e.serializer,s=e.data,u=e.component;t.call(this,{name:r,useAsDefault:n,path:a,regex:o,serializer:i,data:s}),this.aux=null,this.component=u}return o(e,t),e=i([u.CONST(),s("design:paramtypes",[Object])],e)}(l);e.Route=p;var f=function(t){function e(e){var r=e.name,n=e.useAsDefault,a=e.path,o=e.regex,i=e.serializer,s=e.data,u=e.component;t.call(this,{name:r,useAsDefault:n,path:a,regex:o,serializer:i,data:s}),this.component=u}return o(e,t),e=i([u.CONST(),s("design:paramtypes",[Object])],e)}(l);e.AuxRoute=f;var h=function(t){function e(e){var r=e.name,n=e.useAsDefault,a=e.path,o=e.regex,i=e.serializer,s=e.data,u=e.loader;t.call(this,{name:r,useAsDefault:n,path:a,regex:o,serializer:i,data:s}),this.aux=null,this.loader=u}return o(e,t),e=i([u.CONST(),s("design:paramtypes",[Object])],e)}(l);e.AsyncRoute=h;var g=function(t){function e(e){var r=e.name,n=e.useAsDefault,a=e.path,o=e.regex,i=e.serializer,s=e.data,u=e.redirectTo;t.call(this,{name:r,useAsDefault:n,path:a,regex:o,serializer:i,data:s}),this.redirectTo=u}return o(e,t),e=i([u.CONST(),s("design:paramtypes",[Object])],e)}(l);return e.Redirect=g,n.define=a,r.exports}),System.register("angular2/src/router/url_parser",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/exceptions"],!0,function(t,e,r){function n(t){var e=[];return p.isBlank(t)?[]:(l.StringMapWrapper.forEach(t,function(t,r){e.push(t===!0?r:r+"="+t)}),e)}function a(t,e){return void 0===e&&(e="&"),n(t).join(e)}function o(t){for(var e=new h(t[t.length-1]),r=t.length-2;r>=0;r-=1)e=new h(t[r],e);return e}function i(t){var e=p.RegExpWrapper.firstMatch(d,t);return p.isPresent(e)?e[0]:""}var s=System.global,u=s.define;s.define=void 0;var c=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},l=t("angular2/src/facade/collection"),p=t("angular2/src/facade/lang"),f=t("angular2/src/facade/exceptions");e.convertUrlParamsToArray=n,e.serializeParams=a;var h=function(){function t(t,e,r,n){void 0===e&&(e=null),void 0===r&&(r=p.CONST_EXPR([])),void 0===n&&(n=p.CONST_EXPR({})),this.path=t,this.child=e,this.auxiliary=r,this.params=n}return t.prototype.toString=function(){return this.path+this._matrixParamsToString()+this._auxToString()+this._childString()},t.prototype.segmentToString=function(){return this.path+this._matrixParamsToString()},t.prototype._auxToString=function(){return this.auxiliary.length>0?"("+this.auxiliary.map(function(t){return t.toString()}).join("//")+")":""},t.prototype._matrixParamsToString=function(){var t=a(this.params,";");return t.length>0?";"+t:""},t.prototype._childString=function(){return p.isPresent(this.child)?"/"+this.child.toString():""},t}();e.Url=h;var g=function(t){function e(e,r,n,a){void 0===r&&(r=null),void 0===n&&(n=p.CONST_EXPR([])),void 0===a&&(a=null),t.call(this,e,r,n,a)}return c(e,t),e.prototype.toString=function(){return this.path+this._auxToString()+this._childString()+this._queryParamsToString()},e.prototype.segmentToString=function(){return this.path+this._queryParamsToString()},e.prototype._queryParamsToString=function(){return p.isBlank(this.params)?"":"?"+a(this.params)},e}(h);e.RootUrl=g,e.pathSegmentsToUrl=o;var d=p.RegExpWrapper.create("^[^\\/\\(\\)\\?;=&#]+"),m=function(){function t(){}return t.prototype.peekStartsWith=function(t){return this._remaining.startsWith(t)},t.prototype.capture=function(t){if(!this._remaining.startsWith(t))throw new f.BaseException('Expected "'+t+'".');this._remaining=this._remaining.substring(t.length)},t.prototype.parse=function(t){return this._remaining=t,""==t||"/"==t?new h(""):this.parseRoot()},t.prototype.parseRoot=function(){this.peekStartsWith("/")&&this.capture("/");var t=i(this._remaining);this.capture(t);var e=[];this.peekStartsWith("(")&&(e=this.parseAuxiliaryRoutes()),this.peekStartsWith(";")&&this.parseMatrixParams();var r=null;this.peekStartsWith("/")&&!this.peekStartsWith("//")&&(this.capture("/"),r=this.parseSegment());var n=null;return this.peekStartsWith("?")&&(n=this.parseQueryParams()),new g(t,r,e,n)},t.prototype.parseSegment=function(){if(0==this._remaining.length)return null;this.peekStartsWith("/")&&this.capture("/");var t=i(this._remaining);this.capture(t);var e=null;this.peekStartsWith(";")&&(e=this.parseMatrixParams());var r=[];this.peekStartsWith("(")&&(r=this.parseAuxiliaryRoutes());var n=null;return this.peekStartsWith("/")&&!this.peekStartsWith("//")&&(this.capture("/"),n=this.parseSegment()),new h(t,n,r,e)},t.prototype.parseQueryParams=function(){var t={};for(this.capture("?"),this.parseParam(t);this._remaining.length>0&&this.peekStartsWith("&");)this.capture("&"),this.parseParam(t);return t},t.prototype.parseMatrixParams=function(){for(var t={};this._remaining.length>0&&this.peekStartsWith(";");)this.capture(";"),this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=i(this._remaining);if(!p.isBlank(e)){this.capture(e);var r=!0;if(this.peekStartsWith("=")){this.capture("=");var n=i(this._remaining);p.isPresent(n)&&(r=n,this.capture(r))}t[e]=r}},t.prototype.parseAuxiliaryRoutes=function(){var t=[];for(this.capture("(");!this.peekStartsWith(")")&&this._remaining.length>0;)t.push(this.parseSegment()),this.peekStartsWith("//")&&this.capture("//");return this.capture(")"),t},t}();return e.UrlParser=m,e.parser=new m,s.define=u,r.exports}),System.register("angular2/src/router/instruction",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/async"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=t("angular2/src/facade/collection"),s=t("angular2/src/facade/lang"),u=t("angular2/src/facade/async"),c=function(){function t(t){this.params=t}return t.prototype.get=function(t){return s.normalizeBlank(i.StringMapWrapper.get(this.params,t))},t}();e.RouteParams=c;var l=function(){function t(t){void 0===t&&(t=s.CONST_EXPR({})),this.data=t}return t.prototype.get=function(t){return s.normalizeBlank(i.StringMapWrapper.get(this.data,t))},t}();e.RouteData=l,e.BLANK_ROUTE_DATA=new l;var p=function(){function t(t,e,r){this.component=t,this.child=e,this.auxInstruction=r}return Object.defineProperty(t.prototype,"urlPath",{get:function(){return s.isPresent(this.component)?this.component.urlPath:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"urlParams",{get:function(){return s.isPresent(this.component)?this.component.urlParams:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"specificity",{get:function(){var t="";return s.isPresent(this.component)&&(t+=this.component.specificity),s.isPresent(this.child)&&(t+=this.child.specificity),t},enumerable:!0,configurable:!0}),t.prototype.toRootUrl=function(){return this.toUrlPath()+this.toUrlQuery()},t.prototype._toNonRootUrl=function(){return this._stringifyPathMatrixAuxPrefixed()+(s.isPresent(this.child)?this.child._toNonRootUrl():"")},t.prototype.toUrlQuery=function(){return this.urlParams.length>0?"?"+this.urlParams.join("&"):""},t.prototype.replaceChild=function(t){return new f(this.component,t,this.auxInstruction)},t.prototype.toUrlPath=function(){return this.urlPath+this._stringifyAux()+(s.isPresent(this.child)?this.child._toNonRootUrl():"")},t.prototype.toLinkUrl=function(){return this.urlPath+this._stringifyAux()+(s.isPresent(this.child)?this.child._toLinkUrl():"")+this.toUrlQuery()},t.prototype._toLinkUrl=function(){return this._stringifyPathMatrixAuxPrefixed()+(s.isPresent(this.child)?this.child._toLinkUrl():"")},t.prototype._stringifyPathMatrixAuxPrefixed=function(){var t=this._stringifyPathMatrixAux();return t.length>0&&(t="/"+t),t},t.prototype._stringifyMatrixParams=function(){return this.urlParams.length>0?";"+this.urlParams.join(";"):""},t.prototype._stringifyPathMatrixAux=function(){return s.isBlank(this.component)?"":this.urlPath+this._stringifyMatrixParams()+this._stringifyAux()},t.prototype._stringifyAux=function(){var t=[];return i.StringMapWrapper.forEach(this.auxInstruction,function(e,r){t.push(e._stringifyPathMatrixAux())}),t.length>0?"("+t.join("//")+")":""},t}();e.Instruction=p;var f=function(t){function e(e,r,n){t.call(this,e,r,n)}return o(e,t),e.prototype.resolveComponent=function(){return u.PromiseWrapper.resolve(this.component)},e}(p);e.ResolvedInstruction=f;var h=function(t){function e(e,r){t.call(this,e,r,{})}return o(e,t),e.prototype.toLinkUrl=function(){return""},e.prototype._toLinkUrl=function(){return""},e}(f);e.DefaultInstruction=h;var g=function(t){function e(e,r,n){void 0===r&&(r=""),void 0===n&&(n=s.CONST_EXPR([])),t.call(this,null,null,{}),this._resolver=e,this._urlPath=r,this._urlParams=n}return o(e,t),Object.defineProperty(e.prototype,"urlPath",{get:function(){return s.isPresent(this.component)?this.component.urlPath:s.isPresent(this._urlPath)?this._urlPath:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"urlParams",{get:function(){return s.isPresent(this.component)?this.component.urlParams:s.isPresent(this._urlParams)?this._urlParams:[]},enumerable:!0,configurable:!0}),e.prototype.resolveComponent=function(){var t=this;return s.isPresent(this.component)?u.PromiseWrapper.resolve(this.component):this._resolver().then(function(e){return t.child=s.isPresent(e)?e.child:null,t.component=s.isPresent(e)?e.component:null})},e}(p);e.UnresolvedInstruction=g;var d=function(t){function e(e,r,n,a){t.call(this,e,r,n),this._specificity=a}return o(e,t),Object.defineProperty(e.prototype,"specificity",{get:function(){return this._specificity},enumerable:!0,configurable:!0}),e}(f);e.RedirectInstruction=d;var m=function(){function t(t,r,n,a,o,i,u){void 0===u&&(u=null),this.urlPath=t,this.urlParams=r,this.componentType=a,this.terminal=o,this.specificity=i,this.params=u,this.reuse=!1,this.routeData=s.isPresent(n)?n:e.BLANK_ROUTE_DATA}return t}();return e.ComponentInstruction=m,n.define=a,r.exports}),System.register("angular2/src/router/rules/route_handlers/async_route_handler",["angular2/src/facade/lang","angular2/src/router/instruction"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=t("angular2/src/facade/lang"),i=t("angular2/src/router/instruction"),s=function(){function t(t,e){void 0===e&&(e=null),this._loader=t,this._resolvedComponent=null,this.data=o.isPresent(e)?new i.RouteData(e):i.BLANK_ROUTE_DATA}return t.prototype.resolveComponentType=function(){var t=this;return o.isPresent(this._resolvedComponent)?this._resolvedComponent:this._resolvedComponent=this._loader().then(function(e){return t.componentType=e,e})},t}();return e.AsyncRouteHandler=s,n.define=a,r.exports}),System.register("angular2/src/router/rules/route_handlers/sync_route_handler",["angular2/src/facade/async","angular2/src/facade/lang","angular2/src/router/instruction"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=t("angular2/src/facade/async"),i=t("angular2/src/facade/lang"),s=t("angular2/src/router/instruction"),u=function(){function t(t,e){this.componentType=t,this._resolvedComponent=null,this._resolvedComponent=o.PromiseWrapper.resolve(t),this.data=i.isPresent(e)?new s.RouteData(e):s.BLANK_ROUTE_DATA}return t.prototype.resolveComponentType=function(){return this._resolvedComponent},t}();return e.SyncRouteHandler=u,n.define=a,r.exports}),System.register("angular2/src/router/utils",["angular2/src/facade/lang","angular2/src/facade/collection"],!0,function(t,e,r){function n(t){return i.isBlank(t)?null:t.toString()}var a=System.global,o=a.define;a.define=void 0;var i=t("angular2/src/facade/lang"),s=t("angular2/src/facade/collection"),u=function(){function t(t){var e=this;this.map={},this.keys={},i.isPresent(t)&&s.StringMapWrapper.forEach(t,function(t,r){e.map[r]=i.isPresent(t)?t.toString():null,e.keys[r]=!0})}return t.prototype.get=function(t){return s.StringMapWrapper["delete"](this.keys,t),this.map[t]},t.prototype.getUnused=function(){var t=this,e={},r=s.StringMapWrapper.keys(this.keys);return r.forEach(function(r){return e[r]=s.StringMapWrapper.get(t.map,r)}),e},t}();return e.TouchMap=u,e.normalizeString=n,a.define=o,r.exports}),System.register("angular2/src/router/rules/route_paths/route_path",[],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=function(){function t(t,e,r,n,a){this.urlPath=t,this.urlParams=e,this.allParams=r,this.auxiliary=n,this.rest=a}return t}();e.MatchedUrl=o;var i=function(){function t(t,e){this.urlPath=t,this.urlParams=e}return t}();return e.GeneratedUrl=i,n.define=a,r.exports}),System.register("angular2/src/router/rules/route_paths/regex_route_path",["angular2/src/facade/lang","angular2/src/router/rules/route_paths/route_path"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=t("angular2/src/facade/lang"),i=t("angular2/src/router/rules/route_paths/route_path"),s=function(){function t(t,e){this._reString=t,this._serializer=e,this.terminal=!0,this.specificity="2",this.hash=this._reString,this._regex=o.RegExpWrapper.create(this._reString)}return t.prototype.matchUrl=function(t){var e=t.toString(),r={},n=o.RegExpWrapper.matcher(this._regex,e),a=o.RegExpMatcherWrapper.next(n);if(o.isBlank(a))return null;for(var s=0;s<a.length;s+=1)r[s.toString()]=a[s];return new i.MatchedUrl(e,[],r,[],null)},t.prototype.generateUrl=function(t){return this._serializer(t)},t.prototype.toString=function(){return this._reString},t}();return e.RegexRoutePath=s,n.define=a,r.exports}),System.register("angular2/src/router/route_config/route_config_decorator",["angular2/src/router/route_config/route_config_impl","angular2/src/core/util/decorators","angular2/src/router/route_config/route_config_impl"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=t("angular2/src/router/route_config/route_config_impl"),i=t("angular2/src/core/util/decorators"),s=t("angular2/src/router/route_config/route_config_impl");return e.Route=s.Route,e.Redirect=s.Redirect,e.AuxRoute=s.AuxRoute,e.AsyncRoute=s.AsyncRoute,e.RouteConfig=i.makeDecorator(o.RouteConfig),n.define=a,r.exports}),System.register("angular2/src/router/location/location_strategy",["angular2/src/facade/lang","angular2/core"],!0,function(t,e,r){function n(t){return t.length>0&&"?"!=t.substring(0,1)?"?"+t:t}function a(t,e){if(0==t.length)return e;if(0==e.length)return t;var r=0;return t.endsWith("/")&&r++,e.startsWith("/")&&r++,2==r?t+e.substring(1):1==r?t+e:t+"/"+e}var o=System.global,i=o.define;o.define=void 0;var s=t("angular2/src/facade/lang"),u=t("angular2/core"),c=function(){function t(){}return t}();return e.LocationStrategy=c,e.APP_BASE_HREF=s.CONST_EXPR(new u.OpaqueToken("appBaseHref")),e.normalizeQueryParams=n,e.joinWithSlash=a,o.define=i,r.exports}),System.register("angular2/src/router/lifecycle/lifecycle_annotations_impl",["angular2/src/facade/lang"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=this&&this.__decorate||function(t,e,r,n){var a,o=arguments.length,i=3>o?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(3>o?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i},i=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},s=t("angular2/src/facade/lang"),u=function(){function t(t){this.name=t}return t=o([s.CONST(),i("design:paramtypes",[String])],t)}();e.RouteLifecycleHook=u;var c=function(){function t(t){this.fn=t}return t=o([s.CONST(),i("design:paramtypes",[Function])],t)}();return e.CanActivate=c,e.routerCanReuse=s.CONST_EXPR(new u("routerCanReuse")),e.routerCanDeactivate=s.CONST_EXPR(new u("routerCanDeactivate")),e.routerOnActivate=s.CONST_EXPR(new u("routerOnActivate")),e.routerOnReuse=s.CONST_EXPR(new u("routerOnReuse")),e.routerOnDeactivate=s.CONST_EXPR(new u("routerOnDeactivate")),n.define=a,r.exports}),System.register("angular2/src/router/lifecycle/lifecycle_annotations",["angular2/src/core/util/decorators","angular2/src/router/lifecycle/lifecycle_annotations_impl","angular2/src/router/lifecycle/lifecycle_annotations_impl"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=t("angular2/src/core/util/decorators"),i=t("angular2/src/router/lifecycle/lifecycle_annotations_impl"),s=t("angular2/src/router/lifecycle/lifecycle_annotations_impl");return e.routerCanReuse=s.routerCanReuse,e.routerCanDeactivate=s.routerCanDeactivate,e.routerOnActivate=s.routerOnActivate,e.routerOnReuse=s.routerOnReuse,e.routerOnDeactivate=s.routerOnDeactivate,e.CanActivate=o.makeDecorator(i.CanActivate),n.define=a,r.exports}),System.register("angular2/src/router/directives/router_link",["angular2/core","angular2/src/facade/lang","angular2/src/router/router","angular2/src/router/location/location"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=this&&this.__decorate||function(t,e,r,n){var a,o=arguments.length,i=3>o?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(3>o?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i},i=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},s=t("angular2/core"),u=t("angular2/src/facade/lang"),c=t("angular2/src/router/router"),l=t("angular2/src/router/location/location"),p=function(){function t(t,e){var r=this;this._router=t,this._location=e,this._router.subscribe(function(t){return r._updateLink()})}return t.prototype._updateLink=function(){this._navigationInstruction=this._router.generate(this._routeParams);var t=this._navigationInstruction.toLinkUrl();this.visibleHref=this._location.prepareExternalUrl(t)},Object.defineProperty(t.prototype,"isRouteActive",{get:function(){return this._router.isRouteActive(this._navigationInstruction)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"routeParams",{set:function(t){this._routeParams=t,this._updateLink()},enumerable:!0,configurable:!0}),t.prototype.onClick=function(){return u.isString(this.target)&&"_self"!=this.target?!0:(this._router.navigateByInstruction(this._navigationInstruction),!1)},t=o([s.Directive({selector:"[routerLink]",inputs:["routeParams: routerLink","target: target"],host:{"(click)":"onClick()","[attr.href]":"visibleHref","[class.router-link-active]":"isRouteActive"}}),i("design:paramtypes",[c.Router,l.Location])],t)}();return e.RouterLink=p,n.define=a,r.exports}),System.register("angular2/src/router/location/platform_location",[],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=function(){function t(){}return Object.defineProperty(t.prototype,"pathname",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"search",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hash",{get:function(){return null},enumerable:!0,configurable:!0}),t}();return e.PlatformLocation=o,n.define=a,r.exports}),System.register("angular2/src/router/location/hash_location_strategy",["angular2/core","angular2/src/router/location/location_strategy","angular2/src/facade/lang","angular2/src/router/location/platform_location"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=this&&this.__decorate||function(t,e,r,n){var a,o=arguments.length,i=3>o?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(3>o?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i},s=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},u=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},c=t("angular2/core"),l=t("angular2/src/router/location/location_strategy"),p=t("angular2/src/facade/lang"),f=t("angular2/src/router/location/platform_location"),h=function(t){function e(e,r){t.call(this),this._platformLocation=e,this._baseHref="",p.isPresent(r)&&(this._baseHref=r)}return o(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.path=function(){var t=this._platformLocation.hash;return p.isPresent(t)||(t="#"),t.length>0?t.substring(1):t},e.prototype.prepareExternalUrl=function(t){var e=l.joinWithSlash(this._baseHref,t);return e.length>0?"#"+e:e},e.prototype.pushState=function(t,e,r,n){var a=this.prepareExternalUrl(r+l.normalizeQueryParams(n));0==a.length&&(a=this._platformLocation.pathname),this._platformLocation.pushState(t,e,a)},e.prototype.replaceState=function(t,e,r,n){var a=this.prepareExternalUrl(r+l.normalizeQueryParams(n));0==a.length&&(a=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,a)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e=i([c.Injectable(),u(1,c.Optional()),u(1,c.Inject(l.APP_BASE_HREF)),s("design:paramtypes",[f.PlatformLocation,String])],e)}(l.LocationStrategy);return e.HashLocationStrategy=h,n.define=a,r.exports}),System.register("angular2/src/router/location/path_location_strategy",["angular2/core","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/router/location/location_strategy","angular2/src/router/location/platform_location"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=this&&this.__decorate||function(t,e,r,n){var a,o=arguments.length,i=3>o?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(3>o?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i},s=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},u=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},c=t("angular2/core"),l=t("angular2/src/facade/lang"),p=t("angular2/src/facade/exceptions"),f=t("angular2/src/router/location/location_strategy"),h=t("angular2/src/router/location/platform_location"),g=function(t){function e(e,r){if(t.call(this),this._platformLocation=e,l.isBlank(r)&&(r=this._platformLocation.getBaseHrefFromDOM()),l.isBlank(r))throw new p.BaseException("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=r}return o(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.prepareExternalUrl=function(t){return f.joinWithSlash(this._baseHref,t)},e.prototype.path=function(){return this._platformLocation.pathname+f.normalizeQueryParams(this._platformLocation.search)},e.prototype.pushState=function(t,e,r,n){var a=this.prepareExternalUrl(r+f.normalizeQueryParams(n));this._platformLocation.pushState(t,e,a)},e.prototype.replaceState=function(t,e,r,n){var a=this.prepareExternalUrl(r+f.normalizeQueryParams(n));this._platformLocation.replaceState(t,e,a)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e=i([c.Injectable(),u(1,c.Optional()),u(1,c.Inject(f.APP_BASE_HREF)),s("design:paramtypes",[h.PlatformLocation,String])],e)}(f.LocationStrategy);return e.PathLocationStrategy=g,n.define=a,r.exports}),System.register("angular2/src/router/route_definition",[],!0,function(t,e,r){var n=System.global,a=n.define;return n.define=void 0,n.define=a,r.exports}),System.register("angular2/src/router/router_providers_common",["angular2/src/router/location/location_strategy","angular2/src/router/location/path_location_strategy","angular2/src/router/router","angular2/src/router/route_registry","angular2/src/router/location/location","angular2/src/facade/lang","angular2/core","angular2/src/facade/exceptions"],!0,function(t,e,r){function n(t,e,r,n){var a=new c.RootRouter(t,e,r);return n.registerDisposeListener(function(){return a.dispose()}),a}function a(t){if(0==t.componentTypes.length)throw new g.BaseException("Bootstrap at least one component before injecting Router.");return t.componentTypes[0]}var o=System.global,i=o.define;o.define=void 0;var s=t("angular2/src/router/location/location_strategy"),u=t("angular2/src/router/location/path_location_strategy"),c=t("angular2/src/router/router"),l=t("angular2/src/router/route_registry"),p=t("angular2/src/router/location/location"),f=t("angular2/src/facade/lang"),h=t("angular2/core"),g=t("angular2/src/facade/exceptions");
return e.ROUTER_PROVIDERS_COMMON=f.CONST_EXPR([l.RouteRegistry,f.CONST_EXPR(new h.Provider(s.LocationStrategy,{useClass:u.PathLocationStrategy})),p.Location,f.CONST_EXPR(new h.Provider(c.Router,{useFactory:n,deps:f.CONST_EXPR([l.RouteRegistry,p.Location,l.ROUTER_PRIMARY_COMPONENT,h.ApplicationRef])})),f.CONST_EXPR(new h.Provider(l.ROUTER_PRIMARY_COMPONENT,{useFactory:a,deps:f.CONST_EXPR([h.ApplicationRef])}))]),o.define=i,r.exports}),System.register("angular2/src/router/rules/rules",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/promise","angular2/src/facade/collection","angular2/src/router/url_parser","angular2/src/router/instruction"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=t("angular2/src/facade/lang"),s=t("angular2/src/facade/exceptions"),u=t("angular2/src/facade/promise"),c=t("angular2/src/facade/collection"),l=t("angular2/src/router/url_parser"),p=t("angular2/src/router/instruction"),f=function(){function t(){}return t}();e.RouteMatch=f;var h=function(t){function e(e,r,n){t.call(this),this.instruction=e,this.remaining=r,this.remainingAux=n}return o(e,t),e}(f);e.PathMatch=h;var g=function(t){function e(e,r){t.call(this),this.redirectTo=e,this.specificity=r}return o(e,t),e}(f);e.RedirectMatch=g;var d=function(){function t(t,e){this._pathRecognizer=t,this.redirectTo=e,this.hash=this._pathRecognizer.hash}return Object.defineProperty(t.prototype,"path",{get:function(){return this._pathRecognizer.toString()},set:function(t){throw new s.BaseException("you cannot set the path of a RedirectRule directly")},enumerable:!0,configurable:!0}),t.prototype.recognize=function(t){var e=null;return i.isPresent(this._pathRecognizer.matchUrl(t))&&(e=new g(this.redirectTo,this._pathRecognizer.specificity)),u.PromiseWrapper.resolve(e)},t.prototype.generate=function(t){throw new s.BaseException("Tried to generate a redirect.")},t}();e.RedirectRule=d;var m=function(){function t(t,e){this._routePath=t,this.handler=e,this._cache=new c.Map,this.specificity=this._routePath.specificity,this.hash=this._routePath.hash,this.terminal=this._routePath.terminal}return Object.defineProperty(t.prototype,"path",{get:function(){return this._routePath.toString()},set:function(t){throw new s.BaseException("you cannot set the path of a RouteRule directly")},enumerable:!0,configurable:!0}),t.prototype.recognize=function(t){var e=this,r=this._routePath.matchUrl(t);return i.isBlank(r)?null:this.handler.resolveComponentType().then(function(t){var n=e._getInstruction(r.urlPath,r.urlParams,r.allParams);return new h(n,r.rest,r.auxiliary)})},t.prototype.generate=function(t){var e=this._routePath.generateUrl(t),r=e.urlPath,n=e.urlParams;return this._getInstruction(r,l.convertUrlParamsToArray(n),t)},t.prototype.generateComponentPathValues=function(t){return this._routePath.generateUrl(t)},t.prototype._getInstruction=function(t,e,r){if(i.isBlank(this.handler.componentType))throw new s.BaseException("Tried to get instruction before the type was loaded.");var n=t+"?"+e.join("&");if(this._cache.has(n))return this._cache.get(n);var a=new p.ComponentInstruction(t,e,this.handler.data,this.handler.componentType,this.terminal,this.specificity,r);return this._cache.set(n,a),a},t}();return e.RouteRule=m,n.define=a,r.exports}),System.register("angular2/src/router/rules/route_paths/param_route_path",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/router/utils","angular2/src/router/url_parser","angular2/src/router/rules/route_paths/route_path"],!0,function(t,e,r){function n(t){return s.isBlank(t)?null:(t=s.StringWrapper.replaceAll(t,_,"%25"),t=s.StringWrapper.replaceAll(t,v,"%2F"),t=s.StringWrapper.replaceAll(t,R,"%28"),t=s.StringWrapper.replaceAll(t,P,"%29"),t=s.StringWrapper.replaceAll(t,x,"%3B"))}function a(t){return s.isBlank(t)?null:(t=s.StringWrapper.replaceAll(t,S,";"),t=s.StringWrapper.replaceAll(t,b,")"),t=s.StringWrapper.replaceAll(t,O,"("),t=s.StringWrapper.replaceAll(t,w,"/"),t=s.StringWrapper.replaceAll(t,E,"%"))}var o=System.global,i=o.define;o.define=void 0;var s=t("angular2/src/facade/lang"),u=t("angular2/src/facade/exceptions"),c=t("angular2/src/facade/collection"),l=t("angular2/src/router/utils"),p=t("angular2/src/router/url_parser"),f=t("angular2/src/router/rules/route_paths/route_path"),h=function(){function t(){this.name="",this.specificity="",this.hash="..."}return t.prototype.generate=function(t){return""},t.prototype.match=function(t){return!0},t}(),g=function(){function t(t){this.path=t,this.name="",this.specificity="2",this.hash=t}return t.prototype.match=function(t){return t==this.path},t.prototype.generate=function(t){return this.path},t}(),d=function(){function t(t){this.name=t,this.specificity="1",this.hash=":"}return t.prototype.match=function(t){return t.length>0},t.prototype.generate=function(t){if(!c.StringMapWrapper.contains(t.map,this.name))throw new u.BaseException("Route generator for '"+this.name+"' was not included in parameters passed.");return n(l.normalizeString(t.get(this.name)))},t.paramMatcher=/^:([^\/]+)$/g,t}(),m=function(){function t(t){this.name=t,this.specificity="0",this.hash="*"}return t.prototype.match=function(t){return!0},t.prototype.generate=function(t){return l.normalizeString(t.get(this.name))},t.wildcardMatcher=/^\*([^\/]+)$/g,t}(),y=function(){function t(t){this.routePath=t,this.terminal=!0,this._assertValidPath(t),this._parsePathString(t),this.specificity=this._calculateSpecificity(),this.hash=this._calculateHash();var e=this._segments[this._segments.length-1];this.terminal=!(e instanceof h)}return t.prototype.matchUrl=function(t){for(var e,r=t,n={},o=[],i=0;i<this._segments.length;i+=1){var u=this._segments[i];if(e=r,u instanceof h)break;if(s.isPresent(e)){if(u instanceof m){n[u.name]=e.toString(),o.push(e.toString()),r=null;break}if(o.push(e.path),u instanceof d)n[u.name]=a(e.path);else if(!u.match(e.path))return null;r=e.child}else if(!u.match(""))return null}if(this.terminal&&s.isPresent(r))return null;var l=o.join("/"),g=[],y=[],_=n;if(s.isPresent(e)){var v=t instanceof p.RootUrl?t:e;s.isPresent(v.params)?(_=c.StringMapWrapper.merge(v.params,n),y=p.convertUrlParamsToArray(v.params)):_=n,g=e.auxiliary}return new f.MatchedUrl(l,y,_,g,r)},t.prototype.generateUrl=function(t){for(var e=new l.TouchMap(t),r=[],n=0;n<this._segments.length;n++){var a=this._segments[n];a instanceof h||r.push(a.generate(e))}var o=r.join("/"),i=e.getUnused(),s=i;return new f.GeneratedUrl(o,s)},t.prototype.toString=function(){return this.routePath},t.prototype._parsePathString=function(t){t.startsWith("/")&&(t=t.substring(1));var e=t.split("/");this._segments=[];for(var r=e.length-1,n=0;r>=n;n++){var a,o=e[n];if(s.isPresent(a=s.RegExpWrapper.firstMatch(d.paramMatcher,o)))this._segments.push(new d(a[1]));else if(s.isPresent(a=s.RegExpWrapper.firstMatch(m.wildcardMatcher,o)))this._segments.push(new m(a[1]));else if("..."==o){if(r>n)throw new u.BaseException('Unexpected "..." before the end of the path for "'+t+'".');this._segments.push(new h)}else this._segments.push(new g(o))}},t.prototype._calculateSpecificity=function(){var t,e,r=this._segments.length;if(0==r)e+="2";else for(e="",t=0;r>t;t++)e+=this._segments[t].specificity;return e},t.prototype._calculateHash=function(){var t,e=this._segments.length,r=[];for(t=0;e>t;t++)r.push(this._segments[t].hash);return r.join("/")},t.prototype._assertValidPath=function(e){if(s.StringWrapper.contains(e,"#"))throw new u.BaseException('Path "'+e+'" should not include "#". Use "HashLocationStrategy" instead.');var r=s.RegExpWrapper.firstMatch(t.RESERVED_CHARS,e);if(s.isPresent(r))throw new u.BaseException('Path "'+e+'" contains "'+r[0]+'" which is not allowed in a route config.')},t.RESERVED_CHARS=s.RegExpWrapper.create("//|\\(|\\)|;|\\?|="),t}();e.ParamRoutePath=y;var _=/%/g,v=/\//g,R=/\(/g,P=/\)/g,x=/;/g,S=/%3B/gi,b=/%29/gi,O=/%28/gi,w=/%2F/gi,E=/%25/gi;return o.define=i,r.exports}),System.register("angular2/src/router/route_config/route_config_normalizer",["angular2/src/router/route_config/route_config_decorator","angular2/src/facade/lang","angular2/src/facade/exceptions"],!0,function(t,e,r){function n(t,e){if(t instanceof u.AsyncRoute){var r=a(t.loader,e);return new u.AsyncRoute({path:t.path,loader:r,name:t.name,data:t.data,useAsDefault:t.useAsDefault})}if(t instanceof u.Route||t instanceof u.Redirect||t instanceof u.AuxRoute)return t;if(+!!t.component+ +!!t.redirectTo+ +!!t.loader!=1)throw new l.BaseException('Route config should contain exactly one "component", "loader", or "redirectTo" property.');if(t.as&&t.name)throw new l.BaseException('Route config should contain exactly one "as" or "name" property.');if(t.as&&(t.name=t.as),t.loader){var r=a(t.loader,e);return new u.AsyncRoute({path:t.path,loader:r,name:t.name,data:t.data,useAsDefault:t.useAsDefault})}if(t.aux)return new u.AuxRoute({path:t.aux,component:t.component,name:t.name});if(t.component){if("object"==typeof t.component){var n=t.component;if("constructor"==n.type)return new u.Route({path:t.path,component:n.constructor,name:t.name,data:t.data,useAsDefault:t.useAsDefault});if("loader"==n.type)return new u.AsyncRoute({path:t.path,loader:n.loader,name:t.name,data:t.data,useAsDefault:t.useAsDefault});throw new l.BaseException('Invalid component type "'+n.type+'". Valid types are "constructor" and "loader".')}return new u.Route(t)}return t.redirectTo?new u.Redirect({path:t.path,redirectTo:t.redirectTo}):t}function a(t,e){return function(){return t().then(function(t){return e.configFromComponent(t),t})}}function o(t,e){if(!c.isType(t))throw new l.BaseException('Component for route "'+e+'" is not defined, or is not a class.')}var i=System.global,s=i.define;i.define=void 0;var u=t("angular2/src/router/route_config/route_config_decorator"),c=t("angular2/src/facade/lang"),l=t("angular2/src/facade/exceptions");return e.normalizeRouteConfig=n,e.assertComponentExists=o,i.define=s,r.exports}),System.register("angular2/src/router/location/location",["angular2/src/router/location/location_strategy","angular2/src/facade/async","angular2/core"],!0,function(t,e,r){function n(t,e){return t.length>0&&e.startsWith(t)?e.substring(t.length):e}function a(t){return/\/index.html$/g.test(t)?t.substring(0,t.length-11):t}function o(t){return/\/$/g.test(t)&&(t=t.substring(0,t.length-1)),t}var i=System.global,s=i.define;i.define=void 0;var u=this&&this.__decorate||function(t,e,r,n){var a,o=arguments.length,i=3>o?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(3>o?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i},c=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},l=t("angular2/src/router/location/location_strategy"),p=t("angular2/src/facade/async"),f=t("angular2/core"),h=function(){function t(t){var e=this;this.platformStrategy=t,this._subject=new p.EventEmitter;var r=this.platformStrategy.getBaseHref();this._baseHref=o(a(r)),this.platformStrategy.onPopState(function(t){p.ObservableWrapper.callEmit(e._subject,{url:e.path(),pop:!0,type:t.type})})}return t.prototype.path=function(){return this.normalize(this.platformStrategy.path())},t.prototype.normalize=function(t){return o(n(this._baseHref,a(t)))},t.prototype.prepareExternalUrl=function(t){return t.length>0&&!t.startsWith("/")&&(t="/"+t),this.platformStrategy.prepareExternalUrl(t)},t.prototype.go=function(t,e){void 0===e&&(e=""),this.platformStrategy.pushState(null,"",t,e)},t.prototype.replaceState=function(t,e){void 0===e&&(e=""),this.platformStrategy.replaceState(null,"",t,e)},t.prototype.forward=function(){this.platformStrategy.forward()},t.prototype.back=function(){this.platformStrategy.back()},t.prototype.subscribe=function(t,e,r){return void 0===e&&(e=null),void 0===r&&(r=null),p.ObservableWrapper.subscribe(this._subject,t,e,r)},t=u([f.Injectable(),c("design:paramtypes",[l.LocationStrategy])],t)}();return e.Location=h,i.define=s,r.exports}),System.register("angular2/src/router/lifecycle/route_lifecycle_reflector",["angular2/src/facade/lang","angular2/src/router/lifecycle/lifecycle_annotations_impl","angular2/src/core/reflection/reflection"],!0,function(t,e,r){function n(t,e){return e instanceof s.Type?t.name in e.prototype:!1}function a(t){for(var e=c.reflector.annotations(t),r=0;r<e.length;r+=1){var n=e[r];if(n instanceof u.CanActivate)return n.fn}return null}var o=System.global,i=o.define;o.define=void 0;var s=t("angular2/src/facade/lang"),u=t("angular2/src/router/lifecycle/lifecycle_annotations_impl"),c=t("angular2/src/core/reflection/reflection");return e.hasLifecycleHook=n,e.getCanActivateHook=a,o.define=i,r.exports}),System.register("angular2/src/router/directives/router_outlet",["angular2/src/facade/async","angular2/src/facade/collection","angular2/src/facade/lang","angular2/core","angular2/src/router/router","angular2/src/router/instruction","angular2/src/router/lifecycle/lifecycle_annotations","angular2/src/router/lifecycle/route_lifecycle_reflector"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=this&&this.__decorate||function(t,e,r,n){var a,o=arguments.length,i=3>o?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(3>o?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i},i=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},s=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},u=t("angular2/src/facade/async"),c=t("angular2/src/facade/collection"),l=t("angular2/src/facade/lang"),p=t("angular2/core"),f=t("angular2/src/router/router"),h=t("angular2/src/router/instruction"),g=t("angular2/src/router/lifecycle/lifecycle_annotations"),d=t("angular2/src/router/lifecycle/route_lifecycle_reflector"),m=u.PromiseWrapper.resolve(!0),y=function(){function t(t,e,r,n){this._elementRef=t,this._loader=e,this._parentRouter=r,this.name=null,this._componentRef=null,this._currentInstruction=null,l.isPresent(n)?(this.name=n,this._parentRouter.registerAuxOutlet(this)):this._parentRouter.registerPrimaryOutlet(this)}return t.prototype.activate=function(t){var e=this,r=this._currentInstruction;this._currentInstruction=t;var n=t.componentType,a=this._parentRouter.childRouter(n),o=p.Injector.resolve([p.provide(h.RouteData,{useValue:t.routeData}),p.provide(h.RouteParams,{useValue:new h.RouteParams(t.params)}),p.provide(f.Router,{useValue:a})]);return this._componentRef=this._loader.loadNextToLocation(n,this._elementRef,o),this._componentRef.then(function(a){return d.hasLifecycleHook(g.routerOnActivate,n)?e._componentRef.then(function(e){return e.instance.routerOnActivate(t,r)}):a})},t.prototype.reuse=function(t){var e=this._currentInstruction;return this._currentInstruction=t,l.isBlank(this._componentRef)?this.activate(t):u.PromiseWrapper.resolve(d.hasLifecycleHook(g.routerOnReuse,this._currentInstruction.componentType)?this._componentRef.then(function(r){return r.instance.routerOnReuse(t,e)}):!0)},t.prototype.deactivate=function(t){var e=this,r=m;return l.isPresent(this._componentRef)&&l.isPresent(this._currentInstruction)&&d.hasLifecycleHook(g.routerOnDeactivate,this._currentInstruction.componentType)&&(r=this._componentRef.then(function(r){return r.instance.routerOnDeactivate(t,e._currentInstruction)})),r.then(function(t){if(l.isPresent(e._componentRef)){var r=e._componentRef.then(function(t){return t.dispose()});return e._componentRef=null,r}})},t.prototype.routerCanDeactivate=function(t){var e=this;return l.isBlank(this._currentInstruction)?m:d.hasLifecycleHook(g.routerCanDeactivate,this._currentInstruction.componentType)?this._componentRef.then(function(r){return r.instance.routerCanDeactivate(t,e._currentInstruction)}):m},t.prototype.routerCanReuse=function(t){var e,r=this;return e=l.isBlank(this._currentInstruction)||this._currentInstruction.componentType!=t.componentType?!1:d.hasLifecycleHook(g.routerCanReuse,this._currentInstruction.componentType)?this._componentRef.then(function(e){return e.instance.routerCanReuse(t,r._currentInstruction)}):t==this._currentInstruction||l.isPresent(t.params)&&l.isPresent(this._currentInstruction.params)&&c.StringMapWrapper.equals(t.params,this._currentInstruction.params),u.PromiseWrapper.resolve(e)},t.prototype.ngOnDestroy=function(){this._parentRouter.unregisterPrimaryOutlet(this)},t=o([p.Directive({selector:"router-outlet"}),s(3,p.Attribute("name")),i("design:paramtypes",[p.ElementRef,p.DynamicComponentLoader,f.Router,String])],t)}();return e.RouterOutlet=y,n.define=a,r.exports}),System.register("angular2/src/router/location/browser_platform_location",["angular2/core","angular2/src/router/location/platform_location","angular2/src/platform/dom/dom_adapter"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=this&&this.__decorate||function(t,e,r,n){var a,o=arguments.length,i=3>o?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(3>o?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i},s=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},u=t("angular2/core"),c=t("angular2/src/router/location/platform_location"),l=t("angular2/src/platform/dom/dom_adapter"),p=function(t){function e(){t.call(this),this._init()}return o(e,t),e.prototype._init=function(){this._location=l.DOM.getLocation(),this._history=l.DOM.getHistory()},Object.defineProperty(e.prototype,"location",{get:function(){return this._location},enumerable:!0,configurable:!0}),e.prototype.getBaseHrefFromDOM=function(){return l.DOM.getBaseHref()},e.prototype.onPopState=function(t){l.DOM.getGlobalEventTarget("window").addEventListener("popstate",t,!1)},e.prototype.onHashChange=function(t){l.DOM.getGlobalEventTarget("window").addEventListener("hashchange",t,!1)},Object.defineProperty(e.prototype,"pathname",{get:function(){return this._location.pathname},set:function(t){this._location.pathname=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"search",{get:function(){return this._location.search},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hash",{get:function(){return this._location.hash},enumerable:!0,configurable:!0}),e.prototype.pushState=function(t,e,r){this._history.pushState(t,e,r)},e.prototype.replaceState=function(t,e,r){this._history.replaceState(t,e,r)},e.prototype.forward=function(){this._history.forward()},e.prototype.back=function(){this._history.back()},e=i([u.Injectable(),s("design:paramtypes",[])],e)}(c.PlatformLocation);return e.BrowserPlatformLocation=p,n.define=a,r.exports}),System.register("angular2/src/router/rules/rule_set",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/facade/async","angular2/src/router/rules/rules","angular2/src/router/route_config/route_config_impl","angular2/src/router/rules/route_handlers/async_route_handler","angular2/src/router/rules/route_handlers/sync_route_handler","angular2/src/router/rules/route_paths/param_route_path","angular2/src/router/rules/route_paths/regex_route_path"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=t("angular2/src/facade/lang"),i=t("angular2/src/facade/exceptions"),s=t("angular2/src/facade/collection"),u=t("angular2/src/facade/async"),c=t("angular2/src/router/rules/rules"),l=t("angular2/src/router/route_config/route_config_impl"),p=t("angular2/src/router/rules/route_handlers/async_route_handler"),f=t("angular2/src/router/rules/route_handlers/sync_route_handler"),h=t("angular2/src/router/rules/route_paths/param_route_path"),g=t("angular2/src/router/rules/route_paths/regex_route_path"),d=function(){function t(){this.rulesByName=new s.Map,this.auxRulesByName=new s.Map,this.auxRulesByPath=new s.Map,this.rules=[],this.defaultRule=null}return t.prototype.config=function(t){var e;if(o.isPresent(t.name)&&t.name[0].toUpperCase()!=t.name[0]){var r=t.name[0].toUpperCase()+t.name.substring(1);throw new i.BaseException('Route "'+t.path+'" with name "'+t.name+'" does not begin with an uppercase letter. Route names should be CamelCase like "'+r+'".')}if(t instanceof l.AuxRoute){e=new f.SyncRouteHandler(t.component,t.data);var n=this._getRoutePath(t),a=new c.RouteRule(n,e);return this.auxRulesByPath.set(n.toString(),a),o.isPresent(t.name)&&this.auxRulesByName.set(t.name,a),a.terminal}var s=!1;if(t instanceof l.Redirect){var u=this._getRoutePath(t),h=new c.RedirectRule(u,t.redirectTo);return this._assertNoHashCollision(h.hash,t.path),this.rules.push(h),!0}t instanceof l.Route?(e=new f.SyncRouteHandler(t.component,t.data),s=o.isPresent(t.useAsDefault)&&t.useAsDefault):t instanceof l.AsyncRoute&&(e=new p.AsyncRouteHandler(t.loader,t.data),s=o.isPresent(t.useAsDefault)&&t.useAsDefault);var g=this._getRoutePath(t),d=new c.RouteRule(g,e);if(this._assertNoHashCollision(d.hash,t.path),s){if(o.isPresent(this.defaultRule))throw new i.BaseException("Only one route can be default");this.defaultRule=d}return this.rules.push(d),o.isPresent(t.name)&&this.rulesByName.set(t.name,d),d.terminal},t.prototype.recognize=function(t){var e=[];return this.rules.forEach(function(r){var n=r.recognize(t);o.isPresent(n)&&e.push(n)}),0==e.length&&o.isPresent(t)&&t.auxiliary.length>0?[u.PromiseWrapper.resolve(new c.PathMatch(null,null,t.auxiliary))]:e},t.prototype.recognizeAuxiliary=function(t){var e=this.auxRulesByPath.get(t.path);return o.isPresent(e)?[e.recognize(t)]:[u.PromiseWrapper.resolve(null)]},t.prototype.hasRoute=function(t){return this.rulesByName.has(t)},t.prototype.componentLoaded=function(t){return this.hasRoute(t)&&o.isPresent(this.rulesByName.get(t).handler.componentType)},t.prototype.loadComponent=function(t){return this.rulesByName.get(t).handler.resolveComponentType()},t.prototype.generate=function(t,e){var r=this.rulesByName.get(t);return o.isBlank(r)?null:r.generate(e)},t.prototype.generateAuxiliary=function(t,e){var r=this.auxRulesByName.get(t);return o.isBlank(r)?null:r.generate(e)},t.prototype._assertNoHashCollision=function(t,e){this.rules.forEach(function(r){if(t==r.hash)throw new i.BaseException("Configuration '"+e+"' conflicts with existing route '"+r.path+"'")})},t.prototype._getRoutePath=function(t){if(o.isPresent(t.regex)){if(o.isFunction(t.serializer))return new g.RegexRoutePath(t.regex,t.serializer);throw new i.BaseException("Route provides a regex property, '"+t.regex+"', but no serializer property")}if(o.isPresent(t.path)){var e=t instanceof l.AuxRoute&&t.path.startsWith("/")?t.path.substring(1):t.path;return new h.ParamRoutePath(e)}throw new i.BaseException("Route must provide either a path or regex property")},t}();return e.RuleSet=d,n.define=a,r.exports}),System.register("angular2/src/router/router_providers",["angular2/src/router/router_providers_common","angular2/core","angular2/src/facade/lang","angular2/src/router/location/browser_platform_location","angular2/src/router/location/platform_location"],!0,function(t,e,r){var n=System.global,a=n.define;n.define=void 0;var o=t("angular2/src/router/router_providers_common"),i=t("angular2/core"),s=t("angular2/src/facade/lang"),u=t("angular2/src/router/location/browser_platform_location"),c=t("angular2/src/router/location/platform_location");return e.ROUTER_PROVIDERS=s.CONST_EXPR([o.ROUTER_PROVIDERS_COMMON,s.CONST_EXPR(new i.Provider(c.PlatformLocation,{useClass:u.BrowserPlatformLocation}))]),e.ROUTER_BINDINGS=e.ROUTER_PROVIDERS,n.define=a,r.exports}),System.register("angular2/src/router/route_registry",["angular2/src/facade/collection","angular2/src/facade/async","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/core/reflection/reflection","angular2/core","angular2/src/router/route_config/route_config_impl","angular2/src/router/rules/rules","angular2/src/router/rules/rule_set","angular2/src/router/instruction","angular2/src/router/route_config/route_config_normalizer","angular2/src/router/url_parser"],!0,function(t,e,r){function n(t){var e=[];return t.forEach(function(t){if(g.isString(t)){var r=t;e=e.concat(r.split("/"))}else e.push(t)}),e}function a(t){if(t=t.filter(function(t){return g.isPresent(t)}),0==t.length)return null;if(1==t.length)return t[0];var e=t[0],r=t.slice(1);return r.reduce(function(t,e){return-1==o(e.specificity,t.specificity)?e:t},e)}function o(t,e){for(var r=g.Math.min(t.length,e.length),n=0;r>n;n+=1){var a=g.StringWrapper.charCodeAt(t,n),o=g.StringWrapper.charCodeAt(e,n),i=o-a;if(0!=i)return i}return t.length-e.length}function i(t,e){if(g.isType(t)){var r=m.reflector.annotations(t);if(g.isPresent(r))for(var n=0;n<r.length;n++){var a=r[n];if(a instanceof _.RouteConfig)throw new d.BaseException('Child routes are not allowed for "'+e+'". Use "..." on the parent\'s route path.')}}}var s=System.global,u=s.define;s.define=void 0;var c=this&&this.__decorate||function(t,e,r,n){var a,o=arguments.length,i=3>o?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(3>o?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i},l=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},p=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},f=t("angular2/src/facade/collection"),h=t("angular2/src/facade/async"),g=t("angular2/src/facade/lang"),d=t("angular2/src/facade/exceptions"),m=t("angular2/src/core/reflection/reflection"),y=t("angular2/core"),_=t("angular2/src/router/route_config/route_config_impl"),v=t("angular2/src/router/rules/rules"),R=t("angular2/src/router/rules/rule_set"),P=t("angular2/src/router/instruction"),x=t("angular2/src/router/route_config/route_config_normalizer"),S=t("angular2/src/router/url_parser"),b=h.PromiseWrapper.resolve(null);e.ROUTER_PRIMARY_COMPONENT=g.CONST_EXPR(new y.OpaqueToken("RouterPrimaryComponent"));var O=function(){function t(t){this._rootComponent=t,this._rules=new f.Map}return t.prototype.config=function(t,e){e=x.normalizeRouteConfig(e,this),e instanceof _.Route?x.assertComponentExists(e.component,e.path):e instanceof _.AuxRoute&&x.assertComponentExists(e.component,e.path);var r=this._rules.get(t);g.isBlank(r)&&(r=new R.RuleSet,this._rules.set(t,r));var n=r.config(e);e instanceof _.Route&&(n?i(e.component,e.path):this.configFromComponent(e.component))},t.prototype.configFromComponent=function(t){var e=this;if(g.isType(t)&&!this._rules.has(t)){var r=m.reflector.annotations(t);if(g.isPresent(r))for(var n=0;n<r.length;n++){var a=r[n];if(a instanceof _.RouteConfig){var o=a.configs;o.forEach(function(r){return e.config(t,r)})}}}},t.prototype.recognize=function(t,e){var r=S.parser.parse(t);return this._recognize(r,[])},t.prototype._recognize=function(t,e,r){var n=this;void 0===r&&(r=!1);var o=f.ListWrapper.last(e),i=g.isPresent(o)?o.component.componentType:this._rootComponent,s=this._rules.get(i);if(g.isBlank(s))return b;var u=r?s.recognizeAuxiliary(t):s.recognize(t),c=u.map(function(t){return t.then(function(t){if(t instanceof v.PathMatch){var r=e.length>0?[f.ListWrapper.last(e)]:[],a=n._auxRoutesToUnresolved(t.remainingAux,r),o=new P.ResolvedInstruction(t.instruction,null,a);if(g.isBlank(t.instruction)||t.instruction.terminal)return o;var i=e.concat([o]);return n._recognize(t.remaining,i).then(function(t){return g.isBlank(t)?null:t instanceof P.RedirectInstruction?t:(o.child=t,o)})}if(t instanceof v.RedirectMatch){var o=n.generate(t.redirectTo,e.concat([null]));return new P.RedirectInstruction(o.component,o.child,o.auxInstruction,t.specificity)}})});return!g.isBlank(t)&&""!=t.path||0!=u.length?h.PromiseWrapper.all(c).then(a):h.PromiseWrapper.resolve(this.generateDefault(i))},t.prototype._auxRoutesToUnresolved=function(t,e){var r=this,n={};return t.forEach(function(t){n[t.path]=new P.UnresolvedInstruction(function(){return r._recognize(t,e,!0)})}),n},t.prototype.generate=function(t,e,r){void 0===r&&(r=!1);var a,o=n(t);if(""==f.ListWrapper.first(o))o.shift(),a=f.ListWrapper.first(e),e=[];else if(a=e.length>0?e.pop():null,"."==f.ListWrapper.first(o))o.shift();else if(".."==f.ListWrapper.first(o))for(;".."==f.ListWrapper.first(o);){if(e.length<=0)throw new d.BaseException('Link "'+f.ListWrapper.toJSON(t)+'" has too many "../" segments.');a=e.pop(),o=f.ListWrapper.slice(o,1)}else{var i=f.ListWrapper.first(o),s=this._rootComponent,u=null;if(e.length>1){var c=e[e.length-1],l=e[e.length-2];s=c.component.componentType,u=l.component.componentType}else 1==e.length&&(s=e[0].component.componentType,u=this._rootComponent);var p=this.hasRoute(i,s),h=g.isPresent(u)&&this.hasRoute(i,u);if(h&&p){var m='Link "'+f.ListWrapper.toJSON(t)+'" is ambiguous, use "./" or "../" to disambiguate.';throw new d.BaseException(m)}h&&(a=e.pop())}if(""==o[o.length-1]&&o.pop(),o.length>0&&""==o[0]&&o.shift(),o.length<1){var m='Link "'+f.ListWrapper.toJSON(t)+'" must include a route name.';throw new d.BaseException(m)}for(var y=this._generate(o,e,a,r,t),_=e.length-1;_>=0;_--){var v=e[_];if(g.isBlank(v))break;y=v.replaceChild(y)}return y},t.prototype._generate=function(t,e,r,n,a){var o=this;void 0===n&&(n=!1);var i=this._rootComponent,s=null,u={},c=f.ListWrapper.last(e);if(g.isPresent(c)&&g.isPresent(c.component)&&(i=c.component.componentType),0==t.length){var l=this.generateDefault(i);if(g.isBlank(l))throw new d.BaseException('Link "'+f.ListWrapper.toJSON(a)+'" does not resolve to a terminal instruction.');return l}g.isPresent(r)&&!n&&(u=f.StringMapWrapper.merge(r.auxInstruction,u),s=r.component);var p=this._rules.get(i);if(g.isBlank(p))throw new d.BaseException('Component "'+g.getTypeNameForDebugging(i)+'" has no route config.');var h=0,m={};if(h<t.length&&g.isString(t[h])){var y=t[h];if(""==y||"."==y||".."==y)throw new d.BaseException('"'+y+'/" is only allowed at the beginning of a link DSL.');if(h+=1,h<t.length){var _=t[h];g.isStringMap(_)&&!g.isArray(_)&&(m=_,h+=1)}var v=(n?p.auxRulesByName:p.rulesByName).get(y);if(g.isBlank(v))throw new d.BaseException('Component "'+g.getTypeNameForDebugging(i)+'" has no route named "'+y+'".');if(g.isBlank(v.handler.componentType)){var R=v.generateComponentPathValues(m);return new P.UnresolvedInstruction(function(){return v.handler.resolveComponentType().then(function(i){return o._generate(t,e,r,n,a)})},R.urlPath,S.convertUrlParamsToArray(R.urlParams))}s=n?p.generateAuxiliary(y,m):p.generate(y,m)}for(;h<t.length&&g.isArray(t[h]);){var x=[c],b=this._generate(t[h],x,null,!0,a);u[b.component.urlPath]=b,h+=1}var O=new P.ResolvedInstruction(s,null,u);if(g.isPresent(s)&&g.isPresent(s.componentType)){var w=null;if(s.terminal)h>=t.length;else{var E=e.concat([O]),T=t.slice(h);w=this._generate(T,E,null,!1,a)}O.child=w}return O},t.prototype.hasRoute=function(t,e){var r=this._rules.get(e);return g.isBlank(r)?!1:r.hasRoute(t)},t.prototype.generateDefault=function(t){var e=this;if(g.isBlank(t))return null;var r=this._rules.get(t);if(g.isBlank(r)||g.isBlank(r.defaultRule))return null;var n=null;if(g.isPresent(r.defaultRule.handler.componentType)){var a=r.defaultRule.generate({});
return r.defaultRule.terminal||(n=this.generateDefault(r.defaultRule.handler.componentType)),new P.DefaultInstruction(a,n)}return new P.UnresolvedInstruction(function(){return r.defaultRule.handler.resolveComponentType().then(function(r){return e.generateDefault(t)})})},t=c([y.Injectable(),p(0,y.Inject(e.ROUTER_PRIMARY_COMPONENT)),l("design:paramtypes",[g.Type])],t)}();return e.RouteRegistry=O,s.define=u,r.exports}),System.register("angular2/src/router/router",["angular2/src/facade/async","angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/core","angular2/src/router/route_registry","angular2/src/router/location/location","angular2/src/router/lifecycle/route_lifecycle_reflector"],!0,function(t,e,r){function n(t,e){var r=_;return f.isBlank(t.component)?r:(f.isPresent(t.child)&&(r=n(t.child,f.isPresent(e)?e.child:null)),r.then(function(r){if(0==r)return!1;if(t.component.reuse)return!0;var n=y.getCanActivateHook(t.component.componentType);return f.isPresent(n)?n(t.component,f.isPresent(e)?e.component:null):!0}))}var a=System.global,o=a.define;a.define=void 0;var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},s=this&&this.__decorate||function(t,e,r,n){var a,o=arguments.length,i=3>o?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(3>o?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i},u=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},c=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},l=t("angular2/src/facade/async"),p=t("angular2/src/facade/collection"),f=t("angular2/src/facade/lang"),h=t("angular2/src/facade/exceptions"),g=t("angular2/core"),d=t("angular2/src/router/route_registry"),m=t("angular2/src/router/location/location"),y=t("angular2/src/router/lifecycle/route_lifecycle_reflector"),_=l.PromiseWrapper.resolve(!0),v=l.PromiseWrapper.resolve(!1),R=function(){function t(t,e,r,n){this.registry=t,this.parent=e,this.hostComponent=r,this.root=n,this.navigating=!1,this.currentInstruction=null,this._currentNavigation=_,this._outlet=null,this._auxRouters=new p.Map,this._subject=new l.EventEmitter}return t.prototype.childRouter=function(t){return this._childRouter=new x(this,t)},t.prototype.auxRouter=function(t){return new x(this,t)},t.prototype.registerPrimaryOutlet=function(t){if(f.isPresent(t.name))throw new h.BaseException("registerPrimaryOutlet expects to be called with an unnamed outlet.");if(f.isPresent(this._outlet))throw new h.BaseException("Primary outlet is already registered.");return this._outlet=t,f.isPresent(this.currentInstruction)?this.commit(this.currentInstruction,!1):_},t.prototype.unregisterPrimaryOutlet=function(t){if(f.isPresent(t.name))throw new h.BaseException("registerPrimaryOutlet expects to be called with an unnamed outlet.");this._outlet=null},t.prototype.registerAuxOutlet=function(t){var e=t.name;if(f.isBlank(e))throw new h.BaseException("registerAuxOutlet expects to be called with an outlet with a name.");var r=this.auxRouter(this.hostComponent);this._auxRouters.set(e,r),r._outlet=t;var n;return f.isPresent(this.currentInstruction)&&f.isPresent(n=this.currentInstruction.auxInstruction[e])?r.commit(n):_},t.prototype.isRouteActive=function(t){for(var e=this;f.isPresent(e.parent)&&f.isPresent(t.child);)e=e.parent,t=t.child;return f.isPresent(this.currentInstruction)&&this.currentInstruction.component==t.component},t.prototype.config=function(t){var e=this;return t.forEach(function(t){e.registry.config(e.hostComponent,t)}),this.renavigate()},t.prototype.navigate=function(t){var e=this.generate(t);return this.navigateByInstruction(e,!1)},t.prototype.navigateByUrl=function(t,e){var r=this;return void 0===e&&(e=!1),this._currentNavigation=this._currentNavigation.then(function(n){return r.lastNavigationAttempt=t,r._startNavigating(),r._afterPromiseFinishNavigating(r.recognize(t).then(function(t){return f.isBlank(t)?!1:r._navigate(t,e)}))})},t.prototype.navigateByInstruction=function(t,e){var r=this;return void 0===e&&(e=!1),f.isBlank(t)?v:this._currentNavigation=this._currentNavigation.then(function(n){return r._startNavigating(),r._afterPromiseFinishNavigating(r._navigate(t,e))})},t.prototype._settleInstruction=function(t){var e=this;return t.resolveComponent().then(function(r){var n=[];return f.isPresent(t.component)&&(t.component.reuse=!1),f.isPresent(t.child)&&n.push(e._settleInstruction(t.child)),p.StringMapWrapper.forEach(t.auxInstruction,function(t,r){n.push(e._settleInstruction(t))}),l.PromiseWrapper.all(n)})},t.prototype._navigate=function(t,e){var r=this;return this._settleInstruction(t).then(function(e){return r._routerCanReuse(t)}).then(function(e){return r._canActivate(t)}).then(function(n){return n?r._routerCanDeactivate(t).then(function(n){return n?r.commit(t,e).then(function(e){return r._emitNavigationFinish(t.toRootUrl()),!0}):void 0}):!1})},t.prototype._emitNavigationFinish=function(t){l.ObservableWrapper.callEmit(this._subject,t)},t.prototype._emitNavigationFail=function(t){l.ObservableWrapper.callError(this._subject,t)},t.prototype._afterPromiseFinishNavigating=function(t){var e=this;return l.PromiseWrapper.catchError(t.then(function(t){return e._finishNavigating()}),function(t){throw e._finishNavigating(),t})},t.prototype._routerCanReuse=function(t){var e=this;return f.isBlank(this._outlet)?v:f.isBlank(t.component)?_:this._outlet.routerCanReuse(t.component).then(function(r){return t.component.reuse=r,r&&f.isPresent(e._childRouter)&&f.isPresent(t.child)?e._childRouter._routerCanReuse(t.child):void 0})},t.prototype._canActivate=function(t){return n(t,this.currentInstruction)},t.prototype._routerCanDeactivate=function(t){var e=this;if(f.isBlank(this._outlet))return _;var r,n=null,a=!1,o=null;return f.isPresent(t)&&(n=t.child,o=t.component,a=f.isBlank(t.component)||t.component.reuse),r=a?_:this._outlet.routerCanDeactivate(o),r.then(function(t){return 0==t?!1:f.isPresent(e._childRouter)?e._childRouter._routerCanDeactivate(n):!0})},t.prototype.commit=function(t,e){var r=this;void 0===e&&(e=!1),this.currentInstruction=t;var n=_;if(f.isPresent(this._outlet)&&f.isPresent(t.component)){var a=t.component;n=a.reuse?this._outlet.reuse(a):this.deactivate(t).then(function(t){return r._outlet.activate(a)}),f.isPresent(t.child)&&(n=n.then(function(e){return f.isPresent(r._childRouter)?r._childRouter.commit(t.child):void 0}))}var o=[];return this._auxRouters.forEach(function(e,r){f.isPresent(t.auxInstruction[r])&&o.push(e.commit(t.auxInstruction[r]))}),n.then(function(t){return l.PromiseWrapper.all(o)})},t.prototype._startNavigating=function(){this.navigating=!0},t.prototype._finishNavigating=function(){this.navigating=!1},t.prototype.subscribe=function(t,e){return l.ObservableWrapper.subscribe(this._subject,t,e)},t.prototype.deactivate=function(t){var e=this,r=null,n=null;f.isPresent(t)&&(r=t.child,n=t.component);var a=_;return f.isPresent(this._childRouter)&&(a=this._childRouter.deactivate(r)),f.isPresent(this._outlet)&&(a=a.then(function(t){return e._outlet.deactivate(n)})),a},t.prototype.recognize=function(t){var e=this._getAncestorInstructions();return this.registry.recognize(t,e)},t.prototype._getAncestorInstructions=function(){for(var t=[this.currentInstruction],e=this;f.isPresent(e=e.parent);)t.unshift(e.currentInstruction);return t},t.prototype.renavigate=function(){return f.isBlank(this.lastNavigationAttempt)?this._currentNavigation:this.navigateByUrl(this.lastNavigationAttempt)},t.prototype.generate=function(t){var e=this._getAncestorInstructions();return this.registry.generate(t,e)},t=s([g.Injectable(),u("design:paramtypes",[d.RouteRegistry,t,Object,t])],t)}();e.Router=R;var P=function(t){function e(e,r,n){var a=this;t.call(this,e,null,n),this.root=this,this._location=r,this._locationSub=this._location.subscribe(function(t){a.recognize(t.url).then(function(e){f.isPresent(e)?a.navigateByInstruction(e,f.isPresent(t.pop)).then(function(r){if(!f.isPresent(t.pop)||"hashchange"==t.type){var n=e.toUrlPath(),o=e.toUrlQuery();n.length>0&&"/"!=n[0]&&(n="/"+n),"hashchange"==t.type?e.toRootUrl()!=a._location.path()&&a._location.replaceState(n,o):a._location.go(n,o)}}):a._emitNavigationFail(t.url)})}),this.registry.configFromComponent(n),this.navigateByUrl(r.path())}return i(e,t),e.prototype.commit=function(e,r){var n=this;void 0===r&&(r=!1);var a=e.toUrlPath(),o=e.toUrlQuery();a.length>0&&"/"!=a[0]&&(a="/"+a);var i=t.prototype.commit.call(this,e);return r||(i=i.then(function(t){n._location.go(a,o)})),i},e.prototype.dispose=function(){f.isPresent(this._locationSub)&&(l.ObservableWrapper.dispose(this._locationSub),this._locationSub=null)},e=s([g.Injectable(),c(2,g.Inject(d.ROUTER_PRIMARY_COMPONENT)),u("design:paramtypes",[d.RouteRegistry,m.Location,f.Type])],e)}(R);e.RootRouter=P;var x=function(t){function e(e,r){t.call(this,e.registry,e,r,e.root),this.parent=e}return i(e,t),e.prototype.navigateByUrl=function(t,e){return void 0===e&&(e=!1),this.parent.navigateByUrl(t,e)},e.prototype.navigateByInstruction=function(t,e){return void 0===e&&(e=!1),this.parent.navigateByInstruction(t,e)},e}(R);return a.define=o,r.exports}),System.register("angular2/router",["angular2/src/router/router","angular2/src/router/directives/router_outlet","angular2/src/router/directives/router_link","angular2/src/router/instruction","angular2/src/router/location/platform_location","angular2/src/router/route_registry","angular2/src/router/location/location_strategy","angular2/src/router/location/hash_location_strategy","angular2/src/router/location/path_location_strategy","angular2/src/router/location/location","angular2/src/router/route_config/route_config_decorator","angular2/src/router/route_definition","angular2/src/router/lifecycle/lifecycle_annotations","angular2/src/router/instruction","angular2/core","angular2/src/router/router_providers_common","angular2/src/router/router_providers","angular2/src/router/directives/router_outlet","angular2/src/router/directives/router_link","angular2/src/facade/lang"],!0,function(t,e,r){function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var a=System.global,o=a.define;a.define=void 0;var i=t("angular2/src/router/router");e.Router=i.Router;var s=t("angular2/src/router/directives/router_outlet");e.RouterOutlet=s.RouterOutlet;var u=t("angular2/src/router/directives/router_link");e.RouterLink=u.RouterLink;var c=t("angular2/src/router/instruction");e.RouteParams=c.RouteParams,e.RouteData=c.RouteData;var l=t("angular2/src/router/location/platform_location");e.PlatformLocation=l.PlatformLocation;var p=t("angular2/src/router/route_registry");e.RouteRegistry=p.RouteRegistry,e.ROUTER_PRIMARY_COMPONENT=p.ROUTER_PRIMARY_COMPONENT;var f=t("angular2/src/router/location/location_strategy");e.LocationStrategy=f.LocationStrategy,e.APP_BASE_HREF=f.APP_BASE_HREF;var h=t("angular2/src/router/location/hash_location_strategy");e.HashLocationStrategy=h.HashLocationStrategy;var g=t("angular2/src/router/location/path_location_strategy");e.PathLocationStrategy=g.PathLocationStrategy;var d=t("angular2/src/router/location/location");e.Location=d.Location,n(t("angular2/src/router/route_config/route_config_decorator")),n(t("angular2/src/router/route_definition"));var m=t("angular2/src/router/lifecycle/lifecycle_annotations");e.CanActivate=m.CanActivate;var y=t("angular2/src/router/instruction");e.Instruction=y.Instruction,e.ComponentInstruction=y.ComponentInstruction;var _=t("angular2/core");e.OpaqueToken=_.OpaqueToken;var v=t("angular2/src/router/router_providers_common");e.ROUTER_PROVIDERS_COMMON=v.ROUTER_PROVIDERS_COMMON;var R=t("angular2/src/router/router_providers");e.ROUTER_PROVIDERS=R.ROUTER_PROVIDERS,e.ROUTER_BINDINGS=R.ROUTER_BINDINGS;var P=t("angular2/src/router/directives/router_outlet"),x=t("angular2/src/router/directives/router_link"),S=t("angular2/src/facade/lang");return e.ROUTER_DIRECTIVES=S.CONST_EXPR([P.RouterOutlet,x.RouterLink]),a.define=o,r.exports});