diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..8ed330c4a2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ + +root = true + +[{src,scripts}/**.{ts,json,js}] +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 4 diff --git a/demo-shell-ng2/dist/app/app/app.component.js b/demo-shell-ng2/dist/app/app/app.component.js index 4b8da1a4a5..2986012b7a 100644 --- a/demo-shell-ng2/dist/app/app/app.component.js +++ b/demo-shell-ng2/dist/app/app/app.component.js @@ -42,41 +42,38 @@ System.register(['angular2/core', 'angular2/router', './components/login', './se components_1 = components_1_1; }], execute: function() { - AppComponent = (function () { - function AppComponent(auth, router, alfrescoService) { + let AppComponent = class AppComponent { + constructor(auth, router, alfrescoService) { this.auth = auth; this.router = router; alfrescoService.host = 'http://192.168.99.100:8080'; } - AppComponent.prototype.isActive = function (instruction) { + isActive(instruction) { return this.router.isRouteActive(this.router.generate(instruction)); - }; - AppComponent.prototype.isLoggedIn = function () { + } + isLoggedIn() { return this.auth.isLoggedIn(); - }; - AppComponent.prototype.onLogout = function (event) { - var _this = this; + } + onLogout(event) { event.preventDefault(); this.auth.logout() - .subscribe(function () { return _this.router.navigate(['Login']); }); - }; - AppComponent = __decorate([ - core_1.Component({ - selector: 'my-app', - templateUrl: 'app/app.component.html', - directives: [router_1.ROUTER_DIRECTIVES, AuthRouterOutlet_1.AuthRouterOutlet] - }), - router_1.RouteConfig([ - { path: '/', name: 'Home', component: home_view_1.HomeView, useAsDefault: true }, - { path: '/login', name: 'Login', component: login_1.Login }, - { path: '/page1', name: 'Page1', component: page1_view_1.Page1View }, - { path: '/page2', name: 'Page2', component: page2_view_1.Page2View } - ]), - __metadata('design:paramtypes', [authentication_1.Authentication, router_1.Router, (typeof (_a = typeof components_1.AlfrescoService !== 'undefined' && components_1.AlfrescoService) === 'function' && _a) || Object]) - ], AppComponent); - return AppComponent; - var _a; - }()); + .subscribe(() => this.router.navigate(['Login'])); + } + }; + AppComponent = __decorate([ + core_1.Component({ + selector: 'my-app', + templateUrl: 'app/app.component.html', + directives: [router_1.ROUTER_DIRECTIVES, AuthRouterOutlet_1.AuthRouterOutlet] + }), + router_1.RouteConfig([ + { path: '/', name: 'Home', component: home_view_1.HomeView, useAsDefault: true }, + { path: '/login', name: 'Login', component: login_1.Login }, + { path: '/page1', name: 'Page1', component: page1_view_1.Page1View }, + { path: '/page2', name: 'Page2', component: page2_view_1.Page2View } + ]), + __metadata('design:paramtypes', [authentication_1.Authentication, router_1.Router, components_1.AlfrescoService]) + ], AppComponent); exports_1("AppComponent", AppComponent); } } diff --git a/demo-shell-ng2/dist/app/app/app.component.js.map b/demo-shell-ng2/dist/app/app/app.component.js.map index d0ea9fac14..4de54faba3 100644 --- a/demo-shell-ng2/dist/app/app/app.component.js.map +++ b/demo-shell-ng2/dist/app/app/app.component.js.map @@ -1 +1 @@ -{"version":3,"sources":["app.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqBA;gBAEI,sBAAmB,IAAmB,EACnB,MAAa,EACpB,eAA+B;oBAFxB,SAAI,GAAJ,IAAI,CAAe;oBACnB,WAAM,GAAN,MAAM,CAAO;oBAE5B,eAAe,CAAC,IAAI,GAAG,4BAA4B,CAAC;gBACxD,CAAC;gBAED,+BAAQ,GAAR,UAAS,WAAiB;oBACtB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;gBACxE,CAAC;gBAED,iCAAU,GAAV;oBACI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClC,CAAC;gBAED,+BAAQ,GAAR,UAAS,KAAK;oBAAd,iBAMC;oBALG,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;yBACb,SAAS,CACN,cAAM,OAAA,KAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,EAA/B,CAA+B,CACxC,CAAC;gBACV,CAAC;gBAjCL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,QAAQ;wBAClB,WAAW,EAAE,wBAAwB;wBACrC,UAAU,EAAE,CAAC,0BAAiB,EAAE,mCAAgB,CAAC;qBACpD,CAAC;oBACD,oBAAW,CAAC;wBACT,EAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAQ,EAAE,YAAY,EAAE,IAAI,EAAC;wBAClE,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAK,EAAC;wBACjD,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAS,EAAC;wBACrD,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAS,EAAC;qBACxD,CAAC;;gCAAA;gBAwBF,mBAAC;;YAAD,CAvBA,AAuBC,IAAA;YAvBD,uCAuBC,CAAA","file":"app.component.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {Router, RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';\nimport {Login} from './components/login';\nimport {Authentication} from './services/authentication';\nimport {AuthRouterOutlet} from './components/AuthRouterOutlet';\nimport {HomeView} from './components/home.view';\nimport {Page1View} from './components/page1.view';\nimport {Page2View} from './components/page2.view';\nimport {AlfrescoService} from 'ng2-alfresco/components';\n\n@Component({\n selector: 'my-app',\n templateUrl: 'app/app.component.html',\n directives: [ROUTER_DIRECTIVES, AuthRouterOutlet]\n})\n@RouteConfig([\n {path: '/', name: 'Home', component: HomeView, useAsDefault: true},\n {path: '/login', name: 'Login', component: Login},\n {path: '/page1', name: 'Page1', component: Page1View},\n {path: '/page2', name: 'Page2', component: Page2View}\n])\nexport class AppComponent {\n\n constructor(public auth:Authentication,\n public router:Router,\n alfrescoService:AlfrescoService) {\n alfrescoService.host = 'http://192.168.99.100:8080';\n }\n\n isActive(instruction:any[]):boolean {\n return this.router.isRouteActive(this.router.generate(instruction));\n }\n\n isLoggedIn():boolean {\n return this.auth.isLoggedIn();\n }\n\n onLogout(event) {\n event.preventDefault();\n this.auth.logout()\n .subscribe(\n () => this.router.navigate(['Login'])\n );\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["app.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqBA;gBAEI,YAAmB,IAAmB,EACnB,MAAa,EACpB,eAA+B;oBAFxB,SAAI,GAAJ,IAAI,CAAe;oBACnB,WAAM,GAAN,MAAM,CAAO;oBAE5B,eAAe,CAAC,IAAI,GAAG,4BAA4B,CAAC;gBACxD,CAAC;gBAED,QAAQ,CAAC,WAAiB;oBACtB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;gBACxE,CAAC;gBAED,UAAU;oBACN,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClC,CAAC;gBAED,QAAQ,CAAC,KAAK;oBACV,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;yBACb,SAAS,CACN,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CACxC,CAAC;gBACV,CAAC;YACL,CAAC;YAlCD;gBAAC,gBAAS,CAAC;oBACP,QAAQ,EAAE,QAAQ;oBAClB,WAAW,EAAE,wBAAwB;oBACrC,UAAU,EAAE,CAAC,0BAAiB,EAAE,mCAAgB,CAAC;iBACpD,CAAC;gBACD,oBAAW,CAAC;oBACT,EAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAQ,EAAE,YAAY,EAAE,IAAI,EAAC;oBAClE,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAK,EAAC;oBACjD,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAS,EAAC;oBACrD,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAS,EAAC;iBACxD,CAAC;;4BAAA;YACF,uCAuBC,CAAA","file":"app.component.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {Router, RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';\nimport {Login} from './components/login';\nimport {Authentication} from './services/authentication';\nimport {AuthRouterOutlet} from './components/AuthRouterOutlet';\nimport {HomeView} from './components/home.view';\nimport {Page1View} from './components/page1.view';\nimport {Page2View} from './components/page2.view';\nimport {AlfrescoService} from 'ng2-alfresco/components';\n\n@Component({\n selector: 'my-app',\n templateUrl: 'app/app.component.html',\n directives: [ROUTER_DIRECTIVES, AuthRouterOutlet]\n})\n@RouteConfig([\n {path: '/', name: 'Home', component: HomeView, useAsDefault: true},\n {path: '/login', name: 'Login', component: Login},\n {path: '/page1', name: 'Page1', component: Page1View},\n {path: '/page2', name: 'Page2', component: Page2View}\n])\nexport class AppComponent {\n\n constructor(public auth:Authentication,\n public router:Router,\n alfrescoService:AlfrescoService) {\n alfrescoService.host = 'http://192.168.99.100:8080';\n }\n\n isActive(instruction:any[]):boolean {\n return this.router.isRouteActive(this.router.generate(instruction));\n }\n\n isLoggedIn():boolean {\n return this.auth.isLoggedIn();\n }\n\n onLogout(event) {\n event.preventDefault();\n this.auth.logout()\n .subscribe(\n () => this.router.navigate(['Login'])\n );\n }\n}\n"]} \ No newline at end of file diff --git a/demo-shell-ng2/dist/app/app/components/AuthRouterOutlet.js b/demo-shell-ng2/dist/app/app/components/AuthRouterOutlet.js index f3f7320f27..f77f597354 100644 --- a/demo-shell-ng2/dist/app/app/components/AuthRouterOutlet.js +++ b/demo-shell-ng2/dist/app/app/components/AuthRouterOutlet.js @@ -1,11 +1,6 @@ System.register(['angular2/core', 'angular2/router', '../services/authentication'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); @@ -32,33 +27,31 @@ System.register(['angular2/core', 'angular2/router', '../services/authentication authentication_1 = authentication_1_1; }], execute: function() { - AuthRouterOutlet = (function (_super) { - __extends(AuthRouterOutlet, _super); - function AuthRouterOutlet(_elementRef, _loader, _parentRouter, nameAttr, authentication) { - _super.call(this, _elementRef, _loader, _parentRouter, nameAttr); + let AuthRouterOutlet = class AuthRouterOutlet extends router_1.RouterOutlet { + constructor(_elementRef, _loader, _parentRouter, nameAttr, authentication) { + super(_elementRef, _loader, _parentRouter, nameAttr); this.authentication = authentication; this.router = _parentRouter; this.publicRoutes = [ '', 'login', 'signup' ]; } - AuthRouterOutlet.prototype.activate = function (instruction) { + activate(instruction) { if (this._canActivate(instruction.urlPath)) { - return _super.prototype.activate.call(this, instruction); + return super.activate(instruction); } this.router.navigate(['Login']); - }; - AuthRouterOutlet.prototype._canActivate = function (url) { + } + _canActivate(url) { return this.publicRoutes.indexOf(url) !== -1 || this.authentication.isLoggedIn(); - }; - AuthRouterOutlet = __decorate([ - core_1.Directive({ selector: 'auth-router-outlet' }), - __param(3, core_1.Attribute('name')), - __metadata('design:paramtypes', [core_1.ElementRef, core_1.DynamicComponentLoader, router_1.Router, String, authentication_1.Authentication]) - ], AuthRouterOutlet); - return AuthRouterOutlet; - }(router_1.RouterOutlet)); + } + }; + AuthRouterOutlet = __decorate([ + core_1.Directive({ selector: 'auth-router-outlet' }), + __param(3, core_1.Attribute('name')), + __metadata('design:paramtypes', [core_1.ElementRef, core_1.DynamicComponentLoader, router_1.Router, String, authentication_1.Authentication]) + ], AuthRouterOutlet); exports_1("AuthRouterOutlet", AuthRouterOutlet); } } diff --git a/demo-shell-ng2/dist/app/app/components/AuthRouterOutlet.js.map b/demo-shell-ng2/dist/app/app/components/AuthRouterOutlet.js.map index ce547ec67d..3b1042cc6d 100644 --- a/demo-shell-ng2/dist/app/app/components/AuthRouterOutlet.js.map +++ b/demo-shell-ng2/dist/app/app/components/AuthRouterOutlet.js.map @@ -1 +1 @@ -{"version":3,"sources":["components/AuthRouterOutlet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA;gBAAsC,oCAAY;gBAK9C,0BACI,WAAuB,EAAE,OAA+B,EACxD,aAAqB,EAAqB,QAAgB,EAClD,cAA8B;oBAEtC,kBAAM,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;oBAF7C,mBAAc,GAAd,cAAc,CAAgB;oBAItC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;oBAC5B,IAAI,CAAC,YAAY,GAAG;wBAChB,EAAE,EAAE,OAAO,EAAE,QAAQ;qBACxB,CAAC;gBACN,CAAC;gBAED,mCAAQ,GAAR,UAAS,WAAiC;oBACtC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;wBACzC,MAAM,CAAC,gBAAK,CAAC,QAAQ,YAAC,WAAW,CAAC,CAAC;oBACvC,CAAC;oBAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBACpC,CAAC;gBAED,uCAAY,GAAZ,UAAa,GAAG;oBACZ,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;2BACrC,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;gBAC5C,CAAC;gBA9BL;oBAAC,gBAAS,CAAC,EAAC,QAAQ,EAAE,oBAAoB,EAAC,CAAC;+BAQZ,gBAAS,CAAC,MAAM,CAAC;;oCARL;gBA+B5C,uBAAC;YAAD,CA9BA,AA8BC,CA9BqC,qBAAY,GA8BjD;YA9BD,+CA8BC,CAAA","file":"AuthRouterOutlet.js","sourcesContent":["import { ElementRef, DynamicComponentLoader, Directive, Attribute } from 'angular2/core';\nimport { Router, RouterOutlet, ComponentInstruction } from 'angular2/router';\nimport {Authentication} from '../services/authentication';\n\n@Directive({selector: 'auth-router-outlet'})\nexport class AuthRouterOutlet extends RouterOutlet {\n\n publicRoutes: Array;\n private router: Router;\n\n constructor(\n _elementRef: ElementRef, _loader: DynamicComponentLoader,\n _parentRouter: Router, @Attribute('name') nameAttr: string,\n private authentication: Authentication\n ) {\n super(_elementRef, _loader, _parentRouter, nameAttr);\n\n this.router = _parentRouter;\n this.publicRoutes = [\n '', 'login', 'signup'\n ];\n }\n\n activate(instruction: ComponentInstruction) {\n if (this._canActivate(instruction.urlPath)) {\n return super.activate(instruction);\n }\n\n this.router.navigate(['Login']);\n }\n\n _canActivate(url) {\n return this.publicRoutes.indexOf(url) !== -1\n || this.authentication.isLoggedIn();\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["components/AuthRouterOutlet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA,sDAAsC,qBAAY;gBAK9C,YACI,WAAuB,EAAE,OAA+B,EACxD,aAAqB,EAAqB,QAAgB,EAClD,cAA8B;oBAEtC,MAAM,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;oBAF7C,mBAAc,GAAd,cAAc,CAAgB;oBAItC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;oBAC5B,IAAI,CAAC,YAAY,GAAG;wBAChB,EAAE,EAAE,OAAO,EAAE,QAAQ;qBACxB,CAAC;gBACN,CAAC;gBAED,QAAQ,CAAC,WAAiC;oBACtC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;wBACzC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;oBACvC,CAAC;oBAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBACpC,CAAC;gBAED,YAAY,CAAC,GAAG;oBACZ,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;2BACrC,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;gBAC5C,CAAC;YACL,CAAC;YA/BD;gBAAC,gBAAS,CAAC,EAAC,QAAQ,EAAE,oBAAoB,EAAC,CAAC;2BAQZ,gBAAS,CAAC,MAAM,CAAC;;gCARL;YAC5C,+CA8BC,CAAA","file":"AuthRouterOutlet.js","sourcesContent":["import { ElementRef, DynamicComponentLoader, Directive, Attribute } from 'angular2/core';\nimport { Router, RouterOutlet, ComponentInstruction } from 'angular2/router';\nimport {Authentication} from '../services/authentication';\n\n@Directive({selector: 'auth-router-outlet'})\nexport class AuthRouterOutlet extends RouterOutlet {\n\n publicRoutes: Array;\n private router: Router;\n\n constructor(\n _elementRef: ElementRef, _loader: DynamicComponentLoader,\n _parentRouter: Router, @Attribute('name') nameAttr: string,\n private authentication: Authentication\n ) {\n super(_elementRef, _loader, _parentRouter, nameAttr);\n\n this.router = _parentRouter;\n this.publicRoutes = [\n '', 'login', 'signup'\n ];\n }\n\n activate(instruction: ComponentInstruction) {\n if (this._canActivate(instruction.urlPath)) {\n return super.activate(instruction);\n }\n\n this.router.navigate(['Login']);\n }\n\n _canActivate(url) {\n return this.publicRoutes.indexOf(url) !== -1\n || this.authentication.isLoggedIn();\n }\n}\n"]} \ No newline at end of file diff --git a/demo-shell-ng2/dist/app/app/components/home.view.js b/demo-shell-ng2/dist/app/app/components/home.view.js index 6d7d20faf3..e41664c9bb 100644 --- a/demo-shell-ng2/dist/app/app/components/home.view.js +++ b/demo-shell-ng2/dist/app/app/components/home.view.js @@ -21,31 +21,58 @@ System.register(['angular2/core', 'ng2-alfresco/components'], function(exports_1 components_1 = components_1_1; }], execute: function() { - HomeView = (function () { - function HomeView() { + let HomeView = class HomeView { + constructor() { this.thumbnails = true; this.breadcrumb = false; this.navigation = true; this.downloads = true; this.events = []; } - HomeView.prototype.onItemClick = function ($event) { + onItemClick($event) { console.log($event.value); this.events.push({ name: 'Item Clicked', value: $event.value }); - }; - HomeView = __decorate([ - core_1.Component({ - selector: 'home-view', - template: "\n
\n
\n
\n
    \n
  • \n
  • \n
  • \n
  • \n
\n
\n
    \n
  • \n {{event.name}}: {{event.value.displayName}}\n
  • \n
\n
\n
\n \n \n
\n
\n
\n ", - directives: [components_1.DocumentList] - }), - __metadata('design:paramtypes', []) - ], HomeView); - return HomeView; - }()); + } + }; + HomeView = __decorate([ + core_1.Component({ + selector: 'home-view', + template: ` +
+
+
+
    +
  • +
  • +
  • +
  • +
+
+
    +
  • + {{event.name}}: {{event.value.displayName}} +
  • +
+
+
+ + +
+
+
+ `, + directives: [components_1.DocumentList] + }), + __metadata('design:paramtypes', []) + ], HomeView); exports_1("HomeView", HomeView); } } diff --git a/demo-shell-ng2/dist/app/app/components/home.view.js.map b/demo-shell-ng2/dist/app/app/components/home.view.js.map index 1939fa7598..10ed060ec5 100644 --- a/demo-shell-ng2/dist/app/app/components/home.view.js.map +++ b/demo-shell-ng2/dist/app/app/components/home.view.js.map @@ -1 +1 @@ -{"version":3,"sources":["components/home.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAoCA;gBAAA;oBACI,eAAU,GAAY,IAAI,CAAC;oBAC3B,eAAU,GAAY,KAAK,CAAC;oBAC5B,eAAU,GAAY,IAAI,CAAC;oBAC3B,cAAS,GAAY,IAAI,CAAC;oBAE1B,WAAM,GAAU,EAAE,CAAC;gBASvB,CAAC;gBAPG,8BAAW,GAAX,UAAY,MAAM;oBACd,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBAC1B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;wBACb,IAAI,EAAE,cAAc;wBACpB,KAAK,EAAE,MAAM,CAAC,KAAK;qBACtB,CAAC,CAAC;gBACP,CAAC;gBA/CL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,WAAW;wBACrB,QAAQ,EAAE,+6CA4BT;wBACD,UAAU,EAAE,CAAC,yBAAY,CAAC;qBAC7B,CAAC;;4BAAA;gBAgBF,eAAC;YAAD,CAfA,AAeC,IAAA;YAfD,+BAeC,CAAA","file":"home.view.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {DocumentList} from 'ng2-alfresco/components';\n\n@Component({\n selector: 'home-view',\n template: `\n
\n
\n
\n
    \n
  • \n
  • \n
  • \n
  • \n
\n
\n
    \n
  • \n {{event.name}}: {{event.value.displayName}}\n
  • \n
\n
\n
\n \n \n
\n
\n
\n `,\n directives: [DocumentList]\n})\nexport class HomeView {\n thumbnails: boolean = true;\n breadcrumb: boolean = false;\n navigation: boolean = true;\n downloads: boolean = true;\n\n events: any[] = [];\n\n onItemClick($event) {\n console.log($event.value);\n this.events.push({\n name: 'Item Clicked',\n value: $event.value\n });\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["components/home.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAoCA;gBAAA;oBACI,eAAU,GAAY,IAAI,CAAC;oBAC3B,eAAU,GAAY,KAAK,CAAC;oBAC5B,eAAU,GAAY,IAAI,CAAC;oBAC3B,cAAS,GAAY,IAAI,CAAC;oBAE1B,WAAM,GAAU,EAAE,CAAC;gBASvB,CAAC;gBAPG,WAAW,CAAC,MAAM;oBACd,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBAC1B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;wBACb,IAAI,EAAE,cAAc;wBACpB,KAAK,EAAE,MAAM,CAAC,KAAK;qBACtB,CAAC,CAAC;gBACP,CAAC;YACL,CAAC;YAhDD;gBAAC,gBAAS,CAAC;oBACP,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BT;oBACD,UAAU,EAAE,CAAC,yBAAY,CAAC;iBAC7B,CAAC;;wBAAA;YACF,+BAeC,CAAA","file":"home.view.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {DocumentList} from 'ng2-alfresco/components';\n\n@Component({\n selector: 'home-view',\n template: `\n
\n
\n
\n
    \n
  • \n
  • \n
  • \n
  • \n
\n
\n
    \n
  • \n {{event.name}}: {{event.value.displayName}}\n
  • \n
\n
\n
\n \n \n
\n
\n
\n `,\n directives: [DocumentList]\n})\nexport class HomeView {\n thumbnails: boolean = true;\n breadcrumb: boolean = false;\n navigation: boolean = true;\n downloads: boolean = true;\n\n events: any[] = [];\n\n onItemClick($event) {\n console.log($event.value);\n this.events.push({\n name: 'Item Clicked',\n value: $event.value\n });\n }\n}\n"]} \ No newline at end of file diff --git a/demo-shell-ng2/dist/app/app/components/login.js b/demo-shell-ng2/dist/app/app/components/login.js index 7169842b0b..1d8f7ac518 100644 --- a/demo-shell-ng2/dist/app/app/components/login.js +++ b/demo-shell-ng2/dist/app/app/components/login.js @@ -27,8 +27,8 @@ System.register(['angular2/core', 'angular2/router', 'angular2/common', '../serv authentication_1 = authentication_1_1; }], execute: function() { - Login = (function () { - function Login(fb, auth, router) { + let Login = class Login { + constructor(fb, auth, router) { this.auth = auth; this.router = router; this.error = false; @@ -37,33 +37,31 @@ System.register(['angular2/core', 'angular2/router', 'angular2/common', '../serv password: ['', common_1.Validators.required] }); } - Login.prototype.isErrorStyle = function (field) { + isErrorStyle(field) { if (field.valid) { return false; } else { return true; } - }; - Login.prototype.onSubmit = function (value, event) { - var _this = this; + } + onSubmit(value, event) { event.preventDefault(); this.auth.login('POST', value.username, value.password) - .subscribe(function (token) { return _this.router.navigate(['Home']); }, function () { - _this.error = true; + .subscribe((token) => this.router.navigate(['Home']), () => { + this.error = true; }); - }; - Login = __decorate([ - core_1.Component({ - selector: 'login', - directives: [router_1.ROUTER_DIRECTIVES, common_1.FORM_DIRECTIVES], - templateUrl: 'app/template/login.component.html', - styleUrls: ['app/style/login.component.css'], - }), - __metadata('design:paramtypes', [common_1.FormBuilder, authentication_1.Authentication, router_1.Router]) - ], Login); - return Login; - }()); + } + }; + Login = __decorate([ + core_1.Component({ + selector: 'login', + directives: [router_1.ROUTER_DIRECTIVES, common_1.FORM_DIRECTIVES], + templateUrl: 'app/template/login.component.html', + styleUrls: ['app/style/login.component.css'], + }), + __metadata('design:paramtypes', [common_1.FormBuilder, authentication_1.Authentication, router_1.Router]) + ], Login); exports_1("Login", Login); } } diff --git a/demo-shell-ng2/dist/app/app/components/login.js.map b/demo-shell-ng2/dist/app/app/components/login.js.map index 5a76be9cec..6d837b57fd 100644 --- a/demo-shell-ng2/dist/app/app/components/login.js.map +++ b/demo-shell-ng2/dist/app/app/components/login.js.map @@ -1 +1 @@ -{"version":3,"sources":["components/login.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAWA;gBAYI,eAAY,EAAc,EAAS,IAAmB,EAAS,MAAa;oBAAzC,SAAI,GAAJ,IAAI,CAAe;oBAAS,WAAM,GAAN,MAAM,CAAO;oBAV5E,UAAK,GAAW,KAAK,CAAC;oBAWlB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC;wBACjB,QAAQ,EAAE,CAAC,EAAE,EAAE,mBAAU,CAAC,OAAO,CAAC,CAAC,mBAAU,CAAC,QAAQ,EAAE,mBAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBAClF,QAAQ,EAAE,CAAC,EAAE,EAAE,mBAAU,CAAC,QAAQ,CAAC;qBACtC,CAAC,CAAC;gBACP,CAAC;gBAbD,4BAAY,GAAZ,UAAa,KAAkB;oBAC3B,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;wBACd,MAAM,CAAC,KAAK,CAAC;oBACjB,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,IAAI,CAAC;oBAChB,CAAC;gBACL,CAAC;gBASD,wBAAQ,GAAR,UAAS,KAAS,EAAE,KAAK;oBAAzB,iBASC;oBARG,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;yBAClD,SAAS,CACN,UAAC,KAAS,IAAK,OAAA,KAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,EAA9B,CAA8B,EAC7C;wBACI,KAAI,CAAC,KAAK,GAAG,IAAI,CAAC;oBACtB,CAAC,CACJ,CAAC;gBACV,CAAC;gBAlCL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,OAAO;wBACjB,UAAU,EAAE,CAAC,0BAAiB,EAAE,wBAAe,CAAC;wBAChD,WAAW,EAAE,mCAAmC;wBAChD,SAAS,EAAE,CAAC,+BAA+B,CAAC;qBAC/C,CAAC;;yBAAA;gBA8BF,YAAC;YAAD,CA7BA,AA6BC,IAAA;YA7BD,yBA6BC,CAAA","file":"login.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {Router, ROUTER_DIRECTIVES} from 'angular2/router';\nimport {FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators} from 'angular2/common';\nimport {Authentication} from '../services/authentication';\n\n@Component({\n selector: 'login',\n directives: [ROUTER_DIRECTIVES, FORM_DIRECTIVES],\n templateUrl: 'app/template/login.component.html',\n styleUrls: ['app/style/login.component.css'],\n})\nexport class Login {\n form:ControlGroup;\n error:boolean = false;\n\n isErrorStyle(field:ControlGroup) {\n if (field.valid) {\n return false;\n } else {\n return true;\n }\n }\n\n constructor(fb:FormBuilder, public auth:Authentication, public router:Router) {\n this.form = fb.group({\n username: ['', Validators.compose([Validators.required, Validators.minLength(4)])],\n password: ['', Validators.required]\n });\n }\n\n onSubmit(value:any, event) {\n event.preventDefault();\n this.auth.login('POST', value.username, value.password)\n .subscribe(\n (token:any) => this.router.navigate(['Home']),\n () => {\n this.error = true;\n }\n );\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["components/login.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAWA;gBAYI,YAAY,EAAc,EAAS,IAAmB,EAAS,MAAa;oBAAzC,SAAI,GAAJ,IAAI,CAAe;oBAAS,WAAM,GAAN,MAAM,CAAO;oBAV5E,UAAK,GAAW,KAAK,CAAC;oBAWlB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC;wBACjB,QAAQ,EAAE,CAAC,EAAE,EAAE,mBAAU,CAAC,OAAO,CAAC,CAAC,mBAAU,CAAC,QAAQ,EAAE,mBAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBAClF,QAAQ,EAAE,CAAC,EAAE,EAAE,mBAAU,CAAC,QAAQ,CAAC;qBACtC,CAAC,CAAC;gBACP,CAAC;gBAbD,YAAY,CAAC,KAAkB;oBAC3B,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;wBACd,MAAM,CAAC,KAAK,CAAC;oBACjB,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,IAAI,CAAC;oBAChB,CAAC;gBACL,CAAC;gBASD,QAAQ,CAAC,KAAS,EAAE,KAAK;oBACrB,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;yBAClD,SAAS,CACN,CAAC,KAAS,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,EAC7C;wBACI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;oBACtB,CAAC,CACJ,CAAC;gBACV,CAAC;YACL,CAAC;YAnCD;gBAAC,gBAAS,CAAC;oBACP,QAAQ,EAAE,OAAO;oBACjB,UAAU,EAAE,CAAC,0BAAiB,EAAE,wBAAe,CAAC;oBAChD,WAAW,EAAE,mCAAmC;oBAChD,SAAS,EAAE,CAAC,+BAA+B,CAAC;iBAC/C,CAAC;;qBAAA;YACF,yBA6BC,CAAA","file":"login.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {Router, ROUTER_DIRECTIVES} from 'angular2/router';\nimport {FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators} from 'angular2/common';\nimport {Authentication} from '../services/authentication';\n\n@Component({\n selector: 'login',\n directives: [ROUTER_DIRECTIVES, FORM_DIRECTIVES],\n templateUrl: 'app/template/login.component.html',\n styleUrls: ['app/style/login.component.css'],\n})\nexport class Login {\n form:ControlGroup;\n error:boolean = false;\n\n isErrorStyle(field:ControlGroup) {\n if (field.valid) {\n return false;\n } else {\n return true;\n }\n }\n\n constructor(fb:FormBuilder, public auth:Authentication, public router:Router) {\n this.form = fb.group({\n username: ['', Validators.compose([Validators.required, Validators.minLength(4)])],\n password: ['', Validators.required]\n });\n }\n\n onSubmit(value:any, event) {\n event.preventDefault();\n this.auth.login('POST', value.username, value.password)\n .subscribe(\n (token:any) => this.router.navigate(['Home']),\n () => {\n this.error = true;\n }\n );\n }\n}\n"]} \ No newline at end of file diff --git a/demo-shell-ng2/dist/app/app/components/page1.view.js b/demo-shell-ng2/dist/app/app/components/page1.view.js index 7088c04321..009df996bf 100644 --- a/demo-shell-ng2/dist/app/app/components/page1.view.js +++ b/demo-shell-ng2/dist/app/app/components/page1.view.js @@ -21,8 +21,8 @@ System.register(['angular2/core', 'ng2-uploader/ng2-uploader'], function(exports ng2_uploader_1 = ng2_uploader_1_1; }], execute: function() { - Page1View = (function () { - function Page1View() { + let Page1View = class Page1View { + constructor() { this.options = { url: 'http://192.168.99.100:8080/alfresco/service/api/upload', withCredentials: true, @@ -38,43 +38,75 @@ System.register(['angular2/core', 'ng2-uploader/ng2-uploader'], function(exports this.dropResp = []; this.zone = new core_1.NgZone({ enableLongStackTrace: false }); } - Page1View.prototype.handleUpload = function (data) { + handleUpload(data) { if (data && data.response) { data = JSON.parse(data.response); this.uploadFile = data; } - }; - Page1View.prototype.handleDropUpload = function (data) { - var _this = this; - var index = this.dropResp.findIndex(function (x) { return x.id === data.id; }); + } + handleDropUpload(data) { + let index = this.dropResp.findIndex(x => x.id === data.id); if (index === -1) { this.dropResp.push(data); } else { - this.zone.run(function () { - _this.dropResp[index] = data; + this.zone.run(() => { + this.dropResp[index] = data; }); } - var total = 0, uploaded = 0; - this.dropResp.forEach(function (resp) { + let total = 0, uploaded = 0; + this.dropResp.forEach(resp => { total += resp.progress.total; uploaded += resp.progress.loaded; }); this.dropProgress = Math.floor(uploaded / (total / 100)); - }; - Page1View = __decorate([ - core_1.Component({ - selector: 'page1-view', - styles: [ - "\n :host .dropzone {\n width: 100%;\n height: 100px;\n background-color: #f5f5f5;\n margin-top: 2px;\n margin-bottom: 2px;\n box-shadow: inset 0 1px 2px rgba(0,0,0,.1);\n text-align: center;\n }\n " - ], - template: "\n
\n
\n

Upload File

\n \n
\n Response: {{ uploadFile | json }}\n
\n
\n
\n

Drag and Drop file demo

\n
\n
\n Drop file here...\n
\n
\n
\n {{ dropProgress }}%\n
\n
\n
\n
\n ", - directives: [ng2_uploader_1.UPLOAD_DIRECTIVES] - }), - __metadata('design:paramtypes', []) - ], Page1View); - return Page1View; - }()); + } + }; + Page1View = __decorate([ + core_1.Component({ + selector: 'page1-view', + styles: [ + ` + :host .dropzone { + width: 100%; + height: 100px; + background-color: #f5f5f5; + margin-top: 2px; + margin-bottom: 2px; + box-shadow: inset 0 1px 2px rgba(0,0,0,.1); + text-align: center; + } + ` + ], + template: ` +
+
+

Upload File

+ +
+ Response: {{ uploadFile | json }} +
+
+
+

Drag and Drop file demo

+
+
+ Drop file here... +
+
+
+ {{ dropProgress }}% +
+
+
+
+ `, + directives: [ng2_uploader_1.UPLOAD_DIRECTIVES] + }), + __metadata('design:paramtypes', []) + ], Page1View); exports_1("Page1View", Page1View); } } diff --git a/demo-shell-ng2/dist/app/app/components/page1.view.js.map b/demo-shell-ng2/dist/app/app/components/page1.view.js.map index ef64a32e0f..de4dbe23dc 100644 --- a/demo-shell-ng2/dist/app/app/components/page1.view.js.map +++ b/demo-shell-ng2/dist/app/app/components/page1.view.js.map @@ -1 +1 @@ -{"version":3,"sources":["components/page1.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YA6CA;gBAkBI;oBAhBA,YAAO,GAAU;wBACb,GAAG,EAAE,wDAAwD;wBAC7D,eAAe,EAAE,IAAI;wBACrB,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC;wBAC9B,eAAe,EAAE,OAAO;wBACxB,SAAS,EAAE,UAAU;wBACrB,UAAU,EAAE;4BACR,MAAM,EAAE,OAAO;4BACf,WAAW,EAAE,iBAAiB;yBACjC;qBACJ,CAAC;oBAGF,iBAAY,GAAU,CAAC,CAAC;oBACxB,aAAQ,GAAS,EAAE,CAAC;oBAGhB,IAAI,CAAC,IAAI,GAAG,IAAI,aAAM,CAAC,EAAC,oBAAoB,EAAE,KAAK,EAAC,CAAC,CAAC;gBAC1D,CAAC;gBAED,gCAAY,GAAZ,UAAa,IAAI;oBACb,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;wBACxB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;wBACjC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;oBAC3B,CAAC;gBACL,CAAC;gBAED,oCAAgB,GAAhB,UAAiB,IAAI;oBAArB,iBAiBC;oBAhBG,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,EAAhB,CAAgB,CAAC,CAAC;oBAC3D,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;wBACf,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC7B,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;4BACV,KAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;wBAChC,CAAC,CAAC,CAAC;oBACP,CAAC;oBAED,IAAI,KAAK,GAAG,CAAC,EAAE,QAAQ,GAAG,CAAC,CAAC;oBAC5B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,IAAI;wBACtB,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;wBAC7B,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;oBACrC,CAAC,CAAC,CAAC;oBAEH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;gBAC7D,CAAC;gBAxFL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,YAAY;wBACtB,MAAM,EAAE;4BACJ,ySAUC;yBACJ;wBACD,QAAQ,EAAE,6/BAwBT;wBACD,UAAU,EAAE,CAAC,gCAAiB,CAAC;qBAClC,CAAC;;6BAAA;gBAgDF,gBAAC;YAAD,CA/CA,AA+CC,IAAA;YA/CD,iCA+CC,CAAA","file":"page1.view.js","sourcesContent":["import {Component, NgZone} from 'angular2/core';\nimport {UPLOAD_DIRECTIVES} from 'ng2-uploader/ng2-uploader';\n\n@Component({\n selector: 'page1-view',\n styles: [\n `\n :host .dropzone {\n width: 100%;\n height: 100px;\n background-color: #f5f5f5;\n margin-top: 2px;\n margin-bottom: 2px;\n box-shadow: inset 0 1px 2px rgba(0,0,0,.1);\n text-align: center;\n }\n `\n ],\n template: `\n
\n
\n

Upload File

\n \n
\n Response: {{ uploadFile | json }}\n
\n
\n
\n

Drag and Drop file demo

\n
\n
\n Drop file here...\n
\n
\n
\n {{ dropProgress }}%\n
\n
\n
\n
\n `,\n directives: [UPLOAD_DIRECTIVES]\n})\nexport class Page1View {\n uploadFile:any;\n options:Object = {\n url: 'http://192.168.99.100:8080/alfresco/service/api/upload',\n withCredentials: true,\n authToken: btoa('admin:admin'),\n authTokenPrefix: 'Basic',\n fieldName: 'filedata',\n formFields: {\n siteid: 'swsdp',\n containerid: 'documentLibrary'\n }\n };\n\n zone:NgZone;\n dropProgress:number = 0;\n dropResp:any[] = [];\n\n constructor() {\n this.zone = new NgZone({enableLongStackTrace: false});\n }\n\n handleUpload(data):void {\n if (data && data.response) {\n data = JSON.parse(data.response);\n this.uploadFile = data;\n }\n }\n\n handleDropUpload(data):void {\n let index = this.dropResp.findIndex(x => x.id === data.id);\n if (index === -1) {\n this.dropResp.push(data);\n } else {\n this.zone.run(() => {\n this.dropResp[index] = data;\n });\n }\n\n let total = 0, uploaded = 0;\n this.dropResp.forEach(resp => {\n total += resp.progress.total;\n uploaded += resp.progress.loaded;\n });\n\n this.dropProgress = Math.floor(uploaded / (total / 100));\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["components/page1.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YA6CA;gBAkBI;oBAhBA,YAAO,GAAU;wBACb,GAAG,EAAE,wDAAwD;wBAC7D,eAAe,EAAE,IAAI;wBACrB,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC;wBAC9B,eAAe,EAAE,OAAO;wBACxB,SAAS,EAAE,UAAU;wBACrB,UAAU,EAAE;4BACR,MAAM,EAAE,OAAO;4BACf,WAAW,EAAE,iBAAiB;yBACjC;qBACJ,CAAC;oBAGF,iBAAY,GAAU,CAAC,CAAC;oBACxB,aAAQ,GAAS,EAAE,CAAC;oBAGhB,IAAI,CAAC,IAAI,GAAG,IAAI,aAAM,CAAC,EAAC,oBAAoB,EAAE,KAAK,EAAC,CAAC,CAAC;gBAC1D,CAAC;gBAED,YAAY,CAAC,IAAI;oBACb,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;wBACxB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;wBACjC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;oBAC3B,CAAC;gBACL,CAAC;gBAED,gBAAgB,CAAC,IAAI;oBACjB,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;oBAC3D,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;wBACf,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC7B,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;4BACV,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;wBAChC,CAAC,CAAC,CAAC;oBACP,CAAC;oBAED,IAAI,KAAK,GAAG,CAAC,EAAE,QAAQ,GAAG,CAAC,CAAC;oBAC5B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI;wBACtB,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;wBAC7B,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;oBACrC,CAAC,CAAC,CAAC;oBAEH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;gBAC7D,CAAC;YACL,CAAC;YAzFD;gBAAC,gBAAS,CAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE;wBACJ;;;;;;;;;;SAUC;qBACJ;oBACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;KAwBT;oBACD,UAAU,EAAE,CAAC,gCAAiB,CAAC;iBAClC,CAAC;;yBAAA;YACF,iCA+CC,CAAA","file":"page1.view.js","sourcesContent":["import {Component, NgZone} from 'angular2/core';\nimport {UPLOAD_DIRECTIVES} from 'ng2-uploader/ng2-uploader';\n\n@Component({\n selector: 'page1-view',\n styles: [\n `\n :host .dropzone {\n width: 100%;\n height: 100px;\n background-color: #f5f5f5;\n margin-top: 2px;\n margin-bottom: 2px;\n box-shadow: inset 0 1px 2px rgba(0,0,0,.1);\n text-align: center;\n }\n `\n ],\n template: `\n
\n
\n

Upload File

\n \n
\n Response: {{ uploadFile | json }}\n
\n
\n
\n

Drag and Drop file demo

\n
\n
\n Drop file here...\n
\n
\n
\n {{ dropProgress }}%\n
\n
\n
\n
\n `,\n directives: [UPLOAD_DIRECTIVES]\n})\nexport class Page1View {\n uploadFile:any;\n options:Object = {\n url: 'http://192.168.99.100:8080/alfresco/service/api/upload',\n withCredentials: true,\n authToken: btoa('admin:admin'),\n authTokenPrefix: 'Basic',\n fieldName: 'filedata',\n formFields: {\n siteid: 'swsdp',\n containerid: 'documentLibrary'\n }\n };\n\n zone:NgZone;\n dropProgress:number = 0;\n dropResp:any[] = [];\n\n constructor() {\n this.zone = new NgZone({enableLongStackTrace: false});\n }\n\n handleUpload(data):void {\n if (data && data.response) {\n data = JSON.parse(data.response);\n this.uploadFile = data;\n }\n }\n\n handleDropUpload(data):void {\n let index = this.dropResp.findIndex(x => x.id === data.id);\n if (index === -1) {\n this.dropResp.push(data);\n } else {\n this.zone.run(() => {\n this.dropResp[index] = data;\n });\n }\n\n let total = 0, uploaded = 0;\n this.dropResp.forEach(resp => {\n total += resp.progress.total;\n uploaded += resp.progress.loaded;\n });\n\n this.dropProgress = Math.floor(uploaded / (total / 100));\n }\n}\n"]} \ No newline at end of file diff --git a/demo-shell-ng2/dist/app/app/components/page2.view.js b/demo-shell-ng2/dist/app/app/components/page2.view.js index 75ae437cdd..cc29a3db79 100644 --- a/demo-shell-ng2/dist/app/app/components/page2.view.js +++ b/demo-shell-ng2/dist/app/app/components/page2.view.js @@ -21,19 +21,23 @@ System.register(['angular2/core', 'ng2-alfresco/components'], function(exports_1 components_1 = components_1_1; }], execute: function() { - Page2View = (function () { - function Page2View() { - } - Page2View = __decorate([ - core_1.Component({ - selector: 'page2-view', - template: "\n
\n
\n

Page 2

\n \n
\n
\n ", - directives: [components_1.HelloWorld] - }), - __metadata('design:paramtypes', []) - ], Page2View); - return Page2View; - }()); + let Page2View = class Page2View { + }; + Page2View = __decorate([ + core_1.Component({ + selector: 'page2-view', + template: ` +
+
+

Page 2

+ +
+
+ `, + directives: [components_1.HelloWorld] + }), + __metadata('design:paramtypes', []) + ], Page2View); exports_1("Page2View", Page2View); } } diff --git a/demo-shell-ng2/dist/app/app/components/page2.view.js.map b/demo-shell-ng2/dist/app/app/components/page2.view.js.map index 0330c9f68c..0a07c1a512 100644 --- a/demo-shell-ng2/dist/app/app/components/page2.view.js.map +++ b/demo-shell-ng2/dist/app/app/components/page2.view.js.map @@ -1 +1 @@ -{"version":3,"sources":["components/page2.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAeA;gBAAA;gBAEA,CAAC;gBAdD;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,YAAY;wBACtB,QAAQ,EAAE,8LAOT;wBACD,UAAU,EAAE,CAAC,uBAAU,CAAC;qBAC3B,CAAC;;6BAAA;gBAGF,gBAAC;YAAD,CAFA,AAEC,IAAA;YAFD,iCAEC,CAAA","file":"page2.view.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {HelloWorld} from 'ng2-alfresco/components';\n\n@Component({\n selector: 'page2-view',\n template: `\n
\n
\n

Page 2

\n \n
\n
\n `,\n directives: [HelloWorld]\n})\nexport class Page2View {\n\n}\n"]} \ No newline at end of file +{"version":3,"sources":["components/page2.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAeA;YAEA,CAAC;YAdD;gBAAC,gBAAS,CAAC;oBACP,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE;;;;;;;KAOT;oBACD,UAAU,EAAE,CAAC,uBAAU,CAAC;iBAC3B,CAAC;;yBAAA;YACF,iCAEC,CAAA","file":"page2.view.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {HelloWorld} from 'ng2-alfresco/components';\n\n@Component({\n selector: 'page2-view',\n template: `\n
\n
\n

Page 2

\n \n
\n
\n `,\n directives: [HelloWorld]\n})\nexport class Page2View {\n\n}\n"]} \ No newline at end of file diff --git a/demo-shell-ng2/dist/app/app/services/authentication.js b/demo-shell-ng2/dist/app/app/services/authentication.js index 75a5fc7158..ce6b78c063 100644 --- a/demo-shell-ng2/dist/app/app/services/authentication.js +++ b/demo-shell-ng2/dist/app/app/services/authentication.js @@ -24,74 +24,71 @@ System.register(['angular2/core', 'rxjs/Rx', 'angular2/http'], function(exports_ http_1 = http_1_1; }], execute: function() { - Authentication = (function () { - function Authentication(http) { + let Authentication = class Authentication { + constructor(http) { this.http = http; this._host = 'http://192.168.99.100:8080'; this._baseUrl = this._host + '/alfresco/service/api/'; this.token = localStorage.getItem('token'); } - Authentication.prototype.isLoggedIn = function () { + isLoggedIn() { return !!localStorage.getItem('token'); - }; - Authentication.prototype.login = function (method, username, password) { + } + login(method, username, password) { if (method === 'GET') { return this.loginGet(username, password); } else { return this.loginPost(username, password); } - }; - Authentication.prototype.loginGet = function (username, password) { - var _this = this; - var searchParams = new http_1.URLSearchParams(); + } + loginGet(username, password) { + const searchParams = new http_1.URLSearchParams(); searchParams.set('u', username); searchParams.set('pw', password); return this.http.get(this._baseUrl + 'login', { search: searchParams }) - .map(function (res) { - var data = JSON.parse(xml2json(res.text(), ' ')); - _this.token = data.ticket; - _this.saveJwt(_this.token); + .map((res) => { + let data = JSON.parse(xml2json(res.text(), ' ')); + this.token = data.ticket; + this.saveJwt(this.token); }) .catch(this.handleError); - }; - Authentication.prototype.loginPost = function (username, password) { - var _this = this; - var credentials = '{ username: ' + username + ', password: ' + password + ' }'; - var headers = new http_1.Headers(); + } + loginPost(username, password) { + let credentials = '{ username: ' + username + ', password: ' + password + ' }'; + let headers = new http_1.Headers(); headers.append('Content-Type', 'application/json'); return this.http.post(this._baseUrl + 'login', credentials, { headers: headers }) - .map(function (res) { - var response = res.json(); - _this.token = response.data.ticket; - _this.saveJwt(_this.token); + .map((res) => { + let response = res.json(); + this.token = response.data.ticket; + this.saveJwt(this.token); }) .catch(this.handleError); - }; - Authentication.prototype.saveJwt = function (jwt) { + } + saveJwt(jwt) { if (jwt) { localStorage.setItem('token', jwt); } - }; - Authentication.prototype.logout = function () { + } + logout() { this.token = undefined; localStorage.removeItem('token'); return Rx_1.Observable.of(true); - }; - Authentication.prototype.handleError = function (error) { + } + handleError(error) { // in a real world app, we may send the error to some remote logging infrastructure // instead of just logging it to the console console.error(error); return Rx_1.Observable.throw(error.json().error || 'Server error'); - }; - Authentication = __decorate([ - core_1.Injectable(), - __metadata('design:paramtypes', [http_1.Http]) - ], Authentication); - return Authentication; - }()); + } + }; + Authentication = __decorate([ + core_1.Injectable(), + __metadata('design:paramtypes', [http_1.Http]) + ], Authentication); exports_1("Authentication", Authentication); } } diff --git a/demo-shell-ng2/dist/app/app/services/authentication.js.map b/demo-shell-ng2/dist/app/app/services/authentication.js.map index 00c2aff999..486d7493e0 100644 --- a/demo-shell-ng2/dist/app/app/services/authentication.js.map +++ b/demo-shell-ng2/dist/app/app/services/authentication.js.map @@ -1 +1 @@ -{"version":3,"sources":["services/authentication.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;YAOA;gBAMI,wBAAmB,IAAS;oBAAT,SAAI,GAAJ,IAAI,CAAK;oBAHpB,UAAK,GAAU,4BAA4B,CAAC;oBAC5C,aAAQ,GAAU,IAAI,CAAC,KAAK,GAAG,wBAAwB,CAAC;oBAG5D,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC/C,CAAC;gBAED,mCAAU,GAAV;oBACI,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC3C,CAAC;gBAED,8BAAK,GAAL,UAAM,MAAa,EAAE,QAAe,EAAE,QAAe;oBACjD,EAAE,CAAC,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC;wBACnB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;oBAC7C,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;oBAC9C,CAAC;gBACL,CAAC;gBAED,iCAAQ,GAAR,UAAS,QAAe,EAAE,QAAe;oBAAzC,iBAYC;oBAXG,IAAM,YAAY,GAAG,IAAI,sBAAe,EAAE,CAAC;oBAC3C,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;oBAChC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;oBAEjC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE,EAAC,MAAM,EAAE,YAAY,EAAC,CAAC;yBAChE,GAAG,CAAC,UAAC,GAAO;wBACT,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;wBAClD,KAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;wBACzB,KAAI,CAAC,OAAO,CAAC,KAAI,CAAC,KAAK,CAAC,CAAC;oBAC7B,CAAC,CAAC;yBACD,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACjC,CAAC;gBAED,kCAAS,GAAT,UAAU,QAAe,EAAE,QAAe;oBAA1C,iBAeC;oBAdG,IAAI,WAAW,GAAG,cAAc,GAAG,QAAQ,GAAG,cAAc,GAAG,QAAQ,GAAG,IAAI,CAAC;oBAE/E,IAAI,OAAO,GAAG,IAAI,cAAO,EAAE,CAAC;oBAC5B,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;oBAEnD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE,WAAW,EAAE;wBACpD,OAAO,EAAE,OAAO;qBACnB,CAAC;yBACD,GAAG,CAAC,UAAC,GAAO;wBACT,IAAI,QAAQ,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;wBAC1B,KAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;wBAClC,KAAI,CAAC,OAAO,CAAC,KAAI,CAAC,KAAK,CAAC,CAAC;oBAC7B,CAAC,CAAC;yBACD,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACjC,CAAC;gBAED,gCAAO,GAAP,UAAQ,GAAG;oBACP,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;wBACN,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;oBACvC,CAAC;gBACL,CAAC;gBAED,+BAAM,GAAN;oBACI,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;oBACvB,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;oBAEjC,MAAM,CAAC,eAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;gBAC/B,CAAC;gBAEO,oCAAW,GAAnB,UAAoB,KAAc;oBAC9B,mFAAmF;oBACnF,4CAA4C;oBAC5C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACrB,MAAM,CAAC,eAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,cAAc,CAAC,CAAC;gBAClE,CAAC;gBAxEL;oBAAC,iBAAU,EAAE;;kCAAA;gBAyEb,qBAAC;YAAD,CAxEA,AAwEC,IAAA;YAxED,2CAwEC,CAAA","file":"authentication.js","sourcesContent":["import {Injectable} from 'angular2/core';\nimport {Observable} from 'rxjs/Rx';\nimport {Http, Headers, URLSearchParams, Response} from 'angular2/http';\n\ndeclare var xml2json:any;\n\n@Injectable()\nexport class Authentication {\n token:string;\n\n private _host:string = 'http://192.168.99.100:8080';\n private _baseUrl:string = this._host + '/alfresco/service/api/';\n\n constructor(public http:Http) {\n this.token = localStorage.getItem('token');\n }\n\n isLoggedIn() {\n return !!localStorage.getItem('token');\n }\n\n login(method:string, username:string, password:string) {\n if (method === 'GET') {\n return this.loginGet(username, password);\n } else {\n return this.loginPost(username, password);\n }\n }\n\n loginGet(username:string, password:string) {\n const searchParams = new URLSearchParams();\n searchParams.set('u', username);\n searchParams.set('pw', password);\n\n return this.http.get(this._baseUrl + 'login', {search: searchParams})\n .map((res:any) => {\n let data = JSON.parse(xml2json(res.text(), ' '));\n this.token = data.ticket;\n this.saveJwt(this.token);\n })\n .catch(this.handleError);\n }\n\n loginPost(username:string, password:string) {\n let credentials = '{ username: ' + username + ', password: ' + password + ' }';\n\n let headers = new Headers();\n headers.append('Content-Type', 'application/json');\n\n return this.http.post(this._baseUrl + 'login', credentials, {\n headers: headers\n })\n .map((res:any) => {\n let response = res.json();\n this.token = response.data.ticket;\n this.saveJwt(this.token);\n })\n .catch(this.handleError);\n }\n\n saveJwt(jwt) {\n if (jwt) {\n localStorage.setItem('token', jwt);\n }\n }\n\n logout() {\n this.token = undefined;\n localStorage.removeItem('token');\n\n return Observable.of(true);\n }\n\n private handleError(error:Response) {\n // in a real world app, we may send the error to some remote logging infrastructure\n // instead of just logging it to the console\n console.error(error);\n return Observable.throw(error.json().error || 'Server error');\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["services/authentication.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;YAOA;gBAMI,YAAmB,IAAS;oBAAT,SAAI,GAAJ,IAAI,CAAK;oBAHpB,UAAK,GAAU,4BAA4B,CAAC;oBAC5C,aAAQ,GAAU,IAAI,CAAC,KAAK,GAAG,wBAAwB,CAAC;oBAG5D,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC/C,CAAC;gBAED,UAAU;oBACN,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC3C,CAAC;gBAED,KAAK,CAAC,MAAa,EAAE,QAAe,EAAE,QAAe;oBACjD,EAAE,CAAC,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC;wBACnB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;oBAC7C,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;oBAC9C,CAAC;gBACL,CAAC;gBAED,QAAQ,CAAC,QAAe,EAAE,QAAe;oBACrC,MAAM,YAAY,GAAG,IAAI,sBAAe,EAAE,CAAC;oBAC3C,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;oBAChC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;oBAEjC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE,EAAC,MAAM,EAAE,YAAY,EAAC,CAAC;yBAChE,GAAG,CAAC,CAAC,GAAO;wBACT,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;wBAClD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;wBACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBAC7B,CAAC,CAAC;yBACD,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACjC,CAAC;gBAED,SAAS,CAAC,QAAe,EAAE,QAAe;oBACtC,IAAI,WAAW,GAAG,cAAc,GAAG,QAAQ,GAAG,cAAc,GAAG,QAAQ,GAAG,IAAI,CAAC;oBAE/E,IAAI,OAAO,GAAG,IAAI,cAAO,EAAE,CAAC;oBAC5B,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;oBAEnD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE,WAAW,EAAE;wBACpD,OAAO,EAAE,OAAO;qBACnB,CAAC;yBACD,GAAG,CAAC,CAAC,GAAO;wBACT,IAAI,QAAQ,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;wBAC1B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;wBAClC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBAC7B,CAAC,CAAC;yBACD,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACjC,CAAC;gBAED,OAAO,CAAC,GAAG;oBACP,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;wBACN,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;oBACvC,CAAC;gBACL,CAAC;gBAED,MAAM;oBACF,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;oBACvB,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;oBAEjC,MAAM,CAAC,eAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;gBAC/B,CAAC;gBAEO,WAAW,CAAC,KAAc;oBAC9B,mFAAmF;oBACnF,4CAA4C;oBAC5C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACrB,MAAM,CAAC,eAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,cAAc,CAAC,CAAC;gBAClE,CAAC;YACL,CAAC;YAzED;gBAAC,iBAAU,EAAE;;8BAAA;YACb,2CAwEC,CAAA","file":"authentication.js","sourcesContent":["import {Injectable} from 'angular2/core';\nimport {Observable} from 'rxjs/Rx';\nimport {Http, Headers, URLSearchParams, Response} from 'angular2/http';\n\ndeclare var xml2json:any;\n\n@Injectable()\nexport class Authentication {\n token:string;\n\n private _host:string = 'http://192.168.99.100:8080';\n private _baseUrl:string = this._host + '/alfresco/service/api/';\n\n constructor(public http:Http) {\n this.token = localStorage.getItem('token');\n }\n\n isLoggedIn() {\n return !!localStorage.getItem('token');\n }\n\n login(method:string, username:string, password:string) {\n if (method === 'GET') {\n return this.loginGet(username, password);\n } else {\n return this.loginPost(username, password);\n }\n }\n\n loginGet(username:string, password:string) {\n const searchParams = new URLSearchParams();\n searchParams.set('u', username);\n searchParams.set('pw', password);\n\n return this.http.get(this._baseUrl + 'login', {search: searchParams})\n .map((res:any) => {\n let data = JSON.parse(xml2json(res.text(), ' '));\n this.token = data.ticket;\n this.saveJwt(this.token);\n })\n .catch(this.handleError);\n }\n\n loginPost(username:string, password:string) {\n let credentials = '{ username: ' + username + ', password: ' + password + ' }';\n\n let headers = new Headers();\n headers.append('Content-Type', 'application/json');\n\n return this.http.post(this._baseUrl + 'login', credentials, {\n headers: headers\n })\n .map((res:any) => {\n let response = res.json();\n this.token = response.data.ticket;\n this.saveJwt(this.token);\n })\n .catch(this.handleError);\n }\n\n saveJwt(jwt) {\n if (jwt) {\n localStorage.setItem('token', jwt);\n }\n }\n\n logout() {\n this.token = undefined;\n localStorage.removeItem('token');\n\n return Observable.of(true);\n }\n\n private handleError(error:Response) {\n // in a real world app, we may send the error to some remote logging infrastructure\n // instead of just logging it to the console\n console.error(error);\n return Observable.throw(error.json().error || 'Server error');\n }\n}\n"]} \ No newline at end of file diff --git a/demo-shell-ng2/dist/lib/Rx.js b/demo-shell-ng2/dist/lib/Rx.js deleted file mode 100644 index 09d4bcb8cd..0000000000 --- a/demo-shell-ng2/dist/lib/Rx.js +++ /dev/null @@ -1,11411 +0,0 @@ -/** - @license - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2015-2016 Netflix, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - **/ -"format register"; -System.register("rxjs/util/root", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var objectTypes = { - 'boolean': false, - 'function': true, - 'object': true, - 'number': false, - 'string': false, - 'undefined': false - }; - exports.root = (objectTypes[typeof self] && self) || (objectTypes[typeof window] && window); - var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; - var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; - var freeGlobal = objectTypes[typeof global] && global; - if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { - exports.root = freeGlobal; - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/SymbolShim", ["rxjs/util/root"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var root_1 = require("rxjs/util/root"); - function polyfillSymbol(root) { - var Symbol = ensureSymbol(root); - ensureIterator(Symbol, root); - ensureObservable(Symbol); - ensureFor(Symbol); - return Symbol; - } - exports.polyfillSymbol = polyfillSymbol; - function ensureFor(Symbol) { - if (!Symbol.for) { - Symbol.for = symbolForPolyfill; - } - } - exports.ensureFor = ensureFor; - var id = 0; - function ensureSymbol(root) { - if (!root.Symbol) { - root.Symbol = function symbolFuncPolyfill(description) { - return "@@Symbol(" + description + "):" + id++; - }; - } - return root.Symbol; - } - exports.ensureSymbol = ensureSymbol; - function symbolForPolyfill(key) { - return '@@' + key; - } - exports.symbolForPolyfill = symbolForPolyfill; - function ensureIterator(Symbol, root) { - if (!Symbol.iterator) { - if (typeof Symbol.for === 'function') { - Symbol.iterator = Symbol.for('iterator'); - } else if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { - Symbol.iterator = '@@iterator'; - } else if (root.Map) { - var keys = Object.getOwnPropertyNames(root.Map.prototype); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (key !== 'entries' && key !== 'size' && root.Map.prototype[key] === root.Map.prototype['entries']) { - Symbol.iterator = key; - break; - } - } - } else { - Symbol.iterator = '@@iterator'; - } - } - } - exports.ensureIterator = ensureIterator; - function ensureObservable(Symbol) { - if (!Symbol.observable) { - if (typeof Symbol.for === 'function') { - Symbol.observable = Symbol.for('observable'); - } else { - Symbol.observable = '@@observable'; - } - } - } - exports.ensureObservable = ensureObservable; - exports.SymbolShim = polyfillSymbol(root_1.root); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/isFunction", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function isFunction(x) { - return typeof x === 'function'; - } - exports.isFunction = isFunction; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/isArray", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - exports.isArray = Array.isArray || (function(x) { - return x && typeof x.length === 'number'; - }); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/isObject", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function isObject(x) { - return x != null && typeof x === 'object'; - } - exports.isObject = isObject; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/errorObject", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - exports.errorObject = {e: {}}; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/symbol/rxSubscriber", ["rxjs/util/SymbolShim"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var SymbolShim_1 = require("rxjs/util/SymbolShim"); - exports.rxSubscriber = SymbolShim_1.SymbolShim.for('rxSubscriber'); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/Observer", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - exports.empty = { - isUnsubscribed: true, - next: function(value) {}, - error: function(err) { - throw err; - }, - complete: function() {} - }; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/subject/SubjectSubscription", ["rxjs/Subscription"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscription_1 = require("rxjs/Subscription"); - var SubjectSubscription = (function(_super) { - __extends(SubjectSubscription, _super); - function SubjectSubscription(subject, observer) { - _super.call(this); - this.subject = subject; - this.observer = observer; - this.isUnsubscribed = false; - } - SubjectSubscription.prototype.unsubscribe = function() { - if (this.isUnsubscribed) { - return ; - } - this.isUnsubscribed = true; - var subject = this.subject; - var observers = subject.observers; - this.subject = null; - if (!observers || observers.length === 0 || subject.isUnsubscribed) { - return ; - } - var subscriberIndex = observers.indexOf(this.observer); - if (subscriberIndex !== -1) { - observers.splice(subscriberIndex, 1); - } - }; - return SubjectSubscription; - }(Subscription_1.Subscription)); - exports.SubjectSubscription = SubjectSubscription; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/throwError", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function throwError(e) { - throw e; - } - exports.throwError = throwError; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/ObjectUnsubscribedError", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var ObjectUnsubscribedError = (function(_super) { - __extends(ObjectUnsubscribedError, _super); - function ObjectUnsubscribedError() { - _super.call(this, 'object unsubscribed'); - this.name = 'ObjectUnsubscribedError'; - } - return ObjectUnsubscribedError; - }(Error)); - exports.ObjectUnsubscribedError = ObjectUnsubscribedError; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/ScalarObservable", ["rxjs/Observable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var ScalarObservable = (function(_super) { - __extends(ScalarObservable, _super); - function ScalarObservable(value, scheduler) { - _super.call(this); - this.value = value; - this.scheduler = scheduler; - this._isScalar = true; - } - ScalarObservable.create = function(value, scheduler) { - return new ScalarObservable(value, scheduler); - }; - ScalarObservable.dispatch = function(state) { - var done = state.done, - value = state.value, - subscriber = state.subscriber; - if (done) { - subscriber.complete(); - return ; - } - subscriber.next(value); - if (subscriber.isUnsubscribed) { - return ; - } - state.done = true; - this.schedule(state); - }; - ScalarObservable.prototype._subscribe = function(subscriber) { - var value = this.value; - var scheduler = this.scheduler; - if (scheduler) { - return scheduler.schedule(ScalarObservable.dispatch, 0, { - done: false, - value: value, - subscriber: subscriber - }); - } else { - subscriber.next(value); - if (!subscriber.isUnsubscribed) { - subscriber.complete(); - } - } - }; - return ScalarObservable; - }(Observable_1.Observable)); - exports.ScalarObservable = ScalarObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/EmptyObservable", ["rxjs/Observable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var EmptyObservable = (function(_super) { - __extends(EmptyObservable, _super); - function EmptyObservable(scheduler) { - _super.call(this); - this.scheduler = scheduler; - } - EmptyObservable.create = function(scheduler) { - return new EmptyObservable(scheduler); - }; - EmptyObservable.dispatch = function(_a) { - var subscriber = _a.subscriber; - subscriber.complete(); - }; - EmptyObservable.prototype._subscribe = function(subscriber) { - var scheduler = this.scheduler; - if (scheduler) { - return scheduler.schedule(EmptyObservable.dispatch, 0, {subscriber: subscriber}); - } else { - subscriber.complete(); - } - }; - return EmptyObservable; - }(Observable_1.Observable)); - exports.EmptyObservable = EmptyObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/isScheduler", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function isScheduler(value) { - return value && typeof value.schedule === 'function'; - } - exports.isScheduler = isScheduler; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/OuterSubscriber", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var OuterSubscriber = (function(_super) { - __extends(OuterSubscriber, _super); - function OuterSubscriber() { - _super.apply(this, arguments); - } - OuterSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.destination.next(innerValue); - }; - OuterSubscriber.prototype.notifyError = function(error, innerSub) { - this.destination.error(error); - }; - OuterSubscriber.prototype.notifyComplete = function(innerSub) { - this.destination.complete(); - }; - return OuterSubscriber; - }(Subscriber_1.Subscriber)); - exports.OuterSubscriber = OuterSubscriber; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/isPromise", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function isPromise(value) { - return value && typeof value.subscribe !== 'function' && typeof value.then === 'function'; - } - exports.isPromise = isPromise; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/InnerSubscriber", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var InnerSubscriber = (function(_super) { - __extends(InnerSubscriber, _super); - function InnerSubscriber(parent, outerValue, outerIndex) { - _super.call(this); - this.parent = parent; - this.outerValue = outerValue; - this.outerIndex = outerIndex; - this.index = 0; - } - InnerSubscriber.prototype._next = function(value) { - this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this); - }; - InnerSubscriber.prototype._error = function(error) { - this.parent.notifyError(error, this); - this.unsubscribe(); - }; - InnerSubscriber.prototype._complete = function() { - this.parent.notifyComplete(this); - this.unsubscribe(); - }; - return InnerSubscriber; - }(Subscriber_1.Subscriber)); - exports.InnerSubscriber = InnerSubscriber; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/mergeAll", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function mergeAll(concurrent) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - return this.lift(new MergeAllOperator(concurrent)); - } - exports.mergeAll = mergeAll; - var MergeAllOperator = (function() { - function MergeAllOperator(concurrent) { - this.concurrent = concurrent; - } - MergeAllOperator.prototype.call = function(observer) { - return new MergeAllSubscriber(observer, this.concurrent); - }; - return MergeAllOperator; - }()); - exports.MergeAllOperator = MergeAllOperator; - var MergeAllSubscriber = (function(_super) { - __extends(MergeAllSubscriber, _super); - function MergeAllSubscriber(destination, concurrent) { - _super.call(this, destination); - this.concurrent = concurrent; - this.hasCompleted = false; - this.buffer = []; - this.active = 0; - } - MergeAllSubscriber.prototype._next = function(observable) { - if (this.active < this.concurrent) { - this.active++; - this.add(subscribeToResult_1.subscribeToResult(this, observable)); - } else { - this.buffer.push(observable); - } - }; - MergeAllSubscriber.prototype._complete = function() { - this.hasCompleted = true; - if (this.active === 0 && this.buffer.length === 0) { - this.destination.complete(); - } - }; - MergeAllSubscriber.prototype.notifyComplete = function(innerSub) { - var buffer = this.buffer; - this.remove(innerSub); - this.active--; - if (buffer.length > 0) { - this._next(buffer.shift()); - } else if (this.active === 0 && this.hasCompleted) { - this.destination.complete(); - } - }; - return MergeAllSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - exports.MergeAllSubscriber = MergeAllSubscriber; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/merge", ["rxjs/observable/ArrayObservable", "rxjs/operator/mergeAll", "rxjs/util/isScheduler"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var ArrayObservable_1 = require("rxjs/observable/ArrayObservable"); - var mergeAll_1 = require("rxjs/operator/mergeAll"); - var isScheduler_1 = require("rxjs/util/isScheduler"); - function merge() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i - 0] = arguments[_i]; - } - observables.unshift(this); - return mergeStatic.apply(this, observables); - } - exports.merge = merge; - function mergeStatic() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i - 0] = arguments[_i]; - } - var concurrent = Number.POSITIVE_INFINITY; - var scheduler = null; - var last = observables[observables.length - 1]; - if (isScheduler_1.isScheduler(last)) { - scheduler = observables.pop(); - if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') { - concurrent = observables.pop(); - } - } else if (typeof last === 'number') { - concurrent = observables.pop(); - } - if (observables.length === 1) { - return observables[0]; - } - return new ArrayObservable_1.ArrayObservable(observables, scheduler).lift(new mergeAll_1.MergeAllOperator(concurrent)); - } - exports.mergeStatic = mergeStatic; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/race", ["rxjs/util/isArray", "rxjs/observable/ArrayObservable", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var isArray_1 = require("rxjs/util/isArray"); - var ArrayObservable_1 = require("rxjs/observable/ArrayObservable"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function race() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i - 0] = arguments[_i]; - } - if (observables.length === 1 && isArray_1.isArray(observables[0])) { - observables = observables[0]; - } - observables.unshift(this); - return raceStatic.apply(this, observables); - } - exports.race = race; - function raceStatic() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i - 0] = arguments[_i]; - } - if (observables.length === 1) { - if (isArray_1.isArray(observables[0])) { - observables = observables[0]; - } else { - return observables[0]; - } - } - return new ArrayObservable_1.ArrayObservable(observables).lift(new RaceOperator()); - } - exports.raceStatic = raceStatic; - var RaceOperator = (function() { - function RaceOperator() {} - RaceOperator.prototype.call = function(subscriber) { - return new RaceSubscriber(subscriber); - }; - return RaceOperator; - }()); - exports.RaceOperator = RaceOperator; - var RaceSubscriber = (function(_super) { - __extends(RaceSubscriber, _super); - function RaceSubscriber(destination) { - _super.call(this, destination); - this.hasFirst = false; - this.observables = []; - this.subscriptions = []; - } - RaceSubscriber.prototype._next = function(observable) { - this.observables.push(observable); - }; - RaceSubscriber.prototype._complete = function() { - var observables = this.observables; - var len = observables.length; - if (len === 0) { - this.destination.complete(); - } else { - for (var i = 0; i < len; i++) { - var observable = observables[i]; - var subscription = subscribeToResult_1.subscribeToResult(this, observable, observable, i); - this.subscriptions.push(subscription); - this.add(subscription); - } - this.observables = null; - } - }; - RaceSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - if (!this.hasFirst) { - this.hasFirst = true; - for (var i = 0; i < this.subscriptions.length; i++) { - if (i !== outerIndex) { - var subscription = this.subscriptions[i]; - subscription.unsubscribe(); - this.remove(subscription); - } - } - this.subscriptions = null; - } - this.destination.next(innerValue); - }; - return RaceSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - exports.RaceSubscriber = RaceSubscriber; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/subject/AsyncSubject", ["rxjs/Subject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subject_1 = require("rxjs/Subject"); - var AsyncSubject = (function(_super) { - __extends(AsyncSubject, _super); - function AsyncSubject() { - _super.apply(this, arguments); - this.value = null; - this.hasNext = false; - } - AsyncSubject.prototype._subscribe = function(subscriber) { - if (this.hasCompleted && this.hasNext) { - subscriber.next(this.value); - } - return _super.prototype._subscribe.call(this, subscriber); - }; - AsyncSubject.prototype._next = function(value) { - this.value = value; - this.hasNext = true; - }; - AsyncSubject.prototype._complete = function() { - var index = -1; - var observers = this.observers; - var len = observers.length; - this.isUnsubscribed = true; - if (this.hasNext) { - while (++index < len) { - var o = observers[index]; - o.next(this.value); - o.complete(); - } - } else { - while (++index < len) { - observers[index].complete(); - } - } - this.isUnsubscribed = false; - this.unsubscribe(); - }; - return AsyncSubject; - }(Subject_1.Subject)); - exports.AsyncSubject = AsyncSubject; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/BoundNodeCallbackObservable", ["rxjs/Observable", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/subject/AsyncSubject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var AsyncSubject_1 = require("rxjs/subject/AsyncSubject"); - var BoundNodeCallbackObservable = (function(_super) { - __extends(BoundNodeCallbackObservable, _super); - function BoundNodeCallbackObservable(callbackFunc, selector, args, scheduler) { - _super.call(this); - this.callbackFunc = callbackFunc; - this.selector = selector; - this.args = args; - this.scheduler = scheduler; - } - BoundNodeCallbackObservable.create = function(callbackFunc, selector, scheduler) { - if (selector === void 0) { - selector = undefined; - } - return function() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i - 0] = arguments[_i]; - } - return new BoundNodeCallbackObservable(callbackFunc, selector, args, scheduler); - }; - }; - BoundNodeCallbackObservable.prototype._subscribe = function(subscriber) { - var callbackFunc = this.callbackFunc; - var args = this.args; - var scheduler = this.scheduler; - var subject = this.subject; - if (!scheduler) { - if (!subject) { - subject = this.subject = new AsyncSubject_1.AsyncSubject(); - var handler = function handlerFn() { - var innerArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - innerArgs[_i - 0] = arguments[_i]; - } - var source = handlerFn.source; - var selector = source.selector, - subject = source.subject; - var err = innerArgs.shift(); - if (err) { - subject.error(err); - } else if (selector) { - var result_1 = tryCatch_1.tryCatch(selector).apply(this, innerArgs); - if (result_1 === errorObject_1.errorObject) { - subject.error(errorObject_1.errorObject.e); - } else { - subject.next(result_1); - subject.complete(); - } - } else { - subject.next(innerArgs.length === 1 ? innerArgs[0] : innerArgs); - subject.complete(); - } - }; - handler.source = this; - var result = tryCatch_1.tryCatch(callbackFunc).apply(this, args.concat(handler)); - if (result === errorObject_1.errorObject) { - subject.error(errorObject_1.errorObject.e); - } - } - return subject.subscribe(subscriber); - } else { - return scheduler.schedule(dispatch, 0, { - source: this, - subscriber: subscriber - }); - } - }; - return BoundNodeCallbackObservable; - }(Observable_1.Observable)); - exports.BoundNodeCallbackObservable = BoundNodeCallbackObservable; - function dispatch(state) { - var self = this; - var source = state.source, - subscriber = state.subscriber; - var callbackFunc = source.callbackFunc, - args = source.args, - scheduler = source.scheduler; - var subject = source.subject; - if (!subject) { - subject = source.subject = new AsyncSubject_1.AsyncSubject(); - var handler = function handlerFn() { - var innerArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - innerArgs[_i - 0] = arguments[_i]; - } - var source = handlerFn.source; - var selector = source.selector, - subject = source.subject; - var err = innerArgs.shift(); - if (err) { - subject.error(err); - } else if (selector) { - var result_2 = tryCatch_1.tryCatch(selector).apply(this, innerArgs); - if (result_2 === errorObject_1.errorObject) { - self.add(scheduler.schedule(dispatchError, 0, { - err: errorObject_1.errorObject.e, - subject: subject - })); - } else { - self.add(scheduler.schedule(dispatchNext, 0, { - value: result_2, - subject: subject - })); - } - } else { - var value = innerArgs.length === 1 ? innerArgs[0] : innerArgs; - self.add(scheduler.schedule(dispatchNext, 0, { - value: value, - subject: subject - })); - } - }; - handler.source = source; - var result = tryCatch_1.tryCatch(callbackFunc).apply(this, args.concat(handler)); - if (result === errorObject_1.errorObject) { - subject.error(errorObject_1.errorObject.e); - } - } - self.add(subject.subscribe(subscriber)); - } - function dispatchNext(_a) { - var value = _a.value, - subject = _a.subject; - subject.next(value); - subject.complete(); - } - function dispatchError(_a) { - var err = _a.err, - subject = _a.subject; - subject.error(err); - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/DeferObservable", ["rxjs/Observable", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var DeferObservable = (function(_super) { - __extends(DeferObservable, _super); - function DeferObservable(observableFactory) { - _super.call(this); - this.observableFactory = observableFactory; - } - DeferObservable.create = function(observableFactory) { - return new DeferObservable(observableFactory); - }; - DeferObservable.prototype._subscribe = function(subscriber) { - var result = tryCatch_1.tryCatch(this.observableFactory)(); - if (result === errorObject_1.errorObject) { - subscriber.error(errorObject_1.errorObject.e); - } else { - result.subscribe(subscriber); - } - }; - return DeferObservable; - }(Observable_1.Observable)); - exports.DeferObservable = DeferObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/empty", ["rxjs/Observable", "rxjs/observable/EmptyObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var EmptyObservable_1 = require("rxjs/observable/EmptyObservable"); - Observable_1.Observable.empty = EmptyObservable_1.EmptyObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/PromiseObservable", ["rxjs/util/root", "rxjs/Observable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var root_1 = require("rxjs/util/root"); - var Observable_1 = require("rxjs/Observable"); - var PromiseObservable = (function(_super) { - __extends(PromiseObservable, _super); - function PromiseObservable(promise, scheduler) { - if (scheduler === void 0) { - scheduler = null; - } - _super.call(this); - this.promise = promise; - this.scheduler = scheduler; - } - PromiseObservable.create = function(promise, scheduler) { - if (scheduler === void 0) { - scheduler = null; - } - return new PromiseObservable(promise, scheduler); - }; - PromiseObservable.prototype._subscribe = function(subscriber) { - var _this = this; - var promise = this.promise; - var scheduler = this.scheduler; - if (scheduler == null) { - if (this._isScalar) { - if (!subscriber.isUnsubscribed) { - subscriber.next(this.value); - subscriber.complete(); - } - } else { - promise.then(function(value) { - _this.value = value; - _this._isScalar = true; - if (!subscriber.isUnsubscribed) { - subscriber.next(value); - subscriber.complete(); - } - }, function(err) { - if (!subscriber.isUnsubscribed) { - subscriber.error(err); - } - }).then(null, function(err) { - root_1.root.setTimeout(function() { - throw err; - }); - }); - } - } else { - if (this._isScalar) { - if (!subscriber.isUnsubscribed) { - return scheduler.schedule(dispatchNext, 0, { - value: this.value, - subscriber: subscriber - }); - } - } else { - promise.then(function(value) { - _this.value = value; - _this._isScalar = true; - if (!subscriber.isUnsubscribed) { - subscriber.add(scheduler.schedule(dispatchNext, 0, { - value: value, - subscriber: subscriber - })); - } - }, function(err) { - if (!subscriber.isUnsubscribed) { - subscriber.add(scheduler.schedule(dispatchError, 0, { - err: err, - subscriber: subscriber - })); - } - }).then(null, function(err) { - root_1.root.setTimeout(function() { - throw err; - }); - }); - } - } - }; - return PromiseObservable; - }(Observable_1.Observable)); - exports.PromiseObservable = PromiseObservable; - function dispatchNext(_a) { - var value = _a.value, - subscriber = _a.subscriber; - if (!subscriber.isUnsubscribed) { - subscriber.next(value); - subscriber.complete(); - } - } - function dispatchError(_a) { - var err = _a.err, - subscriber = _a.subscriber; - if (!subscriber.isUnsubscribed) { - subscriber.error(err); - } - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/IteratorObservable", ["rxjs/util/root", "rxjs/util/isObject", "rxjs/util/tryCatch", "rxjs/Observable", "rxjs/util/isFunction", "rxjs/util/SymbolShim", "rxjs/util/errorObject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var root_1 = require("rxjs/util/root"); - var isObject_1 = require("rxjs/util/isObject"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var Observable_1 = require("rxjs/Observable"); - var isFunction_1 = require("rxjs/util/isFunction"); - var SymbolShim_1 = require("rxjs/util/SymbolShim"); - var errorObject_1 = require("rxjs/util/errorObject"); - var IteratorObservable = (function(_super) { - __extends(IteratorObservable, _super); - function IteratorObservable(iterator, project, thisArg, scheduler) { - _super.call(this); - if (iterator == null) { - throw new Error('iterator cannot be null.'); - } - if (isObject_1.isObject(project)) { - this.thisArg = project; - this.scheduler = thisArg; - } else if (isFunction_1.isFunction(project)) { - this.project = project; - this.thisArg = thisArg; - this.scheduler = scheduler; - } else if (project != null) { - throw new Error('When provided, `project` must be a function.'); - } - this.iterator = getIterator(iterator); - } - IteratorObservable.create = function(iterator, project, thisArg, scheduler) { - return new IteratorObservable(iterator, project, thisArg, scheduler); - }; - IteratorObservable.dispatch = function(state) { - var index = state.index, - hasError = state.hasError, - thisArg = state.thisArg, - project = state.project, - iterator = state.iterator, - subscriber = state.subscriber; - if (hasError) { - subscriber.error(state.error); - return ; - } - var result = iterator.next(); - if (result.done) { - subscriber.complete(); - return ; - } - if (project) { - result = tryCatch_1.tryCatch(project).call(thisArg, result.value, index); - if (result === errorObject_1.errorObject) { - state.error = errorObject_1.errorObject.e; - state.hasError = true; - } else { - subscriber.next(result); - state.index = index + 1; - } - } else { - subscriber.next(result.value); - state.index = index + 1; - } - if (subscriber.isUnsubscribed) { - return ; - } - this.schedule(state); - }; - IteratorObservable.prototype._subscribe = function(subscriber) { - var index = 0; - var _a = this, - iterator = _a.iterator, - project = _a.project, - thisArg = _a.thisArg, - scheduler = _a.scheduler; - if (scheduler) { - return scheduler.schedule(IteratorObservable.dispatch, 0, { - index: index, - thisArg: thisArg, - project: project, - iterator: iterator, - subscriber: subscriber - }); - } else { - do { - var result = iterator.next(); - if (result.done) { - subscriber.complete(); - break; - } else if (project) { - result = tryCatch_1.tryCatch(project).call(thisArg, result.value, index++); - if (result === errorObject_1.errorObject) { - subscriber.error(errorObject_1.errorObject.e); - break; - } - subscriber.next(result); - } else { - subscriber.next(result.value); - } - if (subscriber.isUnsubscribed) { - break; - } - } while (true); - } - }; - return IteratorObservable; - }(Observable_1.Observable)); - exports.IteratorObservable = IteratorObservable; - var StringIterator = (function() { - function StringIterator(str, idx, len) { - if (idx === void 0) { - idx = 0; - } - if (len === void 0) { - len = str.length; - } - this.str = str; - this.idx = idx; - this.len = len; - } - StringIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function() { - return (this); - }; - StringIterator.prototype.next = function() { - return this.idx < this.len ? { - done: false, - value: this.str.charAt(this.idx++) - } : { - done: true, - value: undefined - }; - }; - return StringIterator; - }()); - var ArrayIterator = (function() { - function ArrayIterator(arr, idx, len) { - if (idx === void 0) { - idx = 0; - } - if (len === void 0) { - len = toLength(arr); - } - this.arr = arr; - this.idx = idx; - this.len = len; - } - ArrayIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function() { - return this; - }; - ArrayIterator.prototype.next = function() { - return this.idx < this.len ? { - done: false, - value: this.arr[this.idx++] - } : { - done: true, - value: undefined - }; - }; - return ArrayIterator; - }()); - function getIterator(obj) { - var i = obj[SymbolShim_1.SymbolShim.iterator]; - if (!i && typeof obj === 'string') { - return new StringIterator(obj); - } - if (!i && obj.length !== undefined) { - return new ArrayIterator(obj); - } - if (!i) { - throw new TypeError('Object is not iterable'); - } - return obj[SymbolShim_1.SymbolShim.iterator](); - } - var maxSafeInteger = Math.pow(2, 53) - 1; - function toLength(o) { - var len = +o.length; - if (isNaN(len)) { - return 0; - } - if (len === 0 || !numberIsFinite(len)) { - return len; - } - len = sign(len) * Math.floor(Math.abs(len)); - if (len <= 0) { - return 0; - } - if (len > maxSafeInteger) { - return maxSafeInteger; - } - return len; - } - function numberIsFinite(value) { - return typeof value === 'number' && root_1.root.isFinite(value); - } - function sign(value) { - var valueAsNumber = +value; - if (valueAsNumber === 0) { - return valueAsNumber; - } - if (isNaN(valueAsNumber)) { - return valueAsNumber; - } - return valueAsNumber < 0 ? -1 : 1; - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/ArrayLikeObservable", ["rxjs/Observable", "rxjs/observable/ScalarObservable", "rxjs/observable/EmptyObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var ScalarObservable_1 = require("rxjs/observable/ScalarObservable"); - var EmptyObservable_1 = require("rxjs/observable/EmptyObservable"); - var ArrayLikeObservable = (function(_super) { - __extends(ArrayLikeObservable, _super); - function ArrayLikeObservable(arrayLike, mapFn, thisArg, scheduler) { - _super.call(this); - this.arrayLike = arrayLike; - this.scheduler = scheduler; - if (!mapFn && !scheduler && arrayLike.length === 1) { - this._isScalar = true; - this.value = arrayLike[0]; - } - if (mapFn) { - this.mapFn = mapFn.bind(thisArg); - } - } - ArrayLikeObservable.create = function(arrayLike, mapFn, thisArg, scheduler) { - var length = arrayLike.length; - if (length === 0) { - return new EmptyObservable_1.EmptyObservable(); - } else if (length === 1 && !mapFn) { - return new ScalarObservable_1.ScalarObservable(arrayLike[0], scheduler); - } else { - return new ArrayLikeObservable(arrayLike, mapFn, thisArg, scheduler); - } - }; - ArrayLikeObservable.dispatch = function(state) { - var arrayLike = state.arrayLike, - index = state.index, - length = state.length, - mapFn = state.mapFn, - subscriber = state.subscriber; - if (subscriber.isUnsubscribed) { - return ; - } - if (index >= length) { - subscriber.complete(); - return ; - } - var result = mapFn ? mapFn(arrayLike[index], index) : arrayLike[index]; - subscriber.next(result); - state.index = index + 1; - this.schedule(state); - }; - ArrayLikeObservable.prototype._subscribe = function(subscriber) { - var index = 0; - var _a = this, - arrayLike = _a.arrayLike, - mapFn = _a.mapFn, - scheduler = _a.scheduler; - var length = arrayLike.length; - if (scheduler) { - return scheduler.schedule(ArrayLikeObservable.dispatch, 0, { - arrayLike: arrayLike, - index: index, - length: length, - mapFn: mapFn, - subscriber: subscriber - }); - } else { - for (var i = 0; i < length && !subscriber.isUnsubscribed; i++) { - var result = mapFn ? mapFn(arrayLike[i], i) : arrayLike[i]; - subscriber.next(result); - } - subscriber.complete(); - } - }; - return ArrayLikeObservable; - }(Observable_1.Observable)); - exports.ArrayLikeObservable = ArrayLikeObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/Notification", ["rxjs/Observable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var Notification = (function() { - function Notification(kind, value, exception) { - this.kind = kind; - this.value = value; - this.exception = exception; - this.hasValue = kind === 'N'; - } - Notification.prototype.observe = function(observer) { - switch (this.kind) { - case 'N': - return observer.next && observer.next(this.value); - case 'E': - return observer.error && observer.error(this.exception); - case 'C': - return observer.complete && observer.complete(); - } - }; - Notification.prototype.do = function(next, error, complete) { - var kind = this.kind; - switch (kind) { - case 'N': - return next && next(this.value); - case 'E': - return error && error(this.exception); - case 'C': - return complete && complete(); - } - }; - Notification.prototype.accept = function(nextOrObserver, error, complete) { - if (nextOrObserver && typeof nextOrObserver.next === 'function') { - return this.observe(nextOrObserver); - } else { - return this.do(nextOrObserver, error, complete); - } - }; - Notification.prototype.toObservable = function() { - var kind = this.kind; - switch (kind) { - case 'N': - return Observable_1.Observable.of(this.value); - case 'E': - return Observable_1.Observable.throw(this.exception); - case 'C': - return Observable_1.Observable.empty(); - } - }; - Notification.createNext = function(value) { - if (typeof value !== 'undefined') { - return new Notification('N', value); - } - return this.undefinedValueNotification; - }; - Notification.createError = function(err) { - return new Notification('E', undefined, err); - }; - Notification.createComplete = function() { - return this.completeNotification; - }; - Notification.completeNotification = new Notification('C'); - Notification.undefinedValueNotification = new Notification('N', undefined); - return Notification; - }()); - exports.Notification = Notification; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/fromArray", ["rxjs/Observable", "rxjs/observable/ArrayObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var ArrayObservable_1 = require("rxjs/observable/ArrayObservable"); - Observable_1.Observable.fromArray = ArrayObservable_1.ArrayObservable.create; - Observable_1.Observable.of = ArrayObservable_1.ArrayObservable.of; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/FromEventObservable", ["rxjs/Observable", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/Subscription"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var Subscription_1 = require("rxjs/Subscription"); - function isNodeStyleEventEmmitter(sourceObj) { - return !!sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function'; - } - function isJQueryStyleEventEmitter(sourceObj) { - return !!sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function'; - } - function isNodeList(sourceObj) { - return !!sourceObj && sourceObj.toString() === '[object NodeList]'; - } - function isHTMLCollection(sourceObj) { - return !!sourceObj && sourceObj.toString() === '[object HTMLCollection]'; - } - function isEventTarget(sourceObj) { - return !!sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function'; - } - var FromEventObservable = (function(_super) { - __extends(FromEventObservable, _super); - function FromEventObservable(sourceObj, eventName, selector) { - _super.call(this); - this.sourceObj = sourceObj; - this.eventName = eventName; - this.selector = selector; - } - FromEventObservable.create = function(sourceObj, eventName, selector) { - return new FromEventObservable(sourceObj, eventName, selector); - }; - FromEventObservable.setupSubscription = function(sourceObj, eventName, handler, subscriber) { - var unsubscribe; - if (isNodeList(sourceObj) || isHTMLCollection(sourceObj)) { - for (var i = 0, - len = sourceObj.length; i < len; i++) { - FromEventObservable.setupSubscription(sourceObj[i], eventName, handler, subscriber); - } - } else if (isEventTarget(sourceObj)) { - sourceObj.addEventListener(eventName, handler); - unsubscribe = function() { - return sourceObj.removeEventListener(eventName, handler); - }; - } else if (isJQueryStyleEventEmitter(sourceObj)) { - sourceObj.on(eventName, handler); - unsubscribe = function() { - return sourceObj.off(eventName, handler); - }; - } else if (isNodeStyleEventEmmitter(sourceObj)) { - sourceObj.addListener(eventName, handler); - unsubscribe = function() { - return sourceObj.removeListener(eventName, handler); - }; - } - subscriber.add(new Subscription_1.Subscription(unsubscribe)); - }; - FromEventObservable.prototype._subscribe = function(subscriber) { - var sourceObj = this.sourceObj; - var eventName = this.eventName; - var selector = this.selector; - var handler = selector ? function() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i - 0] = arguments[_i]; - } - var result = tryCatch_1.tryCatch(selector).apply(void 0, args); - if (result === errorObject_1.errorObject) { - subscriber.error(errorObject_1.errorObject.e); - } else { - subscriber.next(result); - } - } : function(e) { - return subscriber.next(e); - }; - FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber); - }; - return FromEventObservable; - }(Observable_1.Observable)); - exports.FromEventObservable = FromEventObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/FromEventPatternObservable", ["rxjs/Observable", "rxjs/Subscription", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var Subscription_1 = require("rxjs/Subscription"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var FromEventPatternObservable = (function(_super) { - __extends(FromEventPatternObservable, _super); - function FromEventPatternObservable(addHandler, removeHandler, selector) { - _super.call(this); - this.addHandler = addHandler; - this.removeHandler = removeHandler; - this.selector = selector; - } - FromEventPatternObservable.create = function(addHandler, removeHandler, selector) { - return new FromEventPatternObservable(addHandler, removeHandler, selector); - }; - FromEventPatternObservable.prototype._subscribe = function(subscriber) { - var addHandler = this.addHandler; - var removeHandler = this.removeHandler; - var selector = this.selector; - var handler = selector ? function(e) { - var result = tryCatch_1.tryCatch(selector).apply(null, arguments); - if (result === errorObject_1.errorObject) { - subscriber.error(result.e); - } else { - subscriber.next(result); - } - } : function(e) { - subscriber.next(e); - }; - var result = tryCatch_1.tryCatch(addHandler)(handler); - if (result === errorObject_1.errorObject) { - subscriber.error(result.e); - } - subscriber.add(new Subscription_1.Subscription(function() { - removeHandler(handler); - })); - }; - return FromEventPatternObservable; - }(Observable_1.Observable)); - exports.FromEventPatternObservable = FromEventPatternObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/fromPromise", ["rxjs/Observable", "rxjs/observable/PromiseObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var PromiseObservable_1 = require("rxjs/observable/PromiseObservable"); - Observable_1.Observable.fromPromise = PromiseObservable_1.PromiseObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/isNumeric", ["rxjs/util/isArray"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var isArray_1 = require("rxjs/util/isArray"); - function isNumeric(val) { - return !isArray_1.isArray(val) && (val - parseFloat(val) + 1) >= 0; - } - exports.isNumeric = isNumeric; - ; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/Immediate", ["rxjs/util/root"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var root_1 = require("rxjs/util/root"); - var ImmediateDefinition = (function() { - function ImmediateDefinition(root) { - this.root = root; - if (root.setImmediate && typeof root.setImmediate === 'function') { - this.setImmediate = root.setImmediate.bind(root); - this.clearImmediate = root.clearImmediate.bind(root); - } else { - this.nextHandle = 1; - this.tasksByHandle = {}; - this.currentlyRunningATask = false; - if (this.canUseProcessNextTick()) { - this.setImmediate = this.createProcessNextTickSetImmediate(); - } else if (this.canUsePostMessage()) { - this.setImmediate = this.createPostMessageSetImmediate(); - } else if (this.canUseMessageChannel()) { - this.setImmediate = this.createMessageChannelSetImmediate(); - } else if (this.canUseReadyStateChange()) { - this.setImmediate = this.createReadyStateChangeSetImmediate(); - } else { - this.setImmediate = this.createSetTimeoutSetImmediate(); - } - var ci = function clearImmediate(handle) { - delete clearImmediate.instance.tasksByHandle[handle]; - }; - ci.instance = this; - this.clearImmediate = ci; - } - } - ImmediateDefinition.prototype.identify = function(o) { - return this.root.Object.prototype.toString.call(o); - }; - ImmediateDefinition.prototype.canUseProcessNextTick = function() { - return this.identify(this.root.process) === '[object process]'; - }; - ImmediateDefinition.prototype.canUseMessageChannel = function() { - return Boolean(this.root.MessageChannel); - }; - ImmediateDefinition.prototype.canUseReadyStateChange = function() { - var document = this.root.document; - return Boolean(document && 'onreadystatechange' in document.createElement('script')); - }; - ImmediateDefinition.prototype.canUsePostMessage = function() { - var root = this.root; - if (root.postMessage && !root.importScripts) { - var postMessageIsAsynchronous_1 = true; - var oldOnMessage = root.onmessage; - root.onmessage = function() { - postMessageIsAsynchronous_1 = false; - }; - root.postMessage('', '*'); - root.onmessage = oldOnMessage; - return postMessageIsAsynchronous_1; - } - return false; - }; - ImmediateDefinition.prototype.partiallyApplied = function(handler) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var fn = function result() { - var _a = result, - handler = _a.handler, - args = _a.args; - if (typeof handler === 'function') { - handler.apply(undefined, args); - } else { - (new Function('' + handler))(); - } - }; - fn.handler = handler; - fn.args = args; - return fn; - }; - ImmediateDefinition.prototype.addFromSetImmediateArguments = function(args) { - this.tasksByHandle[this.nextHandle] = this.partiallyApplied.apply(undefined, args); - return this.nextHandle++; - }; - ImmediateDefinition.prototype.createProcessNextTickSetImmediate = function() { - var fn = function setImmediate() { - var instance = setImmediate.instance; - var handle = instance.addFromSetImmediateArguments(arguments); - instance.root.process.nextTick(instance.partiallyApplied(instance.runIfPresent, handle)); - return handle; - }; - fn.instance = this; - return fn; - }; - ImmediateDefinition.prototype.createPostMessageSetImmediate = function() { - var root = this.root; - var messagePrefix = 'setImmediate$' + root.Math.random() + '$'; - var onGlobalMessage = function globalMessageHandler(event) { - var instance = globalMessageHandler.instance; - if (event.source === root && typeof event.data === 'string' && event.data.indexOf(messagePrefix) === 0) { - instance.runIfPresent(+event.data.slice(messagePrefix.length)); - } - }; - onGlobalMessage.instance = this; - root.addEventListener('message', onGlobalMessage, false); - var fn = function setImmediate() { - var _a = setImmediate, - messagePrefix = _a.messagePrefix, - instance = _a.instance; - var handle = instance.addFromSetImmediateArguments(arguments); - instance.root.postMessage(messagePrefix + handle, '*'); - return handle; - }; - fn.instance = this; - fn.messagePrefix = messagePrefix; - return fn; - }; - ImmediateDefinition.prototype.runIfPresent = function(handle) { - if (this.currentlyRunningATask) { - this.root.setTimeout(this.partiallyApplied(this.runIfPresent, handle), 0); - } else { - var task = this.tasksByHandle[handle]; - if (task) { - this.currentlyRunningATask = true; - try { - task(); - } finally { - this.clearImmediate(handle); - this.currentlyRunningATask = false; - } - } - } - }; - ImmediateDefinition.prototype.createMessageChannelSetImmediate = function() { - var _this = this; - var channel = new this.root.MessageChannel(); - channel.port1.onmessage = function(event) { - var handle = event.data; - _this.runIfPresent(handle); - }; - var fn = function setImmediate() { - var _a = setImmediate, - channel = _a.channel, - instance = _a.instance; - var handle = instance.addFromSetImmediateArguments(arguments); - channel.port2.postMessage(handle); - return handle; - }; - fn.channel = channel; - fn.instance = this; - return fn; - }; - ImmediateDefinition.prototype.createReadyStateChangeSetImmediate = function() { - var fn = function setImmediate() { - var instance = setImmediate.instance; - var root = instance.root; - var doc = root.document; - var html = doc.documentElement; - var handle = instance.addFromSetImmediateArguments(arguments); - var script = doc.createElement('script'); - script.onreadystatechange = function() { - instance.runIfPresent(handle); - script.onreadystatechange = null; - html.removeChild(script); - script = null; - }; - html.appendChild(script); - return handle; - }; - fn.instance = this; - return fn; - }; - ImmediateDefinition.prototype.createSetTimeoutSetImmediate = function() { - var fn = function setImmediate() { - var instance = setImmediate.instance; - var handle = instance.addFromSetImmediateArguments(arguments); - instance.root.setTimeout(instance.partiallyApplied(instance.runIfPresent, handle), 0); - return handle; - }; - fn.instance = this; - return fn; - }; - return ImmediateDefinition; - }()); - exports.ImmediateDefinition = ImmediateDefinition; - exports.Immediate = new ImmediateDefinition(root_1.root); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/scheduler/FutureAction", ["rxjs/util/root", "rxjs/Subscription"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var root_1 = require("rxjs/util/root"); - var Subscription_1 = require("rxjs/Subscription"); - var FutureAction = (function(_super) { - __extends(FutureAction, _super); - function FutureAction(scheduler, work) { - _super.call(this); - this.scheduler = scheduler; - this.work = work; - } - FutureAction.prototype.execute = function() { - if (this.isUnsubscribed) { - throw new Error('How did did we execute a canceled Action?'); - } - this.work(this.state); - }; - FutureAction.prototype.schedule = function(state, delay) { - if (delay === void 0) { - delay = 0; - } - if (this.isUnsubscribed) { - return this; - } - return this._schedule(state, delay); - }; - FutureAction.prototype._schedule = function(state, delay) { - var _this = this; - if (delay === void 0) { - delay = 0; - } - this.delay = delay; - this.state = state; - var id = this.id; - if (id != null) { - this.id = undefined; - root_1.root.clearTimeout(id); - } - this.id = root_1.root.setTimeout(function() { - _this.id = null; - var scheduler = _this.scheduler; - scheduler.actions.push(_this); - scheduler.flush(); - }, delay); - return this; - }; - FutureAction.prototype._unsubscribe = function() { - var _a = this, - id = _a.id, - scheduler = _a.scheduler; - var actions = scheduler.actions; - var index = actions.indexOf(this); - if (id != null) { - this.id = null; - root_1.root.clearTimeout(id); - } - if (index !== -1) { - actions.splice(index, 1); - } - this.work = null; - this.state = null; - this.scheduler = null; - }; - return FutureAction; - }(Subscription_1.Subscription)); - exports.FutureAction = FutureAction; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/scheduler/QueueAction", ["rxjs/scheduler/FutureAction"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var FutureAction_1 = require("rxjs/scheduler/FutureAction"); - var QueueAction = (function(_super) { - __extends(QueueAction, _super); - function QueueAction() { - _super.apply(this, arguments); - } - QueueAction.prototype._schedule = function(state, delay) { - if (delay === void 0) { - delay = 0; - } - if (delay > 0) { - return _super.prototype._schedule.call(this, state, delay); - } - this.delay = delay; - this.state = state; - var scheduler = this.scheduler; - scheduler.actions.push(this); - scheduler.flush(); - return this; - }; - return QueueAction; - }(FutureAction_1.FutureAction)); - exports.QueueAction = QueueAction; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/noop", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function noop() {} - exports.noop = noop; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/RangeObservable", ["rxjs/Observable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var RangeObservable = (function(_super) { - __extends(RangeObservable, _super); - function RangeObservable(start, end, scheduler) { - _super.call(this); - this.start = start; - this.end = end; - this.scheduler = scheduler; - } - RangeObservable.create = function(start, end, scheduler) { - if (start === void 0) { - start = 0; - } - if (end === void 0) { - end = 0; - } - return new RangeObservable(start, end, scheduler); - }; - RangeObservable.dispatch = function(state) { - var start = state.start, - index = state.index, - end = state.end, - subscriber = state.subscriber; - if (index >= end) { - subscriber.complete(); - return ; - } - subscriber.next(start); - if (subscriber.isUnsubscribed) { - return ; - } - state.index = index + 1; - state.start = start + 1; - this.schedule(state); - }; - RangeObservable.prototype._subscribe = function(subscriber) { - var index = 0; - var start = this.start; - var end = this.end; - var scheduler = this.scheduler; - if (scheduler) { - return scheduler.schedule(RangeObservable.dispatch, 0, { - index: index, - end: end, - start: start, - subscriber: subscriber - }); - } else { - do { - if (index++ >= end) { - subscriber.complete(); - break; - } - subscriber.next(start++); - if (subscriber.isUnsubscribed) { - break; - } - } while (true); - } - }; - return RangeObservable; - }(Observable_1.Observable)); - exports.RangeObservable = RangeObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/ErrorObservable", ["rxjs/Observable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var ErrorObservable = (function(_super) { - __extends(ErrorObservable, _super); - function ErrorObservable(error, scheduler) { - _super.call(this); - this.error = error; - this.scheduler = scheduler; - } - ErrorObservable.create = function(error, scheduler) { - return new ErrorObservable(error, scheduler); - }; - ErrorObservable.dispatch = function(_a) { - var error = _a.error, - subscriber = _a.subscriber; - subscriber.error(error); - }; - ErrorObservable.prototype._subscribe = function(subscriber) { - var error = this.error; - var scheduler = this.scheduler; - if (scheduler) { - return scheduler.schedule(ErrorObservable.dispatch, 0, { - error: error, - subscriber: subscriber - }); - } else { - subscriber.error(error); - } - }; - return ErrorObservable; - }(Observable_1.Observable)); - exports.ErrorObservable = ErrorObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/isDate", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function isDate(value) { - return value instanceof Date && !isNaN(+value); - } - exports.isDate = isDate; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/zip", ["rxjs/observable/ArrayObservable", "rxjs/util/isArray", "rxjs/Subscriber", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult", "rxjs/util/SymbolShim"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var ArrayObservable_1 = require("rxjs/observable/ArrayObservable"); - var isArray_1 = require("rxjs/util/isArray"); - var Subscriber_1 = require("rxjs/Subscriber"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - var SymbolShim_1 = require("rxjs/util/SymbolShim"); - function zipProto() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i - 0] = arguments[_i]; - } - observables.unshift(this); - return zipStatic.apply(this, observables); - } - exports.zipProto = zipProto; - function zipStatic() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i - 0] = arguments[_i]; - } - var project = observables[observables.length - 1]; - if (typeof project === 'function') { - observables.pop(); - } - return new ArrayObservable_1.ArrayObservable(observables).lift(new ZipOperator(project)); - } - exports.zipStatic = zipStatic; - var ZipOperator = (function() { - function ZipOperator(project) { - this.project = project; - } - ZipOperator.prototype.call = function(subscriber) { - return new ZipSubscriber(subscriber, this.project); - }; - return ZipOperator; - }()); - exports.ZipOperator = ZipOperator; - var ZipSubscriber = (function(_super) { - __extends(ZipSubscriber, _super); - function ZipSubscriber(destination, project, values) { - if (values === void 0) { - values = Object.create(null); - } - _super.call(this, destination); - this.index = 0; - this.iterators = []; - this.active = 0; - this.project = (typeof project === 'function') ? project : null; - this.values = values; - } - ZipSubscriber.prototype._next = function(value) { - var iterators = this.iterators; - var index = this.index++; - if (isArray_1.isArray(value)) { - iterators.push(new StaticArrayIterator(value)); - } else if (typeof value[SymbolShim_1.SymbolShim.iterator] === 'function') { - iterators.push(new StaticIterator(value[SymbolShim_1.SymbolShim.iterator]())); - } else { - iterators.push(new ZipBufferIterator(this.destination, this, value, index)); - } - }; - ZipSubscriber.prototype._complete = function() { - var iterators = this.iterators; - var len = iterators.length; - this.active = len; - for (var i = 0; i < len; i++) { - var iterator = iterators[i]; - if (iterator.stillUnsubscribed) { - this.add(iterator.subscribe(iterator, i)); - } else { - this.active--; - } - } - }; - ZipSubscriber.prototype.notifyInactive = function() { - this.active--; - if (this.active === 0) { - this.destination.complete(); - } - }; - ZipSubscriber.prototype.checkIterators = function() { - var iterators = this.iterators; - var len = iterators.length; - var destination = this.destination; - for (var i = 0; i < len; i++) { - var iterator = iterators[i]; - if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) { - return ; - } - } - var shouldComplete = false; - var args = []; - for (var i = 0; i < len; i++) { - var iterator = iterators[i]; - var result = iterator.next(); - if (iterator.hasCompleted()) { - shouldComplete = true; - } - if (result.done) { - destination.complete(); - return ; - } - args.push(result.value); - } - if (this.project) { - this._tryProject(args); - } else { - destination.next(args); - } - if (shouldComplete) { - destination.complete(); - } - }; - ZipSubscriber.prototype._tryProject = function(args) { - var result; - try { - result = this.project.apply(this, args); - } catch (err) { - this.destination.error(err); - return ; - } - this.destination.next(result); - }; - return ZipSubscriber; - }(Subscriber_1.Subscriber)); - exports.ZipSubscriber = ZipSubscriber; - var StaticIterator = (function() { - function StaticIterator(iterator) { - this.iterator = iterator; - this.nextResult = iterator.next(); - } - StaticIterator.prototype.hasValue = function() { - return true; - }; - StaticIterator.prototype.next = function() { - var result = this.nextResult; - this.nextResult = this.iterator.next(); - return result; - }; - StaticIterator.prototype.hasCompleted = function() { - var nextResult = this.nextResult; - return nextResult && nextResult.done; - }; - return StaticIterator; - }()); - var StaticArrayIterator = (function() { - function StaticArrayIterator(array) { - this.array = array; - this.index = 0; - this.length = 0; - this.length = array.length; - } - StaticArrayIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function() { - return this; - }; - StaticArrayIterator.prototype.next = function(value) { - var i = this.index++; - var array = this.array; - return i < this.length ? { - value: array[i], - done: false - } : {done: true}; - }; - StaticArrayIterator.prototype.hasValue = function() { - return this.array.length > this.index; - }; - StaticArrayIterator.prototype.hasCompleted = function() { - return this.array.length === this.index; - }; - return StaticArrayIterator; - }()); - var ZipBufferIterator = (function(_super) { - __extends(ZipBufferIterator, _super); - function ZipBufferIterator(destination, parent, observable, index) { - _super.call(this, destination); - this.parent = parent; - this.observable = observable; - this.index = index; - this.stillUnsubscribed = true; - this.buffer = []; - this.isComplete = false; - } - ZipBufferIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function() { - return this; - }; - ZipBufferIterator.prototype.next = function() { - var buffer = this.buffer; - if (buffer.length === 0 && this.isComplete) { - return {done: true}; - } else { - return { - value: buffer.shift(), - done: false - }; - } - }; - ZipBufferIterator.prototype.hasValue = function() { - return this.buffer.length > 0; - }; - ZipBufferIterator.prototype.hasCompleted = function() { - return this.buffer.length === 0 && this.isComplete; - }; - ZipBufferIterator.prototype.notifyComplete = function() { - if (this.buffer.length > 0) { - this.isComplete = true; - this.parent.notifyInactive(); - } else { - this.destination.complete(); - } - }; - ZipBufferIterator.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.buffer.push(innerValue); - this.parent.checkIterators(); - }; - ZipBufferIterator.prototype.subscribe = function(value, index) { - return subscribeToResult_1.subscribeToResult(this, this.observable, this, index); - }; - return ZipBufferIterator; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/buffer", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function buffer(closingNotifier) { - return this.lift(new BufferOperator(closingNotifier)); - } - exports.buffer = buffer; - var BufferOperator = (function() { - function BufferOperator(closingNotifier) { - this.closingNotifier = closingNotifier; - } - BufferOperator.prototype.call = function(subscriber) { - return new BufferSubscriber(subscriber, this.closingNotifier); - }; - return BufferOperator; - }()); - var BufferSubscriber = (function(_super) { - __extends(BufferSubscriber, _super); - function BufferSubscriber(destination, closingNotifier) { - _super.call(this, destination); - this.buffer = []; - this.add(subscribeToResult_1.subscribeToResult(this, closingNotifier)); - } - BufferSubscriber.prototype._next = function(value) { - this.buffer.push(value); - }; - BufferSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - var buffer = this.buffer; - this.buffer = []; - this.destination.next(buffer); - }; - return BufferSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/bufferCount", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function bufferCount(bufferSize, startBufferEvery) { - if (startBufferEvery === void 0) { - startBufferEvery = null; - } - return this.lift(new BufferCountOperator(bufferSize, startBufferEvery)); - } - exports.bufferCount = bufferCount; - var BufferCountOperator = (function() { - function BufferCountOperator(bufferSize, startBufferEvery) { - this.bufferSize = bufferSize; - this.startBufferEvery = startBufferEvery; - } - BufferCountOperator.prototype.call = function(subscriber) { - return new BufferCountSubscriber(subscriber, this.bufferSize, this.startBufferEvery); - }; - return BufferCountOperator; - }()); - var BufferCountSubscriber = (function(_super) { - __extends(BufferCountSubscriber, _super); - function BufferCountSubscriber(destination, bufferSize, startBufferEvery) { - _super.call(this, destination); - this.bufferSize = bufferSize; - this.startBufferEvery = startBufferEvery; - this.buffers = [[]]; - this.count = 0; - } - BufferCountSubscriber.prototype._next = function(value) { - var count = (this.count += 1); - var destination = this.destination; - var bufferSize = this.bufferSize; - var startBufferEvery = (this.startBufferEvery == null) ? bufferSize : this.startBufferEvery; - var buffers = this.buffers; - var len = buffers.length; - var remove = -1; - if (count % startBufferEvery === 0) { - buffers.push([]); - } - for (var i = 0; i < len; i++) { - var buffer = buffers[i]; - buffer.push(value); - if (buffer.length === bufferSize) { - remove = i; - destination.next(buffer); - } - } - if (remove !== -1) { - buffers.splice(remove, 1); - } - }; - BufferCountSubscriber.prototype._complete = function() { - var destination = this.destination; - var buffers = this.buffers; - while (buffers.length > 0) { - var buffer = buffers.shift(); - if (buffer.length > 0) { - destination.next(buffer); - } - } - _super.prototype._complete.call(this); - }; - return BufferCountSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/bufferTime", ["rxjs/Subscriber", "rxjs/scheduler/asap"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var asap_1 = require("rxjs/scheduler/asap"); - function bufferTime(bufferTimeSpan, bufferCreationInterval, scheduler) { - if (bufferCreationInterval === void 0) { - bufferCreationInterval = null; - } - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - return this.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler)); - } - exports.bufferTime = bufferTime; - var BufferTimeOperator = (function() { - function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler) { - this.bufferTimeSpan = bufferTimeSpan; - this.bufferCreationInterval = bufferCreationInterval; - this.scheduler = scheduler; - } - BufferTimeOperator.prototype.call = function(subscriber) { - return new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.scheduler); - }; - return BufferTimeOperator; - }()); - var BufferTimeSubscriber = (function(_super) { - __extends(BufferTimeSubscriber, _super); - function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, scheduler) { - _super.call(this, destination); - this.bufferTimeSpan = bufferTimeSpan; - this.bufferCreationInterval = bufferCreationInterval; - this.scheduler = scheduler; - this.buffers = []; - var buffer = this.openBuffer(); - if (bufferCreationInterval !== null && bufferCreationInterval >= 0) { - var closeState = { - subscriber: this, - buffer: buffer - }; - var creationState = { - bufferTimeSpan: bufferTimeSpan, - bufferCreationInterval: bufferCreationInterval, - subscriber: this, - scheduler: scheduler - }; - this.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState)); - this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState)); - } else { - var timeSpanOnlyState = { - subscriber: this, - buffer: buffer, - bufferTimeSpan: bufferTimeSpan - }; - this.add(scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState)); - } - } - BufferTimeSubscriber.prototype._next = function(value) { - var buffers = this.buffers; - var len = buffers.length; - for (var i = 0; i < len; i++) { - buffers[i].push(value); - } - }; - BufferTimeSubscriber.prototype._error = function(err) { - this.buffers.length = 0; - _super.prototype._error.call(this, err); - }; - BufferTimeSubscriber.prototype._complete = function() { - var _a = this, - buffers = _a.buffers, - destination = _a.destination; - while (buffers.length > 0) { - destination.next(buffers.shift()); - } - _super.prototype._complete.call(this); - }; - BufferTimeSubscriber.prototype._unsubscribe = function() { - this.buffers = null; - }; - BufferTimeSubscriber.prototype.openBuffer = function() { - var buffer = []; - this.buffers.push(buffer); - return buffer; - }; - BufferTimeSubscriber.prototype.closeBuffer = function(buffer) { - this.destination.next(buffer); - var buffers = this.buffers; - buffers.splice(buffers.indexOf(buffer), 1); - }; - return BufferTimeSubscriber; - }(Subscriber_1.Subscriber)); - function dispatchBufferTimeSpanOnly(state) { - var subscriber = state.subscriber; - var prevBuffer = state.buffer; - if (prevBuffer) { - subscriber.closeBuffer(prevBuffer); - } - state.buffer = subscriber.openBuffer(); - if (!subscriber.isUnsubscribed) { - this.schedule(state, state.bufferTimeSpan); - } - } - function dispatchBufferCreation(state) { - var bufferCreationInterval = state.bufferCreationInterval, - bufferTimeSpan = state.bufferTimeSpan, - subscriber = state.subscriber, - scheduler = state.scheduler; - var buffer = subscriber.openBuffer(); - var action = this; - if (!subscriber.isUnsubscribed) { - action.add(scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { - subscriber: subscriber, - buffer: buffer - })); - action.schedule(state, bufferCreationInterval); - } - } - function dispatchBufferClose(_a) { - var subscriber = _a.subscriber, - buffer = _a.buffer; - subscriber.closeBuffer(buffer); - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/bufferToggle", ["rxjs/Subscriber", "rxjs/Subscription", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var Subscription_1 = require("rxjs/Subscription"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - function bufferToggle(openings, closingSelector) { - return this.lift(new BufferToggleOperator(openings, closingSelector)); - } - exports.bufferToggle = bufferToggle; - var BufferToggleOperator = (function() { - function BufferToggleOperator(openings, closingSelector) { - this.openings = openings; - this.closingSelector = closingSelector; - } - BufferToggleOperator.prototype.call = function(subscriber) { - return new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector); - }; - return BufferToggleOperator; - }()); - var BufferToggleSubscriber = (function(_super) { - __extends(BufferToggleSubscriber, _super); - function BufferToggleSubscriber(destination, openings, closingSelector) { - _super.call(this, destination); - this.openings = openings; - this.closingSelector = closingSelector; - this.contexts = []; - this.add(this.openings.subscribe(new BufferToggleOpeningsSubscriber(this))); - } - BufferToggleSubscriber.prototype._next = function(value) { - var contexts = this.contexts; - var len = contexts.length; - for (var i = 0; i < len; i++) { - contexts[i].buffer.push(value); - } - }; - BufferToggleSubscriber.prototype._error = function(err) { - var contexts = this.contexts; - while (contexts.length > 0) { - var context = contexts.shift(); - context.subscription.unsubscribe(); - context.buffer = null; - context.subscription = null; - } - this.contexts = null; - _super.prototype._error.call(this, err); - }; - BufferToggleSubscriber.prototype._complete = function() { - var contexts = this.contexts; - while (contexts.length > 0) { - var context = contexts.shift(); - this.destination.next(context.buffer); - context.subscription.unsubscribe(); - context.buffer = null; - context.subscription = null; - } - this.contexts = null; - _super.prototype._complete.call(this); - }; - BufferToggleSubscriber.prototype.openBuffer = function(value) { - var closingSelector = this.closingSelector; - var contexts = this.contexts; - var closingNotifier = tryCatch_1.tryCatch(closingSelector)(value); - if (closingNotifier === errorObject_1.errorObject) { - this._error(errorObject_1.errorObject.e); - } else { - var context = { - buffer: [], - subscription: new Subscription_1.Subscription() - }; - contexts.push(context); - var subscriber = new BufferToggleClosingsSubscriber(this, context); - var subscription = closingNotifier.subscribe(subscriber); - context.subscription.add(subscription); - this.add(subscription); - } - }; - BufferToggleSubscriber.prototype.closeBuffer = function(context) { - var contexts = this.contexts; - if (contexts === null) { - return ; - } - var buffer = context.buffer, - subscription = context.subscription; - this.destination.next(buffer); - contexts.splice(contexts.indexOf(context), 1); - this.remove(subscription); - subscription.unsubscribe(); - }; - return BufferToggleSubscriber; - }(Subscriber_1.Subscriber)); - var BufferToggleOpeningsSubscriber = (function(_super) { - __extends(BufferToggleOpeningsSubscriber, _super); - function BufferToggleOpeningsSubscriber(parent) { - _super.call(this, null); - this.parent = parent; - } - BufferToggleOpeningsSubscriber.prototype._next = function(value) { - this.parent.openBuffer(value); - }; - BufferToggleOpeningsSubscriber.prototype._error = function(err) { - this.parent.error(err); - }; - BufferToggleOpeningsSubscriber.prototype._complete = function() {}; - return BufferToggleOpeningsSubscriber; - }(Subscriber_1.Subscriber)); - var BufferToggleClosingsSubscriber = (function(_super) { - __extends(BufferToggleClosingsSubscriber, _super); - function BufferToggleClosingsSubscriber(parent, context) { - _super.call(this, null); - this.parent = parent; - this.context = context; - } - BufferToggleClosingsSubscriber.prototype._next = function() { - this.parent.closeBuffer(this.context); - }; - BufferToggleClosingsSubscriber.prototype._error = function(err) { - this.parent.error(err); - }; - BufferToggleClosingsSubscriber.prototype._complete = function() { - this.parent.closeBuffer(this.context); - }; - return BufferToggleClosingsSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/bufferWhen", ["rxjs/Subscription", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscription_1 = require("rxjs/Subscription"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function bufferWhen(closingSelector) { - return this.lift(new BufferWhenOperator(closingSelector)); - } - exports.bufferWhen = bufferWhen; - var BufferWhenOperator = (function() { - function BufferWhenOperator(closingSelector) { - this.closingSelector = closingSelector; - } - BufferWhenOperator.prototype.call = function(subscriber) { - return new BufferWhenSubscriber(subscriber, this.closingSelector); - }; - return BufferWhenOperator; - }()); - var BufferWhenSubscriber = (function(_super) { - __extends(BufferWhenSubscriber, _super); - function BufferWhenSubscriber(destination, closingSelector) { - _super.call(this, destination); - this.closingSelector = closingSelector; - this.subscribing = false; - this.openBuffer(); - } - BufferWhenSubscriber.prototype._next = function(value) { - this.buffer.push(value); - }; - BufferWhenSubscriber.prototype._complete = function() { - var buffer = this.buffer; - if (buffer) { - this.destination.next(buffer); - } - _super.prototype._complete.call(this); - }; - BufferWhenSubscriber.prototype._unsubscribe = function() { - this.buffer = null; - this.subscribing = false; - }; - BufferWhenSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.openBuffer(); - }; - BufferWhenSubscriber.prototype.notifyComplete = function() { - if (this.subscribing) { - this.complete(); - } else { - this.openBuffer(); - } - }; - BufferWhenSubscriber.prototype.openBuffer = function() { - var closingSubscription = this.closingSubscription; - if (closingSubscription) { - this.remove(closingSubscription); - closingSubscription.unsubscribe(); - } - var buffer = this.buffer; - if (this.buffer) { - this.destination.next(buffer); - } - this.buffer = []; - var closingNotifier = tryCatch_1.tryCatch(this.closingSelector)(); - if (closingNotifier === errorObject_1.errorObject) { - this.error(errorObject_1.errorObject.e); - } else { - closingSubscription = new Subscription_1.Subscription(); - this.closingSubscription = closingSubscription; - this.add(closingSubscription); - this.subscribing = true; - closingSubscription.add(subscribeToResult_1.subscribeToResult(this, closingNotifier)); - this.subscribing = false; - } - }; - return BufferWhenSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/scheduler/queue", ["rxjs/scheduler/QueueScheduler"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var QueueScheduler_1 = require("rxjs/scheduler/QueueScheduler"); - exports.queue = new QueueScheduler_1.QueueScheduler(); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/ConnectableObservable", ["rxjs/Observable", "rxjs/Subscriber", "rxjs/Subscription"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var Subscriber_1 = require("rxjs/Subscriber"); - var Subscription_1 = require("rxjs/Subscription"); - var ConnectableObservable = (function(_super) { - __extends(ConnectableObservable, _super); - function ConnectableObservable(source, subjectFactory) { - _super.call(this); - this.source = source; - this.subjectFactory = subjectFactory; - } - ConnectableObservable.prototype._subscribe = function(subscriber) { - return this.getSubject().subscribe(subscriber); - }; - ConnectableObservable.prototype.getSubject = function() { - var subject = this.subject; - if (subject && !subject.isUnsubscribed) { - return subject; - } - return (this.subject = this.subjectFactory()); - }; - ConnectableObservable.prototype.connect = function() { - var source = this.source; - var subscription = this.subscription; - if (subscription && !subscription.isUnsubscribed) { - return subscription; - } - subscription = source.subscribe(this.getSubject()); - subscription.add(new ConnectableSubscription(this)); - return (this.subscription = subscription); - }; - ConnectableObservable.prototype.refCount = function() { - return new RefCountObservable(this); - }; - ConnectableObservable.prototype._closeSubscription = function() { - this.subject = null; - this.subscription = null; - }; - return ConnectableObservable; - }(Observable_1.Observable)); - exports.ConnectableObservable = ConnectableObservable; - var ConnectableSubscription = (function(_super) { - __extends(ConnectableSubscription, _super); - function ConnectableSubscription(connectable) { - _super.call(this); - this.connectable = connectable; - } - ConnectableSubscription.prototype._unsubscribe = function() { - var connectable = this.connectable; - connectable._closeSubscription(); - this.connectable = null; - }; - return ConnectableSubscription; - }(Subscription_1.Subscription)); - var RefCountObservable = (function(_super) { - __extends(RefCountObservable, _super); - function RefCountObservable(connectable, refCount) { - if (refCount === void 0) { - refCount = 0; - } - _super.call(this); - this.connectable = connectable; - this.refCount = refCount; - } - RefCountObservable.prototype._subscribe = function(subscriber) { - var connectable = this.connectable; - var refCountSubscriber = new RefCountSubscriber(subscriber, this); - var subscription = connectable.subscribe(refCountSubscriber); - if (!subscription.isUnsubscribed && ++this.refCount === 1) { - refCountSubscriber.connection = this.connection = connectable.connect(); - } - return subscription; - }; - return RefCountObservable; - }(Observable_1.Observable)); - var RefCountSubscriber = (function(_super) { - __extends(RefCountSubscriber, _super); - function RefCountSubscriber(destination, refCountObservable) { - _super.call(this, null); - this.destination = destination; - this.refCountObservable = refCountObservable; - this.connection = refCountObservable.connection; - destination.add(this); - } - RefCountSubscriber.prototype._next = function(value) { - this.destination.next(value); - }; - RefCountSubscriber.prototype._error = function(err) { - this._resetConnectable(); - this.destination.error(err); - }; - RefCountSubscriber.prototype._complete = function() { - this._resetConnectable(); - this.destination.complete(); - }; - RefCountSubscriber.prototype._resetConnectable = function() { - var observable = this.refCountObservable; - var obsConnection = observable.connection; - var subConnection = this.connection; - if (subConnection && subConnection === obsConnection) { - observable.refCount = 0; - obsConnection.unsubscribe(); - observable.connection = null; - this.unsubscribe(); - } - }; - RefCountSubscriber.prototype._unsubscribe = function() { - var observable = this.refCountObservable; - if (observable.refCount === 0) { - return ; - } - if (--observable.refCount === 0) { - var obsConnection = observable.connection; - var subConnection = this.connection; - if (subConnection && subConnection === obsConnection) { - obsConnection.unsubscribe(); - observable.connection = null; - } - } - }; - return RefCountSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/catch", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function _catch(selector) { - var operator = new CatchOperator(selector); - var caught = this.lift(operator); - return (operator.caught = caught); - } - exports._catch = _catch; - var CatchOperator = (function() { - function CatchOperator(selector) { - this.selector = selector; - } - CatchOperator.prototype.call = function(subscriber) { - return new CatchSubscriber(subscriber, this.selector, this.caught); - }; - return CatchOperator; - }()); - var CatchSubscriber = (function(_super) { - __extends(CatchSubscriber, _super); - function CatchSubscriber(destination, selector, caught) { - _super.call(this, destination); - this.selector = selector; - this.caught = caught; - } - CatchSubscriber.prototype.error = function(err) { - if (!this.isStopped) { - var result = void 0; - try { - result = this.selector(err, this.caught); - } catch (err) { - this.destination.error(err); - return ; - } - this._innerSub(result); - } - }; - CatchSubscriber.prototype._innerSub = function(result) { - this.unsubscribe(); - this.destination.remove(this); - result.subscribe(this.destination); - }; - return CatchSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/combineAll", ["rxjs/operator/combineLatest"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var combineLatest_1 = require("rxjs/operator/combineLatest"); - function combineAll(project) { - return this.lift(new combineLatest_1.CombineLatestOperator(project)); - } - exports.combineAll = combineAll; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/combineLatest", ["rxjs/Observable", "rxjs/operator/combineLatest"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var combineLatest_1 = require("rxjs/operator/combineLatest"); - Observable_1.Observable.prototype.combineLatest = combineLatest_1.combineLatest; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/concat", ["rxjs/Observable", "rxjs/operator/concat"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var concat_1 = require("rxjs/operator/concat"); - Observable_1.Observable.prototype.concat = concat_1.concat; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/concatAll", ["rxjs/operator/mergeAll"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var mergeAll_1 = require("rxjs/operator/mergeAll"); - function concatAll() { - return this.lift(new mergeAll_1.MergeAllOperator(1)); - } - exports.concatAll = concatAll; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/mergeMap", ["rxjs/util/subscribeToResult", "rxjs/OuterSubscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - function mergeMap(project, resultSelector, concurrent) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - return this.lift(new MergeMapOperator(project, resultSelector, concurrent)); - } - exports.mergeMap = mergeMap; - var MergeMapOperator = (function() { - function MergeMapOperator(project, resultSelector, concurrent) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - this.project = project; - this.resultSelector = resultSelector; - this.concurrent = concurrent; - } - MergeMapOperator.prototype.call = function(observer) { - return new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent); - }; - return MergeMapOperator; - }()); - exports.MergeMapOperator = MergeMapOperator; - var MergeMapSubscriber = (function(_super) { - __extends(MergeMapSubscriber, _super); - function MergeMapSubscriber(destination, project, resultSelector, concurrent) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - _super.call(this, destination); - this.project = project; - this.resultSelector = resultSelector; - this.concurrent = concurrent; - this.hasCompleted = false; - this.buffer = []; - this.active = 0; - this.index = 0; - } - MergeMapSubscriber.prototype._next = function(value) { - if (this.active < this.concurrent) { - this._tryNext(value); - } else { - this.buffer.push(value); - } - }; - MergeMapSubscriber.prototype._tryNext = function(value) { - var result; - var index = this.index++; - try { - result = this.project(value, index); - } catch (err) { - this.destination.error(err); - return ; - } - this.active++; - this._innerSub(result, value, index); - }; - MergeMapSubscriber.prototype._innerSub = function(ish, value, index) { - this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index)); - }; - MergeMapSubscriber.prototype._complete = function() { - this.hasCompleted = true; - if (this.active === 0 && this.buffer.length === 0) { - this.destination.complete(); - } - }; - MergeMapSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - if (this.resultSelector) { - this._notifyResultSelector(outerValue, innerValue, outerIndex, innerIndex); - } else { - this.destination.next(innerValue); - } - }; - MergeMapSubscriber.prototype._notifyResultSelector = function(outerValue, innerValue, outerIndex, innerIndex) { - var result; - try { - result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex); - } catch (err) { - this.destination.error(err); - return ; - } - this.destination.next(result); - }; - MergeMapSubscriber.prototype.notifyComplete = function(innerSub) { - var buffer = this.buffer; - this.remove(innerSub); - this.active--; - if (buffer.length > 0) { - this._next(buffer.shift()); - } else if (this.active === 0 && this.hasCompleted) { - this.destination.complete(); - } - }; - return MergeMapSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - exports.MergeMapSubscriber = MergeMapSubscriber; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/mergeMapTo", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function mergeMapTo(observable, resultSelector, concurrent) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - return this.lift(new MergeMapToOperator(observable, resultSelector, concurrent)); - } - exports.mergeMapTo = mergeMapTo; - var MergeMapToOperator = (function() { - function MergeMapToOperator(ish, resultSelector, concurrent) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - this.ish = ish; - this.resultSelector = resultSelector; - this.concurrent = concurrent; - } - MergeMapToOperator.prototype.call = function(observer) { - return new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent); - }; - return MergeMapToOperator; - }()); - exports.MergeMapToOperator = MergeMapToOperator; - var MergeMapToSubscriber = (function(_super) { - __extends(MergeMapToSubscriber, _super); - function MergeMapToSubscriber(destination, ish, resultSelector, concurrent) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - _super.call(this, destination); - this.ish = ish; - this.resultSelector = resultSelector; - this.concurrent = concurrent; - this.hasCompleted = false; - this.buffer = []; - this.active = 0; - this.index = 0; - } - MergeMapToSubscriber.prototype._next = function(value) { - if (this.active < this.concurrent) { - var resultSelector = this.resultSelector; - var index = this.index++; - var ish = this.ish; - var destination = this.destination; - this.active++; - this._innerSub(ish, destination, resultSelector, value, index); - } else { - this.buffer.push(value); - } - }; - MergeMapToSubscriber.prototype._innerSub = function(ish, destination, resultSelector, value, index) { - this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index)); - }; - MergeMapToSubscriber.prototype._complete = function() { - this.hasCompleted = true; - if (this.active === 0 && this.buffer.length === 0) { - this.destination.complete(); - } - }; - MergeMapToSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - var _a = this, - resultSelector = _a.resultSelector, - destination = _a.destination; - if (resultSelector) { - this.trySelectResult(outerValue, innerValue, outerIndex, innerIndex); - } else { - destination.next(innerValue); - } - }; - MergeMapToSubscriber.prototype.trySelectResult = function(outerValue, innerValue, outerIndex, innerIndex) { - var _a = this, - resultSelector = _a.resultSelector, - destination = _a.destination; - var result; - try { - result = resultSelector(outerValue, innerValue, outerIndex, innerIndex); - } catch (err) { - destination.error(err); - return ; - } - destination.next(result); - }; - MergeMapToSubscriber.prototype.notifyError = function(err) { - this.destination.error(err); - }; - MergeMapToSubscriber.prototype.notifyComplete = function(innerSub) { - var buffer = this.buffer; - this.remove(innerSub); - this.active--; - if (buffer.length > 0) { - this._next(buffer.shift()); - } else if (this.active === 0 && this.hasCompleted) { - this.destination.complete(); - } - }; - return MergeMapToSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - exports.MergeMapToSubscriber = MergeMapToSubscriber; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/count", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function count(predicate) { - return this.lift(new CountOperator(predicate, this)); - } - exports.count = count; - var CountOperator = (function() { - function CountOperator(predicate, source) { - this.predicate = predicate; - this.source = source; - } - CountOperator.prototype.call = function(subscriber) { - return new CountSubscriber(subscriber, this.predicate, this.source); - }; - return CountOperator; - }()); - var CountSubscriber = (function(_super) { - __extends(CountSubscriber, _super); - function CountSubscriber(destination, predicate, source) { - _super.call(this, destination); - this.predicate = predicate; - this.source = source; - this.count = 0; - this.index = 0; - } - CountSubscriber.prototype._next = function(value) { - if (this.predicate) { - this._tryPredicate(value); - } else { - this.count++; - } - }; - CountSubscriber.prototype._tryPredicate = function(value) { - var result; - try { - result = this.predicate(value, this.index++, this.source); - } catch (err) { - this.destination.error(err); - return ; - } - if (result) { - this.count++; - } - }; - CountSubscriber.prototype._complete = function() { - this.destination.next(this.count); - this.destination.complete(); - }; - return CountSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/dematerialize", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function dematerialize() { - return this.lift(new DeMaterializeOperator()); - } - exports.dematerialize = dematerialize; - var DeMaterializeOperator = (function() { - function DeMaterializeOperator() {} - DeMaterializeOperator.prototype.call = function(subscriber) { - return new DeMaterializeSubscriber(subscriber); - }; - return DeMaterializeOperator; - }()); - var DeMaterializeSubscriber = (function(_super) { - __extends(DeMaterializeSubscriber, _super); - function DeMaterializeSubscriber(destination) { - _super.call(this, destination); - } - DeMaterializeSubscriber.prototype._next = function(value) { - value.observe(this.destination); - }; - return DeMaterializeSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/debounce", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function debounce(durationSelector) { - return this.lift(new DebounceOperator(durationSelector)); - } - exports.debounce = debounce; - var DebounceOperator = (function() { - function DebounceOperator(durationSelector) { - this.durationSelector = durationSelector; - } - DebounceOperator.prototype.call = function(subscriber) { - return new DebounceSubscriber(subscriber, this.durationSelector); - }; - return DebounceOperator; - }()); - var DebounceSubscriber = (function(_super) { - __extends(DebounceSubscriber, _super); - function DebounceSubscriber(destination, durationSelector) { - _super.call(this, destination); - this.durationSelector = durationSelector; - this.hasValue = false; - this.durationSubscription = null; - } - DebounceSubscriber.prototype._next = function(value) { - try { - var result = this.durationSelector.call(this, value); - if (result) { - this._tryNext(value, result); - } - } catch (err) { - this.destination.error(err); - } - }; - DebounceSubscriber.prototype._complete = function() { - this.emitValue(); - this.destination.complete(); - }; - DebounceSubscriber.prototype._tryNext = function(value, duration) { - var subscription = this.durationSubscription; - this.value = value; - this.hasValue = true; - if (subscription) { - subscription.unsubscribe(); - this.remove(subscription); - } - subscription = subscribeToResult_1.subscribeToResult(this, duration); - if (!subscription.isUnsubscribed) { - this.add(this.durationSubscription = subscription); - } - }; - DebounceSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.emitValue(); - }; - DebounceSubscriber.prototype.notifyComplete = function() { - this.emitValue(); - }; - DebounceSubscriber.prototype.emitValue = function() { - if (this.hasValue) { - var value = this.value; - var subscription = this.durationSubscription; - if (subscription) { - this.durationSubscription = null; - subscription.unsubscribe(); - this.remove(subscription); - } - this.value = null; - this.hasValue = false; - _super.prototype._next.call(this, value); - } - }; - return DebounceSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/debounceTime", ["rxjs/Subscriber", "rxjs/scheduler/asap"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var asap_1 = require("rxjs/scheduler/asap"); - function debounceTime(dueTime, scheduler) { - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - return this.lift(new DebounceTimeOperator(dueTime, scheduler)); - } - exports.debounceTime = debounceTime; - var DebounceTimeOperator = (function() { - function DebounceTimeOperator(dueTime, scheduler) { - this.dueTime = dueTime; - this.scheduler = scheduler; - } - DebounceTimeOperator.prototype.call = function(subscriber) { - return new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler); - }; - return DebounceTimeOperator; - }()); - var DebounceTimeSubscriber = (function(_super) { - __extends(DebounceTimeSubscriber, _super); - function DebounceTimeSubscriber(destination, dueTime, scheduler) { - _super.call(this, destination); - this.dueTime = dueTime; - this.scheduler = scheduler; - this.debouncedSubscription = null; - this.lastValue = null; - this.hasValue = false; - } - DebounceTimeSubscriber.prototype._next = function(value) { - this.clearDebounce(); - this.lastValue = value; - this.hasValue = true; - this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this)); - }; - DebounceTimeSubscriber.prototype._complete = function() { - this.debouncedNext(); - this.destination.complete(); - }; - DebounceTimeSubscriber.prototype.debouncedNext = function() { - this.clearDebounce(); - if (this.hasValue) { - this.destination.next(this.lastValue); - this.lastValue = null; - this.hasValue = false; - } - }; - DebounceTimeSubscriber.prototype.clearDebounce = function() { - var debouncedSubscription = this.debouncedSubscription; - if (debouncedSubscription !== null) { - this.remove(debouncedSubscription); - debouncedSubscription.unsubscribe(); - this.debouncedSubscription = null; - } - }; - return DebounceTimeSubscriber; - }(Subscriber_1.Subscriber)); - function dispatchNext(subscriber) { - subscriber.debouncedNext(); - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/defaultIfEmpty", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function defaultIfEmpty(defaultValue) { - if (defaultValue === void 0) { - defaultValue = null; - } - return this.lift(new DefaultIfEmptyOperator(defaultValue)); - } - exports.defaultIfEmpty = defaultIfEmpty; - var DefaultIfEmptyOperator = (function() { - function DefaultIfEmptyOperator(defaultValue) { - this.defaultValue = defaultValue; - } - DefaultIfEmptyOperator.prototype.call = function(subscriber) { - return new DefaultIfEmptySubscriber(subscriber, this.defaultValue); - }; - return DefaultIfEmptyOperator; - }()); - var DefaultIfEmptySubscriber = (function(_super) { - __extends(DefaultIfEmptySubscriber, _super); - function DefaultIfEmptySubscriber(destination, defaultValue) { - _super.call(this, destination); - this.defaultValue = defaultValue; - this.isEmpty = true; - } - DefaultIfEmptySubscriber.prototype._next = function(value) { - this.isEmpty = false; - this.destination.next(value); - }; - DefaultIfEmptySubscriber.prototype._complete = function() { - if (this.isEmpty) { - this.destination.next(this.defaultValue); - } - this.destination.complete(); - }; - return DefaultIfEmptySubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/delay", ["rxjs/scheduler/asap", "rxjs/util/isDate", "rxjs/Subscriber", "rxjs/Notification"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var asap_1 = require("rxjs/scheduler/asap"); - var isDate_1 = require("rxjs/util/isDate"); - var Subscriber_1 = require("rxjs/Subscriber"); - var Notification_1 = require("rxjs/Notification"); - function delay(delay, scheduler) { - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - var absoluteDelay = isDate_1.isDate(delay); - var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay); - return this.lift(new DelayOperator(delayFor, scheduler)); - } - exports.delay = delay; - var DelayOperator = (function() { - function DelayOperator(delay, scheduler) { - this.delay = delay; - this.scheduler = scheduler; - } - DelayOperator.prototype.call = function(subscriber) { - return new DelaySubscriber(subscriber, this.delay, this.scheduler); - }; - return DelayOperator; - }()); - var DelaySubscriber = (function(_super) { - __extends(DelaySubscriber, _super); - function DelaySubscriber(destination, delay, scheduler) { - _super.call(this, destination); - this.delay = delay; - this.scheduler = scheduler; - this.queue = []; - this.active = false; - this.errored = false; - } - DelaySubscriber.dispatch = function(state) { - var source = state.source; - var queue = source.queue; - var scheduler = state.scheduler; - var destination = state.destination; - while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) { - queue.shift().notification.observe(destination); - } - if (queue.length > 0) { - var delay_1 = Math.max(0, queue[0].time - scheduler.now()); - this.schedule(state, delay_1); - } else { - source.active = false; - } - }; - DelaySubscriber.prototype._schedule = function(scheduler) { - this.active = true; - this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { - source: this, - destination: this.destination, - scheduler: scheduler - })); - }; - DelaySubscriber.prototype.scheduleNotification = function(notification) { - if (this.errored === true) { - return ; - } - var scheduler = this.scheduler; - var message = new DelayMessage(scheduler.now() + this.delay, notification); - this.queue.push(message); - if (this.active === false) { - this._schedule(scheduler); - } - }; - DelaySubscriber.prototype._next = function(value) { - this.scheduleNotification(Notification_1.Notification.createNext(value)); - }; - DelaySubscriber.prototype._error = function(err) { - this.errored = true; - this.queue = []; - this.destination.error(err); - }; - DelaySubscriber.prototype._complete = function() { - this.scheduleNotification(Notification_1.Notification.createComplete()); - }; - return DelaySubscriber; - }(Subscriber_1.Subscriber)); - var DelayMessage = (function() { - function DelayMessage(time, notification) { - this.time = time; - this.notification = notification; - } - return DelayMessage; - }()); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/delayWhen", ["rxjs/Subscriber", "rxjs/Observable", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var Observable_1 = require("rxjs/Observable"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function delayWhen(delayDurationSelector, subscriptionDelay) { - if (subscriptionDelay) { - return new SubscriptionDelayObservable(this, subscriptionDelay).lift(new DelayWhenOperator(delayDurationSelector)); - } - return this.lift(new DelayWhenOperator(delayDurationSelector)); - } - exports.delayWhen = delayWhen; - var DelayWhenOperator = (function() { - function DelayWhenOperator(delayDurationSelector) { - this.delayDurationSelector = delayDurationSelector; - } - DelayWhenOperator.prototype.call = function(subscriber) { - return new DelayWhenSubscriber(subscriber, this.delayDurationSelector); - }; - return DelayWhenOperator; - }()); - var DelayWhenSubscriber = (function(_super) { - __extends(DelayWhenSubscriber, _super); - function DelayWhenSubscriber(destination, delayDurationSelector) { - _super.call(this, destination); - this.delayDurationSelector = delayDurationSelector; - this.completed = false; - this.delayNotifierSubscriptions = []; - this.values = []; - } - DelayWhenSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.destination.next(outerValue); - this.removeSubscription(innerSub); - this.tryComplete(); - }; - DelayWhenSubscriber.prototype.notifyError = function(error, innerSub) { - this._error(error); - }; - DelayWhenSubscriber.prototype.notifyComplete = function(innerSub) { - var value = this.removeSubscription(innerSub); - if (value) { - this.destination.next(value); - } - this.tryComplete(); - }; - DelayWhenSubscriber.prototype._next = function(value) { - try { - var delayNotifier = this.delayDurationSelector(value); - if (delayNotifier) { - this.tryDelay(delayNotifier, value); - } - } catch (err) { - this.destination.error(err); - } - }; - DelayWhenSubscriber.prototype._complete = function() { - this.completed = true; - this.tryComplete(); - }; - DelayWhenSubscriber.prototype.removeSubscription = function(subscription) { - subscription.unsubscribe(); - var subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription); - var value = null; - if (subscriptionIdx !== -1) { - value = this.values[subscriptionIdx]; - this.delayNotifierSubscriptions.splice(subscriptionIdx, 1); - this.values.splice(subscriptionIdx, 1); - } - return value; - }; - DelayWhenSubscriber.prototype.tryDelay = function(delayNotifier, value) { - var notifierSubscription = subscribeToResult_1.subscribeToResult(this, delayNotifier, value); - this.add(notifierSubscription); - this.delayNotifierSubscriptions.push(notifierSubscription); - this.values.push(value); - }; - DelayWhenSubscriber.prototype.tryComplete = function() { - if (this.completed && this.delayNotifierSubscriptions.length === 0) { - this.destination.complete(); - } - }; - return DelayWhenSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - var SubscriptionDelayObservable = (function(_super) { - __extends(SubscriptionDelayObservable, _super); - function SubscriptionDelayObservable(source, subscriptionDelay) { - _super.call(this); - this.source = source; - this.subscriptionDelay = subscriptionDelay; - } - SubscriptionDelayObservable.prototype._subscribe = function(subscriber) { - this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source)); - }; - return SubscriptionDelayObservable; - }(Observable_1.Observable)); - var SubscriptionDelaySubscriber = (function(_super) { - __extends(SubscriptionDelaySubscriber, _super); - function SubscriptionDelaySubscriber(parent, source) { - _super.call(this); - this.parent = parent; - this.source = source; - this.sourceSubscribed = false; - } - SubscriptionDelaySubscriber.prototype._next = function(unused) { - this.subscribeToSource(); - }; - SubscriptionDelaySubscriber.prototype._error = function(err) { - this.unsubscribe(); - this.parent.error(err); - }; - SubscriptionDelaySubscriber.prototype._complete = function() { - this.subscribeToSource(); - }; - SubscriptionDelaySubscriber.prototype.subscribeToSource = function() { - if (!this.sourceSubscribed) { - this.sourceSubscribed = true; - this.unsubscribe(); - this.source.subscribe(this.parent); - } - }; - return SubscriptionDelaySubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/distinctUntilChanged", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - function distinctUntilChanged(compare, keySelector) { - return this.lift(new DistinctUntilChangedOperator(compare, keySelector)); - } - exports.distinctUntilChanged = distinctUntilChanged; - var DistinctUntilChangedOperator = (function() { - function DistinctUntilChangedOperator(compare, keySelector) { - this.compare = compare; - this.keySelector = keySelector; - } - DistinctUntilChangedOperator.prototype.call = function(subscriber) { - return new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector); - }; - return DistinctUntilChangedOperator; - }()); - var DistinctUntilChangedSubscriber = (function(_super) { - __extends(DistinctUntilChangedSubscriber, _super); - function DistinctUntilChangedSubscriber(destination, compare, keySelector) { - _super.call(this, destination); - this.keySelector = keySelector; - this.hasKey = false; - if (typeof compare === 'function') { - this.compare = compare; - } - } - DistinctUntilChangedSubscriber.prototype.compare = function(x, y) { - return x === y; - }; - DistinctUntilChangedSubscriber.prototype._next = function(value) { - var keySelector = this.keySelector; - var key = value; - if (keySelector) { - key = tryCatch_1.tryCatch(this.keySelector)(value); - if (key === errorObject_1.errorObject) { - return this.destination.error(errorObject_1.errorObject.e); - } - } - var result = false; - if (this.hasKey) { - result = tryCatch_1.tryCatch(this.compare)(this.key, key); - if (result === errorObject_1.errorObject) { - return this.destination.error(errorObject_1.errorObject.e); - } - } else { - this.hasKey = true; - } - if (Boolean(result) === false) { - this.key = key; - this.destination.next(value); - } - }; - return DistinctUntilChangedSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/do", ["rxjs/Subscriber", "rxjs/util/noop"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var noop_1 = require("rxjs/util/noop"); - function _do(nextOrObserver, error, complete) { - var next; - if (nextOrObserver && typeof nextOrObserver === 'object') { - next = nextOrObserver.next; - error = nextOrObserver.error; - complete = nextOrObserver.complete; - } else { - next = nextOrObserver; - } - return this.lift(new DoOperator(next || noop_1.noop, error || noop_1.noop, complete || noop_1.noop)); - } - exports._do = _do; - var DoOperator = (function() { - function DoOperator(next, error, complete) { - this.next = next; - this.error = error; - this.complete = complete; - } - DoOperator.prototype.call = function(subscriber) { - return new DoSubscriber(subscriber, this.next, this.error, this.complete); - }; - return DoOperator; - }()); - var DoSubscriber = (function(_super) { - __extends(DoSubscriber, _super); - function DoSubscriber(destination, next, error, complete) { - _super.call(this, destination); - this.__next = next; - this.__error = error; - this.__complete = complete; - } - DoSubscriber.prototype._next = function(value) { - try { - this.__next(value); - } catch (err) { - this.destination.error(err); - return ; - } - this.destination.next(value); - }; - DoSubscriber.prototype._error = function(err) { - try { - this.__error(err); - } catch (err) { - this.destination.error(err); - return ; - } - this.destination.error(err); - }; - DoSubscriber.prototype._complete = function() { - try { - this.__complete(); - } catch (err) { - this.destination.error(err); - return ; - } - this.destination.complete(); - }; - return DoSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/expand", ["rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function expand(project, concurrent, scheduler) { - if (concurrent === void 0) { - concurrent = Number.POSITIVE_INFINITY; - } - if (scheduler === void 0) { - scheduler = undefined; - } - concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent; - return this.lift(new ExpandOperator(project, concurrent, scheduler)); - } - exports.expand = expand; - var ExpandOperator = (function() { - function ExpandOperator(project, concurrent, scheduler) { - this.project = project; - this.concurrent = concurrent; - this.scheduler = scheduler; - } - ExpandOperator.prototype.call = function(subscriber) { - return new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler); - }; - return ExpandOperator; - }()); - exports.ExpandOperator = ExpandOperator; - var ExpandSubscriber = (function(_super) { - __extends(ExpandSubscriber, _super); - function ExpandSubscriber(destination, project, concurrent, scheduler) { - _super.call(this, destination); - this.project = project; - this.concurrent = concurrent; - this.scheduler = scheduler; - this.index = 0; - this.active = 0; - this.hasCompleted = false; - if (concurrent < Number.POSITIVE_INFINITY) { - this.buffer = []; - } - } - ExpandSubscriber.dispatch = function(_a) { - var subscriber = _a.subscriber, - result = _a.result, - value = _a.value, - index = _a.index; - subscriber.subscribeToProjection(result, value, index); - }; - ExpandSubscriber.prototype._next = function(value) { - var destination = this.destination; - if (destination.isUnsubscribed) { - this._complete(); - return ; - } - var index = this.index++; - if (this.active < this.concurrent) { - destination.next(value); - var result = tryCatch_1.tryCatch(this.project)(value, index); - if (result === errorObject_1.errorObject) { - destination.error(errorObject_1.errorObject.e); - } else if (!this.scheduler) { - this.subscribeToProjection(result, value, index); - } else { - var state = { - subscriber: this, - result: result, - value: value, - index: index - }; - this.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state)); - } - } else { - this.buffer.push(value); - } - }; - ExpandSubscriber.prototype.subscribeToProjection = function(result, value, index) { - this.active++; - this.add(subscribeToResult_1.subscribeToResult(this, result, value, index)); - }; - ExpandSubscriber.prototype._complete = function() { - this.hasCompleted = true; - if (this.hasCompleted && this.active === 0) { - this.destination.complete(); - } - }; - ExpandSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this._next(innerValue); - }; - ExpandSubscriber.prototype.notifyComplete = function(innerSub) { - var buffer = this.buffer; - this.remove(innerSub); - this.active--; - if (buffer && buffer.length > 0) { - this._next(buffer.shift()); - } - if (this.hasCompleted && this.active === 0) { - this.destination.complete(); - } - }; - return ExpandSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - exports.ExpandSubscriber = ExpandSubscriber; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/filter", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function filter(select, thisArg) { - return this.lift(new FilterOperator(select, thisArg)); - } - exports.filter = filter; - var FilterOperator = (function() { - function FilterOperator(select, thisArg) { - this.select = select; - this.thisArg = thisArg; - } - FilterOperator.prototype.call = function(subscriber) { - return new FilterSubscriber(subscriber, this.select, this.thisArg); - }; - return FilterOperator; - }()); - var FilterSubscriber = (function(_super) { - __extends(FilterSubscriber, _super); - function FilterSubscriber(destination, select, thisArg) { - _super.call(this, destination); - this.select = select; - this.thisArg = thisArg; - this.count = 0; - this.select = select; - } - FilterSubscriber.prototype._next = function(value) { - var result; - try { - result = this.select.call(this.thisArg, value, this.count++); - } catch (err) { - this.destination.error(err); - return ; - } - if (result) { - this.destination.next(value); - } - }; - return FilterSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/finally", ["rxjs/Subscriber", "rxjs/Subscription"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var Subscription_1 = require("rxjs/Subscription"); - function _finally(finallySelector) { - return this.lift(new FinallyOperator(finallySelector)); - } - exports._finally = _finally; - var FinallyOperator = (function() { - function FinallyOperator(finallySelector) { - this.finallySelector = finallySelector; - } - FinallyOperator.prototype.call = function(subscriber) { - return new FinallySubscriber(subscriber, this.finallySelector); - }; - return FinallyOperator; - }()); - var FinallySubscriber = (function(_super) { - __extends(FinallySubscriber, _super); - function FinallySubscriber(destination, finallySelector) { - _super.call(this, destination); - this.add(new Subscription_1.Subscription(finallySelector)); - } - return FinallySubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/EmptyError", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var EmptyError = (function(_super) { - __extends(EmptyError, _super); - function EmptyError() { - _super.call(this, 'no elements in sequence'); - this.name = 'EmptyError'; - } - return EmptyError; - }(Error)); - exports.EmptyError = EmptyError; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/Operator", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Subscriber_1 = require("rxjs/Subscriber"); - var Operator = (function() { - function Operator() {} - Operator.prototype.call = function(subscriber) { - return new Subscriber_1.Subscriber(subscriber); - }; - return Operator; - }()); - exports.Operator = Operator; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/MapPolyfill", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var MapPolyfill = (function() { - function MapPolyfill() { - this.size = 0; - this._values = []; - this._keys = []; - } - MapPolyfill.prototype.get = function(key) { - var i = this._keys.indexOf(key); - return i === -1 ? undefined : this._values[i]; - }; - MapPolyfill.prototype.set = function(key, value) { - var i = this._keys.indexOf(key); - if (i === -1) { - this._keys.push(key); - this._values.push(value); - this.size++; - } else { - this._values[i] = value; - } - return this; - }; - MapPolyfill.prototype.delete = function(key) { - var i = this._keys.indexOf(key); - if (i === -1) { - return false; - } - this._values.splice(i, 1); - this._keys.splice(i, 1); - this.size--; - return true; - }; - MapPolyfill.prototype.clear = function() { - this._keys.length = 0; - this._values.length = 0; - this.size = 0; - }; - MapPolyfill.prototype.forEach = function(cb, thisArg) { - for (var i = 0; i < this.size; i++) { - cb.call(thisArg, this._values[i], this._keys[i]); - } - }; - return MapPolyfill; - }()); - exports.MapPolyfill = MapPolyfill; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/FastMap", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var FastMap = (function() { - function FastMap() { - this.values = {}; - } - FastMap.prototype.delete = function(key) { - this.values[key] = null; - return true; - }; - FastMap.prototype.set = function(key, value) { - this.values[key] = value; - return this; - }; - FastMap.prototype.get = function(key) { - return this.values[key]; - }; - FastMap.prototype.forEach = function(cb, thisArg) { - var values = this.values; - for (var key in values) { - if (values.hasOwnProperty(key) && values[key] !== null) { - cb.call(thisArg, values[key], key); - } - } - }; - FastMap.prototype.clear = function() { - this.values = {}; - }; - return FastMap; - }()); - exports.FastMap = FastMap; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/ignoreElements", ["rxjs/Subscriber", "rxjs/util/noop"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var noop_1 = require("rxjs/util/noop"); - function ignoreElements() { - return this.lift(new IgnoreElementsOperator()); - } - exports.ignoreElements = ignoreElements; - ; - var IgnoreElementsOperator = (function() { - function IgnoreElementsOperator() {} - IgnoreElementsOperator.prototype.call = function(subscriber) { - return new IgnoreElementsSubscriber(subscriber); - }; - return IgnoreElementsOperator; - }()); - var IgnoreElementsSubscriber = (function(_super) { - __extends(IgnoreElementsSubscriber, _super); - function IgnoreElementsSubscriber() { - _super.apply(this, arguments); - } - IgnoreElementsSubscriber.prototype._next = function(unused) { - noop_1.noop(); - }; - return IgnoreElementsSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/inspect", ["rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function inspect(durationSelector) { - return this.lift(new InspectOperator(durationSelector)); - } - exports.inspect = inspect; - var InspectOperator = (function() { - function InspectOperator(durationSelector) { - this.durationSelector = durationSelector; - } - InspectOperator.prototype.call = function(subscriber) { - return new InspectSubscriber(subscriber, this.durationSelector); - }; - return InspectOperator; - }()); - var InspectSubscriber = (function(_super) { - __extends(InspectSubscriber, _super); - function InspectSubscriber(destination, durationSelector) { - _super.call(this, destination); - this.durationSelector = durationSelector; - this.hasValue = false; - } - InspectSubscriber.prototype._next = function(value) { - this.value = value; - this.hasValue = true; - if (!this.throttled) { - var duration = tryCatch_1.tryCatch(this.durationSelector)(value); - if (duration === errorObject_1.errorObject) { - this.destination.error(errorObject_1.errorObject.e); - } else { - this.add(this.throttled = subscribeToResult_1.subscribeToResult(this, duration)); - } - } - }; - InspectSubscriber.prototype.clearThrottle = function() { - var _a = this, - value = _a.value, - hasValue = _a.hasValue, - throttled = _a.throttled; - if (throttled) { - this.remove(throttled); - this.throttled = null; - throttled.unsubscribe(); - } - if (hasValue) { - this.value = null; - this.hasValue = false; - this.destination.next(value); - } - }; - InspectSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex) { - this.clearThrottle(); - }; - InspectSubscriber.prototype.notifyComplete = function() { - this.clearThrottle(); - }; - return InspectSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/inspectTime", ["rxjs/scheduler/asap", "rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var asap_1 = require("rxjs/scheduler/asap"); - var Subscriber_1 = require("rxjs/Subscriber"); - function inspectTime(delay, scheduler) { - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - return this.lift(new InspectTimeOperator(delay, scheduler)); - } - exports.inspectTime = inspectTime; - var InspectTimeOperator = (function() { - function InspectTimeOperator(delay, scheduler) { - this.delay = delay; - this.scheduler = scheduler; - } - InspectTimeOperator.prototype.call = function(subscriber) { - return new InspectTimeSubscriber(subscriber, this.delay, this.scheduler); - }; - return InspectTimeOperator; - }()); - var InspectTimeSubscriber = (function(_super) { - __extends(InspectTimeSubscriber, _super); - function InspectTimeSubscriber(destination, delay, scheduler) { - _super.call(this, destination); - this.delay = delay; - this.scheduler = scheduler; - this.hasValue = false; - } - InspectTimeSubscriber.prototype._next = function(value) { - this.value = value; - this.hasValue = true; - if (!this.throttled) { - this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.delay, this)); - } - }; - InspectTimeSubscriber.prototype.clearThrottle = function() { - var _a = this, - value = _a.value, - hasValue = _a.hasValue, - throttled = _a.throttled; - if (throttled) { - this.remove(throttled); - this.throttled = null; - throttled.unsubscribe(); - } - if (hasValue) { - this.value = null; - this.hasValue = false; - this.destination.next(value); - } - }; - return InspectTimeSubscriber; - }(Subscriber_1.Subscriber)); - function dispatchNext(subscriber) { - subscriber.clearThrottle(); - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/every", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function every(predicate, thisArg) { - var source = this; - return source.lift(new EveryOperator(predicate, thisArg, source)); - } - exports.every = every; - var EveryOperator = (function() { - function EveryOperator(predicate, thisArg, source) { - this.predicate = predicate; - this.thisArg = thisArg; - this.source = source; - } - EveryOperator.prototype.call = function(observer) { - return new EverySubscriber(observer, this.predicate, this.thisArg, this.source); - }; - return EveryOperator; - }()); - var EverySubscriber = (function(_super) { - __extends(EverySubscriber, _super); - function EverySubscriber(destination, predicate, thisArg, source) { - _super.call(this, destination); - this.predicate = predicate; - this.thisArg = thisArg; - this.source = source; - this.index = 0; - this.thisArg = thisArg || this; - } - EverySubscriber.prototype.notifyComplete = function(everyValueMatch) { - this.destination.next(everyValueMatch); - this.destination.complete(); - }; - EverySubscriber.prototype._next = function(value) { - var result = false; - try { - result = this.predicate.call(this.thisArg, value, this.index++, this.source); - } catch (err) { - this.destination.error(err); - return ; - } - if (!result) { - this.notifyComplete(false); - } - }; - EverySubscriber.prototype._complete = function() { - this.notifyComplete(true); - }; - return EverySubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/last", ["rxjs/Subscriber", "rxjs/util/EmptyError"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var EmptyError_1 = require("rxjs/util/EmptyError"); - function last(predicate, resultSelector, defaultValue) { - return this.lift(new LastOperator(predicate, resultSelector, defaultValue, this)); - } - exports.last = last; - var LastOperator = (function() { - function LastOperator(predicate, resultSelector, defaultValue, source) { - this.predicate = predicate; - this.resultSelector = resultSelector; - this.defaultValue = defaultValue; - this.source = source; - } - LastOperator.prototype.call = function(observer) { - return new LastSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); - }; - return LastOperator; - }()); - var LastSubscriber = (function(_super) { - __extends(LastSubscriber, _super); - function LastSubscriber(destination, predicate, resultSelector, defaultValue, source) { - _super.call(this, destination); - this.predicate = predicate; - this.resultSelector = resultSelector; - this.defaultValue = defaultValue; - this.source = source; - this.hasValue = false; - this.index = 0; - if (typeof defaultValue !== 'undefined') { - this.lastValue = defaultValue; - this.hasValue = true; - } - } - LastSubscriber.prototype._next = function(value) { - var index = this.index++; - if (this.predicate) { - this._tryPredicate(value, index); - } else { - if (this.resultSelector) { - this._tryResultSelector(value, index); - return ; - } - this.lastValue = value; - this.hasValue = true; - } - }; - LastSubscriber.prototype._tryPredicate = function(value, index) { - var result; - try { - result = this.predicate(value, index, this.source); - } catch (err) { - this.destination.error(err); - return ; - } - if (result) { - if (this.resultSelector) { - this._tryResultSelector(value, index); - return ; - } - this.lastValue = value; - this.hasValue = true; - } - }; - LastSubscriber.prototype._tryResultSelector = function(value, index) { - var result; - try { - result = this.resultSelector(value, index); - } catch (err) { - this.destination.error(err); - return ; - } - this.lastValue = result; - this.hasValue = true; - }; - LastSubscriber.prototype._complete = function() { - var destination = this.destination; - if (this.hasValue) { - destination.next(this.lastValue); - destination.complete(); - } else { - destination.error(new EmptyError_1.EmptyError); - } - }; - return LastSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/let", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function letProto(func) { - return func(this); - } - exports.letProto = letProto; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/map", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function map(project, thisArg) { - if (typeof project !== 'function') { - throw new TypeError('argument is not a function. Are you looking for `mapTo()`?'); - } - return this.lift(new MapOperator(project, thisArg)); - } - exports.map = map; - var MapOperator = (function() { - function MapOperator(project, thisArg) { - this.project = project; - this.thisArg = thisArg; - } - MapOperator.prototype.call = function(subscriber) { - return new MapSubscriber(subscriber, this.project, this.thisArg); - }; - return MapOperator; - }()); - var MapSubscriber = (function(_super) { - __extends(MapSubscriber, _super); - function MapSubscriber(destination, project, thisArg) { - _super.call(this, destination); - this.project = project; - this.count = 0; - this.thisArg = thisArg || this; - } - MapSubscriber.prototype._next = function(value) { - var result; - try { - result = this.project.call(this.thisArg, value, this.count++); - } catch (err) { - this.destination.error(err); - return ; - } - this.destination.next(result); - }; - return MapSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/mapTo", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function mapTo(value) { - return this.lift(new MapToOperator(value)); - } - exports.mapTo = mapTo; - var MapToOperator = (function() { - function MapToOperator(value) { - this.value = value; - } - MapToOperator.prototype.call = function(subscriber) { - return new MapToSubscriber(subscriber, this.value); - }; - return MapToOperator; - }()); - var MapToSubscriber = (function(_super) { - __extends(MapToSubscriber, _super); - function MapToSubscriber(destination, value) { - _super.call(this, destination); - this.value = value; - } - MapToSubscriber.prototype._next = function(x) { - this.destination.next(this.value); - }; - return MapToSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/materialize", ["rxjs/Subscriber", "rxjs/Notification"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var Notification_1 = require("rxjs/Notification"); - function materialize() { - return this.lift(new MaterializeOperator()); - } - exports.materialize = materialize; - var MaterializeOperator = (function() { - function MaterializeOperator() {} - MaterializeOperator.prototype.call = function(subscriber) { - return new MaterializeSubscriber(subscriber); - }; - return MaterializeOperator; - }()); - var MaterializeSubscriber = (function(_super) { - __extends(MaterializeSubscriber, _super); - function MaterializeSubscriber(destination) { - _super.call(this, destination); - } - MaterializeSubscriber.prototype._next = function(value) { - this.destination.next(Notification_1.Notification.createNext(value)); - }; - MaterializeSubscriber.prototype._error = function(err) { - var destination = this.destination; - destination.next(Notification_1.Notification.createError(err)); - destination.complete(); - }; - MaterializeSubscriber.prototype._complete = function() { - var destination = this.destination; - destination.next(Notification_1.Notification.createComplete()); - destination.complete(); - }; - return MaterializeSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/merge", ["rxjs/Observable", "rxjs/operator/merge"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var merge_1 = require("rxjs/operator/merge"); - Observable_1.Observable.prototype.merge = merge_1.merge; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/mergeAll", ["rxjs/Observable", "rxjs/operator/mergeAll"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var mergeAll_1 = require("rxjs/operator/mergeAll"); - Observable_1.Observable.prototype.mergeAll = mergeAll_1.mergeAll; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/mergeMap", ["rxjs/Observable", "rxjs/operator/mergeMap"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var mergeMap_1 = require("rxjs/operator/mergeMap"); - Observable_1.Observable.prototype.mergeMap = mergeMap_1.mergeMap; - Observable_1.Observable.prototype.flatMap = mergeMap_1.mergeMap; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/mergeMapTo", ["rxjs/Observable", "rxjs/operator/mergeMapTo"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var mergeMapTo_1 = require("rxjs/operator/mergeMapTo"); - Observable_1.Observable.prototype.mergeMapTo = mergeMapTo_1.mergeMapTo; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/multicast", ["rxjs/Observable", "rxjs/operator/multicast"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var multicast_1 = require("rxjs/operator/multicast"); - Observable_1.Observable.prototype.multicast = multicast_1.multicast; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/observeOn", ["rxjs/Observable", "rxjs/operator/observeOn"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var observeOn_1 = require("rxjs/operator/observeOn"); - Observable_1.Observable.prototype.observeOn = observeOn_1.observeOn; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/not", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function not(pred, thisArg) { - function notPred() { - return !(notPred.pred.apply(notPred.thisArg, arguments)); - } - notPred.pred = pred; - notPred.thisArg = thisArg; - return notPred; - } - exports.not = not; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/pluck", ["rxjs/operator/map"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var map_1 = require("rxjs/operator/map"); - function pluck() { - var properties = []; - for (var _i = 0; _i < arguments.length; _i++) { - properties[_i - 0] = arguments[_i]; - } - var length = properties.length; - if (length === 0) { - throw new Error('List of properties cannot be empty.'); - } - return map_1.map.call(this, plucker(properties, length)); - } - exports.pluck = pluck; - function plucker(props, length) { - var mapper = function(x) { - var currentProp = x; - for (var i = 0; i < length; i++) { - var p = currentProp[props[i]]; - if (typeof p !== 'undefined') { - currentProp = p; - } else { - return undefined; - } - } - return currentProp; - }; - return mapper; - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/publish", ["rxjs/Subject", "rxjs/operator/multicast"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Subject_1 = require("rxjs/Subject"); - var multicast_1 = require("rxjs/operator/multicast"); - function publish() { - return multicast_1.multicast.call(this, new Subject_1.Subject()); - } - exports.publish = publish; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/subject/BehaviorSubject", ["rxjs/Subject", "rxjs/util/throwError", "rxjs/util/ObjectUnsubscribedError"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subject_1 = require("rxjs/Subject"); - var throwError_1 = require("rxjs/util/throwError"); - var ObjectUnsubscribedError_1 = require("rxjs/util/ObjectUnsubscribedError"); - var BehaviorSubject = (function(_super) { - __extends(BehaviorSubject, _super); - function BehaviorSubject(_value) { - _super.call(this); - this._value = _value; - } - BehaviorSubject.prototype.getValue = function() { - if (this.hasErrored) { - throwError_1.throwError(this.errorValue); - } else if (this.isUnsubscribed) { - throwError_1.throwError(new ObjectUnsubscribedError_1.ObjectUnsubscribedError()); - } else { - return this._value; - } - }; - Object.defineProperty(BehaviorSubject.prototype, "value", { - get: function() { - return this.getValue(); - }, - enumerable: true, - configurable: true - }); - BehaviorSubject.prototype._subscribe = function(subscriber) { - var subscription = _super.prototype._subscribe.call(this, subscriber); - if (subscription && !subscription.isUnsubscribed) { - subscriber.next(this._value); - } - return subscription; - }; - BehaviorSubject.prototype._next = function(value) { - _super.prototype._next.call(this, this._value = value); - }; - BehaviorSubject.prototype._error = function(err) { - this.hasErrored = true; - _super.prototype._error.call(this, this.errorValue = err); - }; - return BehaviorSubject; - }(Subject_1.Subject)); - exports.BehaviorSubject = BehaviorSubject; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/publishReplay", ["rxjs/Observable", "rxjs/operator/publishReplay"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var publishReplay_1 = require("rxjs/operator/publishReplay"); - Observable_1.Observable.prototype.publishReplay = publishReplay_1.publishReplay; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/publishLast", ["rxjs/subject/AsyncSubject", "rxjs/operator/multicast"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var AsyncSubject_1 = require("rxjs/subject/AsyncSubject"); - var multicast_1 = require("rxjs/operator/multicast"); - function publishLast() { - return multicast_1.multicast.call(this, new AsyncSubject_1.AsyncSubject()); - } - exports.publishLast = publishLast; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/race", ["rxjs/Observable", "rxjs/operator/race"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var race_1 = require("rxjs/operator/race"); - Observable_1.Observable.prototype.race = race_1.race; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/reduce", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function reduce(project, seed) { - return this.lift(new ReduceOperator(project, seed)); - } - exports.reduce = reduce; - var ReduceOperator = (function() { - function ReduceOperator(project, seed) { - this.project = project; - this.seed = seed; - } - ReduceOperator.prototype.call = function(subscriber) { - return new ReduceSubscriber(subscriber, this.project, this.seed); - }; - return ReduceOperator; - }()); - exports.ReduceOperator = ReduceOperator; - var ReduceSubscriber = (function(_super) { - __extends(ReduceSubscriber, _super); - function ReduceSubscriber(destination, project, seed) { - _super.call(this, destination); - this.hasValue = false; - this.acc = seed; - this.project = project; - this.hasSeed = typeof seed !== 'undefined'; - } - ReduceSubscriber.prototype._next = function(value) { - if (this.hasValue || (this.hasValue = this.hasSeed)) { - this._tryReduce(value); - } else { - this.acc = value; - this.hasValue = true; - } - }; - ReduceSubscriber.prototype._tryReduce = function(value) { - var result; - try { - result = this.project(this.acc, value); - } catch (err) { - this.destination.error(err); - return ; - } - this.acc = result; - }; - ReduceSubscriber.prototype._complete = function() { - if (this.hasValue || this.hasSeed) { - this.destination.next(this.acc); - } - this.destination.complete(); - }; - return ReduceSubscriber; - }(Subscriber_1.Subscriber)); - exports.ReduceSubscriber = ReduceSubscriber; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/repeat", ["rxjs/Subscriber", "rxjs/observable/EmptyObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var EmptyObservable_1 = require("rxjs/observable/EmptyObservable"); - function repeat(count) { - if (count === void 0) { - count = -1; - } - if (count === 0) { - return new EmptyObservable_1.EmptyObservable(); - } else if (count < 0) { - return this.lift(new RepeatOperator(-1, this)); - } else { - return this.lift(new RepeatOperator(count - 1, this)); - } - } - exports.repeat = repeat; - var RepeatOperator = (function() { - function RepeatOperator(count, source) { - this.count = count; - this.source = source; - } - RepeatOperator.prototype.call = function(subscriber) { - return new RepeatSubscriber(subscriber, this.count, this.source); - }; - return RepeatOperator; - }()); - var RepeatSubscriber = (function(_super) { - __extends(RepeatSubscriber, _super); - function RepeatSubscriber(destination, count, source) { - _super.call(this, destination); - this.count = count; - this.source = source; - } - RepeatSubscriber.prototype.complete = function() { - if (!this.isStopped) { - var _a = this, - source = _a.source, - count = _a.count; - if (count === 0) { - return _super.prototype.complete.call(this); - } else if (count > -1) { - this.count = count - 1; - } - this.unsubscribe(); - this.isStopped = false; - this.isUnsubscribed = false; - source.subscribe(this); - } - }; - return RepeatSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/retry", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function retry(count) { - if (count === void 0) { - count = -1; - } - return this.lift(new RetryOperator(count, this)); - } - exports.retry = retry; - var RetryOperator = (function() { - function RetryOperator(count, source) { - this.count = count; - this.source = source; - } - RetryOperator.prototype.call = function(subscriber) { - return new RetrySubscriber(subscriber, this.count, this.source); - }; - return RetryOperator; - }()); - var RetrySubscriber = (function(_super) { - __extends(RetrySubscriber, _super); - function RetrySubscriber(destination, count, source) { - _super.call(this, destination); - this.count = count; - this.source = source; - } - RetrySubscriber.prototype.error = function(err) { - if (!this.isStopped) { - var _a = this, - source = _a.source, - count = _a.count; - if (count === 0) { - return _super.prototype.error.call(this, err); - } else if (count > -1) { - this.count = count - 1; - } - this.unsubscribe(); - this.isStopped = false; - this.isUnsubscribed = false; - source.subscribe(this); - } - }; - return RetrySubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/retryWhen", ["rxjs/Subject", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subject_1 = require("rxjs/Subject"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function retryWhen(notifier) { - return this.lift(new RetryWhenOperator(notifier, this)); - } - exports.retryWhen = retryWhen; - var RetryWhenOperator = (function() { - function RetryWhenOperator(notifier, source) { - this.notifier = notifier; - this.source = source; - } - RetryWhenOperator.prototype.call = function(subscriber) { - return new RetryWhenSubscriber(subscriber, this.notifier, this.source); - }; - return RetryWhenOperator; - }()); - var RetryWhenSubscriber = (function(_super) { - __extends(RetryWhenSubscriber, _super); - function RetryWhenSubscriber(destination, notifier, source) { - _super.call(this, destination); - this.notifier = notifier; - this.source = source; - } - RetryWhenSubscriber.prototype.error = function(err) { - if (!this.isStopped) { - var errors = this.errors; - var retries = this.retries; - var retriesSubscription = this.retriesSubscription; - if (!retries) { - errors = new Subject_1.Subject(); - retries = tryCatch_1.tryCatch(this.notifier)(errors); - if (retries === errorObject_1.errorObject) { - return _super.prototype.error.call(this, errorObject_1.errorObject.e); - } - retriesSubscription = subscribeToResult_1.subscribeToResult(this, retries); - } else { - this.errors = null; - this.retriesSubscription = null; - } - this.unsubscribe(); - this.isUnsubscribed = false; - this.errors = errors; - this.retries = retries; - this.retriesSubscription = retriesSubscription; - errors.next(err); - } - }; - RetryWhenSubscriber.prototype._unsubscribe = function() { - var _a = this, - errors = _a.errors, - retriesSubscription = _a.retriesSubscription; - if (errors) { - errors.unsubscribe(); - this.errors = null; - } - if (retriesSubscription) { - retriesSubscription.unsubscribe(); - this.retriesSubscription = null; - } - this.retries = null; - }; - RetryWhenSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - var _a = this, - errors = _a.errors, - retries = _a.retries, - retriesSubscription = _a.retriesSubscription; - this.errors = null; - this.retries = null; - this.retriesSubscription = null; - this.unsubscribe(); - this.isStopped = false; - this.isUnsubscribed = false; - this.errors = errors; - this.retries = retries; - this.retriesSubscription = retriesSubscription; - this.source.subscribe(this); - }; - return RetryWhenSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/sample", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function sample(notifier) { - return this.lift(new SampleOperator(notifier)); - } - exports.sample = sample; - var SampleOperator = (function() { - function SampleOperator(notifier) { - this.notifier = notifier; - } - SampleOperator.prototype.call = function(subscriber) { - return new SampleSubscriber(subscriber, this.notifier); - }; - return SampleOperator; - }()); - var SampleSubscriber = (function(_super) { - __extends(SampleSubscriber, _super); - function SampleSubscriber(destination, notifier) { - _super.call(this, destination); - this.hasValue = false; - this.add(subscribeToResult_1.subscribeToResult(this, notifier)); - } - SampleSubscriber.prototype._next = function(value) { - this.value = value; - this.hasValue = true; - }; - SampleSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.emitValue(); - }; - SampleSubscriber.prototype.notifyComplete = function() { - this.emitValue(); - }; - SampleSubscriber.prototype.emitValue = function() { - if (this.hasValue) { - this.hasValue = false; - this.destination.next(this.value); - } - }; - return SampleSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/sampleTime", ["rxjs/Subscriber", "rxjs/scheduler/asap"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var asap_1 = require("rxjs/scheduler/asap"); - function sampleTime(delay, scheduler) { - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - return this.lift(new SampleTimeOperator(delay, scheduler)); - } - exports.sampleTime = sampleTime; - var SampleTimeOperator = (function() { - function SampleTimeOperator(delay, scheduler) { - this.delay = delay; - this.scheduler = scheduler; - } - SampleTimeOperator.prototype.call = function(subscriber) { - return new SampleTimeSubscriber(subscriber, this.delay, this.scheduler); - }; - return SampleTimeOperator; - }()); - var SampleTimeSubscriber = (function(_super) { - __extends(SampleTimeSubscriber, _super); - function SampleTimeSubscriber(destination, delay, scheduler) { - _super.call(this, destination); - this.delay = delay; - this.scheduler = scheduler; - this.hasValue = false; - this.add(scheduler.schedule(dispatchNotification, delay, { - subscriber: this, - delay: delay - })); - } - SampleTimeSubscriber.prototype._next = function(value) { - this.lastValue = value; - this.hasValue = true; - }; - SampleTimeSubscriber.prototype.notifyNext = function() { - if (this.hasValue) { - this.hasValue = false; - this.destination.next(this.lastValue); - } - }; - return SampleTimeSubscriber; - }(Subscriber_1.Subscriber)); - function dispatchNotification(state) { - var subscriber = state.subscriber, - delay = state.delay; - subscriber.notifyNext(); - this.schedule(state, delay); - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/scan", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function scan(accumulator, seed) { - return this.lift(new ScanOperator(accumulator, seed)); - } - exports.scan = scan; - var ScanOperator = (function() { - function ScanOperator(accumulator, seed) { - this.accumulator = accumulator; - this.seed = seed; - } - ScanOperator.prototype.call = function(subscriber) { - return new ScanSubscriber(subscriber, this.accumulator, this.seed); - }; - return ScanOperator; - }()); - var ScanSubscriber = (function(_super) { - __extends(ScanSubscriber, _super); - function ScanSubscriber(destination, accumulator, seed) { - _super.call(this, destination); - this.accumulator = accumulator; - this.accumulatorSet = false; - this.seed = seed; - this.accumulator = accumulator; - this.accumulatorSet = typeof seed !== 'undefined'; - } - Object.defineProperty(ScanSubscriber.prototype, "seed", { - get: function() { - return this._seed; - }, - set: function(value) { - this.accumulatorSet = true; - this._seed = value; - }, - enumerable: true, - configurable: true - }); - ScanSubscriber.prototype._next = function(value) { - if (!this.accumulatorSet) { - this.seed = value; - this.destination.next(value); - } else { - return this._tryNext(value); - } - }; - ScanSubscriber.prototype._tryNext = function(value) { - var result; - try { - result = this.accumulator(this.seed, value); - } catch (err) { - this.destination.error(err); - } - this.seed = result; - this.destination.next(result); - }; - return ScanSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/share", ["rxjs/operator/multicast", "rxjs/Subject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var multicast_1 = require("rxjs/operator/multicast"); - var Subject_1 = require("rxjs/Subject"); - function shareSubjectFactory() { - return new Subject_1.Subject(); - } - function share() { - return multicast_1.multicast.call(this, shareSubjectFactory).refCount(); - } - exports.share = share; - ; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/single", ["rxjs/Subscriber", "rxjs/util/EmptyError"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var EmptyError_1 = require("rxjs/util/EmptyError"); - function single(predicate) { - return this.lift(new SingleOperator(predicate, this)); - } - exports.single = single; - var SingleOperator = (function() { - function SingleOperator(predicate, source) { - this.predicate = predicate; - this.source = source; - } - SingleOperator.prototype.call = function(subscriber) { - return new SingleSubscriber(subscriber, this.predicate, this.source); - }; - return SingleOperator; - }()); - var SingleSubscriber = (function(_super) { - __extends(SingleSubscriber, _super); - function SingleSubscriber(destination, predicate, source) { - _super.call(this, destination); - this.predicate = predicate; - this.source = source; - this.seenValue = false; - this.index = 0; - } - SingleSubscriber.prototype.applySingleValue = function(value) { - if (this.seenValue) { - this.destination.error('Sequence contains more than one element'); - } else { - this.seenValue = true; - this.singleValue = value; - } - }; - SingleSubscriber.prototype._next = function(value) { - var predicate = this.predicate; - this.index++; - if (predicate) { - this.tryNext(value); - } else { - this.applySingleValue(value); - } - }; - SingleSubscriber.prototype.tryNext = function(value) { - try { - var result = this.predicate(value, this.index, this.source); - if (result) { - this.applySingleValue(value); - } - } catch (err) { - this.destination.error(err); - } - }; - SingleSubscriber.prototype._complete = function() { - var destination = this.destination; - if (this.index > 0) { - destination.next(this.seenValue ? this.singleValue : undefined); - destination.complete(); - } else { - destination.error(new EmptyError_1.EmptyError); - } - }; - return SingleSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/skip", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function skip(total) { - return this.lift(new SkipOperator(total)); - } - exports.skip = skip; - var SkipOperator = (function() { - function SkipOperator(total) { - this.total = total; - } - SkipOperator.prototype.call = function(subscriber) { - return new SkipSubscriber(subscriber, this.total); - }; - return SkipOperator; - }()); - var SkipSubscriber = (function(_super) { - __extends(SkipSubscriber, _super); - function SkipSubscriber(destination, total) { - _super.call(this, destination); - this.total = total; - this.count = 0; - } - SkipSubscriber.prototype._next = function(x) { - if (++this.count > this.total) { - this.destination.next(x); - } - }; - return SkipSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/skipUntil", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function skipUntil(notifier) { - return this.lift(new SkipUntilOperator(notifier)); - } - exports.skipUntil = skipUntil; - var SkipUntilOperator = (function() { - function SkipUntilOperator(notifier) { - this.notifier = notifier; - } - SkipUntilOperator.prototype.call = function(subscriber) { - return new SkipUntilSubscriber(subscriber, this.notifier); - }; - return SkipUntilOperator; - }()); - var SkipUntilSubscriber = (function(_super) { - __extends(SkipUntilSubscriber, _super); - function SkipUntilSubscriber(destination, notifier) { - _super.call(this, destination); - this.hasValue = false; - this.isInnerStopped = false; - this.add(subscribeToResult_1.subscribeToResult(this, notifier)); - } - SkipUntilSubscriber.prototype._next = function(value) { - if (this.hasValue) { - _super.prototype._next.call(this, value); - } - }; - SkipUntilSubscriber.prototype._complete = function() { - if (this.isInnerStopped) { - _super.prototype._complete.call(this); - } else { - this.unsubscribe(); - } - }; - SkipUntilSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.hasValue = true; - }; - SkipUntilSubscriber.prototype.notifyComplete = function() { - this.isInnerStopped = true; - if (this.isStopped) { - _super.prototype._complete.call(this); - } - }; - return SkipUntilSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/skipWhile", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function skipWhile(predicate) { - return this.lift(new SkipWhileOperator(predicate)); - } - exports.skipWhile = skipWhile; - var SkipWhileOperator = (function() { - function SkipWhileOperator(predicate) { - this.predicate = predicate; - } - SkipWhileOperator.prototype.call = function(subscriber) { - return new SkipWhileSubscriber(subscriber, this.predicate); - }; - return SkipWhileOperator; - }()); - var SkipWhileSubscriber = (function(_super) { - __extends(SkipWhileSubscriber, _super); - function SkipWhileSubscriber(destination, predicate) { - _super.call(this, destination); - this.predicate = predicate; - this.skipping = true; - this.index = 0; - } - SkipWhileSubscriber.prototype._next = function(value) { - var destination = this.destination; - if (this.skipping) { - this.tryCallPredicate(value); - } - if (!this.skipping) { - destination.next(value); - } - }; - SkipWhileSubscriber.prototype.tryCallPredicate = function(value) { - try { - var result = this.predicate(value, this.index++); - this.skipping = Boolean(result); - } catch (err) { - this.destination.error(err); - } - }; - return SkipWhileSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/startWith", ["rxjs/observable/ArrayObservable", "rxjs/observable/ScalarObservable", "rxjs/observable/EmptyObservable", "rxjs/operator/concat", "rxjs/util/isScheduler"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var ArrayObservable_1 = require("rxjs/observable/ArrayObservable"); - var ScalarObservable_1 = require("rxjs/observable/ScalarObservable"); - var EmptyObservable_1 = require("rxjs/observable/EmptyObservable"); - var concat_1 = require("rxjs/operator/concat"); - var isScheduler_1 = require("rxjs/util/isScheduler"); - function startWith() { - var array = []; - for (var _i = 0; _i < arguments.length; _i++) { - array[_i - 0] = arguments[_i]; - } - var scheduler = array[array.length - 1]; - if (isScheduler_1.isScheduler(scheduler)) { - array.pop(); - } else { - scheduler = null; - } - var len = array.length; - if (len === 1) { - return concat_1.concatStatic(new ScalarObservable_1.ScalarObservable(array[0], scheduler), this); - } else if (len > 1) { - return concat_1.concatStatic(new ArrayObservable_1.ArrayObservable(array, scheduler), this); - } else { - return concat_1.concatStatic(new EmptyObservable_1.EmptyObservable(scheduler), this); - } - } - exports.startWith = startWith; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/SubscribeOnObservable", ["rxjs/Observable", "rxjs/scheduler/asap", "rxjs/util/isNumeric"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var asap_1 = require("rxjs/scheduler/asap"); - var isNumeric_1 = require("rxjs/util/isNumeric"); - var SubscribeOnObservable = (function(_super) { - __extends(SubscribeOnObservable, _super); - function SubscribeOnObservable(source, delayTime, scheduler) { - if (delayTime === void 0) { - delayTime = 0; - } - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - _super.call(this); - this.source = source; - this.delayTime = delayTime; - this.scheduler = scheduler; - if (!isNumeric_1.isNumeric(delayTime) || delayTime < 0) { - this.delayTime = 0; - } - if (!scheduler || typeof scheduler.schedule !== 'function') { - this.scheduler = asap_1.asap; - } - } - SubscribeOnObservable.create = function(source, delay, scheduler) { - if (delay === void 0) { - delay = 0; - } - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - return new SubscribeOnObservable(source, delay, scheduler); - }; - SubscribeOnObservable.dispatch = function(_a) { - var source = _a.source, - subscriber = _a.subscriber; - return source.subscribe(subscriber); - }; - SubscribeOnObservable.prototype._subscribe = function(subscriber) { - var delay = this.delayTime; - var source = this.source; - var scheduler = this.scheduler; - return scheduler.schedule(SubscribeOnObservable.dispatch, delay, { - source: source, - subscriber: subscriber - }); - }; - return SubscribeOnObservable; - }(Observable_1.Observable)); - exports.SubscribeOnObservable = SubscribeOnObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/switch", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function _switch() { - return this.lift(new SwitchOperator()); - } - exports._switch = _switch; - var SwitchOperator = (function() { - function SwitchOperator() {} - SwitchOperator.prototype.call = function(subscriber) { - return new SwitchSubscriber(subscriber); - }; - return SwitchOperator; - }()); - var SwitchSubscriber = (function(_super) { - __extends(SwitchSubscriber, _super); - function SwitchSubscriber(destination) { - _super.call(this, destination); - this.active = 0; - this.hasCompleted = false; - } - SwitchSubscriber.prototype._next = function(value) { - this.unsubscribeInner(); - this.active++; - this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, value)); - }; - SwitchSubscriber.prototype._complete = function() { - this.hasCompleted = true; - if (this.active === 0) { - this.destination.complete(); - } - }; - SwitchSubscriber.prototype.unsubscribeInner = function() { - this.active = this.active > 0 ? this.active - 1 : 0; - var innerSubscription = this.innerSubscription; - if (innerSubscription) { - innerSubscription.unsubscribe(); - this.remove(innerSubscription); - } - }; - SwitchSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.destination.next(innerValue); - }; - SwitchSubscriber.prototype.notifyError = function(err) { - this.destination.error(err); - }; - SwitchSubscriber.prototype.notifyComplete = function() { - this.unsubscribeInner(); - if (this.hasCompleted && this.active === 0) { - this.destination.complete(); - } - }; - return SwitchSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/switchMap", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function switchMap(project, resultSelector) { - return this.lift(new SwitchMapOperator(project, resultSelector)); - } - exports.switchMap = switchMap; - var SwitchMapOperator = (function() { - function SwitchMapOperator(project, resultSelector) { - this.project = project; - this.resultSelector = resultSelector; - } - SwitchMapOperator.prototype.call = function(subscriber) { - return new SwitchMapSubscriber(subscriber, this.project, this.resultSelector); - }; - return SwitchMapOperator; - }()); - var SwitchMapSubscriber = (function(_super) { - __extends(SwitchMapSubscriber, _super); - function SwitchMapSubscriber(destination, project, resultSelector) { - _super.call(this, destination); - this.project = project; - this.resultSelector = resultSelector; - this.index = 0; - } - SwitchMapSubscriber.prototype._next = function(value) { - var result; - var index = this.index++; - try { - result = this.project(value, index); - } catch (error) { - this.destination.error(error); - return ; - } - this._innerSub(result, value, index); - }; - SwitchMapSubscriber.prototype._innerSub = function(result, value, index) { - var innerSubscription = this.innerSubscription; - if (innerSubscription) { - innerSubscription.unsubscribe(); - } - this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, result, value, index)); - }; - SwitchMapSubscriber.prototype._complete = function() { - var innerSubscription = this.innerSubscription; - if (!innerSubscription || innerSubscription.isUnsubscribed) { - _super.prototype._complete.call(this); - } - }; - SwitchMapSubscriber.prototype._unsubscribe = function() { - this.innerSubscription = null; - }; - SwitchMapSubscriber.prototype.notifyComplete = function(innerSub) { - this.remove(innerSub); - this.innerSubscription = null; - if (this.isStopped) { - _super.prototype._complete.call(this); - } - }; - SwitchMapSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - if (this.resultSelector) { - this._tryNotifyNext(outerValue, innerValue, outerIndex, innerIndex); - } else { - this.destination.next(innerValue); - } - }; - SwitchMapSubscriber.prototype._tryNotifyNext = function(outerValue, innerValue, outerIndex, innerIndex) { - var result; - try { - result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex); - } catch (err) { - this.destination.error(err); - return ; - } - this.destination.next(result); - }; - return SwitchMapSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/switchMapTo", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function switchMapTo(observable, resultSelector) { - return this.lift(new SwitchMapToOperator(observable, resultSelector)); - } - exports.switchMapTo = switchMapTo; - var SwitchMapToOperator = (function() { - function SwitchMapToOperator(observable, resultSelector) { - this.observable = observable; - this.resultSelector = resultSelector; - } - SwitchMapToOperator.prototype.call = function(subscriber) { - return new SwitchMapToSubscriber(subscriber, this.observable, this.resultSelector); - }; - return SwitchMapToOperator; - }()); - var SwitchMapToSubscriber = (function(_super) { - __extends(SwitchMapToSubscriber, _super); - function SwitchMapToSubscriber(destination, inner, resultSelector) { - _super.call(this, destination); - this.inner = inner; - this.resultSelector = resultSelector; - this.index = 0; - } - SwitchMapToSubscriber.prototype._next = function(value) { - var innerSubscription = this.innerSubscription; - if (innerSubscription) { - innerSubscription.unsubscribe(); - } - this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, this.inner, value, this.index++)); - }; - SwitchMapToSubscriber.prototype._complete = function() { - var innerSubscription = this.innerSubscription; - if (!innerSubscription || innerSubscription.isUnsubscribed) { - _super.prototype._complete.call(this); - } - }; - SwitchMapToSubscriber.prototype._unsubscribe = function() { - this.innerSubscription = null; - }; - SwitchMapToSubscriber.prototype.notifyComplete = function(innerSub) { - this.remove(innerSub); - this.innerSubscription = null; - if (this.isStopped) { - _super.prototype._complete.call(this); - } - }; - SwitchMapToSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - var _a = this, - resultSelector = _a.resultSelector, - destination = _a.destination; - if (resultSelector) { - this.tryResultSelector(outerValue, innerValue, outerIndex, innerIndex); - } else { - destination.next(innerValue); - } - }; - SwitchMapToSubscriber.prototype.tryResultSelector = function(outerValue, innerValue, outerIndex, innerIndex) { - var _a = this, - resultSelector = _a.resultSelector, - destination = _a.destination; - var result; - try { - result = resultSelector(outerValue, innerValue, outerIndex, innerIndex); - } catch (err) { - destination.error(err); - return ; - } - destination.next(result); - }; - return SwitchMapToSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/ArgumentOutOfRangeError", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var ArgumentOutOfRangeError = (function(_super) { - __extends(ArgumentOutOfRangeError, _super); - function ArgumentOutOfRangeError() { - _super.call(this, 'argument out of range'); - this.name = 'ArgumentOutOfRangeError'; - } - return ArgumentOutOfRangeError; - }(Error)); - exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/takeLast", ["rxjs/Subscriber", "rxjs/util/ArgumentOutOfRangeError", "rxjs/observable/EmptyObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var ArgumentOutOfRangeError_1 = require("rxjs/util/ArgumentOutOfRangeError"); - var EmptyObservable_1 = require("rxjs/observable/EmptyObservable"); - function takeLast(total) { - if (total === 0) { - return new EmptyObservable_1.EmptyObservable(); - } else { - return this.lift(new TakeLastOperator(total)); - } - } - exports.takeLast = takeLast; - var TakeLastOperator = (function() { - function TakeLastOperator(total) { - this.total = total; - if (this.total < 0) { - throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError; - } - } - TakeLastOperator.prototype.call = function(subscriber) { - return new TakeLastSubscriber(subscriber, this.total); - }; - return TakeLastOperator; - }()); - var TakeLastSubscriber = (function(_super) { - __extends(TakeLastSubscriber, _super); - function TakeLastSubscriber(destination, total) { - _super.call(this, destination); - this.total = total; - this.count = 0; - this.index = 0; - this.ring = new Array(total); - } - TakeLastSubscriber.prototype._next = function(value) { - var index = this.index; - var ring = this.ring; - var total = this.total; - var count = this.count; - if (total > 1) { - if (count < total) { - this.count = count + 1; - this.index = index + 1; - } else if (index === 0) { - this.index = ++index; - } else if (index < total) { - this.index = index + 1; - } else { - this.index = index = 0; - } - } else if (count < total) { - this.count = total; - } - ring[index] = value; - }; - TakeLastSubscriber.prototype._complete = function() { - var iter = -1; - var _a = this, - ring = _a.ring, - count = _a.count, - total = _a.total, - destination = _a.destination; - var index = (total === 1 || count < total) ? 0 : this.index - 1; - while (++iter < count) { - if (iter + index === total) { - index = total - iter; - } - destination.next(ring[iter + index]); - } - destination.complete(); - }; - return TakeLastSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/takeUntil", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function takeUntil(notifier) { - return this.lift(new TakeUntilOperator(notifier)); - } - exports.takeUntil = takeUntil; - var TakeUntilOperator = (function() { - function TakeUntilOperator(notifier) { - this.notifier = notifier; - } - TakeUntilOperator.prototype.call = function(subscriber) { - return new TakeUntilSubscriber(subscriber, this.notifier); - }; - return TakeUntilOperator; - }()); - var TakeUntilSubscriber = (function(_super) { - __extends(TakeUntilSubscriber, _super); - function TakeUntilSubscriber(destination, notifier) { - _super.call(this, destination); - this.notifier = notifier; - this.add(subscribeToResult_1.subscribeToResult(this, notifier)); - } - TakeUntilSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.complete(); - }; - TakeUntilSubscriber.prototype.notifyComplete = function() {}; - return TakeUntilSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/takeWhile", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function takeWhile(predicate) { - return this.lift(new TakeWhileOperator(predicate)); - } - exports.takeWhile = takeWhile; - var TakeWhileOperator = (function() { - function TakeWhileOperator(predicate) { - this.predicate = predicate; - } - TakeWhileOperator.prototype.call = function(subscriber) { - return new TakeWhileSubscriber(subscriber, this.predicate); - }; - return TakeWhileOperator; - }()); - var TakeWhileSubscriber = (function(_super) { - __extends(TakeWhileSubscriber, _super); - function TakeWhileSubscriber(destination, predicate) { - _super.call(this, destination); - this.predicate = predicate; - this.index = 0; - } - TakeWhileSubscriber.prototype._next = function(value) { - var destination = this.destination; - var result; - try { - result = this.predicate(value, this.index++); - } catch (err) { - destination.error(err); - return ; - } - this.nextOrComplete(value, result); - }; - TakeWhileSubscriber.prototype.nextOrComplete = function(value, predicateResult) { - var destination = this.destination; - if (Boolean(predicateResult)) { - destination.next(value); - } else { - destination.complete(); - } - }; - return TakeWhileSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/throttle", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function throttle(durationSelector) { - return this.lift(new ThrottleOperator(durationSelector)); - } - exports.throttle = throttle; - var ThrottleOperator = (function() { - function ThrottleOperator(durationSelector) { - this.durationSelector = durationSelector; - } - ThrottleOperator.prototype.call = function(subscriber) { - return new ThrottleSubscriber(subscriber, this.durationSelector); - }; - return ThrottleOperator; - }()); - var ThrottleSubscriber = (function(_super) { - __extends(ThrottleSubscriber, _super); - function ThrottleSubscriber(destination, durationSelector) { - _super.call(this, destination); - this.destination = destination; - this.durationSelector = durationSelector; - } - ThrottleSubscriber.prototype._next = function(value) { - if (!this.throttled) { - this.tryDurationSelector(value); - } - }; - ThrottleSubscriber.prototype.tryDurationSelector = function(value) { - var duration = null; - try { - duration = this.durationSelector(value); - } catch (err) { - this.destination.error(err); - return ; - } - this.emitAndThrottle(value, duration); - }; - ThrottleSubscriber.prototype.emitAndThrottle = function(value, duration) { - this.add(this.throttled = subscribeToResult_1.subscribeToResult(this, duration)); - this.destination.next(value); - }; - ThrottleSubscriber.prototype._unsubscribe = function() { - var throttled = this.throttled; - if (throttled) { - this.remove(throttled); - this.throttled = null; - throttled.unsubscribe(); - } - }; - ThrottleSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this._unsubscribe(); - }; - ThrottleSubscriber.prototype.notifyComplete = function() { - this._unsubscribe(); - }; - return ThrottleSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/throttleTime", ["rxjs/Subscriber", "rxjs/scheduler/asap"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var asap_1 = require("rxjs/scheduler/asap"); - function throttleTime(delay, scheduler) { - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - return this.lift(new ThrottleTimeOperator(delay, scheduler)); - } - exports.throttleTime = throttleTime; - var ThrottleTimeOperator = (function() { - function ThrottleTimeOperator(delay, scheduler) { - this.delay = delay; - this.scheduler = scheduler; - } - ThrottleTimeOperator.prototype.call = function(subscriber) { - return new ThrottleTimeSubscriber(subscriber, this.delay, this.scheduler); - }; - return ThrottleTimeOperator; - }()); - var ThrottleTimeSubscriber = (function(_super) { - __extends(ThrottleTimeSubscriber, _super); - function ThrottleTimeSubscriber(destination, delay, scheduler) { - _super.call(this, destination); - this.delay = delay; - this.scheduler = scheduler; - } - ThrottleTimeSubscriber.prototype._next = function(value) { - if (!this.throttled) { - this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.delay, {subscriber: this})); - this.destination.next(value); - } - }; - ThrottleTimeSubscriber.prototype.clearThrottle = function() { - var throttled = this.throttled; - if (throttled) { - throttled.unsubscribe(); - this.remove(throttled); - this.throttled = null; - } - }; - return ThrottleTimeSubscriber; - }(Subscriber_1.Subscriber)); - function dispatchNext(_a) { - var subscriber = _a.subscriber; - subscriber.clearThrottle(); - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/timeout", ["rxjs/scheduler/asap", "rxjs/util/isDate", "rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var asap_1 = require("rxjs/scheduler/asap"); - var isDate_1 = require("rxjs/util/isDate"); - var Subscriber_1 = require("rxjs/Subscriber"); - function timeout(due, errorToSend, scheduler) { - if (errorToSend === void 0) { - errorToSend = null; - } - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - var absoluteTimeout = isDate_1.isDate(due); - var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due); - return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler)); - } - exports.timeout = timeout; - var TimeoutOperator = (function() { - function TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler) { - this.waitFor = waitFor; - this.absoluteTimeout = absoluteTimeout; - this.errorToSend = errorToSend; - this.scheduler = scheduler; - } - TimeoutOperator.prototype.call = function(subscriber) { - return new TimeoutSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.errorToSend, this.scheduler); - }; - return TimeoutOperator; - }()); - var TimeoutSubscriber = (function(_super) { - __extends(TimeoutSubscriber, _super); - function TimeoutSubscriber(destination, absoluteTimeout, waitFor, errorToSend, scheduler) { - _super.call(this, destination); - this.absoluteTimeout = absoluteTimeout; - this.waitFor = waitFor; - this.errorToSend = errorToSend; - this.scheduler = scheduler; - this.index = 0; - this._previousIndex = 0; - this._hasCompleted = false; - this.scheduleTimeout(); - } - Object.defineProperty(TimeoutSubscriber.prototype, "previousIndex", { - get: function() { - return this._previousIndex; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TimeoutSubscriber.prototype, "hasCompleted", { - get: function() { - return this._hasCompleted; - }, - enumerable: true, - configurable: true - }); - TimeoutSubscriber.dispatchTimeout = function(state) { - var source = state.subscriber; - var currentIndex = state.index; - if (!source.hasCompleted && source.previousIndex === currentIndex) { - source.notifyTimeout(); - } - }; - TimeoutSubscriber.prototype.scheduleTimeout = function() { - var currentIndex = this.index; - this.scheduler.schedule(TimeoutSubscriber.dispatchTimeout, this.waitFor, { - subscriber: this, - index: currentIndex - }); - this.index++; - this._previousIndex = currentIndex; - }; - TimeoutSubscriber.prototype._next = function(value) { - this.destination.next(value); - if (!this.absoluteTimeout) { - this.scheduleTimeout(); - } - }; - TimeoutSubscriber.prototype._error = function(err) { - this.destination.error(err); - this._hasCompleted = true; - }; - TimeoutSubscriber.prototype._complete = function() { - this.destination.complete(); - this._hasCompleted = true; - }; - TimeoutSubscriber.prototype.notifyTimeout = function() { - this.error(this.errorToSend || new Error('timeout')); - }; - return TimeoutSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/timeoutWith", ["rxjs/scheduler/asap", "rxjs/util/isDate", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var asap_1 = require("rxjs/scheduler/asap"); - var isDate_1 = require("rxjs/util/isDate"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function timeoutWith(due, withObservable, scheduler) { - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - var absoluteTimeout = isDate_1.isDate(due); - var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due); - return this.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); - } - exports.timeoutWith = timeoutWith; - var TimeoutWithOperator = (function() { - function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) { - this.waitFor = waitFor; - this.absoluteTimeout = absoluteTimeout; - this.withObservable = withObservable; - this.scheduler = scheduler; - } - TimeoutWithOperator.prototype.call = function(subscriber) { - return new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler); - }; - return TimeoutWithOperator; - }()); - var TimeoutWithSubscriber = (function(_super) { - __extends(TimeoutWithSubscriber, _super); - function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) { - _super.call(this); - this.destination = destination; - this.absoluteTimeout = absoluteTimeout; - this.waitFor = waitFor; - this.withObservable = withObservable; - this.scheduler = scheduler; - this.timeoutSubscription = undefined; - this.index = 0; - this._previousIndex = 0; - this._hasCompleted = false; - destination.add(this); - this.scheduleTimeout(); - } - Object.defineProperty(TimeoutWithSubscriber.prototype, "previousIndex", { - get: function() { - return this._previousIndex; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(TimeoutWithSubscriber.prototype, "hasCompleted", { - get: function() { - return this._hasCompleted; - }, - enumerable: true, - configurable: true - }); - TimeoutWithSubscriber.dispatchTimeout = function(state) { - var source = state.subscriber; - var currentIndex = state.index; - if (!source.hasCompleted && source.previousIndex === currentIndex) { - source.handleTimeout(); - } - }; - TimeoutWithSubscriber.prototype.scheduleTimeout = function() { - var currentIndex = this.index; - var timeoutState = { - subscriber: this, - index: currentIndex - }; - this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, timeoutState); - this.index++; - this._previousIndex = currentIndex; - }; - TimeoutWithSubscriber.prototype._next = function(value) { - this.destination.next(value); - if (!this.absoluteTimeout) { - this.scheduleTimeout(); - } - }; - TimeoutWithSubscriber.prototype._error = function(err) { - this.destination.error(err); - this._hasCompleted = true; - }; - TimeoutWithSubscriber.prototype._complete = function() { - this.destination.complete(); - this._hasCompleted = true; - }; - TimeoutWithSubscriber.prototype.handleTimeout = function() { - if (!this.isUnsubscribed) { - var withObservable = this.withObservable; - this.unsubscribe(); - this.destination.add(this.timeoutSubscription = subscribeToResult_1.subscribeToResult(this, withObservable)); - } - }; - return TimeoutWithSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/toArray", ["rxjs/Subscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - function toArray() { - return this.lift(new ToArrayOperator()); - } - exports.toArray = toArray; - var ToArrayOperator = (function() { - function ToArrayOperator() {} - ToArrayOperator.prototype.call = function(subscriber) { - return new ToArraySubscriber(subscriber); - }; - return ToArrayOperator; - }()); - var ToArraySubscriber = (function(_super) { - __extends(ToArraySubscriber, _super); - function ToArraySubscriber(destination) { - _super.call(this, destination); - this.array = []; - } - ToArraySubscriber.prototype._next = function(x) { - this.array.push(x); - }; - ToArraySubscriber.prototype._complete = function() { - this.destination.next(this.array); - this.destination.complete(); - }; - return ToArraySubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/toPromise", ["rxjs/util/root"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var root_1 = require("rxjs/util/root"); - function toPromise(PromiseCtor) { - var _this = this; - if (!PromiseCtor) { - if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) { - PromiseCtor = root_1.root.Rx.config.Promise; - } else if (root_1.root.Promise) { - PromiseCtor = root_1.root.Promise; - } - } - if (!PromiseCtor) { - throw new Error('no Promise impl found'); - } - return new PromiseCtor(function(resolve, reject) { - var value; - _this.subscribe(function(x) { - return value = x; - }, function(err) { - return reject(err); - }, function() { - return resolve(value); - }); - }); - } - exports.toPromise = toPromise; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/window", ["rxjs/Subject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subject_1 = require("rxjs/Subject"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function window(closingNotifier) { - return this.lift(new WindowOperator(closingNotifier)); - } - exports.window = window; - var WindowOperator = (function() { - function WindowOperator(closingNotifier) { - this.closingNotifier = closingNotifier; - } - WindowOperator.prototype.call = function(subscriber) { - return new WindowSubscriber(subscriber, this.closingNotifier); - }; - return WindowOperator; - }()); - var WindowSubscriber = (function(_super) { - __extends(WindowSubscriber, _super); - function WindowSubscriber(destination, closingNotifier) { - _super.call(this, destination); - this.destination = destination; - this.closingNotifier = closingNotifier; - this.add(subscribeToResult_1.subscribeToResult(this, closingNotifier)); - this.openWindow(); - } - WindowSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.openWindow(); - }; - WindowSubscriber.prototype.notifyError = function(error, innerSub) { - this._error(error); - }; - WindowSubscriber.prototype.notifyComplete = function(innerSub) { - this._complete(); - }; - WindowSubscriber.prototype._next = function(value) { - this.window.next(value); - }; - WindowSubscriber.prototype._error = function(err) { - this.window.error(err); - this.destination.error(err); - }; - WindowSubscriber.prototype._complete = function() { - this.window.complete(); - this.destination.complete(); - }; - WindowSubscriber.prototype.openWindow = function() { - var prevWindow = this.window; - if (prevWindow) { - prevWindow.complete(); - } - var destination = this.destination; - var newWindow = this.window = new Subject_1.Subject(); - destination.add(newWindow); - destination.next(newWindow); - }; - return WindowSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/windowCount", ["rxjs/Subscriber", "rxjs/Subject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var Subject_1 = require("rxjs/Subject"); - function windowCount(windowSize, startWindowEvery) { - if (startWindowEvery === void 0) { - startWindowEvery = 0; - } - return this.lift(new WindowCountOperator(windowSize, startWindowEvery)); - } - exports.windowCount = windowCount; - var WindowCountOperator = (function() { - function WindowCountOperator(windowSize, startWindowEvery) { - this.windowSize = windowSize; - this.startWindowEvery = startWindowEvery; - } - WindowCountOperator.prototype.call = function(subscriber) { - return new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery); - }; - return WindowCountOperator; - }()); - var WindowCountSubscriber = (function(_super) { - __extends(WindowCountSubscriber, _super); - function WindowCountSubscriber(destination, windowSize, startWindowEvery) { - _super.call(this, destination); - this.destination = destination; - this.windowSize = windowSize; - this.startWindowEvery = startWindowEvery; - this.windows = [new Subject_1.Subject()]; - this.count = 0; - var firstWindow = this.windows[0]; - destination.add(firstWindow); - destination.next(firstWindow); - } - WindowCountSubscriber.prototype._next = function(value) { - var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize; - var destination = this.destination; - var windowSize = this.windowSize; - var windows = this.windows; - var len = windows.length; - for (var i = 0; i < len; i++) { - windows[i].next(value); - } - var c = this.count - windowSize + 1; - if (c >= 0 && c % startWindowEvery === 0) { - windows.shift().complete(); - } - if (++this.count % startWindowEvery === 0) { - var window_1 = new Subject_1.Subject(); - windows.push(window_1); - destination.add(window_1); - destination.next(window_1); - } - }; - WindowCountSubscriber.prototype._error = function(err) { - var windows = this.windows; - while (windows.length > 0) { - windows.shift().error(err); - } - this.destination.error(err); - }; - WindowCountSubscriber.prototype._complete = function() { - var windows = this.windows; - while (windows.length > 0) { - windows.shift().complete(); - } - this.destination.complete(); - }; - return WindowCountSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/windowTime", ["rxjs/Subscriber", "rxjs/Subject", "rxjs/scheduler/asap"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var Subject_1 = require("rxjs/Subject"); - var asap_1 = require("rxjs/scheduler/asap"); - function windowTime(windowTimeSpan, windowCreationInterval, scheduler) { - if (windowCreationInterval === void 0) { - windowCreationInterval = null; - } - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - return this.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler)); - } - exports.windowTime = windowTime; - var WindowTimeOperator = (function() { - function WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler) { - this.windowTimeSpan = windowTimeSpan; - this.windowCreationInterval = windowCreationInterval; - this.scheduler = scheduler; - } - WindowTimeOperator.prototype.call = function(subscriber) { - return new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.scheduler); - }; - return WindowTimeOperator; - }()); - var WindowTimeSubscriber = (function(_super) { - __extends(WindowTimeSubscriber, _super); - function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, scheduler) { - _super.call(this, destination); - this.destination = destination; - this.windowTimeSpan = windowTimeSpan; - this.windowCreationInterval = windowCreationInterval; - this.scheduler = scheduler; - this.windows = []; - if (windowCreationInterval !== null && windowCreationInterval >= 0) { - var window_1 = this.openWindow(); - var closeState = { - subscriber: this, - window: window_1, - context: null - }; - var creationState = { - windowTimeSpan: windowTimeSpan, - windowCreationInterval: windowCreationInterval, - subscriber: this, - scheduler: scheduler - }; - this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState)); - this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState)); - } else { - var window_2 = this.openWindow(); - var timeSpanOnlyState = { - subscriber: this, - window: window_2, - windowTimeSpan: windowTimeSpan - }; - this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState)); - } - } - WindowTimeSubscriber.prototype._next = function(value) { - var windows = this.windows; - var len = windows.length; - for (var i = 0; i < len; i++) { - var window_3 = windows[i]; - if (!window_3.isUnsubscribed) { - window_3.next(value); - } - } - }; - WindowTimeSubscriber.prototype._error = function(err) { - var windows = this.windows; - while (windows.length > 0) { - windows.shift().error(err); - } - this.destination.error(err); - }; - WindowTimeSubscriber.prototype._complete = function() { - var windows = this.windows; - while (windows.length > 0) { - var window_4 = windows.shift(); - if (!window_4.isUnsubscribed) { - window_4.complete(); - } - } - this.destination.complete(); - }; - WindowTimeSubscriber.prototype.openWindow = function() { - var window = new Subject_1.Subject(); - this.windows.push(window); - var destination = this.destination; - destination.add(window); - destination.next(window); - return window; - }; - WindowTimeSubscriber.prototype.closeWindow = function(window) { - window.complete(); - var windows = this.windows; - windows.splice(windows.indexOf(window), 1); - }; - return WindowTimeSubscriber; - }(Subscriber_1.Subscriber)); - function dispatchWindowTimeSpanOnly(state) { - var subscriber = state.subscriber, - windowTimeSpan = state.windowTimeSpan, - window = state.window; - if (window) { - window.complete(); - } - state.window = subscriber.openWindow(); - this.schedule(state, windowTimeSpan); - } - function dispatchWindowCreation(state) { - var windowTimeSpan = state.windowTimeSpan, - subscriber = state.subscriber, - scheduler = state.scheduler, - windowCreationInterval = state.windowCreationInterval; - var window = subscriber.openWindow(); - var action = this; - var context = { - action: action, - subscription: null - }; - var timeSpanState = { - subscriber: subscriber, - window: window, - context: context - }; - context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState); - action.add(context.subscription); - action.schedule(state, windowCreationInterval); - } - function dispatchWindowClose(_a) { - var subscriber = _a.subscriber, - window = _a.window, - context = _a.context; - if (context && context.action && context.subscription) { - context.action.remove(context.subscription); - } - subscriber.closeWindow(window); - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/windowToggle", ["rxjs/Subject", "rxjs/Subscription", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subject_1 = require("rxjs/Subject"); - var Subscription_1 = require("rxjs/Subscription"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function windowToggle(openings, closingSelector) { - return this.lift(new WindowToggleOperator(openings, closingSelector)); - } - exports.windowToggle = windowToggle; - var WindowToggleOperator = (function() { - function WindowToggleOperator(openings, closingSelector) { - this.openings = openings; - this.closingSelector = closingSelector; - } - WindowToggleOperator.prototype.call = function(subscriber) { - return new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector); - }; - return WindowToggleOperator; - }()); - var WindowToggleSubscriber = (function(_super) { - __extends(WindowToggleSubscriber, _super); - function WindowToggleSubscriber(destination, openings, closingSelector) { - _super.call(this, destination); - this.openings = openings; - this.closingSelector = closingSelector; - this.contexts = []; - this.add(this.openSubscription = subscribeToResult_1.subscribeToResult(this, openings, openings)); - } - WindowToggleSubscriber.prototype._next = function(value) { - var contexts = this.contexts; - if (contexts) { - var len = contexts.length; - for (var i = 0; i < len; i++) { - contexts[i].window.next(value); - } - } - }; - WindowToggleSubscriber.prototype._error = function(err) { - var contexts = this.contexts; - this.contexts = null; - if (contexts) { - var len = contexts.length; - var index = -1; - while (++index < len) { - var context = contexts[index]; - context.window.error(err); - context.subscription.unsubscribe(); - } - } - _super.prototype._error.call(this, err); - }; - WindowToggleSubscriber.prototype._complete = function() { - var contexts = this.contexts; - this.contexts = null; - if (contexts) { - var len = contexts.length; - var index = -1; - while (++index < len) { - var context = contexts[index]; - context.window.complete(); - context.subscription.unsubscribe(); - } - } - _super.prototype._complete.call(this); - }; - WindowToggleSubscriber.prototype._unsubscribe = function() { - var contexts = this.contexts; - this.contexts = null; - if (contexts) { - var len = contexts.length; - var index = -1; - while (++index < len) { - var context = contexts[index]; - context.window.unsubscribe(); - context.subscription.unsubscribe(); - } - } - }; - WindowToggleSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - if (outerValue === this.openings) { - var closingSelector = this.closingSelector; - var closingNotifier = tryCatch_1.tryCatch(closingSelector)(innerValue); - if (closingNotifier === errorObject_1.errorObject) { - return this.error(errorObject_1.errorObject.e); - } else { - var window_1 = new Subject_1.Subject(); - var subscription = new Subscription_1.Subscription(); - var context = { - window: window_1, - subscription: subscription - }; - this.contexts.push(context); - var innerSubscription = subscribeToResult_1.subscribeToResult(this, closingNotifier, context); - innerSubscription.context = context; - subscription.add(innerSubscription); - this.destination.next(window_1); - } - } else { - this.closeWindow(this.contexts.indexOf(outerValue)); - } - }; - WindowToggleSubscriber.prototype.notifyError = function(err) { - this.error(err); - }; - WindowToggleSubscriber.prototype.notifyComplete = function(inner) { - if (inner !== this.openSubscription) { - this.closeWindow(this.contexts.indexOf(inner.context)); - } - }; - WindowToggleSubscriber.prototype.closeWindow = function(index) { - var contexts = this.contexts; - var context = contexts[index]; - var window = context.window, - subscription = context.subscription; - contexts.splice(index, 1); - window.complete(); - subscription.unsubscribe(); - }; - return WindowToggleSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/windowWhen", ["rxjs/Subject", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subject_1 = require("rxjs/Subject"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function windowWhen(closingSelector) { - return this.lift(new WindowOperator(closingSelector)); - } - exports.windowWhen = windowWhen; - var WindowOperator = (function() { - function WindowOperator(closingSelector) { - this.closingSelector = closingSelector; - } - WindowOperator.prototype.call = function(subscriber) { - return new WindowSubscriber(subscriber, this.closingSelector); - }; - return WindowOperator; - }()); - var WindowSubscriber = (function(_super) { - __extends(WindowSubscriber, _super); - function WindowSubscriber(destination, closingSelector) { - _super.call(this, destination); - this.destination = destination; - this.closingSelector = closingSelector; - this.openWindow(); - } - WindowSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.openWindow(innerSub); - }; - WindowSubscriber.prototype.notifyError = function(error, innerSub) { - this._error(error); - }; - WindowSubscriber.prototype.notifyComplete = function(innerSub) { - this.openWindow(innerSub); - }; - WindowSubscriber.prototype._next = function(value) { - this.window.next(value); - }; - WindowSubscriber.prototype._error = function(err) { - this.window.error(err); - this.destination.error(err); - this.unsubscribeClosingNotification(); - }; - WindowSubscriber.prototype._complete = function() { - this.window.complete(); - this.destination.complete(); - this.unsubscribeClosingNotification(); - }; - WindowSubscriber.prototype.unsubscribeClosingNotification = function() { - if (this.closingNotification) { - this.closingNotification.unsubscribe(); - } - }; - WindowSubscriber.prototype.openWindow = function(innerSub) { - if (innerSub === void 0) { - innerSub = null; - } - if (innerSub) { - this.remove(innerSub); - innerSub.unsubscribe(); - } - var prevWindow = this.window; - if (prevWindow) { - prevWindow.complete(); - } - var window = this.window = new Subject_1.Subject(); - this.destination.next(window); - var closingNotifier = tryCatch_1.tryCatch(this.closingSelector)(); - if (closingNotifier === errorObject_1.errorObject) { - var err = errorObject_1.errorObject.e; - this.destination.error(err); - this.window.error(err); - } else { - this.add(this.closingNotification = subscribeToResult_1.subscribeToResult(this, closingNotifier)); - this.add(window); - } - }; - return WindowSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/withLatestFrom", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function withLatestFrom() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i - 0] = arguments[_i]; - } - var project; - if (typeof args[args.length - 1] === 'function') { - project = args.pop(); - } - var observables = args; - return this.lift(new WithLatestFromOperator(observables, project)); - } - exports.withLatestFrom = withLatestFrom; - var WithLatestFromOperator = (function() { - function WithLatestFromOperator(observables, project) { - this.observables = observables; - this.project = project; - } - WithLatestFromOperator.prototype.call = function(subscriber) { - return new WithLatestFromSubscriber(subscriber, this.observables, this.project); - }; - return WithLatestFromOperator; - }()); - var WithLatestFromSubscriber = (function(_super) { - __extends(WithLatestFromSubscriber, _super); - function WithLatestFromSubscriber(destination, observables, project) { - _super.call(this, destination); - this.observables = observables; - this.project = project; - this.toRespond = []; - var len = observables.length; - this.values = new Array(len); - for (var i = 0; i < len; i++) { - this.toRespond.push(i); - } - for (var i = 0; i < len; i++) { - var observable = observables[i]; - this.add(subscribeToResult_1.subscribeToResult(this, observable, observable, i)); - } - } - WithLatestFromSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.values[outerIndex] = innerValue; - var toRespond = this.toRespond; - if (toRespond.length > 0) { - var found = toRespond.indexOf(outerIndex); - if (found !== -1) { - toRespond.splice(found, 1); - } - } - }; - WithLatestFromSubscriber.prototype.notifyComplete = function() {}; - WithLatestFromSubscriber.prototype._next = function(value) { - if (this.toRespond.length === 0) { - var args = [value].concat(this.values); - if (this.project) { - this._tryProject(args); - } else { - this.destination.next(args); - } - } - }; - WithLatestFromSubscriber.prototype._tryProject = function(args) { - var result; - try { - result = this.project.apply(this, args); - } catch (err) { - this.destination.error(err); - return ; - } - this.destination.next(result); - }; - return WithLatestFromSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/zip", ["rxjs/Observable", "rxjs/operator/zip"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var zip_1 = require("rxjs/operator/zip"); - Observable_1.Observable.prototype.zip = zip_1.zipProto; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/zipAll", ["rxjs/operator/zip"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var zip_1 = require("rxjs/operator/zip"); - function zipAll(project) { - return this.lift(new zip_1.ZipOperator(project)); - } - exports.zipAll = zipAll; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/tryCatch", ["rxjs/util/errorObject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var errorObject_1 = require("rxjs/util/errorObject"); - var tryCatchTarget; - function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } catch (e) { - errorObject_1.errorObject.e = e; - return errorObject_1.errorObject; - } - } - function tryCatch(fn) { - tryCatchTarget = fn; - return tryCatcher; - } - exports.tryCatch = tryCatch; - ; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/ArrayObservable", ["rxjs/Observable", "rxjs/observable/ScalarObservable", "rxjs/observable/EmptyObservable", "rxjs/util/isScheduler"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var ScalarObservable_1 = require("rxjs/observable/ScalarObservable"); - var EmptyObservable_1 = require("rxjs/observable/EmptyObservable"); - var isScheduler_1 = require("rxjs/util/isScheduler"); - var ArrayObservable = (function(_super) { - __extends(ArrayObservable, _super); - function ArrayObservable(array, scheduler) { - _super.call(this); - this.array = array; - this.scheduler = scheduler; - if (!scheduler && array.length === 1) { - this._isScalar = true; - this.value = array[0]; - } - } - ArrayObservable.create = function(array, scheduler) { - return new ArrayObservable(array, scheduler); - }; - ArrayObservable.of = function() { - var array = []; - for (var _i = 0; _i < arguments.length; _i++) { - array[_i - 0] = arguments[_i]; - } - var scheduler = array[array.length - 1]; - if (isScheduler_1.isScheduler(scheduler)) { - array.pop(); - } else { - scheduler = null; - } - var len = array.length; - if (len > 1) { - return new ArrayObservable(array, scheduler); - } else if (len === 1) { - return new ScalarObservable_1.ScalarObservable(array[0], scheduler); - } else { - return new EmptyObservable_1.EmptyObservable(scheduler); - } - }; - ArrayObservable.dispatch = function(state) { - var array = state.array, - index = state.index, - count = state.count, - subscriber = state.subscriber; - if (index >= count) { - subscriber.complete(); - return ; - } - subscriber.next(array[index]); - if (subscriber.isUnsubscribed) { - return ; - } - state.index = index + 1; - this.schedule(state); - }; - ArrayObservable.prototype._subscribe = function(subscriber) { - var index = 0; - var array = this.array; - var count = array.length; - var scheduler = this.scheduler; - if (scheduler) { - return scheduler.schedule(ArrayObservable.dispatch, 0, { - array: array, - index: index, - count: count, - subscriber: subscriber - }); - } else { - for (var i = 0; i < count && !subscriber.isUnsubscribed; i++) { - subscriber.next(array[i]); - } - subscriber.complete(); - } - }; - return ArrayObservable; - }(Observable_1.Observable)); - exports.ArrayObservable = ArrayObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/subscribeToResult", ["rxjs/util/root", "rxjs/util/isArray", "rxjs/util/isPromise", "rxjs/Observable", "rxjs/util/SymbolShim", "rxjs/InnerSubscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var root_1 = require("rxjs/util/root"); - var isArray_1 = require("rxjs/util/isArray"); - var isPromise_1 = require("rxjs/util/isPromise"); - var Observable_1 = require("rxjs/Observable"); - var SymbolShim_1 = require("rxjs/util/SymbolShim"); - var InnerSubscriber_1 = require("rxjs/InnerSubscriber"); - function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { - var destination = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex); - if (destination.isUnsubscribed) { - return ; - } - if (result instanceof Observable_1.Observable) { - if (result._isScalar) { - destination.next(result.value); - destination.complete(); - return ; - } else { - return result.subscribe(destination); - } - } - if (isArray_1.isArray(result)) { - for (var i = 0, - len = result.length; i < len && !destination.isUnsubscribed; i++) { - destination.next(result[i]); - } - if (!destination.isUnsubscribed) { - destination.complete(); - } - } else if (isPromise_1.isPromise(result)) { - result.then(function(value) { - if (!destination.isUnsubscribed) { - destination.next(value); - destination.complete(); - } - }, function(err) { - return destination.error(err); - }).then(null, function(err) { - root_1.root.setTimeout(function() { - throw err; - }); - }); - return destination; - } else if (typeof result[SymbolShim_1.SymbolShim.iterator] === 'function') { - for (var _i = 0, - result_1 = result; _i < result_1.length; _i++) { - var item = result_1[_i]; - destination.next(item); - if (destination.isUnsubscribed) { - break; - } - } - if (!destination.isUnsubscribed) { - destination.complete(); - } - } else if (typeof result[SymbolShim_1.SymbolShim.observable] === 'function') { - var obs = result[SymbolShim_1.SymbolShim.observable](); - if (typeof obs.subscribe !== 'function') { - destination.error('invalid observable'); - } else { - return obs.subscribe(new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex)); - } - } else { - destination.error(new TypeError('unknown type returned')); - } - } - exports.subscribeToResult = subscribeToResult; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/concat", ["rxjs/util/isScheduler", "rxjs/observable/ArrayObservable", "rxjs/operator/mergeAll"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var isScheduler_1 = require("rxjs/util/isScheduler"); - var ArrayObservable_1 = require("rxjs/observable/ArrayObservable"); - var mergeAll_1 = require("rxjs/operator/mergeAll"); - function concat() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i - 0] = arguments[_i]; - } - return concatStatic.apply(void 0, [this].concat(observables)); - } - exports.concat = concat; - function concatStatic() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i - 0] = arguments[_i]; - } - var scheduler = null; - var args = observables; - if (isScheduler_1.isScheduler(args[observables.length - 1])) { - scheduler = args.pop(); - } - return new ArrayObservable_1.ArrayObservable(observables, scheduler).lift(new mergeAll_1.MergeAllOperator(1)); - } - exports.concatStatic = concatStatic; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/merge", ["rxjs/Observable", "rxjs/operator/merge"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var merge_1 = require("rxjs/operator/merge"); - Observable_1.Observable.merge = merge_1.mergeStatic; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/race", ["rxjs/Observable", "rxjs/operator/race"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var race_1 = require("rxjs/operator/race"); - Observable_1.Observable.race = race_1.raceStatic; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/BoundCallbackObservable", ["rxjs/Observable", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/subject/AsyncSubject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var AsyncSubject_1 = require("rxjs/subject/AsyncSubject"); - var BoundCallbackObservable = (function(_super) { - __extends(BoundCallbackObservable, _super); - function BoundCallbackObservable(callbackFunc, selector, args, scheduler) { - _super.call(this); - this.callbackFunc = callbackFunc; - this.selector = selector; - this.args = args; - this.scheduler = scheduler; - } - BoundCallbackObservable.create = function(callbackFunc, selector, scheduler) { - if (selector === void 0) { - selector = undefined; - } - return function() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i - 0] = arguments[_i]; - } - return new BoundCallbackObservable(callbackFunc, selector, args, scheduler); - }; - }; - BoundCallbackObservable.prototype._subscribe = function(subscriber) { - var callbackFunc = this.callbackFunc; - var args = this.args; - var scheduler = this.scheduler; - var subject = this.subject; - if (!scheduler) { - if (!subject) { - subject = this.subject = new AsyncSubject_1.AsyncSubject(); - var handler = function handlerFn() { - var innerArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - innerArgs[_i - 0] = arguments[_i]; - } - var source = handlerFn.source; - var selector = source.selector, - subject = source.subject; - if (selector) { - var result_1 = tryCatch_1.tryCatch(selector).apply(this, innerArgs); - if (result_1 === errorObject_1.errorObject) { - subject.error(errorObject_1.errorObject.e); - } else { - subject.next(result_1); - subject.complete(); - } - } else { - subject.next(innerArgs.length === 1 ? innerArgs[0] : innerArgs); - subject.complete(); - } - }; - handler.source = this; - var result = tryCatch_1.tryCatch(callbackFunc).apply(this, args.concat(handler)); - if (result === errorObject_1.errorObject) { - subject.error(errorObject_1.errorObject.e); - } - } - return subject.subscribe(subscriber); - } else { - return scheduler.schedule(dispatch, 0, { - source: this, - subscriber: subscriber - }); - } - }; - return BoundCallbackObservable; - }(Observable_1.Observable)); - exports.BoundCallbackObservable = BoundCallbackObservable; - function dispatch(state) { - var self = this; - var source = state.source, - subscriber = state.subscriber; - var callbackFunc = source.callbackFunc, - args = source.args, - scheduler = source.scheduler; - var subject = source.subject; - if (!subject) { - subject = source.subject = new AsyncSubject_1.AsyncSubject(); - var handler = function handlerFn() { - var innerArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - innerArgs[_i - 0] = arguments[_i]; - } - var source = handlerFn.source; - var selector = source.selector, - subject = source.subject; - if (selector) { - var result_2 = tryCatch_1.tryCatch(selector).apply(this, innerArgs); - if (result_2 === errorObject_1.errorObject) { - self.add(scheduler.schedule(dispatchError, 0, { - err: errorObject_1.errorObject.e, - subject: subject - })); - } else { - self.add(scheduler.schedule(dispatchNext, 0, { - value: result_2, - subject: subject - })); - } - } else { - var value = innerArgs.length === 1 ? innerArgs[0] : innerArgs; - self.add(scheduler.schedule(dispatchNext, 0, { - value: value, - subject: subject - })); - } - }; - handler.source = source; - var result = tryCatch_1.tryCatch(callbackFunc).apply(this, args.concat(handler)); - if (result === errorObject_1.errorObject) { - subject.error(errorObject_1.errorObject.e); - } - } - self.add(subject.subscribe(subscriber)); - } - function dispatchNext(_a) { - var value = _a.value, - subject = _a.subject; - subject.next(value); - subject.complete(); - } - function dispatchError(_a) { - var err = _a.err, - subject = _a.subject; - subject.error(err); - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/bindNodeCallback", ["rxjs/Observable", "rxjs/observable/BoundNodeCallbackObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var BoundNodeCallbackObservable_1 = require("rxjs/observable/BoundNodeCallbackObservable"); - Observable_1.Observable.bindNodeCallback = BoundNodeCallbackObservable_1.BoundNodeCallbackObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/defer", ["rxjs/Observable", "rxjs/observable/DeferObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var DeferObservable_1 = require("rxjs/observable/DeferObservable"); - Observable_1.Observable.defer = DeferObservable_1.DeferObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/ForkJoinObservable", ["rxjs/Observable", "rxjs/Subscriber", "rxjs/observable/PromiseObservable", "rxjs/observable/EmptyObservable", "rxjs/util/isPromise", "rxjs/util/isArray"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var Subscriber_1 = require("rxjs/Subscriber"); - var PromiseObservable_1 = require("rxjs/observable/PromiseObservable"); - var EmptyObservable_1 = require("rxjs/observable/EmptyObservable"); - var isPromise_1 = require("rxjs/util/isPromise"); - var isArray_1 = require("rxjs/util/isArray"); - var ForkJoinObservable = (function(_super) { - __extends(ForkJoinObservable, _super); - function ForkJoinObservable(sources, resultSelector) { - _super.call(this); - this.sources = sources; - this.resultSelector = resultSelector; - } - ForkJoinObservable.create = function() { - var sources = []; - for (var _i = 0; _i < arguments.length; _i++) { - sources[_i - 0] = arguments[_i]; - } - if (sources === null || arguments.length === 0) { - return new EmptyObservable_1.EmptyObservable(); - } - var resultSelector = null; - if (typeof sources[sources.length - 1] === 'function') { - resultSelector = sources.pop(); - } - if (sources.length === 1 && isArray_1.isArray(sources[0])) { - sources = sources[0]; - } - if (sources.length === 0) { - return new EmptyObservable_1.EmptyObservable(); - } - return new ForkJoinObservable(sources, resultSelector); - }; - ForkJoinObservable.prototype._subscribe = function(subscriber) { - var sources = this.sources; - var len = sources.length; - var context = { - completed: 0, - total: len, - values: emptyArray(len), - selector: this.resultSelector - }; - for (var i = 0; i < len; i++) { - var source = sources[i]; - if (isPromise_1.isPromise(source)) { - source = new PromiseObservable_1.PromiseObservable(source); - } - source.subscribe(new AllSubscriber(subscriber, i, context)); - } - }; - return ForkJoinObservable; - }(Observable_1.Observable)); - exports.ForkJoinObservable = ForkJoinObservable; - var AllSubscriber = (function(_super) { - __extends(AllSubscriber, _super); - function AllSubscriber(destination, index, context) { - _super.call(this, destination); - this.index = index; - this.context = context; - this._value = null; - } - AllSubscriber.prototype._next = function(value) { - this._value = value; - }; - AllSubscriber.prototype._complete = function() { - var destination = this.destination; - if (this._value == null) { - destination.complete(); - } - var context = this.context; - context.completed++; - context.values[this.index] = this._value; - var values = context.values; - if (context.completed !== values.length) { - return ; - } - if (values.every(hasValue)) { - var value = context.selector ? context.selector.apply(this, values) : values; - destination.next(value); - } - destination.complete(); - }; - return AllSubscriber; - }(Subscriber_1.Subscriber)); - function hasValue(x) { - return x !== null; - } - function emptyArray(len) { - var arr = []; - for (var i = 0; i < len; i++) { - arr.push(null); - } - return arr; - } - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/observeOn", ["rxjs/Subscriber", "rxjs/Notification"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var Notification_1 = require("rxjs/Notification"); - function observeOn(scheduler, delay) { - if (delay === void 0) { - delay = 0; - } - return this.lift(new ObserveOnOperator(scheduler, delay)); - } - exports.observeOn = observeOn; - var ObserveOnOperator = (function() { - function ObserveOnOperator(scheduler, delay) { - if (delay === void 0) { - delay = 0; - } - this.scheduler = scheduler; - this.delay = delay; - } - ObserveOnOperator.prototype.call = function(subscriber) { - return new ObserveOnSubscriber(subscriber, this.scheduler, this.delay); - }; - return ObserveOnOperator; - }()); - exports.ObserveOnOperator = ObserveOnOperator; - var ObserveOnSubscriber = (function(_super) { - __extends(ObserveOnSubscriber, _super); - function ObserveOnSubscriber(destination, scheduler, delay) { - if (delay === void 0) { - delay = 0; - } - _super.call(this, destination); - this.scheduler = scheduler; - this.delay = delay; - } - ObserveOnSubscriber.dispatch = function(_a) { - var notification = _a.notification, - destination = _a.destination; - notification.observe(destination); - }; - ObserveOnSubscriber.prototype.scheduleMessage = function(notification) { - this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination))); - }; - ObserveOnSubscriber.prototype._next = function(value) { - this.scheduleMessage(Notification_1.Notification.createNext(value)); - }; - ObserveOnSubscriber.prototype._error = function(err) { - this.scheduleMessage(Notification_1.Notification.createError(err)); - }; - ObserveOnSubscriber.prototype._complete = function() { - this.scheduleMessage(Notification_1.Notification.createComplete()); - }; - return ObserveOnSubscriber; - }(Subscriber_1.Subscriber)); - exports.ObserveOnSubscriber = ObserveOnSubscriber; - var ObserveOnMessage = (function() { - function ObserveOnMessage(notification, destination) { - this.notification = notification; - this.destination = destination; - } - return ObserveOnMessage; - }()); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/fromEvent", ["rxjs/Observable", "rxjs/observable/FromEventObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var FromEventObservable_1 = require("rxjs/observable/FromEventObservable"); - Observable_1.Observable.fromEvent = FromEventObservable_1.FromEventObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/fromEventPattern", ["rxjs/Observable", "rxjs/observable/FromEventPatternObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var FromEventPatternObservable_1 = require("rxjs/observable/FromEventPatternObservable"); - Observable_1.Observable.fromEventPattern = FromEventPatternObservable_1.FromEventPatternObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/scheduler/AsapAction", ["rxjs/util/Immediate", "rxjs/scheduler/FutureAction"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Immediate_1 = require("rxjs/util/Immediate"); - var FutureAction_1 = require("rxjs/scheduler/FutureAction"); - var AsapAction = (function(_super) { - __extends(AsapAction, _super); - function AsapAction() { - _super.apply(this, arguments); - } - AsapAction.prototype._schedule = function(state, delay) { - if (delay === void 0) { - delay = 0; - } - if (delay > 0) { - return _super.prototype._schedule.call(this, state, delay); - } - this.delay = delay; - this.state = state; - var scheduler = this.scheduler; - scheduler.actions.push(this); - if (!scheduler.scheduledId) { - scheduler.scheduledId = Immediate_1.Immediate.setImmediate(function() { - scheduler.scheduledId = null; - scheduler.flush(); - }); - } - return this; - }; - AsapAction.prototype._unsubscribe = function() { - var scheduler = this.scheduler; - var scheduledId = scheduler.scheduledId, - actions = scheduler.actions; - _super.prototype._unsubscribe.call(this); - if (actions.length === 0) { - scheduler.active = false; - if (scheduledId != null) { - scheduler.scheduledId = null; - Immediate_1.Immediate.clearImmediate(scheduledId); - } - } - }; - return AsapAction; - }(FutureAction_1.FutureAction)); - exports.AsapAction = AsapAction; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/scheduler/QueueScheduler", ["rxjs/scheduler/QueueAction", "rxjs/scheduler/FutureAction"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var QueueAction_1 = require("rxjs/scheduler/QueueAction"); - var FutureAction_1 = require("rxjs/scheduler/FutureAction"); - var QueueScheduler = (function() { - function QueueScheduler() { - this.active = false; - this.actions = []; - this.scheduledId = null; - } - QueueScheduler.prototype.now = function() { - return Date.now(); - }; - QueueScheduler.prototype.flush = function() { - if (this.active || this.scheduledId) { - return ; - } - this.active = true; - var actions = this.actions; - for (var action = void 0; action = actions.shift(); ) { - action.execute(); - } - this.active = false; - }; - QueueScheduler.prototype.schedule = function(work, delay, state) { - if (delay === void 0) { - delay = 0; - } - return (delay <= 0) ? this.scheduleNow(work, state) : this.scheduleLater(work, delay, state); - }; - QueueScheduler.prototype.scheduleNow = function(work, state) { - return new QueueAction_1.QueueAction(this, work).schedule(state); - }; - QueueScheduler.prototype.scheduleLater = function(work, delay, state) { - return new FutureAction_1.FutureAction(this, work).schedule(state, delay); - }; - return QueueScheduler; - }()); - exports.QueueScheduler = QueueScheduler; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/NeverObservable", ["rxjs/Observable", "rxjs/util/noop"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var noop_1 = require("rxjs/util/noop"); - var NeverObservable = (function(_super) { - __extends(NeverObservable, _super); - function NeverObservable() { - _super.call(this); - } - NeverObservable.create = function() { - return new NeverObservable(); - }; - NeverObservable.prototype._subscribe = function(subscriber) { - noop_1.noop(); - }; - return NeverObservable; - }(Observable_1.Observable)); - exports.NeverObservable = NeverObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/range", ["rxjs/Observable", "rxjs/observable/RangeObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var RangeObservable_1 = require("rxjs/observable/RangeObservable"); - Observable_1.Observable.range = RangeObservable_1.RangeObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/throw", ["rxjs/Observable", "rxjs/observable/ErrorObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var ErrorObservable_1 = require("rxjs/observable/ErrorObservable"); - Observable_1.Observable.throw = ErrorObservable_1.ErrorObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/TimerObservable", ["rxjs/util/isNumeric", "rxjs/Observable", "rxjs/scheduler/asap", "rxjs/util/isScheduler", "rxjs/util/isDate"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var isNumeric_1 = require("rxjs/util/isNumeric"); - var Observable_1 = require("rxjs/Observable"); - var asap_1 = require("rxjs/scheduler/asap"); - var isScheduler_1 = require("rxjs/util/isScheduler"); - var isDate_1 = require("rxjs/util/isDate"); - var TimerObservable = (function(_super) { - __extends(TimerObservable, _super); - function TimerObservable(dueTime, period, scheduler) { - if (dueTime === void 0) { - dueTime = 0; - } - _super.call(this); - this.period = -1; - this.dueTime = 0; - if (isNumeric_1.isNumeric(period)) { - this.period = Number(period) < 1 && 1 || Number(period); - } else if (isScheduler_1.isScheduler(period)) { - scheduler = period; - } - if (!isScheduler_1.isScheduler(scheduler)) { - scheduler = asap_1.asap; - } - this.scheduler = scheduler; - this.dueTime = isDate_1.isDate(dueTime) ? (+dueTime - this.scheduler.now()) : dueTime; - } - TimerObservable.create = function(dueTime, period, scheduler) { - if (dueTime === void 0) { - dueTime = 0; - } - return new TimerObservable(dueTime, period, scheduler); - }; - TimerObservable.dispatch = function(state) { - var index = state.index, - period = state.period, - subscriber = state.subscriber; - var action = this; - subscriber.next(index); - if (subscriber.isUnsubscribed) { - return ; - } else if (period === -1) { - return subscriber.complete(); - } - state.index = index + 1; - action.schedule(state, period); - }; - TimerObservable.prototype._subscribe = function(subscriber) { - var index = 0; - var _a = this, - period = _a.period, - dueTime = _a.dueTime, - scheduler = _a.scheduler; - return scheduler.schedule(TimerObservable.dispatch, dueTime, { - index: index, - period: period, - subscriber: subscriber - }); - }; - return TimerObservable; - }(Observable_1.Observable)); - exports.TimerObservable = TimerObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/zip", ["rxjs/Observable", "rxjs/operator/zip"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var zip_1 = require("rxjs/operator/zip"); - Observable_1.Observable.zip = zip_1.zipStatic; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/buffer", ["rxjs/Observable", "rxjs/operator/buffer"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var buffer_1 = require("rxjs/operator/buffer"); - Observable_1.Observable.prototype.buffer = buffer_1.buffer; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/bufferCount", ["rxjs/Observable", "rxjs/operator/bufferCount"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var bufferCount_1 = require("rxjs/operator/bufferCount"); - Observable_1.Observable.prototype.bufferCount = bufferCount_1.bufferCount; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/bufferTime", ["rxjs/Observable", "rxjs/operator/bufferTime"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var bufferTime_1 = require("rxjs/operator/bufferTime"); - Observable_1.Observable.prototype.bufferTime = bufferTime_1.bufferTime; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/bufferToggle", ["rxjs/Observable", "rxjs/operator/bufferToggle"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var bufferToggle_1 = require("rxjs/operator/bufferToggle"); - Observable_1.Observable.prototype.bufferToggle = bufferToggle_1.bufferToggle; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/bufferWhen", ["rxjs/Observable", "rxjs/operator/bufferWhen"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var bufferWhen_1 = require("rxjs/operator/bufferWhen"); - Observable_1.Observable.prototype.bufferWhen = bufferWhen_1.bufferWhen; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/subject/ReplaySubject", ["rxjs/Subject", "rxjs/scheduler/queue", "rxjs/operator/observeOn"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subject_1 = require("rxjs/Subject"); - var queue_1 = require("rxjs/scheduler/queue"); - var observeOn_1 = require("rxjs/operator/observeOn"); - var ReplaySubject = (function(_super) { - __extends(ReplaySubject, _super); - function ReplaySubject(bufferSize, windowTime, scheduler) { - if (bufferSize === void 0) { - bufferSize = Number.POSITIVE_INFINITY; - } - if (windowTime === void 0) { - windowTime = Number.POSITIVE_INFINITY; - } - _super.call(this); - this.events = []; - this.scheduler = scheduler; - this.bufferSize = bufferSize < 1 ? 1 : bufferSize; - this._windowTime = windowTime < 1 ? 1 : windowTime; - } - ReplaySubject.prototype._next = function(value) { - var now = this._getNow(); - this.events.push(new ReplayEvent(now, value)); - this._trimBufferThenGetEvents(now); - _super.prototype._next.call(this, value); - }; - ReplaySubject.prototype._subscribe = function(subscriber) { - var events = this._trimBufferThenGetEvents(this._getNow()); - var scheduler = this.scheduler; - if (scheduler) { - subscriber.add(subscriber = new observeOn_1.ObserveOnSubscriber(subscriber, scheduler)); - } - var index = -1; - var len = events.length; - while (++index < len && !subscriber.isUnsubscribed) { - subscriber.next(events[index].value); - } - return _super.prototype._subscribe.call(this, subscriber); - }; - ReplaySubject.prototype._getNow = function() { - return (this.scheduler || queue_1.queue).now(); - }; - ReplaySubject.prototype._trimBufferThenGetEvents = function(now) { - var bufferSize = this.bufferSize; - var _windowTime = this._windowTime; - var events = this.events; - var eventsCount = events.length; - var spliceCount = 0; - while (spliceCount < eventsCount) { - if ((now - events[spliceCount].time) < _windowTime) { - break; - } - spliceCount += 1; - } - if (eventsCount > bufferSize) { - spliceCount = Math.max(spliceCount, eventsCount - bufferSize); - } - if (spliceCount > 0) { - events.splice(0, spliceCount); - } - return events; - }; - return ReplaySubject; - }(Subject_1.Subject)); - exports.ReplaySubject = ReplaySubject; - var ReplayEvent = (function() { - function ReplayEvent(time, value) { - this.time = time; - this.value = value; - } - return ReplayEvent; - }()); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/multicast", ["rxjs/observable/ConnectableObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var ConnectableObservable_1 = require("rxjs/observable/ConnectableObservable"); - function multicast(subjectOrSubjectFactory) { - var subjectFactory; - if (typeof subjectOrSubjectFactory === 'function') { - subjectFactory = subjectOrSubjectFactory; - } else { - subjectFactory = function subjectFactory() { - return subjectOrSubjectFactory; - }; - } - return new ConnectableObservable_1.ConnectableObservable(this, subjectFactory); - } - exports.multicast = multicast; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/catch", ["rxjs/Observable", "rxjs/operator/catch"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var catch_1 = require("rxjs/operator/catch"); - Observable_1.Observable.prototype.catch = catch_1._catch; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/combineAll", ["rxjs/Observable", "rxjs/operator/combineAll"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var combineAll_1 = require("rxjs/operator/combineAll"); - Observable_1.Observable.prototype.combineAll = combineAll_1.combineAll; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/concatAll", ["rxjs/Observable", "rxjs/operator/concatAll"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var concatAll_1 = require("rxjs/operator/concatAll"); - Observable_1.Observable.prototype.concatAll = concatAll_1.concatAll; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/concatMap", ["rxjs/operator/mergeMap"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var mergeMap_1 = require("rxjs/operator/mergeMap"); - function concatMap(project, resultSelector) { - return this.lift(new mergeMap_1.MergeMapOperator(project, resultSelector, 1)); - } - exports.concatMap = concatMap; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/concatMapTo", ["rxjs/operator/mergeMapTo"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var mergeMapTo_1 = require("rxjs/operator/mergeMapTo"); - function concatMapTo(observable, resultSelector) { - return this.lift(new mergeMapTo_1.MergeMapToOperator(observable, resultSelector, 1)); - } - exports.concatMapTo = concatMapTo; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/count", ["rxjs/Observable", "rxjs/operator/count"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var count_1 = require("rxjs/operator/count"); - Observable_1.Observable.prototype.count = count_1.count; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/dematerialize", ["rxjs/Observable", "rxjs/operator/dematerialize"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var dematerialize_1 = require("rxjs/operator/dematerialize"); - Observable_1.Observable.prototype.dematerialize = dematerialize_1.dematerialize; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/debounce", ["rxjs/Observable", "rxjs/operator/debounce"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var debounce_1 = require("rxjs/operator/debounce"); - Observable_1.Observable.prototype.debounce = debounce_1.debounce; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/debounceTime", ["rxjs/Observable", "rxjs/operator/debounceTime"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var debounceTime_1 = require("rxjs/operator/debounceTime"); - Observable_1.Observable.prototype.debounceTime = debounceTime_1.debounceTime; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/defaultIfEmpty", ["rxjs/Observable", "rxjs/operator/defaultIfEmpty"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var defaultIfEmpty_1 = require("rxjs/operator/defaultIfEmpty"); - Observable_1.Observable.prototype.defaultIfEmpty = defaultIfEmpty_1.defaultIfEmpty; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/delay", ["rxjs/Observable", "rxjs/operator/delay"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var delay_1 = require("rxjs/operator/delay"); - Observable_1.Observable.prototype.delay = delay_1.delay; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/delayWhen", ["rxjs/Observable", "rxjs/operator/delayWhen"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var delayWhen_1 = require("rxjs/operator/delayWhen"); - Observable_1.Observable.prototype.delayWhen = delayWhen_1.delayWhen; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/distinctUntilChanged", ["rxjs/Observable", "rxjs/operator/distinctUntilChanged"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var distinctUntilChanged_1 = require("rxjs/operator/distinctUntilChanged"); - Observable_1.Observable.prototype.distinctUntilChanged = distinctUntilChanged_1.distinctUntilChanged; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/do", ["rxjs/Observable", "rxjs/operator/do"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var do_1 = require("rxjs/operator/do"); - Observable_1.Observable.prototype.do = do_1._do; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/expand", ["rxjs/Observable", "rxjs/operator/expand"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var expand_1 = require("rxjs/operator/expand"); - Observable_1.Observable.prototype.expand = expand_1.expand; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/filter", ["rxjs/Observable", "rxjs/operator/filter"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var filter_1 = require("rxjs/operator/filter"); - Observable_1.Observable.prototype.filter = filter_1.filter; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/finally", ["rxjs/Observable", "rxjs/operator/finally"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var finally_1 = require("rxjs/operator/finally"); - Observable_1.Observable.prototype.finally = finally_1._finally; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/first", ["rxjs/Subscriber", "rxjs/util/EmptyError"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var EmptyError_1 = require("rxjs/util/EmptyError"); - function first(predicate, resultSelector, defaultValue) { - return this.lift(new FirstOperator(predicate, resultSelector, defaultValue, this)); - } - exports.first = first; - var FirstOperator = (function() { - function FirstOperator(predicate, resultSelector, defaultValue, source) { - this.predicate = predicate; - this.resultSelector = resultSelector; - this.defaultValue = defaultValue; - this.source = source; - } - FirstOperator.prototype.call = function(observer) { - return new FirstSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); - }; - return FirstOperator; - }()); - var FirstSubscriber = (function(_super) { - __extends(FirstSubscriber, _super); - function FirstSubscriber(destination, predicate, resultSelector, defaultValue, source) { - _super.call(this, destination); - this.predicate = predicate; - this.resultSelector = resultSelector; - this.defaultValue = defaultValue; - this.source = source; - this.index = 0; - this.hasCompleted = false; - } - FirstSubscriber.prototype._next = function(value) { - var index = this.index++; - if (this.predicate) { - this._tryPredicate(value, index); - } else { - this._emit(value, index); - } - }; - FirstSubscriber.prototype._tryPredicate = function(value, index) { - var result; - try { - result = this.predicate(value, index, this.source); - } catch (err) { - this.destination.error(err); - return ; - } - if (result) { - this._emit(value, index); - } - }; - FirstSubscriber.prototype._emit = function(value, index) { - if (this.resultSelector) { - this._tryResultSelector(value, index); - return ; - } - this._emitFinal(value); - }; - FirstSubscriber.prototype._tryResultSelector = function(value, index) { - var result; - try { - result = this.resultSelector(value, index); - } catch (err) { - this.destination.error(err); - return ; - } - this._emitFinal(result); - }; - FirstSubscriber.prototype._emitFinal = function(value) { - var destination = this.destination; - destination.next(value); - destination.complete(); - this.hasCompleted = true; - }; - FirstSubscriber.prototype._complete = function() { - var destination = this.destination; - if (!this.hasCompleted && typeof this.defaultValue !== 'undefined') { - destination.next(this.defaultValue); - destination.complete(); - } else if (!this.hasCompleted) { - destination.error(new EmptyError_1.EmptyError); - } - }; - return FirstSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/Map", ["rxjs/util/root", "rxjs/util/MapPolyfill"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var root_1 = require("rxjs/util/root"); - var MapPolyfill_1 = require("rxjs/util/MapPolyfill"); - exports.Map = root_1.root.Map || (function() { - return MapPolyfill_1.MapPolyfill; - })(); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/ignoreElements", ["rxjs/Observable", "rxjs/operator/ignoreElements"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var ignoreElements_1 = require("rxjs/operator/ignoreElements"); - Observable_1.Observable.prototype.ignoreElements = ignoreElements_1.ignoreElements; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/inspect", ["rxjs/Observable", "rxjs/operator/inspect"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var inspect_1 = require("rxjs/operator/inspect"); - Observable_1.Observable.prototype.inspect = inspect_1.inspect; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/inspectTime", ["rxjs/Observable", "rxjs/operator/inspectTime"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var inspectTime_1 = require("rxjs/operator/inspectTime"); - Observable_1.Observable.prototype.inspectTime = inspectTime_1.inspectTime; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/every", ["rxjs/Observable", "rxjs/operator/every"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var every_1 = require("rxjs/operator/every"); - Observable_1.Observable.prototype.every = every_1.every; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/last", ["rxjs/Observable", "rxjs/operator/last"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var last_1 = require("rxjs/operator/last"); - Observable_1.Observable.prototype.last = last_1.last; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/let", ["rxjs/Observable", "rxjs/operator/let"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var let_1 = require("rxjs/operator/let"); - Observable_1.Observable.prototype.let = let_1.letProto; - Observable_1.Observable.prototype.letBind = let_1.letProto; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/map", ["rxjs/Observable", "rxjs/operator/map"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var map_1 = require("rxjs/operator/map"); - Observable_1.Observable.prototype.map = map_1.map; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/mapTo", ["rxjs/Observable", "rxjs/operator/mapTo"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var mapTo_1 = require("rxjs/operator/mapTo"); - Observable_1.Observable.prototype.mapTo = mapTo_1.mapTo; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/materialize", ["rxjs/Observable", "rxjs/operator/materialize"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var materialize_1 = require("rxjs/operator/materialize"); - Observable_1.Observable.prototype.materialize = materialize_1.materialize; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/partition", ["rxjs/util/not", "rxjs/operator/filter"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var not_1 = require("rxjs/util/not"); - var filter_1 = require("rxjs/operator/filter"); - function partition(predicate, thisArg) { - return [filter_1.filter.call(this, predicate), filter_1.filter.call(this, not_1.not(predicate, thisArg))]; - } - exports.partition = partition; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/pluck", ["rxjs/Observable", "rxjs/operator/pluck"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var pluck_1 = require("rxjs/operator/pluck"); - Observable_1.Observable.prototype.pluck = pluck_1.pluck; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/publish", ["rxjs/Observable", "rxjs/operator/publish"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var publish_1 = require("rxjs/operator/publish"); - Observable_1.Observable.prototype.publish = publish_1.publish; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/publishBehavior", ["rxjs/subject/BehaviorSubject", "rxjs/operator/multicast"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var BehaviorSubject_1 = require("rxjs/subject/BehaviorSubject"); - var multicast_1 = require("rxjs/operator/multicast"); - function publishBehavior(value) { - return multicast_1.multicast.call(this, new BehaviorSubject_1.BehaviorSubject(value)); - } - exports.publishBehavior = publishBehavior; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/publishLast", ["rxjs/Observable", "rxjs/operator/publishLast"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var publishLast_1 = require("rxjs/operator/publishLast"); - Observable_1.Observable.prototype.publishLast = publishLast_1.publishLast; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/reduce", ["rxjs/Observable", "rxjs/operator/reduce"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var reduce_1 = require("rxjs/operator/reduce"); - Observable_1.Observable.prototype.reduce = reduce_1.reduce; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/repeat", ["rxjs/Observable", "rxjs/operator/repeat"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var repeat_1 = require("rxjs/operator/repeat"); - Observable_1.Observable.prototype.repeat = repeat_1.repeat; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/retry", ["rxjs/Observable", "rxjs/operator/retry"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var retry_1 = require("rxjs/operator/retry"); - Observable_1.Observable.prototype.retry = retry_1.retry; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/retryWhen", ["rxjs/Observable", "rxjs/operator/retryWhen"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var retryWhen_1 = require("rxjs/operator/retryWhen"); - Observable_1.Observable.prototype.retryWhen = retryWhen_1.retryWhen; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/sample", ["rxjs/Observable", "rxjs/operator/sample"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var sample_1 = require("rxjs/operator/sample"); - Observable_1.Observable.prototype.sample = sample_1.sample; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/sampleTime", ["rxjs/Observable", "rxjs/operator/sampleTime"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var sampleTime_1 = require("rxjs/operator/sampleTime"); - Observable_1.Observable.prototype.sampleTime = sampleTime_1.sampleTime; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/scan", ["rxjs/Observable", "rxjs/operator/scan"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var scan_1 = require("rxjs/operator/scan"); - Observable_1.Observable.prototype.scan = scan_1.scan; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/share", ["rxjs/Observable", "rxjs/operator/share"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var share_1 = require("rxjs/operator/share"); - Observable_1.Observable.prototype.share = share_1.share; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/single", ["rxjs/Observable", "rxjs/operator/single"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var single_1 = require("rxjs/operator/single"); - Observable_1.Observable.prototype.single = single_1.single; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/skip", ["rxjs/Observable", "rxjs/operator/skip"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var skip_1 = require("rxjs/operator/skip"); - Observable_1.Observable.prototype.skip = skip_1.skip; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/skipUntil", ["rxjs/Observable", "rxjs/operator/skipUntil"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var skipUntil_1 = require("rxjs/operator/skipUntil"); - Observable_1.Observable.prototype.skipUntil = skipUntil_1.skipUntil; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/skipWhile", ["rxjs/Observable", "rxjs/operator/skipWhile"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var skipWhile_1 = require("rxjs/operator/skipWhile"); - Observable_1.Observable.prototype.skipWhile = skipWhile_1.skipWhile; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/startWith", ["rxjs/Observable", "rxjs/operator/startWith"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var startWith_1 = require("rxjs/operator/startWith"); - Observable_1.Observable.prototype.startWith = startWith_1.startWith; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/subscribeOn", ["rxjs/observable/SubscribeOnObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var SubscribeOnObservable_1 = require("rxjs/observable/SubscribeOnObservable"); - function subscribeOn(scheduler, delay) { - if (delay === void 0) { - delay = 0; - } - return new SubscribeOnObservable_1.SubscribeOnObservable(this, delay, scheduler); - } - exports.subscribeOn = subscribeOn; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/switch", ["rxjs/Observable", "rxjs/operator/switch"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var switch_1 = require("rxjs/operator/switch"); - Observable_1.Observable.prototype.switch = switch_1._switch; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/switchMap", ["rxjs/Observable", "rxjs/operator/switchMap"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var switchMap_1 = require("rxjs/operator/switchMap"); - Observable_1.Observable.prototype.switchMap = switchMap_1.switchMap; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/switchMapTo", ["rxjs/Observable", "rxjs/operator/switchMapTo"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var switchMapTo_1 = require("rxjs/operator/switchMapTo"); - Observable_1.Observable.prototype.switchMapTo = switchMapTo_1.switchMapTo; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/take", ["rxjs/Subscriber", "rxjs/util/ArgumentOutOfRangeError", "rxjs/observable/EmptyObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var ArgumentOutOfRangeError_1 = require("rxjs/util/ArgumentOutOfRangeError"); - var EmptyObservable_1 = require("rxjs/observable/EmptyObservable"); - function take(total) { - if (total === 0) { - return new EmptyObservable_1.EmptyObservable(); - } else { - return this.lift(new TakeOperator(total)); - } - } - exports.take = take; - var TakeOperator = (function() { - function TakeOperator(total) { - this.total = total; - if (this.total < 0) { - throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError; - } - } - TakeOperator.prototype.call = function(subscriber) { - return new TakeSubscriber(subscriber, this.total); - }; - return TakeOperator; - }()); - var TakeSubscriber = (function(_super) { - __extends(TakeSubscriber, _super); - function TakeSubscriber(destination, total) { - _super.call(this, destination); - this.total = total; - this.count = 0; - } - TakeSubscriber.prototype._next = function(value) { - var total = this.total; - if (++this.count <= total) { - this.destination.next(value); - if (this.count === total) { - this.destination.complete(); - } - } - }; - return TakeSubscriber; - }(Subscriber_1.Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/takeLast", ["rxjs/Observable", "rxjs/operator/takeLast"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var takeLast_1 = require("rxjs/operator/takeLast"); - Observable_1.Observable.prototype.takeLast = takeLast_1.takeLast; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/takeUntil", ["rxjs/Observable", "rxjs/operator/takeUntil"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var takeUntil_1 = require("rxjs/operator/takeUntil"); - Observable_1.Observable.prototype.takeUntil = takeUntil_1.takeUntil; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/takeWhile", ["rxjs/Observable", "rxjs/operator/takeWhile"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var takeWhile_1 = require("rxjs/operator/takeWhile"); - Observable_1.Observable.prototype.takeWhile = takeWhile_1.takeWhile; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/throttle", ["rxjs/Observable", "rxjs/operator/throttle"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var throttle_1 = require("rxjs/operator/throttle"); - Observable_1.Observable.prototype.throttle = throttle_1.throttle; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/throttleTime", ["rxjs/Observable", "rxjs/operator/throttleTime"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var throttleTime_1 = require("rxjs/operator/throttleTime"); - Observable_1.Observable.prototype.throttleTime = throttleTime_1.throttleTime; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/timeout", ["rxjs/Observable", "rxjs/operator/timeout"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var timeout_1 = require("rxjs/operator/timeout"); - Observable_1.Observable.prototype.timeout = timeout_1.timeout; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/timeoutWith", ["rxjs/Observable", "rxjs/operator/timeoutWith"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var timeoutWith_1 = require("rxjs/operator/timeoutWith"); - Observable_1.Observable.prototype.timeoutWith = timeoutWith_1.timeoutWith; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/toArray", ["rxjs/Observable", "rxjs/operator/toArray"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var toArray_1 = require("rxjs/operator/toArray"); - Observable_1.Observable.prototype.toArray = toArray_1.toArray; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/toPromise", ["rxjs/Observable", "rxjs/operator/toPromise"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var toPromise_1 = require("rxjs/operator/toPromise"); - Observable_1.Observable.prototype.toPromise = toPromise_1.toPromise; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/window", ["rxjs/Observable", "rxjs/operator/window"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var window_1 = require("rxjs/operator/window"); - Observable_1.Observable.prototype.window = window_1.window; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/windowCount", ["rxjs/Observable", "rxjs/operator/windowCount"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var windowCount_1 = require("rxjs/operator/windowCount"); - Observable_1.Observable.prototype.windowCount = windowCount_1.windowCount; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/windowTime", ["rxjs/Observable", "rxjs/operator/windowTime"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var windowTime_1 = require("rxjs/operator/windowTime"); - Observable_1.Observable.prototype.windowTime = windowTime_1.windowTime; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/windowToggle", ["rxjs/Observable", "rxjs/operator/windowToggle"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var windowToggle_1 = require("rxjs/operator/windowToggle"); - Observable_1.Observable.prototype.windowToggle = windowToggle_1.windowToggle; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/windowWhen", ["rxjs/Observable", "rxjs/operator/windowWhen"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var windowWhen_1 = require("rxjs/operator/windowWhen"); - Observable_1.Observable.prototype.windowWhen = windowWhen_1.windowWhen; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/withLatestFrom", ["rxjs/Observable", "rxjs/operator/withLatestFrom"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var withLatestFrom_1 = require("rxjs/operator/withLatestFrom"); - Observable_1.Observable.prototype.withLatestFrom = withLatestFrom_1.withLatestFrom; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/zipAll", ["rxjs/Observable", "rxjs/operator/zipAll"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var zipAll_1 = require("rxjs/operator/zipAll"); - Observable_1.Observable.prototype.zipAll = zipAll_1.zipAll; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/Subscription", ["rxjs/util/isArray", "rxjs/util/isObject", "rxjs/util/isFunction", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var isArray_1 = require("rxjs/util/isArray"); - var isObject_1 = require("rxjs/util/isObject"); - var isFunction_1 = require("rxjs/util/isFunction"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var Subscription = (function() { - function Subscription(_unsubscribe) { - this.isUnsubscribed = false; - if (_unsubscribe) { - this._unsubscribe = _unsubscribe; - } - } - Subscription.prototype.unsubscribe = function() { - var hasErrors = false; - var errors; - if (this.isUnsubscribed) { - return ; - } - this.isUnsubscribed = true; - var _a = this, - _unsubscribe = _a._unsubscribe, - _subscriptions = _a._subscriptions; - this._subscriptions = null; - if (isFunction_1.isFunction(_unsubscribe)) { - var trial = tryCatch_1.tryCatch(_unsubscribe).call(this); - if (trial === errorObject_1.errorObject) { - hasErrors = true; - (errors = errors || []).push(errorObject_1.errorObject.e); - } - } - if (isArray_1.isArray(_subscriptions)) { - var index = -1; - var len = _subscriptions.length; - while (++index < len) { - var sub = _subscriptions[index]; - if (isObject_1.isObject(sub)) { - var trial = tryCatch_1.tryCatch(sub.unsubscribe).call(sub); - if (trial === errorObject_1.errorObject) { - hasErrors = true; - errors = errors || []; - var err = errorObject_1.errorObject.e; - if (err instanceof UnsubscriptionError) { - errors = errors.concat(err.errors); - } else { - errors.push(err); - } - } - } - } - } - if (hasErrors) { - throw new UnsubscriptionError(errors); - } - }; - Subscription.prototype.add = function(subscription) { - if (!subscription || (subscription === this) || (subscription === Subscription.EMPTY)) { - return ; - } - var sub = subscription; - switch (typeof subscription) { - case 'function': - sub = new Subscription(subscription); - case 'object': - if (sub.isUnsubscribed || typeof sub.unsubscribe !== 'function') { - break; - } else if (this.isUnsubscribed) { - sub.unsubscribe(); - } else { - (this._subscriptions || (this._subscriptions = [])).push(sub); - } - break; - default: - throw new Error('Unrecognized subscription ' + subscription + ' added to Subscription.'); - } - }; - Subscription.prototype.remove = function(subscription) { - if (subscription == null || (subscription === this) || (subscription === Subscription.EMPTY)) { - return ; - } - var subscriptions = this._subscriptions; - if (subscriptions) { - var subscriptionIndex = subscriptions.indexOf(subscription); - if (subscriptionIndex !== -1) { - subscriptions.splice(subscriptionIndex, 1); - } - } - }; - Subscription.EMPTY = (function(empty) { - empty.isUnsubscribed = true; - return empty; - }(new Subscription())); - return Subscription; - }()); - exports.Subscription = Subscription; - var UnsubscriptionError = (function(_super) { - __extends(UnsubscriptionError, _super); - function UnsubscriptionError(errors) { - _super.call(this, 'unsubscriptoin error(s)'); - this.errors = errors; - this.name = 'UnsubscriptionError'; - } - return UnsubscriptionError; - }(Error)); - exports.UnsubscriptionError = UnsubscriptionError; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/combineLatest", ["rxjs/observable/ArrayObservable", "rxjs/util/isArray", "rxjs/util/isScheduler", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var ArrayObservable_1 = require("rxjs/observable/ArrayObservable"); - var isArray_1 = require("rxjs/util/isArray"); - var isScheduler_1 = require("rxjs/util/isScheduler"); - var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); - var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); - function combineLatest() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i - 0] = arguments[_i]; - } - var project = null; - if (typeof observables[observables.length - 1] === 'function') { - project = observables.pop(); - } - if (observables.length === 1 && isArray_1.isArray(observables[0])) { - observables = observables[0]; - } - observables.unshift(this); - return new ArrayObservable_1.ArrayObservable(observables).lift(new CombineLatestOperator(project)); - } - exports.combineLatest = combineLatest; - function combineLatestStatic() { - var observables = []; - for (var _i = 0; _i < arguments.length; _i++) { - observables[_i - 0] = arguments[_i]; - } - var project = null; - var scheduler = null; - if (isScheduler_1.isScheduler(observables[observables.length - 1])) { - scheduler = observables.pop(); - } - if (typeof observables[observables.length - 1] === 'function') { - project = observables.pop(); - } - if (observables.length === 1 && isArray_1.isArray(observables[0])) { - observables = observables[0]; - } - return new ArrayObservable_1.ArrayObservable(observables, scheduler).lift(new CombineLatestOperator(project)); - } - exports.combineLatestStatic = combineLatestStatic; - var CombineLatestOperator = (function() { - function CombineLatestOperator(project) { - this.project = project; - } - CombineLatestOperator.prototype.call = function(subscriber) { - return new CombineLatestSubscriber(subscriber, this.project); - }; - return CombineLatestOperator; - }()); - exports.CombineLatestOperator = CombineLatestOperator; - var CombineLatestSubscriber = (function(_super) { - __extends(CombineLatestSubscriber, _super); - function CombineLatestSubscriber(destination, project) { - _super.call(this, destination); - this.project = project; - this.active = 0; - this.values = []; - this.observables = []; - this.toRespond = []; - } - CombineLatestSubscriber.prototype._next = function(observable) { - var toRespond = this.toRespond; - toRespond.push(toRespond.length); - this.observables.push(observable); - }; - CombineLatestSubscriber.prototype._complete = function() { - var observables = this.observables; - var len = observables.length; - if (len === 0) { - this.destination.complete(); - } else { - this.active = len; - for (var i = 0; i < len; i++) { - var observable = observables[i]; - this.add(subscribeToResult_1.subscribeToResult(this, observable, observable, i)); - } - } - }; - CombineLatestSubscriber.prototype.notifyComplete = function(unused) { - if ((this.active -= 1) === 0) { - this.destination.complete(); - } - }; - CombineLatestSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) { - var values = this.values; - values[outerIndex] = innerValue; - var toRespond = this.toRespond; - if (toRespond.length > 0) { - var found = toRespond.indexOf(outerIndex); - if (found !== -1) { - toRespond.splice(found, 1); - } - } - if (toRespond.length === 0) { - if (this.project) { - this._tryProject(values); - } else { - this.destination.next(values); - } - } - }; - CombineLatestSubscriber.prototype._tryProject = function(values) { - var result; - try { - result = this.project.apply(this, values); - } catch (err) { - this.destination.error(err); - return ; - } - this.destination.next(result); - }; - return CombineLatestSubscriber; - }(OuterSubscriber_1.OuterSubscriber)); - exports.CombineLatestSubscriber = CombineLatestSubscriber; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/concat", ["rxjs/Observable", "rxjs/operator/concat"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var concat_1 = require("rxjs/operator/concat"); - Observable_1.Observable.concat = concat_1.concatStatic; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/bindCallback", ["rxjs/Observable", "rxjs/observable/BoundCallbackObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var BoundCallbackObservable_1 = require("rxjs/observable/BoundCallbackObservable"); - Observable_1.Observable.bindCallback = BoundCallbackObservable_1.BoundCallbackObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/forkJoin", ["rxjs/Observable", "rxjs/observable/ForkJoinObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var ForkJoinObservable_1 = require("rxjs/observable/ForkJoinObservable"); - Observable_1.Observable.forkJoin = ForkJoinObservable_1.ForkJoinObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/FromObservable", ["rxjs/util/isArray", "rxjs/util/isFunction", "rxjs/util/isPromise", "rxjs/util/isScheduler", "rxjs/observable/PromiseObservable", "rxjs/observable/IteratorObservable", "rxjs/observable/ArrayObservable", "rxjs/observable/ArrayLikeObservable", "rxjs/util/SymbolShim", "rxjs/Observable", "rxjs/operator/observeOn"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var isArray_1 = require("rxjs/util/isArray"); - var isFunction_1 = require("rxjs/util/isFunction"); - var isPromise_1 = require("rxjs/util/isPromise"); - var isScheduler_1 = require("rxjs/util/isScheduler"); - var PromiseObservable_1 = require("rxjs/observable/PromiseObservable"); - var IteratorObservable_1 = require("rxjs/observable/IteratorObservable"); - var ArrayObservable_1 = require("rxjs/observable/ArrayObservable"); - var ArrayLikeObservable_1 = require("rxjs/observable/ArrayLikeObservable"); - var SymbolShim_1 = require("rxjs/util/SymbolShim"); - var Observable_1 = require("rxjs/Observable"); - var observeOn_1 = require("rxjs/operator/observeOn"); - var isArrayLike = (function(x) { - return x && typeof x.length === 'number'; - }); - var FromObservable = (function(_super) { - __extends(FromObservable, _super); - function FromObservable(ish, scheduler) { - _super.call(this, null); - this.ish = ish; - this.scheduler = scheduler; - } - FromObservable.create = function(ish, mapFnOrScheduler, thisArg, lastScheduler) { - var scheduler = null; - var mapFn = null; - if (isFunction_1.isFunction(mapFnOrScheduler)) { - scheduler = lastScheduler || null; - mapFn = mapFnOrScheduler; - } else if (isScheduler_1.isScheduler(scheduler)) { - scheduler = mapFnOrScheduler; - } - if (ish != null) { - if (typeof ish[SymbolShim_1.SymbolShim.observable] === 'function') { - if (ish instanceof Observable_1.Observable && !scheduler) { - return ish; - } - return new FromObservable(ish, scheduler); - } else if (isArray_1.isArray(ish)) { - return new ArrayObservable_1.ArrayObservable(ish, scheduler); - } else if (isPromise_1.isPromise(ish)) { - return new PromiseObservable_1.PromiseObservable(ish, scheduler); - } else if (typeof ish[SymbolShim_1.SymbolShim.iterator] === 'function' || typeof ish === 'string') { - return new IteratorObservable_1.IteratorObservable(ish, null, null, scheduler); - } else if (isArrayLike(ish)) { - return new ArrayLikeObservable_1.ArrayLikeObservable(ish, mapFn, thisArg, scheduler); - } - } - throw new TypeError((ish !== null && typeof ish || ish) + ' is not observable'); - }; - FromObservable.prototype._subscribe = function(subscriber) { - var ish = this.ish; - var scheduler = this.scheduler; - if (scheduler == null) { - return ish[SymbolShim_1.SymbolShim.observable]().subscribe(subscriber); - } else { - return ish[SymbolShim_1.SymbolShim.observable]().subscribe(new observeOn_1.ObserveOnSubscriber(subscriber, scheduler, 0)); - } - }; - return FromObservable; - }(Observable_1.Observable)); - exports.FromObservable = FromObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/scheduler/AsapScheduler", ["rxjs/scheduler/AsapAction", "rxjs/scheduler/QueueScheduler"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var AsapAction_1 = require("rxjs/scheduler/AsapAction"); - var QueueScheduler_1 = require("rxjs/scheduler/QueueScheduler"); - var AsapScheduler = (function(_super) { - __extends(AsapScheduler, _super); - function AsapScheduler() { - _super.apply(this, arguments); - } - AsapScheduler.prototype.scheduleNow = function(work, state) { - return new AsapAction_1.AsapAction(this, work).schedule(state); - }; - return AsapScheduler; - }(QueueScheduler_1.QueueScheduler)); - exports.AsapScheduler = AsapScheduler; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/never", ["rxjs/Observable", "rxjs/observable/NeverObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var NeverObservable_1 = require("rxjs/observable/NeverObservable"); - Observable_1.Observable.never = NeverObservable_1.NeverObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/timer", ["rxjs/Observable", "rxjs/observable/TimerObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var TimerObservable_1 = require("rxjs/observable/TimerObservable"); - Observable_1.Observable.timer = TimerObservable_1.TimerObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/publishReplay", ["rxjs/subject/ReplaySubject", "rxjs/operator/multicast"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var ReplaySubject_1 = require("rxjs/subject/ReplaySubject"); - var multicast_1 = require("rxjs/operator/multicast"); - function publishReplay(bufferSize, windowTime, scheduler) { - if (bufferSize === void 0) { - bufferSize = Number.POSITIVE_INFINITY; - } - if (windowTime === void 0) { - windowTime = Number.POSITIVE_INFINITY; - } - return multicast_1.multicast.call(this, new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler)); - } - exports.publishReplay = publishReplay; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/concatMap", ["rxjs/Observable", "rxjs/operator/concatMap"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var concatMap_1 = require("rxjs/operator/concatMap"); - Observable_1.Observable.prototype.concatMap = concatMap_1.concatMap; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/concatMapTo", ["rxjs/Observable", "rxjs/operator/concatMapTo"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var concatMapTo_1 = require("rxjs/operator/concatMapTo"); - Observable_1.Observable.prototype.concatMapTo = concatMapTo_1.concatMapTo; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/first", ["rxjs/Observable", "rxjs/operator/first"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var first_1 = require("rxjs/operator/first"); - Observable_1.Observable.prototype.first = first_1.first; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/groupBy", ["rxjs/Subscriber", "rxjs/Subscription", "rxjs/Observable", "rxjs/Operator", "rxjs/Subject", "rxjs/util/Map", "rxjs/util/FastMap"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Subscriber_1 = require("rxjs/Subscriber"); - var Subscription_1 = require("rxjs/Subscription"); - var Observable_1 = require("rxjs/Observable"); - var Operator_1 = require("rxjs/Operator"); - var Subject_1 = require("rxjs/Subject"); - var Map_1 = require("rxjs/util/Map"); - var FastMap_1 = require("rxjs/util/FastMap"); - function groupBy(keySelector, elementSelector, durationSelector) { - return this.lift(new GroupByOperator(this, keySelector, elementSelector, durationSelector)); - } - exports.groupBy = groupBy; - var GroupByOperator = (function(_super) { - __extends(GroupByOperator, _super); - function GroupByOperator(source, keySelector, elementSelector, durationSelector) { - _super.call(this); - this.source = source; - this.keySelector = keySelector; - this.elementSelector = elementSelector; - this.durationSelector = durationSelector; - } - GroupByOperator.prototype.call = function(subscriber) { - return new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector); - }; - return GroupByOperator; - }(Operator_1.Operator)); - var GroupBySubscriber = (function(_super) { - __extends(GroupBySubscriber, _super); - function GroupBySubscriber(destination, keySelector, elementSelector, durationSelector) { - _super.call(this); - this.keySelector = keySelector; - this.elementSelector = elementSelector; - this.durationSelector = durationSelector; - this.groups = null; - this.attemptedToUnsubscribe = false; - this.count = 0; - this.destination = destination; - this.add(destination); - } - GroupBySubscriber.prototype._next = function(value) { - var key; - try { - key = this.keySelector(value); - } catch (err) { - this.error(err); - return ; - } - this._group(value, key); - }; - GroupBySubscriber.prototype._group = function(value, key) { - var groups = this.groups; - if (!groups) { - groups = this.groups = typeof key === 'string' ? new FastMap_1.FastMap() : new Map_1.Map(); - } - var group = groups.get(key); - if (!group) { - groups.set(key, group = new Subject_1.Subject()); - var groupedObservable = new GroupedObservable(key, group, this); - if (this.durationSelector) { - this._selectDuration(key, group); - } - this.destination.next(groupedObservable); - } - if (this.elementSelector) { - this._selectElement(value, group); - } else { - this.tryGroupNext(value, group); - } - }; - GroupBySubscriber.prototype._selectElement = function(value, group) { - var result; - try { - result = this.elementSelector(value); - } catch (err) { - this.error(err); - return ; - } - this.tryGroupNext(result, group); - }; - GroupBySubscriber.prototype._selectDuration = function(key, group) { - var duration; - try { - duration = this.durationSelector(new GroupedObservable(key, group)); - } catch (err) { - this.error(err); - return ; - } - this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this))); - }; - GroupBySubscriber.prototype.tryGroupNext = function(value, group) { - if (!group.isUnsubscribed) { - group.next(value); - } - }; - GroupBySubscriber.prototype._error = function(err) { - var groups = this.groups; - if (groups) { - groups.forEach(function(group, key) { - group.error(err); - }); - groups.clear(); - } - this.destination.error(err); - }; - GroupBySubscriber.prototype._complete = function() { - var groups = this.groups; - if (groups) { - groups.forEach(function(group, key) { - group.complete(); - }); - groups.clear(); - } - this.destination.complete(); - }; - GroupBySubscriber.prototype.removeGroup = function(key) { - this.groups.delete(key); - }; - GroupBySubscriber.prototype.unsubscribe = function() { - if (!this.isUnsubscribed && !this.attemptedToUnsubscribe) { - this.attemptedToUnsubscribe = true; - if (this.count === 0) { - _super.prototype.unsubscribe.call(this); - } - } - }; - return GroupBySubscriber; - }(Subscriber_1.Subscriber)); - var GroupDurationSubscriber = (function(_super) { - __extends(GroupDurationSubscriber, _super); - function GroupDurationSubscriber(key, group, parent) { - _super.call(this); - this.key = key; - this.group = group; - this.parent = parent; - } - GroupDurationSubscriber.prototype._next = function(value) { - this.tryComplete(); - }; - GroupDurationSubscriber.prototype._error = function(err) { - this.tryError(err); - }; - GroupDurationSubscriber.prototype._complete = function() { - this.tryComplete(); - }; - GroupDurationSubscriber.prototype.tryError = function(err) { - var group = this.group; - if (!group.isUnsubscribed) { - group.error(err); - } - this.parent.removeGroup(this.key); - }; - GroupDurationSubscriber.prototype.tryComplete = function() { - var group = this.group; - if (!group.isUnsubscribed) { - group.complete(); - } - this.parent.removeGroup(this.key); - }; - return GroupDurationSubscriber; - }(Subscriber_1.Subscriber)); - var GroupedObservable = (function(_super) { - __extends(GroupedObservable, _super); - function GroupedObservable(key, groupSubject, refCountSubscription) { - _super.call(this); - this.key = key; - this.groupSubject = groupSubject; - this.refCountSubscription = refCountSubscription; - } - GroupedObservable.prototype._subscribe = function(subscriber) { - var subscription = new Subscription_1.Subscription(); - var _a = this, - refCountSubscription = _a.refCountSubscription, - groupSubject = _a.groupSubject; - if (refCountSubscription && !refCountSubscription.isUnsubscribed) { - subscription.add(new InnerRefCountSubscription(refCountSubscription)); - } - subscription.add(groupSubject.subscribe(subscriber)); - return subscription; - }; - return GroupedObservable; - }(Observable_1.Observable)); - exports.GroupedObservable = GroupedObservable; - var InnerRefCountSubscription = (function(_super) { - __extends(InnerRefCountSubscription, _super); - function InnerRefCountSubscription(parent) { - _super.call(this); - this.parent = parent; - parent.count++; - } - InnerRefCountSubscription.prototype.unsubscribe = function() { - var parent = this.parent; - if (!parent.isUnsubscribed && !this.isUnsubscribed) { - _super.prototype.unsubscribe.call(this); - parent.count -= 1; - if (parent.count === 0 && parent.attemptedToUnsubscribe) { - parent.unsubscribe(); - } - } - }; - return InnerRefCountSubscription; - }(Subscription_1.Subscription)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/partition", ["rxjs/Observable", "rxjs/operator/partition"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var partition_1 = require("rxjs/operator/partition"); - Observable_1.Observable.prototype.partition = partition_1.partition; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/publishBehavior", ["rxjs/Observable", "rxjs/operator/publishBehavior"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var publishBehavior_1 = require("rxjs/operator/publishBehavior"); - Observable_1.Observable.prototype.publishBehavior = publishBehavior_1.publishBehavior; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/subscribeOn", ["rxjs/Observable", "rxjs/operator/subscribeOn"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var subscribeOn_1 = require("rxjs/operator/subscribeOn"); - Observable_1.Observable.prototype.subscribeOn = subscribeOn_1.subscribeOn; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/take", ["rxjs/Observable", "rxjs/operator/take"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var take_1 = require("rxjs/operator/take"); - Observable_1.Observable.prototype.take = take_1.take; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/Subscriber", ["rxjs/util/isFunction", "rxjs/Subscription", "rxjs/symbol/rxSubscriber", "rxjs/Observer"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var isFunction_1 = require("rxjs/util/isFunction"); - var Subscription_1 = require("rxjs/Subscription"); - var rxSubscriber_1 = require("rxjs/symbol/rxSubscriber"); - var Observer_1 = require("rxjs/Observer"); - var Subscriber = (function(_super) { - __extends(Subscriber, _super); - function Subscriber(destinationOrNext, error, complete) { - _super.call(this); - this.syncErrorValue = null; - this.syncErrorThrown = false; - this.syncErrorThrowable = false; - this.isStopped = false; - switch (arguments.length) { - case 0: - this.destination = Observer_1.empty; - break; - case 1: - if (!destinationOrNext) { - this.destination = Observer_1.empty; - break; - } - if (typeof destinationOrNext === 'object') { - if (destinationOrNext instanceof Subscriber) { - this.destination = destinationOrNext; - } else { - this.syncErrorThrowable = true; - this.destination = new SafeSubscriber(this, destinationOrNext); - } - break; - } - default: - this.syncErrorThrowable = true; - this.destination = new SafeSubscriber(this, destinationOrNext, error, complete); - break; - } - } - Subscriber.create = function(next, error, complete) { - var subscriber = new Subscriber(next, error, complete); - subscriber.syncErrorThrowable = false; - return subscriber; - }; - Subscriber.prototype.next = function(value) { - if (!this.isStopped) { - this._next(value); - } - }; - Subscriber.prototype.error = function(err) { - if (!this.isStopped) { - this.isStopped = true; - this._error(err); - } - }; - Subscriber.prototype.complete = function() { - if (!this.isStopped) { - this.isStopped = true; - this._complete(); - } - }; - Subscriber.prototype.unsubscribe = function() { - if (this.isUnsubscribed) { - return ; - } - this.isStopped = true; - _super.prototype.unsubscribe.call(this); - }; - Subscriber.prototype._next = function(value) { - this.destination.next(value); - }; - Subscriber.prototype._error = function(err) { - this.destination.error(err); - this.unsubscribe(); - }; - Subscriber.prototype._complete = function() { - this.destination.complete(); - this.unsubscribe(); - }; - Subscriber.prototype[rxSubscriber_1.rxSubscriber] = function() { - return this; - }; - return Subscriber; - }(Subscription_1.Subscription)); - exports.Subscriber = Subscriber; - var SafeSubscriber = (function(_super) { - __extends(SafeSubscriber, _super); - function SafeSubscriber(_parent, observerOrNext, error, complete) { - _super.call(this); - this._parent = _parent; - var next; - var context = this; - if (isFunction_1.isFunction(observerOrNext)) { - next = observerOrNext; - } else if (observerOrNext) { - context = observerOrNext; - next = observerOrNext.next; - error = observerOrNext.error; - complete = observerOrNext.complete; - } - this._context = context; - this._next = next; - this._error = error; - this._complete = complete; - } - SafeSubscriber.prototype.next = function(value) { - if (!this.isStopped && this._next) { - var _parent = this._parent; - if (!_parent.syncErrorThrowable) { - this.__tryOrUnsub(this._next, value); - } else if (this.__tryOrSetError(_parent, this._next, value)) { - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.error = function(err) { - if (!this.isStopped) { - var _parent = this._parent; - if (this._error) { - if (!_parent.syncErrorThrowable) { - this.__tryOrUnsub(this._error, err); - this.unsubscribe(); - } else { - this.__tryOrSetError(_parent, this._error, err); - this.unsubscribe(); - } - } else if (!_parent.syncErrorThrowable) { - this.unsubscribe(); - throw err; - } else { - _parent.syncErrorValue = err; - _parent.syncErrorThrown = true; - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.complete = function() { - if (!this.isStopped) { - var _parent = this._parent; - if (this._complete) { - if (!_parent.syncErrorThrowable) { - this.__tryOrUnsub(this._complete); - this.unsubscribe(); - } else { - this.__tryOrSetError(_parent, this._complete); - this.unsubscribe(); - } - } else { - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.__tryOrUnsub = function(fn, value) { - try { - fn.call(this._context, value); - } catch (err) { - this.unsubscribe(); - throw err; - } - }; - SafeSubscriber.prototype.__tryOrSetError = function(parent, fn, value) { - try { - fn.call(this._context, value); - } catch (err) { - parent.syncErrorValue = err; - parent.syncErrorThrown = true; - return true; - } - return false; - }; - SafeSubscriber.prototype._unsubscribe = function() { - var _parent = this._parent; - this._context = null; - this._parent = null; - _parent.unsubscribe(); - }; - return SafeSubscriber; - }(Subscriber)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/combineLatest", ["rxjs/Observable", "rxjs/operator/combineLatest"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var combineLatest_1 = require("rxjs/operator/combineLatest"); - Observable_1.Observable.combineLatest = combineLatest_1.combineLatestStatic; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/from", ["rxjs/Observable", "rxjs/observable/FromObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var FromObservable_1 = require("rxjs/observable/FromObservable"); - Observable_1.Observable.from = FromObservable_1.FromObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/scheduler/asap", ["rxjs/scheduler/AsapScheduler"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var AsapScheduler_1 = require("rxjs/scheduler/AsapScheduler"); - exports.asap = new AsapScheduler_1.AsapScheduler(); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/operator/cache", ["rxjs/operator/publishReplay"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var publishReplay_1 = require("rxjs/operator/publishReplay"); - function cache(bufferSize, windowTime, scheduler) { - if (bufferSize === void 0) { - bufferSize = Number.POSITIVE_INFINITY; - } - if (windowTime === void 0) { - windowTime = Number.POSITIVE_INFINITY; - } - return publishReplay_1.publishReplay.call(this, bufferSize, windowTime, scheduler).refCount(); - } - exports.cache = cache; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/groupBy", ["rxjs/Observable", "rxjs/operator/groupBy"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var groupBy_1 = require("rxjs/operator/groupBy"); - Observable_1.Observable.prototype.groupBy = groupBy_1.groupBy; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/util/toSubscriber", ["rxjs/Subscriber", "rxjs/symbol/rxSubscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Subscriber_1 = require("rxjs/Subscriber"); - var rxSubscriber_1 = require("rxjs/symbol/rxSubscriber"); - function toSubscriber(nextOrObserver, error, complete) { - if (nextOrObserver && typeof nextOrObserver === 'object') { - if (nextOrObserver instanceof Subscriber_1.Subscriber) { - return nextOrObserver; - } else if (typeof nextOrObserver[rxSubscriber_1.rxSubscriber] === 'function') { - return nextOrObserver[rxSubscriber_1.rxSubscriber](); - } - } - return new Subscriber_1.Subscriber(nextOrObserver, error, complete); - } - exports.toSubscriber = toSubscriber; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/observable/IntervalObservable", ["rxjs/util/isNumeric", "rxjs/Observable", "rxjs/scheduler/asap"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var isNumeric_1 = require("rxjs/util/isNumeric"); - var Observable_1 = require("rxjs/Observable"); - var asap_1 = require("rxjs/scheduler/asap"); - var IntervalObservable = (function(_super) { - __extends(IntervalObservable, _super); - function IntervalObservable(period, scheduler) { - if (period === void 0) { - period = 0; - } - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - _super.call(this); - this.period = period; - this.scheduler = scheduler; - if (!isNumeric_1.isNumeric(period) || period < 0) { - this.period = 0; - } - if (!scheduler || typeof scheduler.schedule !== 'function') { - this.scheduler = asap_1.asap; - } - } - IntervalObservable.create = function(period, scheduler) { - if (period === void 0) { - period = 0; - } - if (scheduler === void 0) { - scheduler = asap_1.asap; - } - return new IntervalObservable(period, scheduler); - }; - IntervalObservable.dispatch = function(state) { - var index = state.index, - subscriber = state.subscriber, - period = state.period; - subscriber.next(index); - if (subscriber.isUnsubscribed) { - return ; - } - state.index += 1; - this.schedule(state, period); - }; - IntervalObservable.prototype._subscribe = function(subscriber) { - var index = 0; - var period = this.period; - var scheduler = this.scheduler; - subscriber.add(scheduler.schedule(IntervalObservable.dispatch, period, { - index: index, - subscriber: subscriber, - period: period - })); - }; - return IntervalObservable; - }(Observable_1.Observable)); - exports.IntervalObservable = IntervalObservable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/operator/cache", ["rxjs/Observable", "rxjs/operator/cache"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var cache_1 = require("rxjs/operator/cache"); - Observable_1.Observable.prototype.cache = cache_1.cache; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/Observable", ["rxjs/util/root", "rxjs/util/SymbolShim", "rxjs/util/toSubscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var root_1 = require("rxjs/util/root"); - var SymbolShim_1 = require("rxjs/util/SymbolShim"); - var toSubscriber_1 = require("rxjs/util/toSubscriber"); - var tryCatch_1 = require("rxjs/util/tryCatch"); - var errorObject_1 = require("rxjs/util/errorObject"); - var Observable = (function() { - function Observable(subscribe) { - this._isScalar = false; - if (subscribe) { - this._subscribe = subscribe; - } - } - Observable.prototype.lift = function(operator) { - var observable = new Observable(); - observable.source = this; - observable.operator = operator; - return observable; - }; - Observable.prototype.subscribe = function(observerOrNext, error, complete) { - var operator = this.operator; - var subscriber = toSubscriber_1.toSubscriber(observerOrNext, error, complete); - if (operator) { - subscriber.add(this._subscribe(operator.call(subscriber))); - } else { - subscriber.add(this._subscribe(subscriber)); - } - if (subscriber.syncErrorThrowable) { - subscriber.syncErrorThrowable = false; - if (subscriber.syncErrorThrown) { - throw subscriber.syncErrorValue; - } - } - return subscriber; - }; - Observable.prototype.forEach = function(next, thisArg, PromiseCtor) { - if (!PromiseCtor) { - if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) { - PromiseCtor = root_1.root.Rx.config.Promise; - } else if (root_1.root.Promise) { - PromiseCtor = root_1.root.Promise; - } - } - if (!PromiseCtor) { - throw new Error('no Promise impl found'); - } - var source = this; - return new PromiseCtor(function(resolve, reject) { - source.subscribe(function(value) { - var result = tryCatch_1.tryCatch(next).call(thisArg, value); - if (result === errorObject_1.errorObject) { - reject(errorObject_1.errorObject.e); - } - }, reject, resolve); - }); - }; - Observable.prototype._subscribe = function(subscriber) { - return this.source.subscribe(subscriber); - }; - Observable.prototype[SymbolShim_1.SymbolShim.observable] = function() { - return this; - }; - Observable.create = function(subscribe) { - return new Observable(subscribe); - }; - return Observable; - }()); - exports.Observable = Observable; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/add/observable/interval", ["rxjs/Observable", "rxjs/observable/IntervalObservable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Observable_1 = require("rxjs/Observable"); - var IntervalObservable_1 = require("rxjs/observable/IntervalObservable"); - Observable_1.Observable.interval = IntervalObservable_1.IntervalObservable.create; - global.define = __define; - return module.exports; -}); - -System.register("rxjs/Subject", ["rxjs/Observable", "rxjs/Subscriber", "rxjs/Subscription", "rxjs/subject/SubjectSubscription", "rxjs/symbol/rxSubscriber", "rxjs/util/throwError", "rxjs/util/ObjectUnsubscribedError"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var Observable_1 = require("rxjs/Observable"); - var Subscriber_1 = require("rxjs/Subscriber"); - var Subscription_1 = require("rxjs/Subscription"); - var SubjectSubscription_1 = require("rxjs/subject/SubjectSubscription"); - var rxSubscriber_1 = require("rxjs/symbol/rxSubscriber"); - var throwError_1 = require("rxjs/util/throwError"); - var ObjectUnsubscribedError_1 = require("rxjs/util/ObjectUnsubscribedError"); - var Subject = (function(_super) { - __extends(Subject, _super); - function Subject(destination, source) { - _super.call(this); - this.destination = destination; - this.source = source; - this.observers = []; - this.isUnsubscribed = false; - this.isStopped = false; - this.hasErrored = false; - this.dispatching = false; - this.hasCompleted = false; - } - Subject.prototype.lift = function(operator) { - var subject = new Subject(this.destination || this, this); - subject.operator = operator; - return subject; - }; - Subject.prototype.add = function(subscription) { - Subscription_1.Subscription.prototype.add.call(this, subscription); - }; - Subject.prototype.remove = function(subscription) { - Subscription_1.Subscription.prototype.remove.call(this, subscription); - }; - Subject.prototype.unsubscribe = function() { - Subscription_1.Subscription.prototype.unsubscribe.call(this); - }; - Subject.prototype._subscribe = function(subscriber) { - if (this.source) { - return this.source.subscribe(subscriber); - } else { - if (subscriber.isUnsubscribed) { - return ; - } else if (this.hasErrored) { - return subscriber.error(this.errorValue); - } else if (this.hasCompleted) { - return subscriber.complete(); - } - this.throwIfUnsubscribed(); - var subscription = new SubjectSubscription_1.SubjectSubscription(this, subscriber); - this.observers.push(subscriber); - return subscription; - } - }; - Subject.prototype._unsubscribe = function() { - this.source = null; - this.isStopped = true; - this.observers = null; - this.destination = null; - }; - Subject.prototype.next = function(value) { - this.throwIfUnsubscribed(); - if (this.isStopped) { - return ; - } - this.dispatching = true; - this._next(value); - this.dispatching = false; - if (this.hasErrored) { - this._error(this.errorValue); - } else if (this.hasCompleted) { - this._complete(); - } - }; - Subject.prototype.error = function(err) { - this.throwIfUnsubscribed(); - if (this.isStopped) { - return ; - } - this.isStopped = true; - this.hasErrored = true; - this.errorValue = err; - if (this.dispatching) { - return ; - } - this._error(err); - }; - Subject.prototype.complete = function() { - this.throwIfUnsubscribed(); - if (this.isStopped) { - return ; - } - this.isStopped = true; - this.hasCompleted = true; - if (this.dispatching) { - return ; - } - this._complete(); - }; - Subject.prototype.asObservable = function() { - var observable = new SubjectObservable(this); - return observable; - }; - Subject.prototype._next = function(value) { - if (this.destination) { - this.destination.next(value); - } else { - this._finalNext(value); - } - }; - Subject.prototype._finalNext = function(value) { - var index = -1; - var observers = this.observers.slice(0); - var len = observers.length; - while (++index < len) { - observers[index].next(value); - } - }; - Subject.prototype._error = function(err) { - if (this.destination) { - this.destination.error(err); - } else { - this._finalError(err); - } - }; - Subject.prototype._finalError = function(err) { - var index = -1; - var observers = this.observers; - this.observers = null; - this.isUnsubscribed = true; - if (observers) { - var len = observers.length; - while (++index < len) { - observers[index].error(err); - } - } - this.isUnsubscribed = false; - this.unsubscribe(); - }; - Subject.prototype._complete = function() { - if (this.destination) { - this.destination.complete(); - } else { - this._finalComplete(); - } - }; - Subject.prototype._finalComplete = function() { - var index = -1; - var observers = this.observers; - this.observers = null; - this.isUnsubscribed = true; - if (observers) { - var len = observers.length; - while (++index < len) { - observers[index].complete(); - } - } - this.isUnsubscribed = false; - this.unsubscribe(); - }; - Subject.prototype.throwIfUnsubscribed = function() { - if (this.isUnsubscribed) { - throwError_1.throwError(new ObjectUnsubscribedError_1.ObjectUnsubscribedError()); - } - }; - Subject.prototype[rxSubscriber_1.rxSubscriber] = function() { - return new Subscriber_1.Subscriber(this); - }; - Subject.create = function(destination, source) { - return new Subject(destination, source); - }; - return Subject; - }(Observable_1.Observable)); - exports.Subject = Subject; - var SubjectObservable = (function(_super) { - __extends(SubjectObservable, _super); - function SubjectObservable(source) { - _super.call(this); - this.source = source; - } - return SubjectObservable; - }(Observable_1.Observable)); - global.define = __define; - return module.exports; -}); - -System.register("rxjs/Rx", ["rxjs/Subject", "rxjs/Observable", "rxjs/add/observable/combineLatest", "rxjs/add/observable/concat", "rxjs/add/observable/merge", "rxjs/add/observable/race", "rxjs/add/observable/bindCallback", "rxjs/add/observable/bindNodeCallback", "rxjs/add/observable/defer", "rxjs/add/observable/empty", "rxjs/add/observable/forkJoin", "rxjs/add/observable/from", "rxjs/add/observable/fromArray", "rxjs/add/observable/fromEvent", "rxjs/add/observable/fromEventPattern", "rxjs/add/observable/fromPromise", "rxjs/add/observable/interval", "rxjs/add/observable/never", "rxjs/add/observable/range", "rxjs/add/observable/throw", "rxjs/add/observable/timer", "rxjs/add/observable/zip", "rxjs/add/operator/buffer", "rxjs/add/operator/bufferCount", "rxjs/add/operator/bufferTime", "rxjs/add/operator/bufferToggle", "rxjs/add/operator/bufferWhen", "rxjs/add/operator/cache", "rxjs/add/operator/catch", "rxjs/add/operator/combineAll", "rxjs/add/operator/combineLatest", "rxjs/add/operator/concat", "rxjs/add/operator/concatAll", "rxjs/add/operator/concatMap", "rxjs/add/operator/concatMapTo", "rxjs/add/operator/count", "rxjs/add/operator/dematerialize", "rxjs/add/operator/debounce", "rxjs/add/operator/debounceTime", "rxjs/add/operator/defaultIfEmpty", "rxjs/add/operator/delay", "rxjs/add/operator/delayWhen", "rxjs/add/operator/distinctUntilChanged", "rxjs/add/operator/do", "rxjs/add/operator/expand", "rxjs/add/operator/filter", "rxjs/add/operator/finally", "rxjs/add/operator/first", "rxjs/add/operator/groupBy", "rxjs/add/operator/ignoreElements", "rxjs/add/operator/inspect", "rxjs/add/operator/inspectTime", "rxjs/add/operator/every", "rxjs/add/operator/last", "rxjs/add/operator/let", "rxjs/add/operator/map", "rxjs/add/operator/mapTo", "rxjs/add/operator/materialize", "rxjs/add/operator/merge", "rxjs/add/operator/mergeAll", "rxjs/add/operator/mergeMap", "rxjs/add/operator/mergeMapTo", "rxjs/add/operator/multicast", "rxjs/add/operator/observeOn", "rxjs/add/operator/partition", "rxjs/add/operator/pluck", "rxjs/add/operator/publish", "rxjs/add/operator/publishBehavior", "rxjs/add/operator/publishReplay", "rxjs/add/operator/publishLast", "rxjs/add/operator/race", "rxjs/add/operator/reduce", "rxjs/add/operator/repeat", "rxjs/add/operator/retry", "rxjs/add/operator/retryWhen", "rxjs/add/operator/sample", "rxjs/add/operator/sampleTime", "rxjs/add/operator/scan", "rxjs/add/operator/share", "rxjs/add/operator/single", "rxjs/add/operator/skip", "rxjs/add/operator/skipUntil", "rxjs/add/operator/skipWhile", "rxjs/add/operator/startWith", "rxjs/add/operator/subscribeOn", "rxjs/add/operator/switch", "rxjs/add/operator/switchMap", "rxjs/add/operator/switchMapTo", "rxjs/add/operator/take", "rxjs/add/operator/takeLast", "rxjs/add/operator/takeUntil", "rxjs/add/operator/takeWhile", "rxjs/add/operator/throttle", "rxjs/add/operator/throttleTime", "rxjs/add/operator/timeout", "rxjs/add/operator/timeoutWith", "rxjs/add/operator/toArray", "rxjs/add/operator/toPromise", "rxjs/add/operator/window", "rxjs/add/operator/windowCount", "rxjs/add/operator/windowTime", "rxjs/add/operator/windowToggle", "rxjs/add/operator/windowWhen", "rxjs/add/operator/withLatestFrom", "rxjs/add/operator/zip", "rxjs/add/operator/zipAll", "rxjs/Operator", "rxjs/Subscription", "rxjs/Subscriber", "rxjs/subject/AsyncSubject", "rxjs/subject/ReplaySubject", "rxjs/subject/BehaviorSubject", "rxjs/observable/ConnectableObservable", "rxjs/Notification", "rxjs/util/EmptyError", "rxjs/util/ArgumentOutOfRangeError", "rxjs/util/ObjectUnsubscribedError", "rxjs/scheduler/asap", "rxjs/scheduler/queue", "rxjs/symbol/rxSubscriber"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Subject_1 = require("rxjs/Subject"); - exports.Subject = Subject_1.Subject; - var Observable_1 = require("rxjs/Observable"); - exports.Observable = Observable_1.Observable; - require("rxjs/add/observable/combineLatest"); - require("rxjs/add/observable/concat"); - require("rxjs/add/observable/merge"); - require("rxjs/add/observable/race"); - require("rxjs/add/observable/bindCallback"); - require("rxjs/add/observable/bindNodeCallback"); - require("rxjs/add/observable/defer"); - require("rxjs/add/observable/empty"); - require("rxjs/add/observable/forkJoin"); - require("rxjs/add/observable/from"); - require("rxjs/add/observable/fromArray"); - require("rxjs/add/observable/fromEvent"); - require("rxjs/add/observable/fromEventPattern"); - require("rxjs/add/observable/fromPromise"); - require("rxjs/add/observable/interval"); - require("rxjs/add/observable/never"); - require("rxjs/add/observable/range"); - require("rxjs/add/observable/throw"); - require("rxjs/add/observable/timer"); - require("rxjs/add/observable/zip"); - require("rxjs/add/operator/buffer"); - require("rxjs/add/operator/bufferCount"); - require("rxjs/add/operator/bufferTime"); - require("rxjs/add/operator/bufferToggle"); - require("rxjs/add/operator/bufferWhen"); - require("rxjs/add/operator/cache"); - require("rxjs/add/operator/catch"); - require("rxjs/add/operator/combineAll"); - require("rxjs/add/operator/combineLatest"); - require("rxjs/add/operator/concat"); - require("rxjs/add/operator/concatAll"); - require("rxjs/add/operator/concatMap"); - require("rxjs/add/operator/concatMapTo"); - require("rxjs/add/operator/count"); - require("rxjs/add/operator/dematerialize"); - require("rxjs/add/operator/debounce"); - require("rxjs/add/operator/debounceTime"); - require("rxjs/add/operator/defaultIfEmpty"); - require("rxjs/add/operator/delay"); - require("rxjs/add/operator/delayWhen"); - require("rxjs/add/operator/distinctUntilChanged"); - require("rxjs/add/operator/do"); - require("rxjs/add/operator/expand"); - require("rxjs/add/operator/filter"); - require("rxjs/add/operator/finally"); - require("rxjs/add/operator/first"); - require("rxjs/add/operator/groupBy"); - require("rxjs/add/operator/ignoreElements"); - require("rxjs/add/operator/inspect"); - require("rxjs/add/operator/inspectTime"); - require("rxjs/add/operator/every"); - require("rxjs/add/operator/last"); - require("rxjs/add/operator/let"); - require("rxjs/add/operator/map"); - require("rxjs/add/operator/mapTo"); - require("rxjs/add/operator/materialize"); - require("rxjs/add/operator/merge"); - require("rxjs/add/operator/mergeAll"); - require("rxjs/add/operator/mergeMap"); - require("rxjs/add/operator/mergeMapTo"); - require("rxjs/add/operator/multicast"); - require("rxjs/add/operator/observeOn"); - require("rxjs/add/operator/partition"); - require("rxjs/add/operator/pluck"); - require("rxjs/add/operator/publish"); - require("rxjs/add/operator/publishBehavior"); - require("rxjs/add/operator/publishReplay"); - require("rxjs/add/operator/publishLast"); - require("rxjs/add/operator/race"); - require("rxjs/add/operator/reduce"); - require("rxjs/add/operator/repeat"); - require("rxjs/add/operator/retry"); - require("rxjs/add/operator/retryWhen"); - require("rxjs/add/operator/sample"); - require("rxjs/add/operator/sampleTime"); - require("rxjs/add/operator/scan"); - require("rxjs/add/operator/share"); - require("rxjs/add/operator/single"); - require("rxjs/add/operator/skip"); - require("rxjs/add/operator/skipUntil"); - require("rxjs/add/operator/skipWhile"); - require("rxjs/add/operator/startWith"); - require("rxjs/add/operator/subscribeOn"); - require("rxjs/add/operator/switch"); - require("rxjs/add/operator/switchMap"); - require("rxjs/add/operator/switchMapTo"); - require("rxjs/add/operator/take"); - require("rxjs/add/operator/takeLast"); - require("rxjs/add/operator/takeUntil"); - require("rxjs/add/operator/takeWhile"); - require("rxjs/add/operator/throttle"); - require("rxjs/add/operator/throttleTime"); - require("rxjs/add/operator/timeout"); - require("rxjs/add/operator/timeoutWith"); - require("rxjs/add/operator/toArray"); - require("rxjs/add/operator/toPromise"); - require("rxjs/add/operator/window"); - require("rxjs/add/operator/windowCount"); - require("rxjs/add/operator/windowTime"); - require("rxjs/add/operator/windowToggle"); - require("rxjs/add/operator/windowWhen"); - require("rxjs/add/operator/withLatestFrom"); - require("rxjs/add/operator/zip"); - require("rxjs/add/operator/zipAll"); - var Operator_1 = require("rxjs/Operator"); - exports.Operator = Operator_1.Operator; - var Subscription_1 = require("rxjs/Subscription"); - exports.Subscription = Subscription_1.Subscription; - exports.UnsubscriptionError = Subscription_1.UnsubscriptionError; - var Subscriber_1 = require("rxjs/Subscriber"); - exports.Subscriber = Subscriber_1.Subscriber; - var AsyncSubject_1 = require("rxjs/subject/AsyncSubject"); - exports.AsyncSubject = AsyncSubject_1.AsyncSubject; - var ReplaySubject_1 = require("rxjs/subject/ReplaySubject"); - exports.ReplaySubject = ReplaySubject_1.ReplaySubject; - var BehaviorSubject_1 = require("rxjs/subject/BehaviorSubject"); - exports.BehaviorSubject = BehaviorSubject_1.BehaviorSubject; - var ConnectableObservable_1 = require("rxjs/observable/ConnectableObservable"); - exports.ConnectableObservable = ConnectableObservable_1.ConnectableObservable; - var Notification_1 = require("rxjs/Notification"); - exports.Notification = Notification_1.Notification; - var EmptyError_1 = require("rxjs/util/EmptyError"); - exports.EmptyError = EmptyError_1.EmptyError; - var ArgumentOutOfRangeError_1 = require("rxjs/util/ArgumentOutOfRangeError"); - exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError_1.ArgumentOutOfRangeError; - var ObjectUnsubscribedError_1 = require("rxjs/util/ObjectUnsubscribedError"); - exports.ObjectUnsubscribedError = ObjectUnsubscribedError_1.ObjectUnsubscribedError; - var asap_1 = require("rxjs/scheduler/asap"); - var queue_1 = require("rxjs/scheduler/queue"); - var rxSubscriber_1 = require("rxjs/symbol/rxSubscriber"); - var Scheduler = { - asap: asap_1.asap, - queue: queue_1.queue - }; - exports.Scheduler = Scheduler; - var Symbol = {rxSubscriber: rxSubscriber_1.rxSubscriber}; - exports.Symbol = Symbol; - global.define = __define; - return module.exports; -}); - diff --git a/demo-shell-ng2/dist/lib/angular2-polyfills.js b/demo-shell-ng2/dist/lib/angular2-polyfills.js deleted file mode 100644 index 8af3125876..0000000000 --- a/demo-shell-ng2/dist/lib/angular2-polyfills.js +++ /dev/null @@ -1,2491 +0,0 @@ -/** - @license -The MIT License - -Copyright (c) 2016 Google, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - */ - -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(global) {"use strict"; - __webpack_require__(1); - var event_target_1 = __webpack_require__(2); - var define_property_1 = __webpack_require__(4); - var register_element_1 = __webpack_require__(5); - var property_descriptor_1 = __webpack_require__(6); - var utils_1 = __webpack_require__(3); - var set = 'set'; - var clear = 'clear'; - var blockingMethods = ['alert', 'prompt', 'confirm']; - var _global = typeof window == 'undefined' ? global : window; - patchTimer(_global, set, clear, 'Timeout'); - patchTimer(_global, set, clear, 'Interval'); - patchTimer(_global, set, clear, 'Immediate'); - patchTimer(_global, 'request', 'cancelMacroTask', 'AnimationFrame'); - patchTimer(_global, 'mozRequest', 'mozCancel', 'AnimationFrame'); - patchTimer(_global, 'webkitRequest', 'webkitCancel', 'AnimationFrame'); - for (var i = 0; i < blockingMethods.length; i++) { - var name = blockingMethods[i]; - utils_1.patchMethod(_global, name, function (delegate, symbol, name) { - return function (s, args) { - return Zone.current.run(delegate, _global, args, name); - }; - }); - } - event_target_1.eventTargetPatch(_global); - property_descriptor_1.propertyDescriptorPatch(_global); - utils_1.patchClass('MutationObserver'); - utils_1.patchClass('WebKitMutationObserver'); - utils_1.patchClass('FileReader'); - define_property_1.propertyPatch(); - register_element_1.registerElementPatch(_global); - // Treat XMLHTTPRequest as a macrotask. - patchXHR(_global); - var XHR_TASK = utils_1.zoneSymbol('xhrTask'); - function patchXHR(window) { - function findPendingTask(target) { - var pendingTask = target[XHR_TASK]; - return pendingTask; - } - function scheduleTask(task) { - var data = task.data; - data.target.addEventListener('readystatechange', function () { - if (data.target.readyState === XMLHttpRequest.DONE) { - if (!data.aborted) { - task.invoke(); - } - } - }); - var storedTask = data.target[XHR_TASK]; - if (!storedTask) { - data.target[XHR_TASK] = task; - } - setNative.apply(data.target, data.args); - return task; - } - function placeholderCallback() { - } - function clearTask(task) { - var data = task.data; - // Note - ideally, we would call data.target.removeEventListener here, but it's too late - // to prevent it from firing. So instead, we store info for the event listener. - data.aborted = true; - return clearNative.apply(data.target, data.args); - } - var setNative = utils_1.patchMethod(window.XMLHttpRequest.prototype, 'send', function () { return function (self, args) { - var zone = Zone.current; - var options = { - target: self, - isPeriodic: false, - delay: null, - args: args, - aborted: false - }; - return zone.scheduleMacroTask('XMLHttpRequest.send', placeholderCallback, options, scheduleTask, clearTask); - }; }); - var clearNative = utils_1.patchMethod(window.XMLHttpRequest.prototype, 'abort', function (delegate) { return function (self, args) { - var task = findPendingTask(self); - if (task && typeof task.type == 'string') { - // If the XHR has already completed, do nothing. - if (task.cancelFn == null) { - return; - } - task.zone.cancelTask(task); - } - // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no task to cancel. Do nothing. - }; }); - } - /// GEO_LOCATION - if (_global['navigator'] && _global['navigator'].geolocation) { - utils_1.patchPrototype(_global['navigator'].geolocation, [ - 'getCurrentPosition', - 'watchPosition' - ]); - } - function patchTimer(window, setName, cancelName, nameSuffix) { - setName += nameSuffix; - cancelName += nameSuffix; - function scheduleTask(task) { - var data = task.data; - data.args[0] = task.invoke; - data.handleId = setNative.apply(window, data.args); - return task; - } - function clearTask(task) { - return clearNative(task.data.handleId); - } - var setNative = utils_1.patchMethod(window, setName, function (delegate) { return function (self, args) { - if (typeof args[0] === 'function') { - var zone = Zone.current; - var options = { - handleId: null, - isPeriodic: nameSuffix == 'Interval', - delay: (nameSuffix == 'Timeout' || nameSuffix == 'Interval') ? args[1] || 0 : null, - args: args - }; - return zone.scheduleMacroTask(setName, args[0], options, scheduleTask, clearTask); - } - else { - // cause an error by calling it directly. - return delegate.apply(window, args); - } - }; }); - var clearNative = utils_1.patchMethod(window, cancelName, function (delegate) { return function (self, args) { - var task = args[0]; - if (task && typeof task.type == 'string') { - if (task.cancelFn && task.data.isPeriodic || task.runCount == 0) { - // Do not cancel already canceled functions - task.zone.cancelTask(task); - } - } - else { - // cause an error by calling it directly. - delegate.apply(window, args); - } - }; }); - } - - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ }, -/* 1 */ -/***/ function(module, exports) { - - /* WEBPACK VAR INJECTION */(function(global) {; - ; - var Zone = (function (global) { - var Zone = (function () { - function Zone(parent, zoneSpec) { - this._properties = null; - this._parent = parent; - this._name = zoneSpec ? zoneSpec.name || 'unnamed' : ''; - this._properties = zoneSpec && zoneSpec.properties || {}; - this._zoneDelegate = new ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec); - } - Object.defineProperty(Zone, "current", { - get: function () { return _currentZone; }, - enumerable: true, - configurable: true - }); - ; - Object.defineProperty(Zone, "currentTask", { - get: function () { return _currentTask; }, - enumerable: true, - configurable: true - }); - ; - Object.defineProperty(Zone.prototype, "parent", { - get: function () { return this._parent; }, - enumerable: true, - configurable: true - }); - ; - Object.defineProperty(Zone.prototype, "name", { - get: function () { return this._name; }, - enumerable: true, - configurable: true - }); - ; - Zone.prototype.get = function (key) { - var current = this; - while (current) { - if (current._properties.hasOwnProperty(key)) { - return current._properties[key]; - } - current = current._parent; - } - }; - Zone.prototype.fork = function (zoneSpec) { - if (!zoneSpec) - throw new Error('ZoneSpec required!'); - return this._zoneDelegate.fork(this, zoneSpec); - }; - Zone.prototype.wrap = function (callback, source) { - if (typeof callback != 'function') { - throw new Error('Expecting function got: ' + callback); - } - var callback = this._zoneDelegate.intercept(this, callback, source); - var zone = this; - return function () { - return zone.runGuarded(callback, this, arguments, source); - }; - }; - Zone.prototype.run = function (callback, applyThis, applyArgs, source) { - if (applyThis === void 0) { applyThis = null; } - if (applyArgs === void 0) { applyArgs = null; } - if (source === void 0) { source = null; } - var oldZone = _currentZone; - _currentZone = this; - try { - return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source); - } - finally { - _currentZone = oldZone; - } - }; - Zone.prototype.runGuarded = function (callback, applyThis, applyArgs, source) { - if (applyThis === void 0) { applyThis = null; } - if (applyArgs === void 0) { applyArgs = null; } - if (source === void 0) { source = null; } - var oldZone = _currentZone; - _currentZone = this; - try { - try { - return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source); - } - catch (error) { - if (this._zoneDelegate.handleError(this, error)) { - throw error; - } - } - } - finally { - _currentZone = oldZone; - } - }; - Zone.prototype.runTask = function (task, applyThis, applyArgs) { - task.runCount++; - if (task.zone != this) - throw new Error('A task can only be run in the zone which created it! (Creation: ' + - task.zone.name + '; Execution: ' + this.name + ')'); - var previousTask = _currentTask; - _currentTask = task; - var oldZone = _currentZone; - _currentZone = this; - try { - try { - return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs); - } - catch (error) { - if (this._zoneDelegate.handleError(this, error)) { - throw error; - } - } - } - finally { - if (task.type == 'macroTask' && task.data && !task.data.isPeriodic) { - task.cancelFn = null; - } - _currentZone = oldZone; - _currentTask = previousTask; - } - }; - Zone.prototype.scheduleMicroTask = function (source, callback, data, customSchedule) { - return this._zoneDelegate.scheduleTask(this, new ZoneTask('microTask', this, source, callback, data, customSchedule, null)); - }; - Zone.prototype.scheduleMacroTask = function (source, callback, data, customSchedule, customCancel) { - return this._zoneDelegate.scheduleTask(this, new ZoneTask('macroTask', this, source, callback, data, customSchedule, customCancel)); - }; - Zone.prototype.scheduleEventTask = function (source, callback, data, customSchedule, customCancel) { - return this._zoneDelegate.scheduleTask(this, new ZoneTask('eventTask', this, source, callback, data, customSchedule, customCancel)); - }; - Zone.prototype.cancelTask = function (task) { - var value = this._zoneDelegate.cancelTask(this, task); - task.runCount = -1; - task.cancelFn = null; - return value; - }; - Zone.__symbol__ = __symbol__; - return Zone; - }()); - ; - var ZoneDelegate = (function () { - function ZoneDelegate(zone, parentDelegate, zoneSpec) { - this._taskCounts = { microTask: 0, macroTask: 0, eventTask: 0 }; - this.zone = zone; - this._parentDelegate = parentDelegate; - this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS); - this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt); - this._interceptZS = zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS); - this._interceptDlgt = zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt); - this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS); - this._invokeDlgt = zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt); - this._handleErrorZS = zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS); - this._handleErrorDlgt = zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt); - this._scheduleTaskZS = zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS); - this._scheduleTaskDlgt = zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt); - this._invokeTaskZS = zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS); - this._invokeTaskDlgt = zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt); - this._cancelTaskZS = zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS); - this._cancelTaskDlgt = zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt); - this._hasTaskZS = zoneSpec && (zoneSpec.onHasTask ? zoneSpec : parentDelegate._hasTaskZS); - this._hasTaskDlgt = zoneSpec && (zoneSpec.onHasTask ? parentDelegate : parentDelegate._hasTaskDlgt); - } - ZoneDelegate.prototype.fork = function (targetZone, zoneSpec) { - return this._forkZS - ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec) - : new Zone(targetZone, zoneSpec); - }; - ZoneDelegate.prototype.intercept = function (targetZone, callback, source) { - return this._interceptZS - ? this._interceptZS.onIntercept(this._interceptDlgt, this.zone, targetZone, callback, source) - : callback; - }; - ZoneDelegate.prototype.invoke = function (targetZone, callback, applyThis, applyArgs, source) { - return this._invokeZS - ? this._invokeZS.onInvoke(this._invokeDlgt, this.zone, targetZone, callback, applyThis, applyArgs, source) - : callback.apply(applyThis, applyArgs); - }; - ZoneDelegate.prototype.handleError = function (targetZone, error) { - return this._handleErrorZS - ? this._handleErrorZS.onHandleError(this._handleErrorDlgt, this.zone, targetZone, error) - : true; - }; - ZoneDelegate.prototype.scheduleTask = function (targetZone, task) { - try { - if (this._scheduleTaskZS) { - return this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this.zone, targetZone, task); - } - else if (task.scheduleFn) { - task.scheduleFn(task); - } - else if (task.type == 'microTask') { - scheduleMicroTask(task); - } - else { - throw new Error('Task is missing scheduleFn.'); - } - return task; - } - finally { - if (targetZone == this.zone) { - this._updateTaskCount(task.type, 1); - } - } - }; - ZoneDelegate.prototype.invokeTask = function (targetZone, task, applyThis, applyArgs) { - try { - return this._invokeTaskZS - ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this.zone, targetZone, task, applyThis, applyArgs) - : task.callback.apply(applyThis, applyArgs); - } - finally { - if (targetZone == this.zone && (task.type != 'eventTask') && !(task.data && task.data.isPeriodic)) { - this._updateTaskCount(task.type, -1); - } - } - }; - ZoneDelegate.prototype.cancelTask = function (targetZone, task) { - var value; - if (this._cancelTaskZS) { - value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this.zone, targetZone, task); - } - else if (!task.cancelFn) { - throw new Error('Task does not support cancellation, or is already canceled.'); - } - else { - value = task.cancelFn(task); - } - if (targetZone == this.zone) { - // this should not be in the finally block, because exceptions assume not canceled. - this._updateTaskCount(task.type, -1); - } - return value; - }; - ZoneDelegate.prototype.hasTask = function (targetZone, isEmpty) { - return this._hasTaskZS && this._hasTaskZS.onHasTask(this._hasTaskDlgt, this.zone, targetZone, isEmpty); - }; - ZoneDelegate.prototype._updateTaskCount = function (type, count) { - var counts = this._taskCounts; - var prev = counts[type]; - var next = counts[type] = prev + count; - if (next < 0) { - throw new Error('More tasks executed then were scheduled.'); - } - if (prev == 0 || next == 0) { - var isEmpty = { - microTask: counts.microTask > 0, - macroTask: counts.macroTask > 0, - eventTask: counts.eventTask > 0, - change: type - }; - try { - this.hasTask(this.zone, isEmpty); - } - finally { - if (this._parentDelegate) { - this._parentDelegate._updateTaskCount(type, count); - } - } - } - }; - return ZoneDelegate; - }()); - var ZoneTask = (function () { - function ZoneTask(type, zone, source, callback, options, scheduleFn, cancelFn) { - this.runCount = 0; - this.type = type; - this.zone = zone; - this.source = source; - this.data = options; - this.scheduleFn = scheduleFn; - this.cancelFn = cancelFn; - this.callback = callback; - var self = this; - this.invoke = function () { - try { - return zone.runTask(self, this, arguments); - } - finally { - drainMicroTaskQueue(); - } - }; - } - return ZoneTask; - }()); - function __symbol__(name) { return '__zone_symbol__' + name; } - ; - var symbolSetTimeout = __symbol__('setTimeout'); - var symbolPromise = __symbol__('Promise'); - var symbolThen = __symbol__('then'); - var _currentZone = new Zone(null, null); - var _currentTask = null; - var _microTaskQueue = []; - var _isDrainingMicrotaskQueue = false; - var _uncaughtPromiseErrors = []; - var _drainScheduled = false; - function scheduleQueueDrain() { - if (!_drainScheduled && !_currentTask && _microTaskQueue.length == 0) { - // We are not running in Task, so we need to kickstart the microtask queue. - if (global[symbolPromise]) { - global[symbolPromise].resolve(0)[symbolThen](drainMicroTaskQueue); - } - else { - global[symbolSetTimeout](drainMicroTaskQueue, 0); - } - } - } - function scheduleMicroTask(task) { - scheduleQueueDrain(); - _microTaskQueue.push(task); - } - function consoleError(e) { - var rejection = e && e.rejection; - if (rejection) { - console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection); - } - console.error(e); - } - function drainMicroTaskQueue() { - if (!_isDrainingMicrotaskQueue) { - _isDrainingMicrotaskQueue = true; - while (_microTaskQueue.length) { - var queue = _microTaskQueue; - _microTaskQueue = []; - for (var i = 0; i < queue.length; i++) { - var task = queue[i]; - try { - task.zone.runTask(task, null, null); - } - catch (e) { - consoleError(e); - } - } - } - while (_uncaughtPromiseErrors.length) { - var uncaughtPromiseErrors = _uncaughtPromiseErrors; - _uncaughtPromiseErrors = []; - for (var i = 0; i < uncaughtPromiseErrors.length; i++) { - var uncaughtPromiseError = uncaughtPromiseErrors[i]; - try { - uncaughtPromiseError.zone.runGuarded(function () { throw uncaughtPromiseError; }); - } - catch (e) { - consoleError(e); - } - } - } - _isDrainingMicrotaskQueue = false; - _drainScheduled = false; - } - } - function isThenable(value) { - return value && value.then; - } - function forwardResolution(value) { return value; } - function forwardRejection(rejection) { return ZoneAwarePromise.reject(rejection); } - var symbolState = __symbol__('state'); - var symbolValue = __symbol__('value'); - var source = 'Promise.then'; - var UNRESOLVED = null; - var RESOLVED = true; - var REJECTED = false; - var REJECTED_NO_CATCH = 0; - function makeResolver(promise, state) { - return function (v) { - resolvePromise(promise, state, v); - // Do not return value or you will break the Promise spec. - }; - } - function resolvePromise(promise, state, value) { - if (promise[symbolState] === UNRESOLVED) { - if (value instanceof ZoneAwarePromise && value[symbolState] !== UNRESOLVED) { - clearRejectedNoCatch(value); - resolvePromise(promise, value[symbolState], value[symbolValue]); - } - else if (isThenable(value)) { - value.then(makeResolver(promise, state), makeResolver(promise, false)); - } - else { - promise[symbolState] = state; - var queue = promise[symbolValue]; - promise[symbolValue] = value; - for (var i = 0; i < queue.length;) { - scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]); - } - if (queue.length == 0 && state == REJECTED) { - promise[symbolState] = REJECTED_NO_CATCH; - try { - throw new Error("Uncaught (in promise): " + value); - } - catch (e) { - var error = e; - error.rejection = value; - error.promise = promise; - error.zone = Zone.current; - error.task = Zone.currentTask; - _uncaughtPromiseErrors.push(error); - scheduleQueueDrain(); - } - } - } - } - // Resolving an already resolved promise is a noop. - return promise; - } - function clearRejectedNoCatch(promise) { - if (promise[symbolState] === REJECTED_NO_CATCH) { - promise[symbolState] = REJECTED; - for (var i = 0; i < _uncaughtPromiseErrors.length; i++) { - if (promise === _uncaughtPromiseErrors[i].promise) { - _uncaughtPromiseErrors.splice(i, 1); - break; - } - } - } - } - function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) { - clearRejectedNoCatch(promise); - var delegate = promise[symbolState] ? onFulfilled || forwardResolution : onRejected || forwardRejection; - zone.scheduleMicroTask(source, function () { - try { - resolvePromise(chainPromise, true, zone.run(delegate, null, [promise[symbolValue]])); - } - catch (error) { - resolvePromise(chainPromise, false, error); - } - }); - } - var ZoneAwarePromise = (function () { - function ZoneAwarePromise(executor) { - var promise = this; - promise[symbolState] = UNRESOLVED; - promise[symbolValue] = []; // queue; - try { - executor && executor(makeResolver(promise, RESOLVED), makeResolver(promise, REJECTED)); - } - catch (e) { - resolvePromise(promise, false, e); - } - } - ZoneAwarePromise.resolve = function (value) { - return resolvePromise(new this(null), RESOLVED, value); - }; - ZoneAwarePromise.reject = function (error) { - return resolvePromise(new this(null), REJECTED, error); - }; - ZoneAwarePromise.race = function (values) { - var resolve; - var reject; - var promise = new this(function (res, rej) { resolve = res; reject = rej; }); - function onResolve(value) { promise && (promise = null || resolve(value)); } - function onReject(error) { promise && (promise = null || reject(error)); } - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var value = values_1[_i]; - if (!isThenable(value)) { - value = this.resolve(value); - } - value.then(onResolve, onReject); - } - return promise; - }; - ZoneAwarePromise.all = function (values) { - var resolve; - var reject; - var promise = new this(function (res, rej) { resolve = res; reject = rej; }); - var resolvedValues = []; - var count = 0; - function onReject(error) { promise && reject(error); promise = null; } - for (var _i = 0, values_2 = values; _i < values_2.length; _i++) { - var value = values_2[_i]; - if (!isThenable(value)) { - value = this.resolve(value); - } - value.then((function (index) { return function (value) { - resolvedValues[index] = value; - count--; - if (promise && !count) { - resolve(resolvedValues); - } - promise == null; - }; })(count), onReject); - count++; - } - if (!count) - resolve(resolvedValues); - return promise; - }; - ZoneAwarePromise.prototype.then = function (onFulfilled, onRejected) { - var chainPromise = new ZoneAwarePromise(null); - var zone = Zone.current; - if (this[symbolState] == UNRESOLVED) { - this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected); - } - else { - scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected); - } - return chainPromise; - }; - ZoneAwarePromise.prototype.catch = function (onRejected) { - return this.then(null, onRejected); - }; - return ZoneAwarePromise; - }()); - var NativePromise = global[__symbol__('Promise')] = global.Promise; - global.Promise = ZoneAwarePromise; - if (NativePromise) { - var NativePromiseProtototype = NativePromise.prototype; - var NativePromiseThen = NativePromiseProtototype[__symbol__('then')] - = NativePromiseProtototype.then; - NativePromiseProtototype.then = function (onResolve, onReject) { - var nativePromise = this; - return new ZoneAwarePromise(function (resolve, reject) { - NativePromiseThen.call(nativePromise, resolve, reject); - }).then(onResolve, onReject); - }; - } - return global.Zone = Zone; - })(typeof window == 'undefined' ? global : window); - - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - var utils_1 = __webpack_require__(3); - var WTF_ISSUE_555 = 'Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video'; - var NO_EVENT_TARGET = 'ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex'.split(','); - var EVENT_TARGET = 'EventTarget'; - function eventTargetPatch(_global) { - var apis = []; - var isWtf = _global['wtf']; - if (isWtf) { - // Workaround for: https://github.com/google/tracing-framework/issues/555 - apis = WTF_ISSUE_555.split(',').map(function (v) { return 'HTML' + v + 'Element'; }).concat(NO_EVENT_TARGET); - } - else if (_global[EVENT_TARGET]) { - apis.push(EVENT_TARGET); - } - else { - // Note: EventTarget is not available in all browsers, - // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget - apis = NO_EVENT_TARGET; - } - for (var i = 0; i < apis.length; i++) { - var type = _global[apis[i]]; - utils_1.patchEventTargetMethods(type && type.prototype); - } - } - exports.eventTargetPatch = eventTargetPatch; - - -/***/ }, -/* 3 */ -/***/ function(module, exports) { - - /* WEBPACK VAR INJECTION */(function(global) {/** - * Suppress closure compiler errors about unknown 'process' variable - * @fileoverview - * @suppress {undefinedVars} - */ - "use strict"; - exports.zoneSymbol = Zone['__symbol__']; - var _global = typeof window == 'undefined' ? global : window; - function bindArguments(args, source) { - for (var i = args.length - 1; i >= 0; i--) { - if (typeof args[i] === 'function') { - args[i] = Zone.current.wrap(args[i], source + '_' + i); - } - } - return args; - } - exports.bindArguments = bindArguments; - ; - function patchPrototype(prototype, fnNames) { - var source = prototype.constructor['name']; - for (var i = 0; i < fnNames.length; i++) { - var name = fnNames[i]; - var delegate = prototype[name]; - if (delegate) { - prototype[name] = (function (delegate) { - return function () { - return delegate.apply(this, bindArguments(arguments, source + '.' + name)); - }; - })(delegate); - } - } - } - exports.patchPrototype = patchPrototype; - ; - exports.isWebWorker = (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope); - exports.isNode = (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'); - exports.isBrowser = !exports.isNode && !exports.isWebWorker && !!(window && window['HTMLElement']); - function patchProperty(obj, prop) { - var desc = Object.getOwnPropertyDescriptor(obj, prop) || { - enumerable: true, - configurable: true - }; - // A property descriptor cannot have getter/setter and be writable - // deleting the writable and value properties avoids this error: - // - // TypeError: property descriptors must not specify a value or be writable when a - // getter or setter has been specified - delete desc.writable; - delete desc.value; - // substr(2) cuz 'onclick' -> 'click', etc - var eventName = prop.substr(2); - var _prop = '_' + prop; - desc.set = function (fn) { - if (this[_prop]) { - this.removeEventListener(eventName, this[_prop]); - } - if (typeof fn === 'function') { - var wrapFn = function (event) { - var result; - result = fn.apply(this, arguments); - if (result != undefined && !result) - event.preventDefault(); - }; - this[_prop] = wrapFn; - this.addEventListener(eventName, wrapFn, false); - } - else { - this[_prop] = null; - } - }; - desc.get = function () { - return this[_prop]; - }; - Object.defineProperty(obj, prop, desc); - } - exports.patchProperty = patchProperty; - ; - function patchOnProperties(obj, properties) { - var onProperties = []; - for (var prop in obj) { - if (prop.substr(0, 2) == 'on') { - onProperties.push(prop); - } - } - for (var j = 0; j < onProperties.length; j++) { - patchProperty(obj, onProperties[j]); - } - if (properties) { - for (var i = 0; i < properties.length; i++) { - patchProperty(obj, 'on' + properties[i]); - } - } - } - exports.patchOnProperties = patchOnProperties; - ; - var EVENT_TASKS = exports.zoneSymbol('eventTasks'); - var ADD_EVENT_LISTENER = 'addEventListener'; - var REMOVE_EVENT_LISTENER = 'removeEventListener'; - var SYMBOL_ADD_EVENT_LISTENER = exports.zoneSymbol(ADD_EVENT_LISTENER); - var SYMBOL_REMOVE_EVENT_LISTENER = exports.zoneSymbol(REMOVE_EVENT_LISTENER); - function findExistingRegisteredTask(target, handler, name, capture, remove) { - var eventTasks = target[EVENT_TASKS]; - if (eventTasks) { - for (var i = 0; i < eventTasks.length; i++) { - var eventTask = eventTasks[i]; - var data = eventTask.data; - if (data.handler === handler - && data.useCapturing === capture - && data.eventName === name) { - if (remove) { - eventTasks.splice(i, 1); - } - return eventTask; - } - } - } - return null; - } - function attachRegisteredEvent(target, eventTask) { - var eventTasks = target[EVENT_TASKS]; - if (!eventTasks) { - eventTasks = target[EVENT_TASKS] = []; - } - eventTasks.push(eventTask); - } - function scheduleEventListener(eventTask) { - var meta = eventTask.data; - attachRegisteredEvent(meta.target, eventTask); - return meta.target[SYMBOL_ADD_EVENT_LISTENER](meta.eventName, eventTask.invoke, meta.useCapturing); - } - function cancelEventListener(eventTask) { - var meta = eventTask.data; - findExistingRegisteredTask(meta.target, eventTask.invoke, meta.eventName, meta.useCapturing, true); - meta.target[SYMBOL_REMOVE_EVENT_LISTENER](meta.eventName, eventTask.invoke, meta.useCapturing); - } - function zoneAwareAddEventListener(self, args) { - var eventName = args[0]; - var handler = args[1]; - var useCapturing = args[2] || false; - // - Inside a Web Worker, `this` is undefined, the context is `global` - // - When `addEventListener` is called on the global context in strict mode, `this` is undefined - // see https://github.com/angular/zone.js/issues/190 - var target = self || _global; - var delegate = null; - if (typeof handler == 'function') { - delegate = handler; - } - else if (handler && handler.handleEvent) { - delegate = function (event) { return handler.handleEvent(event); }; - } - // Ignore special listeners of IE11 & Edge dev tools, see https://github.com/angular/zone.js/issues/150 - if (!delegate || handler && handler.toString() === "[object FunctionWrapper]") { - return target[SYMBOL_ADD_EVENT_LISTENER](eventName, handler, useCapturing); - } - var eventTask = findExistingRegisteredTask(target, handler, eventName, useCapturing, false); - if (eventTask) { - // we already registered, so this will have noop. - return target[SYMBOL_ADD_EVENT_LISTENER](eventName, eventTask.invoke, useCapturing); - } - var zone = Zone.current; - var source = target.constructor['name'] + '.addEventListener:' + eventName; - var data = { - target: target, - eventName: eventName, - name: eventName, - useCapturing: useCapturing, - handler: handler - }; - zone.scheduleEventTask(source, delegate, data, scheduleEventListener, cancelEventListener); - } - function zoneAwareRemoveEventListener(self, args) { - var eventName = args[0]; - var handler = args[1]; - var useCapturing = args[2] || false; - // - Inside a Web Worker, `this` is undefined, the context is `global` - // - When `addEventListener` is called on the global context in strict mode, `this` is undefined - // see https://github.com/angular/zone.js/issues/190 - var target = self || _global; - var eventTask = findExistingRegisteredTask(target, handler, eventName, useCapturing, true); - if (eventTask) { - eventTask.zone.cancelTask(eventTask); - } - else { - target[SYMBOL_REMOVE_EVENT_LISTENER](eventName, handler, useCapturing); - } - } - function patchEventTargetMethods(obj) { - if (obj && obj.addEventListener) { - patchMethod(obj, ADD_EVENT_LISTENER, function () { return zoneAwareAddEventListener; }); - patchMethod(obj, REMOVE_EVENT_LISTENER, function () { return zoneAwareRemoveEventListener; }); - return true; - } - else { - return false; - } - } - exports.patchEventTargetMethods = patchEventTargetMethods; - ; - var originalInstanceKey = exports.zoneSymbol('originalInstance'); - // wrap some native API on `window` - function patchClass(className) { - var OriginalClass = _global[className]; - if (!OriginalClass) - return; - _global[className] = function () { - var a = bindArguments(arguments, className); - switch (a.length) { - case 0: - this[originalInstanceKey] = new OriginalClass(); - break; - case 1: - this[originalInstanceKey] = new OriginalClass(a[0]); - break; - case 2: - this[originalInstanceKey] = new OriginalClass(a[0], a[1]); - break; - case 3: - this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); - break; - case 4: - this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); - break; - default: throw new Error('Arg list too long.'); - } - }; - var instance = new OriginalClass(function () { }); - var prop; - for (prop in instance) { - (function (prop) { - if (typeof instance[prop] === 'function') { - _global[className].prototype[prop] = function () { - return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); - }; - } - else { - Object.defineProperty(_global[className].prototype, prop, { - set: function (fn) { - if (typeof fn === 'function') { - this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop); - } - else { - this[originalInstanceKey][prop] = fn; - } - }, - get: function () { - return this[originalInstanceKey][prop]; - } - }); - } - }(prop)); - } - for (prop in OriginalClass) { - if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) { - _global[className][prop] = OriginalClass[prop]; - } - } - } - exports.patchClass = patchClass; - ; - function createNamedFn(name, delegate) { - try { - return (Function('f', "return function " + name + "(){return f(this, arguments)}"))(delegate); - } - catch (e) { - // if we fail, we must be CSP, just return delegate. - return function () { - return delegate(this, arguments); - }; - } - } - exports.createNamedFn = createNamedFn; - function patchMethod(target, name, patchFn) { - var proto = target; - while (proto && !proto.hasOwnProperty(name)) { - proto = Object.getPrototypeOf(proto); - } - if (!proto && target[name]) { - // somehow we did not find it, but we can see it. This happens on IE for Window properties. - proto = target; - } - var delegateName = exports.zoneSymbol(name); - var delegate; - if (proto && !(delegate = proto[delegateName])) { - delegate = proto[delegateName] = proto[name]; - proto[name] = createNamedFn(name, patchFn(delegate, delegateName, name)); - } - return delegate; - } - exports.patchMethod = patchMethod; - - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ }, -/* 4 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - var utils_1 = __webpack_require__(3); - // might need similar for object.freeze - // i regret nothing - var _defineProperty = Object.defineProperty; - var _getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var _create = Object.create; - var unconfigurablesKey = utils_1.zoneSymbol('unconfigurables'); - function propertyPatch() { - Object.defineProperty = function (obj, prop, desc) { - if (isUnconfigurable(obj, prop)) { - throw new TypeError('Cannot assign to read only property \'' + prop + '\' of ' + obj); - } - if (prop !== 'prototype') { - desc = rewriteDescriptor(obj, prop, desc); - } - return _defineProperty(obj, prop, desc); - }; - Object.defineProperties = function (obj, props) { - Object.keys(props).forEach(function (prop) { - Object.defineProperty(obj, prop, props[prop]); - }); - return obj; - }; - Object.create = function (obj, proto) { - if (typeof proto === 'object') { - Object.keys(proto).forEach(function (prop) { - proto[prop] = rewriteDescriptor(obj, prop, proto[prop]); - }); - } - return _create(obj, proto); - }; - Object.getOwnPropertyDescriptor = function (obj, prop) { - var desc = _getOwnPropertyDescriptor(obj, prop); - if (isUnconfigurable(obj, prop)) { - desc.configurable = false; - } - return desc; - }; - } - exports.propertyPatch = propertyPatch; - ; - function _redefineProperty(obj, prop, desc) { - desc = rewriteDescriptor(obj, prop, desc); - return _defineProperty(obj, prop, desc); - } - exports._redefineProperty = _redefineProperty; - ; - function isUnconfigurable(obj, prop) { - return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop]; - } - function rewriteDescriptor(obj, prop, desc) { - desc.configurable = true; - if (!desc.configurable) { - if (!obj[unconfigurablesKey]) { - _defineProperty(obj, unconfigurablesKey, { writable: true, value: {} }); - } - obj[unconfigurablesKey][prop] = true; - } - return desc; - } - - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - var define_property_1 = __webpack_require__(4); - var utils_1 = __webpack_require__(3); - function registerElementPatch(_global) { - if (!utils_1.isBrowser || !('registerElement' in _global.document)) { - return; - } - var _registerElement = document.registerElement; - var callbacks = [ - 'createdCallback', - 'attachedCallback', - 'detachedCallback', - 'attributeChangedCallback' - ]; - document.registerElement = function (name, opts) { - if (opts && opts.prototype) { - callbacks.forEach(function (callback) { - var source = 'Document.registerElement::' + callback; - if (opts.prototype.hasOwnProperty(callback)) { - var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback); - if (descriptor && descriptor.value) { - descriptor.value = Zone.current.wrap(descriptor.value, source); - define_property_1._redefineProperty(opts.prototype, callback, descriptor); - } - else { - opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source); - } - } - else if (opts.prototype[callback]) { - opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source); - } - }); - } - return _registerElement.apply(document, [name, opts]); - }; - } - exports.registerElementPatch = registerElementPatch; - - -/***/ }, -/* 6 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - var webSocketPatch = __webpack_require__(7); - var utils_1 = __webpack_require__(3); - var eventNames = 'copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror'.split(' '); - function propertyDescriptorPatch(_global) { - if (utils_1.isNode) { - return; - } - var supportsWebSocket = typeof WebSocket !== 'undefined'; - if (canPatchViaPropertyDescriptor()) { - // for browsers that we can patch the descriptor: Chrome & Firefox - if (utils_1.isBrowser) { - utils_1.patchOnProperties(HTMLElement.prototype, eventNames); - } - utils_1.patchOnProperties(XMLHttpRequest.prototype, null); - if (typeof IDBIndex !== 'undefined') { - utils_1.patchOnProperties(IDBIndex.prototype, null); - utils_1.patchOnProperties(IDBRequest.prototype, null); - utils_1.patchOnProperties(IDBOpenDBRequest.prototype, null); - utils_1.patchOnProperties(IDBDatabase.prototype, null); - utils_1.patchOnProperties(IDBTransaction.prototype, null); - utils_1.patchOnProperties(IDBCursor.prototype, null); - } - if (supportsWebSocket) { - utils_1.patchOnProperties(WebSocket.prototype, null); - } - } - else { - // Safari, Android browsers (Jelly Bean) - patchViaCapturingAllTheEvents(); - utils_1.patchClass('XMLHttpRequest'); - if (supportsWebSocket) { - webSocketPatch.apply(_global); - } - } - } - exports.propertyDescriptorPatch = propertyDescriptorPatch; - function canPatchViaPropertyDescriptor() { - if (utils_1.isBrowser && !Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') - && typeof Element !== 'undefined') { - // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364 - // IDL interface attributes are not configurable - var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick'); - if (desc && !desc.configurable) - return false; - } - Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', { - get: function () { - return true; - } - }); - var req = new XMLHttpRequest(); - var result = !!req.onreadystatechange; - Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', {}); - return result; - } - ; - var unboundKey = utils_1.zoneSymbol('unbound'); - // Whenever any eventListener fires, we check the eventListener target and all parents - // for `onwhatever` properties and replace them with zone-bound functions - // - Chrome (for now) - function patchViaCapturingAllTheEvents() { - for (var i = 0; i < eventNames.length; i++) { - var property = eventNames[i]; - var onproperty = 'on' + property; - document.addEventListener(property, function (event) { - var elt = event.target, bound; - var source = elt.constructor['name'] + '.' + onproperty; - while (elt) { - if (elt[onproperty] && !elt[onproperty][unboundKey]) { - bound = Zone.current.wrap(elt[onproperty], source); - bound[unboundKey] = elt[onproperty]; - elt[onproperty] = bound; - } - elt = elt.parentElement; - } - }, true); - } - ; - } - ; - - -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(global) {"use strict"; - var utils_1 = __webpack_require__(3); - // we have to patch the instance since the proto is non-configurable - function apply(_global) { - var WS = _global.WebSocket; - // On Safari window.EventTarget doesn't exist so need to patch WS add/removeEventListener - // On older Chrome, no need since EventTarget was already patched - if (!_global.EventTarget) { - utils_1.patchEventTargetMethods(WS.prototype); - } - _global.WebSocket = function (a, b) { - var socket = arguments.length > 1 ? new WS(a, b) : new WS(a); - var proxySocket; - // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance - var onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage'); - if (onmessageDesc && onmessageDesc.configurable === false) { - proxySocket = Object.create(socket); - ['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function (propName) { - proxySocket[propName] = function () { - return socket[propName].apply(socket, arguments); - }; - }); - } - else { - // we can patch the real socket - proxySocket = socket; - } - utils_1.patchOnProperties(proxySocket, ['close', 'error', 'message', 'open']); - return proxySocket; - }; - global.WebSocket.prototype = Object.create(WS.prototype, { constructor: { value: WebSocket } }); - } - exports.apply = apply; - - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ } -/******/ ]); -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports) { - - 'use strict'; - (function () { - var NEWLINE = '\n'; - var SEP = ' ------------- '; - var IGNORE_FRAMES = []; - var creationTrace = '__creationTrace__'; - var LongStackTrace = (function () { - function LongStackTrace() { - this.error = getStacktrace(); - this.timestamp = new Date(); - } - return LongStackTrace; - }()); - function getStacktraceWithUncaughtError() { - return new Error('STACKTRACE TRACKING'); - } - function getStacktraceWithCaughtError() { - try { - throw getStacktraceWithUncaughtError(); - } - catch (e) { - return e; - } - } - // Some implementations of exception handling don't create a stack trace if the exception - // isn't thrown, however it's faster not to actually throw the exception. - var error = getStacktraceWithUncaughtError(); - var coughtError = getStacktraceWithCaughtError(); - var getStacktrace = error.stack - ? getStacktraceWithUncaughtError - : (coughtError.stack ? getStacktraceWithCaughtError : getStacktraceWithUncaughtError); - function getFrames(error) { - return error.stack ? error.stack.split(NEWLINE) : []; - } - function addErrorStack(lines, error) { - var trace; - trace = getFrames(error); - for (var i = 0; i < trace.length; i++) { - var frame = trace[i]; - // Filter out the Frames which are part of stack capturing. - if (!(i < IGNORE_FRAMES.length && IGNORE_FRAMES[i] === frame)) { - lines.push(trace[i]); - } - } - } - function renderLongStackTrace(frames, stack) { - var longTrace = [stack]; - if (frames) { - var timestamp = new Date().getTime(); - for (var i = 0; i < frames.length; i++) { - var traceFrames = frames[i]; - var lastTime = traceFrames.timestamp; - longTrace.push(SEP + " Elapsed: " + (timestamp - lastTime.getTime()) + " ms; At: " + lastTime + " " + SEP); - addErrorStack(longTrace, traceFrames.error); - timestamp = lastTime.getTime(); - } - } - return longTrace.join(NEWLINE); - } - Zone['longStackTraceZoneSpec'] = { - name: 'long-stack-trace', - longStackTraceLimit: 10, - onScheduleTask: function (parentZoneDelegate, currentZone, targetZone, task) { - var currentTask = Zone.currentTask; - var trace = currentTask && currentTask.data && currentTask.data[creationTrace] || []; - trace = [new LongStackTrace()].concat(trace); - if (trace.length > this.longStackTraceLimit) { - trace.length = this.longStackTraceLimit; - } - if (!task.data) - task.data = {}; - task.data[creationTrace] = trace; - return parentZoneDelegate.scheduleTask(targetZone, task); - }, - onHandleError: function (parentZoneDelegate, currentZone, targetZone, error) { - var parentTask = Zone.currentTask; - if (error instanceof Error && parentTask) { - var descriptor = Object.getOwnPropertyDescriptor(error, 'stack'); - if (descriptor) { - var delegateGet = descriptor.get; - var value = descriptor.value; - descriptor = { - get: function () { - return renderLongStackTrace(parentTask.data && parentTask.data[creationTrace], delegateGet ? delegateGet.apply(this) : value); - } - }; - Object.defineProperty(error, 'stack', descriptor); - } - else { - error.stack = renderLongStackTrace(parentTask.data && parentTask.data[creationTrace], error.stack); - } - } - return parentZoneDelegate.handleError(targetZone, error); - } - }; - function captureStackTraces(stackTraces, count) { - if (count > 0) { - stackTraces.push(getFrames((new LongStackTrace()).error)); - captureStackTraces(stackTraces, count - 1); - } - } - function computeIgnoreFrames() { - var frames = []; - captureStackTraces(frames, 2); - var frames1 = frames[0]; - var frames2 = frames[1]; - for (var i = 0; i < frames1.length; i++) { - var frame1 = frames1[i]; - var frame2 = frames2[i]; - if (frame1 === frame2) { - IGNORE_FRAMES.push(frame1); - } - else { - break; - } - } - } - computeIgnoreFrames(); - })(); - - -/***/ } -/******/ ]); -/** - @license -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - -If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - */ - -/*! ***************************************************************************** -Copyright (C) Microsoft. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -"use strict"; -var Reflect; -(function (Reflect) { - // Load global or shim versions of Map, Set, and WeakMap - var functionPrototype = Object.getPrototypeOf(Function); - var _Map = typeof Map === "function" ? Map : CreateMapPolyfill(); - var _Set = typeof Set === "function" ? Set : CreateSetPolyfill(); - var _WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill(); - // [[Metadata]] internal slot - var __Metadata__ = new _WeakMap(); - /** - * Applies a set of decorators to a property of a target object. - * @param decorators An array of decorators. - * @param target The target object. - * @param targetKey (Optional) The property key to decorate. - * @param targetDescriptor (Optional) The property descriptor for the target key - * @remarks Decorators are applied in reverse order. - * @example - * - * class C { - * // property declarations are not part of ES6, though they are valid in TypeScript: - * // static staticProperty; - * // property; - * - * constructor(p) { } - * static staticMethod(p) { } - * method(p) { } - * } - * - * // constructor - * C = Reflect.decorate(decoratorsArray, C); - * - * // property (on constructor) - * Reflect.decorate(decoratorsArray, C, "staticProperty"); - * - * // property (on prototype) - * Reflect.decorate(decoratorsArray, C.prototype, "property"); - * - * // method (on constructor) - * Object.defineProperty(C, "staticMethod", - * Reflect.decorate(decoratorsArray, C, "staticMethod", - * Object.getOwnPropertyDescriptor(C, "staticMethod"))); - * - * // method (on prototype) - * Object.defineProperty(C.prototype, "method", - * Reflect.decorate(decoratorsArray, C.prototype, "method", - * Object.getOwnPropertyDescriptor(C.prototype, "method"))); - * - */ - function decorate(decorators, target, targetKey, targetDescriptor) { - if (!IsUndefined(targetDescriptor)) { - if (!IsArray(decorators)) { - throw new TypeError(); - } - else if (!IsObject(target)) { - throw new TypeError(); - } - else if (IsUndefined(targetKey)) { - throw new TypeError(); - } - else if (!IsObject(targetDescriptor)) { - throw new TypeError(); - } - targetKey = ToPropertyKey(targetKey); - return DecoratePropertyWithDescriptor(decorators, target, targetKey, targetDescriptor); - } - else if (!IsUndefined(targetKey)) { - if (!IsArray(decorators)) { - throw new TypeError(); - } - else if (!IsObject(target)) { - throw new TypeError(); - } - targetKey = ToPropertyKey(targetKey); - return DecoratePropertyWithoutDescriptor(decorators, target, targetKey); - } - else { - if (!IsArray(decorators)) { - throw new TypeError(); - } - else if (!IsConstructor(target)) { - throw new TypeError(); - } - return DecorateConstructor(decorators, target); - } - } - Reflect.decorate = decorate; - /** - * A default metadata decorator factory that can be used on a class, class member, or parameter. - * @param metadataKey The key for the metadata entry. - * @param metadataValue The value for the metadata entry. - * @returns A decorator function. - * @remarks - * If `metadataKey` is already defined for the target and target key, the - * metadataValue for that key will be overwritten. - * @example - * - * // constructor - * @Reflect.metadata(key, value) - * class C { - * } - * - * // property (on constructor, TypeScript only) - * class C { - * @Reflect.metadata(key, value) - * static staticProperty; - * } - * - * // property (on prototype, TypeScript only) - * class C { - * @Reflect.metadata(key, value) - * property; - * } - * - * // method (on constructor) - * class C { - * @Reflect.metadata(key, value) - * static staticMethod() { } - * } - * - * // method (on prototype) - * class C { - * @Reflect.metadata(key, value) - * method() { } - * } - * - */ - function metadata(metadataKey, metadataValue) { - function decorator(target, targetKey) { - if (!IsUndefined(targetKey)) { - if (!IsObject(target)) { - throw new TypeError(); - } - targetKey = ToPropertyKey(targetKey); - OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey); - } - else { - if (!IsConstructor(target)) { - throw new TypeError(); - } - OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, undefined); - } - } - return decorator; - } - Reflect.metadata = metadata; - /** - * Define a unique metadata entry on the target. - * @param metadataKey A key used to store and retrieve metadata. - * @param metadataValue A value that contains attached metadata. - * @param target The target object on which to define metadata. - * @param targetKey (Optional) The property key for the target. - * @example - * - * class C { - * // property declarations are not part of ES6, though they are valid in TypeScript: - * // static staticProperty; - * // property; - * - * constructor(p) { } - * static staticMethod(p) { } - * method(p) { } - * } - * - * // constructor - * Reflect.defineMetadata("custom:annotation", options, C); - * - * // property (on constructor) - * Reflect.defineMetadata("custom:annotation", options, C, "staticProperty"); - * - * // property (on prototype) - * Reflect.defineMetadata("custom:annotation", options, C.prototype, "property"); - * - * // method (on constructor) - * Reflect.defineMetadata("custom:annotation", options, C, "staticMethod"); - * - * // method (on prototype) - * Reflect.defineMetadata("custom:annotation", options, C.prototype, "method"); - * - * // decorator factory as metadata-producing annotation. - * function MyAnnotation(options): Decorator { - * return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key); - * } - * - */ - function defineMetadata(metadataKey, metadataValue, target, targetKey) { - if (!IsObject(target)) { - throw new TypeError(); - } - else if (!IsUndefined(targetKey)) { - targetKey = ToPropertyKey(targetKey); - } - return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey); - } - Reflect.defineMetadata = defineMetadata; - /** - * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. - * @param metadataKey A key used to store and retrieve metadata. - * @param target The target object on which the metadata is defined. - * @param targetKey (Optional) The property key for the target. - * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. - * @example - * - * class C { - * // property declarations are not part of ES6, though they are valid in TypeScript: - * // static staticProperty; - * // property; - * - * constructor(p) { } - * static staticMethod(p) { } - * method(p) { } - * } - * - * // constructor - * result = Reflect.hasMetadata("custom:annotation", C); - * - * // property (on constructor) - * result = Reflect.hasMetadata("custom:annotation", C, "staticProperty"); - * - * // property (on prototype) - * result = Reflect.hasMetadata("custom:annotation", C.prototype, "property"); - * - * // method (on constructor) - * result = Reflect.hasMetadata("custom:annotation", C, "staticMethod"); - * - * // method (on prototype) - * result = Reflect.hasMetadata("custom:annotation", C.prototype, "method"); - * - */ - function hasMetadata(metadataKey, target, targetKey) { - if (!IsObject(target)) { - throw new TypeError(); - } - else if (!IsUndefined(targetKey)) { - targetKey = ToPropertyKey(targetKey); - } - return OrdinaryHasMetadata(metadataKey, target, targetKey); - } - Reflect.hasMetadata = hasMetadata; - /** - * Gets a value indicating whether the target object has the provided metadata key defined. - * @param metadataKey A key used to store and retrieve metadata. - * @param target The target object on which the metadata is defined. - * @param targetKey (Optional) The property key for the target. - * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. - * @example - * - * class C { - * // property declarations are not part of ES6, though they are valid in TypeScript: - * // static staticProperty; - * // property; - * - * constructor(p) { } - * static staticMethod(p) { } - * method(p) { } - * } - * - * // constructor - * result = Reflect.hasOwnMetadata("custom:annotation", C); - * - * // property (on constructor) - * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticProperty"); - * - * // property (on prototype) - * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "property"); - * - * // method (on constructor) - * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticMethod"); - * - * // method (on prototype) - * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "method"); - * - */ - function hasOwnMetadata(metadataKey, target, targetKey) { - if (!IsObject(target)) { - throw new TypeError(); - } - else if (!IsUndefined(targetKey)) { - targetKey = ToPropertyKey(targetKey); - } - return OrdinaryHasOwnMetadata(metadataKey, target, targetKey); - } - Reflect.hasOwnMetadata = hasOwnMetadata; - /** - * Gets the metadata value for the provided metadata key on the target object or its prototype chain. - * @param metadataKey A key used to store and retrieve metadata. - * @param target The target object on which the metadata is defined. - * @param targetKey (Optional) The property key for the target. - * @returns The metadata value for the metadata key if found; otherwise, `undefined`. - * @example - * - * class C { - * // property declarations are not part of ES6, though they are valid in TypeScript: - * // static staticProperty; - * // property; - * - * constructor(p) { } - * static staticMethod(p) { } - * method(p) { } - * } - * - * // constructor - * result = Reflect.getMetadata("custom:annotation", C); - * - * // property (on constructor) - * result = Reflect.getMetadata("custom:annotation", C, "staticProperty"); - * - * // property (on prototype) - * result = Reflect.getMetadata("custom:annotation", C.prototype, "property"); - * - * // method (on constructor) - * result = Reflect.getMetadata("custom:annotation", C, "staticMethod"); - * - * // method (on prototype) - * result = Reflect.getMetadata("custom:annotation", C.prototype, "method"); - * - */ - function getMetadata(metadataKey, target, targetKey) { - if (!IsObject(target)) { - throw new TypeError(); - } - else if (!IsUndefined(targetKey)) { - targetKey = ToPropertyKey(targetKey); - } - return OrdinaryGetMetadata(metadataKey, target, targetKey); - } - Reflect.getMetadata = getMetadata; - /** - * Gets the metadata value for the provided metadata key on the target object. - * @param metadataKey A key used to store and retrieve metadata. - * @param target The target object on which the metadata is defined. - * @param targetKey (Optional) The property key for the target. - * @returns The metadata value for the metadata key if found; otherwise, `undefined`. - * @example - * - * class C { - * // property declarations are not part of ES6, though they are valid in TypeScript: - * // static staticProperty; - * // property; - * - * constructor(p) { } - * static staticMethod(p) { } - * method(p) { } - * } - * - * // constructor - * result = Reflect.getOwnMetadata("custom:annotation", C); - * - * // property (on constructor) - * result = Reflect.getOwnMetadata("custom:annotation", C, "staticProperty"); - * - * // property (on prototype) - * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "property"); - * - * // method (on constructor) - * result = Reflect.getOwnMetadata("custom:annotation", C, "staticMethod"); - * - * // method (on prototype) - * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "method"); - * - */ - function getOwnMetadata(metadataKey, target, targetKey) { - if (!IsObject(target)) { - throw new TypeError(); - } - else if (!IsUndefined(targetKey)) { - targetKey = ToPropertyKey(targetKey); - } - return OrdinaryGetOwnMetadata(metadataKey, target, targetKey); - } - Reflect.getOwnMetadata = getOwnMetadata; - /** - * Gets the metadata keys defined on the target object or its prototype chain. - * @param target The target object on which the metadata is defined. - * @param targetKey (Optional) The property key for the target. - * @returns An array of unique metadata keys. - * @example - * - * class C { - * // property declarations are not part of ES6, though they are valid in TypeScript: - * // static staticProperty; - * // property; - * - * constructor(p) { } - * static staticMethod(p) { } - * method(p) { } - * } - * - * // constructor - * result = Reflect.getMetadataKeys(C); - * - * // property (on constructor) - * result = Reflect.getMetadataKeys(C, "staticProperty"); - * - * // property (on prototype) - * result = Reflect.getMetadataKeys(C.prototype, "property"); - * - * // method (on constructor) - * result = Reflect.getMetadataKeys(C, "staticMethod"); - * - * // method (on prototype) - * result = Reflect.getMetadataKeys(C.prototype, "method"); - * - */ - function getMetadataKeys(target, targetKey) { - if (!IsObject(target)) { - throw new TypeError(); - } - else if (!IsUndefined(targetKey)) { - targetKey = ToPropertyKey(targetKey); - } - return OrdinaryMetadataKeys(target, targetKey); - } - Reflect.getMetadataKeys = getMetadataKeys; - /** - * Gets the unique metadata keys defined on the target object. - * @param target The target object on which the metadata is defined. - * @param targetKey (Optional) The property key for the target. - * @returns An array of unique metadata keys. - * @example - * - * class C { - * // property declarations are not part of ES6, though they are valid in TypeScript: - * // static staticProperty; - * // property; - * - * constructor(p) { } - * static staticMethod(p) { } - * method(p) { } - * } - * - * // constructor - * result = Reflect.getOwnMetadataKeys(C); - * - * // property (on constructor) - * result = Reflect.getOwnMetadataKeys(C, "staticProperty"); - * - * // property (on prototype) - * result = Reflect.getOwnMetadataKeys(C.prototype, "property"); - * - * // method (on constructor) - * result = Reflect.getOwnMetadataKeys(C, "staticMethod"); - * - * // method (on prototype) - * result = Reflect.getOwnMetadataKeys(C.prototype, "method"); - * - */ - function getOwnMetadataKeys(target, targetKey) { - if (!IsObject(target)) { - throw new TypeError(); - } - else if (!IsUndefined(targetKey)) { - targetKey = ToPropertyKey(targetKey); - } - return OrdinaryOwnMetadataKeys(target, targetKey); - } - Reflect.getOwnMetadataKeys = getOwnMetadataKeys; - /** - * Deletes the metadata entry from the target object with the provided key. - * @param metadataKey A key used to store and retrieve metadata. - * @param target The target object on which the metadata is defined. - * @param targetKey (Optional) The property key for the target. - * @returns `true` if the metadata entry was found and deleted; otherwise, false. - * @example - * - * class C { - * // property declarations are not part of ES6, though they are valid in TypeScript: - * // static staticProperty; - * // property; - * - * constructor(p) { } - * static staticMethod(p) { } - * method(p) { } - * } - * - * // constructor - * result = Reflect.deleteMetadata("custom:annotation", C); - * - * // property (on constructor) - * result = Reflect.deleteMetadata("custom:annotation", C, "staticProperty"); - * - * // property (on prototype) - * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "property"); - * - * // method (on constructor) - * result = Reflect.deleteMetadata("custom:annotation", C, "staticMethod"); - * - * // method (on prototype) - * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "method"); - * - */ - function deleteMetadata(metadataKey, target, targetKey) { - if (!IsObject(target)) { - throw new TypeError(); - } - else if (!IsUndefined(targetKey)) { - targetKey = ToPropertyKey(targetKey); - } - // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#deletemetadata-metadatakey-p- - var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); - if (IsUndefined(metadataMap)) { - return false; - } - if (!metadataMap.delete(metadataKey)) { - return false; - } - if (metadataMap.size > 0) { - return true; - } - var targetMetadata = __Metadata__.get(target); - targetMetadata.delete(targetKey); - if (targetMetadata.size > 0) { - return true; - } - __Metadata__.delete(target); - return true; - } - Reflect.deleteMetadata = deleteMetadata; - function DecorateConstructor(decorators, target) { - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - var decorated = decorator(target); - if (!IsUndefined(decorated)) { - if (!IsConstructor(decorated)) { - throw new TypeError(); - } - target = decorated; - } - } - return target; - } - function DecoratePropertyWithDescriptor(decorators, target, propertyKey, descriptor) { - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - var decorated = decorator(target, propertyKey, descriptor); - if (!IsUndefined(decorated)) { - if (!IsObject(decorated)) { - throw new TypeError(); - } - descriptor = decorated; - } - } - return descriptor; - } - function DecoratePropertyWithoutDescriptor(decorators, target, propertyKey) { - for (var i = decorators.length - 1; i >= 0; --i) { - var decorator = decorators[i]; - decorator(target, propertyKey); - } - } - // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#getorcreatemetadatamap--o-p-create- - function GetOrCreateMetadataMap(target, targetKey, create) { - var targetMetadata = __Metadata__.get(target); - if (!targetMetadata) { - if (!create) { - return undefined; - } - targetMetadata = new _Map(); - __Metadata__.set(target, targetMetadata); - } - var keyMetadata = targetMetadata.get(targetKey); - if (!keyMetadata) { - if (!create) { - return undefined; - } - keyMetadata = new _Map(); - targetMetadata.set(targetKey, keyMetadata); - } - return keyMetadata; - } - // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasmetadata--metadatakey-o-p- - function OrdinaryHasMetadata(MetadataKey, O, P) { - var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) { - return true; - } - var parent = GetPrototypeOf(O); - if (parent !== null) { - return OrdinaryHasMetadata(MetadataKey, parent, P); - } - return false; - } - // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasownmetadata--metadatakey-o-p- - function OrdinaryHasOwnMetadata(MetadataKey, O, P) { - var metadataMap = GetOrCreateMetadataMap(O, P, false); - if (metadataMap === undefined) { - return false; - } - return Boolean(metadataMap.has(MetadataKey)); - } - // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetmetadata--metadatakey-o-p- - function OrdinaryGetMetadata(MetadataKey, O, P) { - var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) { - return OrdinaryGetOwnMetadata(MetadataKey, O, P); - } - var parent = GetPrototypeOf(O); - if (parent !== null) { - return OrdinaryGetMetadata(MetadataKey, parent, P); - } - return undefined; - } - // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetownmetadata--metadatakey-o-p- - function OrdinaryGetOwnMetadata(MetadataKey, O, P) { - var metadataMap = GetOrCreateMetadataMap(O, P, false); - if (metadataMap === undefined) { - return undefined; - } - return metadataMap.get(MetadataKey); - } - // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarydefineownmetadata--metadatakey-metadatavalue-o-p- - function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { - var metadataMap = GetOrCreateMetadataMap(O, P, true); - metadataMap.set(MetadataKey, MetadataValue); - } - // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarymetadatakeys--o-p- - function OrdinaryMetadataKeys(O, P) { - var ownKeys = OrdinaryOwnMetadataKeys(O, P); - var parent = GetPrototypeOf(O); - if (parent === null) { - return ownKeys; - } - var parentKeys = OrdinaryMetadataKeys(parent, P); - if (parentKeys.length <= 0) { - return ownKeys; - } - if (ownKeys.length <= 0) { - return parentKeys; - } - var set = new _Set(); - var keys = []; - for (var _i = 0; _i < ownKeys.length; _i++) { - var key = ownKeys[_i]; - var hasKey = set.has(key); - if (!hasKey) { - set.add(key); - keys.push(key); - } - } - for (var _a = 0; _a < parentKeys.length; _a++) { - var key = parentKeys[_a]; - var hasKey = set.has(key); - if (!hasKey) { - set.add(key); - keys.push(key); - } - } - return keys; - } - // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryownmetadatakeys--o-p- - function OrdinaryOwnMetadataKeys(target, targetKey) { - var metadataMap = GetOrCreateMetadataMap(target, targetKey, false); - var keys = []; - if (metadataMap) { - metadataMap.forEach(function (_, key) { return keys.push(key); }); - } - return keys; - } - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-undefined-type - function IsUndefined(x) { - return x === undefined; - } - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray - function IsArray(x) { - return Array.isArray(x); - } - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object-type - function IsObject(x) { - return typeof x === "object" ? x !== null : typeof x === "function"; - } - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor - function IsConstructor(x) { - return typeof x === "function"; - } - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-symbol-type - function IsSymbol(x) { - return typeof x === "symbol"; - } - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey - function ToPropertyKey(value) { - if (IsSymbol(value)) { - return value; - } - return String(value); - } - function GetPrototypeOf(O) { - var proto = Object.getPrototypeOf(O); - if (typeof O !== "function" || O === functionPrototype) { - return proto; - } - // TypeScript doesn't set __proto__ in ES5, as it's non-standard. - // Try to determine the superclass constructor. Compatible implementations - // must either set __proto__ on a subclass constructor to the superclass constructor, - // or ensure each class has a valid `constructor` property on its prototype that - // points back to the constructor. - // If this is not the same as Function.[[Prototype]], then this is definately inherited. - // This is the case when in ES6 or when using __proto__ in a compatible browser. - if (proto !== functionPrototype) { - return proto; - } - // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage. - var prototype = O.prototype; - var prototypeProto = Object.getPrototypeOf(prototype); - if (prototypeProto == null || prototypeProto === Object.prototype) { - return proto; - } - // if the constructor was not a function, then we cannot determine the heritage. - var constructor = prototypeProto.constructor; - if (typeof constructor !== "function") { - return proto; - } - // if we have some kind of self-reference, then we cannot determine the heritage. - if (constructor === O) { - return proto; - } - // we have a pretty good guess at the heritage. - return constructor; - } - // naive Map shim - function CreateMapPolyfill() { - var cacheSentinel = {}; - function Map() { - this._keys = []; - this._values = []; - this._cache = cacheSentinel; - } - Map.prototype = { - get size() { - return this._keys.length; - }, - has: function (key) { - if (key === this._cache) { - return true; - } - if (this._find(key) >= 0) { - this._cache = key; - return true; - } - return false; - }, - get: function (key) { - var index = this._find(key); - if (index >= 0) { - this._cache = key; - return this._values[index]; - } - return undefined; - }, - set: function (key, value) { - this.delete(key); - this._keys.push(key); - this._values.push(value); - this._cache = key; - return this; - }, - delete: function (key) { - var index = this._find(key); - if (index >= 0) { - this._keys.splice(index, 1); - this._values.splice(index, 1); - this._cache = cacheSentinel; - return true; - } - return false; - }, - clear: function () { - this._keys.length = 0; - this._values.length = 0; - this._cache = cacheSentinel; - }, - forEach: function (callback, thisArg) { - var size = this.size; - for (var i = 0; i < size; ++i) { - var key = this._keys[i]; - var value = this._values[i]; - this._cache = key; - callback.call(this, value, key, this); - } - }, - _find: function (key) { - var keys = this._keys; - var size = keys.length; - for (var i = 0; i < size; ++i) { - if (keys[i] === key) { - return i; - } - } - return -1; - } - }; - return Map; - } - // naive Set shim - function CreateSetPolyfill() { - var cacheSentinel = {}; - function Set() { - this._map = new _Map(); - } - Set.prototype = { - get size() { - return this._map.length; - }, - has: function (value) { - return this._map.has(value); - }, - add: function (value) { - this._map.set(value, value); - return this; - }, - delete: function (value) { - return this._map.delete(value); - }, - clear: function () { - this._map.clear(); - }, - forEach: function (callback, thisArg) { - this._map.forEach(callback, thisArg); - } - }; - return Set; - } - // naive WeakMap shim - function CreateWeakMapPolyfill() { - var UUID_SIZE = 16; - var isNode = typeof global !== "undefined" && Object.prototype.toString.call(global.process) === '[object process]'; - var nodeCrypto = isNode && require("crypto"); - var hasOwn = Object.prototype.hasOwnProperty; - var keys = {}; - var rootKey = CreateUniqueKey(); - function WeakMap() { - this._key = CreateUniqueKey(); - } - WeakMap.prototype = { - has: function (target) { - var table = GetOrCreateWeakMapTable(target, false); - if (table) { - return this._key in table; - } - return false; - }, - get: function (target) { - var table = GetOrCreateWeakMapTable(target, false); - if (table) { - return table[this._key]; - } - return undefined; - }, - set: function (target, value) { - var table = GetOrCreateWeakMapTable(target, true); - table[this._key] = value; - return this; - }, - delete: function (target) { - var table = GetOrCreateWeakMapTable(target, false); - if (table && this._key in table) { - return delete table[this._key]; - } - return false; - }, - clear: function () { - // NOTE: not a real clear, just makes the previous data unreachable - this._key = CreateUniqueKey(); - } - }; - function FillRandomBytes(buffer, size) { - for (var i = 0; i < size; ++i) { - buffer[i] = Math.random() * 255 | 0; - } - } - function GenRandomBytes(size) { - if (nodeCrypto) { - var data = nodeCrypto.randomBytes(size); - return data; - } - else if (typeof Uint8Array === "function") { - var data = new Uint8Array(size); - if (typeof crypto !== "undefined") { - crypto.getRandomValues(data); - } - else if (typeof msCrypto !== "undefined") { - msCrypto.getRandomValues(data); - } - else { - FillRandomBytes(data, size); - } - return data; - } - else { - var data = new Array(size); - FillRandomBytes(data, size); - return data; - } - } - function CreateUUID() { - var data = GenRandomBytes(UUID_SIZE); - // mark as random - RFC 4122 § 4.4 - data[6] = data[6] & 0x4f | 0x40; - data[8] = data[8] & 0xbf | 0x80; - var result = ""; - for (var offset = 0; offset < UUID_SIZE; ++offset) { - var byte = data[offset]; - if (offset === 4 || offset === 6 || offset === 8) { - result += "-"; - } - if (byte < 16) { - result += "0"; - } - result += byte.toString(16).toLowerCase(); - } - return result; - } - function CreateUniqueKey() { - var key; - do { - key = "@@WeakMap@@" + CreateUUID(); - } while (hasOwn.call(keys, key)); - keys[key] = true; - return key; - } - function GetOrCreateWeakMapTable(target, create) { - if (!hasOwn.call(target, rootKey)) { - if (!create) { - return undefined; - } - Object.defineProperty(target, rootKey, { value: Object.create(null) }); - } - return target[rootKey]; - } - return WeakMap; - } - // hook global Reflect - (function (__global) { - if (typeof __global.Reflect !== "undefined") { - if (__global.Reflect !== Reflect) { - for (var p in Reflect) { - __global.Reflect[p] = Reflect[p]; - } - } - } - else { - __global.Reflect = Reflect; - } - })(typeof window !== "undefined" ? window : - typeof WorkerGlobalScope !== "undefined" ? self : - typeof global !== "undefined" ? global : - Function("return this;")()); -})(Reflect || (Reflect = {})); -//# sourceMappingURLDisabled=Reflect.js.map \ No newline at end of file diff --git a/demo-shell-ng2/dist/lib/angular2.dev.js b/demo-shell-ng2/dist/lib/angular2.dev.js deleted file mode 100644 index 4c3f750d32..0000000000 --- a/demo-shell-ng2/dist/lib/angular2.dev.js +++ /dev/null @@ -1,26056 +0,0 @@ -"format register"; -System.register("angular2/src/facade/lang", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var globalScope; - if (typeof window === 'undefined') { - if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) { - globalScope = self; - } else { - globalScope = global; - } - } else { - globalScope = window; - } - function scheduleMicroTask(fn) { - Zone.current.scheduleMicroTask('scheduleMicrotask', fn); - } - exports.scheduleMicroTask = scheduleMicroTask; - exports.IS_DART = false; - var _global = globalScope; - exports.global = _global; - exports.Type = Function; - function getTypeNameForDebugging(type) { - if (type['name']) { - return type['name']; - } - return typeof type; - } - exports.getTypeNameForDebugging = getTypeNameForDebugging; - exports.Math = _global.Math; - exports.Date = _global.Date; - var _devMode = true; - var _modeLocked = false; - function lockMode() { - _modeLocked = true; - } - exports.lockMode = lockMode; - function enableProdMode() { - if (_modeLocked) { - throw 'Cannot enable prod mode after platform setup.'; - } - _devMode = false; - } - exports.enableProdMode = enableProdMode; - function assertionsEnabled() { - return _devMode; - } - exports.assertionsEnabled = assertionsEnabled; - _global.assert = function assert(condition) {}; - function CONST_EXPR(expr) { - return expr; - } - exports.CONST_EXPR = CONST_EXPR; - function CONST() { - return function(target) { - return target; - }; - } - exports.CONST = CONST; - function isPresent(obj) { - return obj !== undefined && obj !== null; - } - exports.isPresent = isPresent; - function isBlank(obj) { - return obj === undefined || obj === null; - } - exports.isBlank = isBlank; - function isBoolean(obj) { - return typeof obj === "boolean"; - } - exports.isBoolean = isBoolean; - function isNumber(obj) { - return typeof obj === "number"; - } - exports.isNumber = isNumber; - function isString(obj) { - return typeof obj === "string"; - } - exports.isString = isString; - function isFunction(obj) { - return typeof obj === "function"; - } - exports.isFunction = isFunction; - function isType(obj) { - return isFunction(obj); - } - exports.isType = isType; - function isStringMap(obj) { - return typeof obj === 'object' && obj !== null; - } - exports.isStringMap = isStringMap; - function isPromise(obj) { - return obj instanceof _global.Promise; - } - exports.isPromise = isPromise; - function isArray(obj) { - return Array.isArray(obj); - } - exports.isArray = isArray; - function isDate(obj) { - return obj instanceof exports.Date && !isNaN(obj.valueOf()); - } - exports.isDate = isDate; - function noop() {} - exports.noop = noop; - function stringify(token) { - if (typeof token === 'string') { - return token; - } - if (token === undefined || token === null) { - return '' + token; - } - if (token.name) { - return token.name; - } - if (token.overriddenName) { - return token.overriddenName; - } - var res = token.toString(); - var newLineIndex = res.indexOf("\n"); - return (newLineIndex === -1) ? res : res.substring(0, newLineIndex); - } - exports.stringify = stringify; - function serializeEnum(val) { - return val; - } - exports.serializeEnum = serializeEnum; - function deserializeEnum(val, values) { - return val; - } - exports.deserializeEnum = deserializeEnum; - function resolveEnumToken(enumValue, val) { - return enumValue[val]; - } - exports.resolveEnumToken = resolveEnumToken; - var StringWrapper = (function() { - function StringWrapper() {} - StringWrapper.fromCharCode = function(code) { - return String.fromCharCode(code); - }; - StringWrapper.charCodeAt = function(s, index) { - return s.charCodeAt(index); - }; - StringWrapper.split = function(s, regExp) { - return s.split(regExp); - }; - StringWrapper.equals = function(s, s2) { - return s === s2; - }; - StringWrapper.stripLeft = function(s, charVal) { - if (s && s.length) { - var pos = 0; - for (var i = 0; i < s.length; i++) { - if (s[i] != charVal) - break; - pos++; - } - s = s.substring(pos); - } - return s; - }; - StringWrapper.stripRight = function(s, charVal) { - if (s && s.length) { - var pos = s.length; - for (var i = s.length - 1; i >= 0; i--) { - if (s[i] != charVal) - break; - pos--; - } - s = s.substring(0, pos); - } - return s; - }; - StringWrapper.replace = function(s, from, replace) { - return s.replace(from, replace); - }; - StringWrapper.replaceAll = function(s, from, replace) { - return s.replace(from, replace); - }; - StringWrapper.slice = function(s, from, to) { - if (from === void 0) { - from = 0; - } - if (to === void 0) { - to = null; - } - return s.slice(from, to === null ? undefined : to); - }; - StringWrapper.replaceAllMapped = function(s, from, cb) { - return s.replace(from, function() { - var matches = []; - for (var _i = 0; _i < arguments.length; _i++) { - matches[_i - 0] = arguments[_i]; - } - matches.splice(-2, 2); - return cb(matches); - }); - }; - StringWrapper.contains = function(s, substr) { - return s.indexOf(substr) != -1; - }; - StringWrapper.compare = function(a, b) { - if (a < b) { - return -1; - } else if (a > b) { - return 1; - } else { - return 0; - } - }; - return StringWrapper; - }()); - exports.StringWrapper = StringWrapper; - var StringJoiner = (function() { - function StringJoiner(parts) { - if (parts === void 0) { - parts = []; - } - this.parts = parts; - } - StringJoiner.prototype.add = function(part) { - this.parts.push(part); - }; - StringJoiner.prototype.toString = function() { - return this.parts.join(""); - }; - return StringJoiner; - }()); - exports.StringJoiner = StringJoiner; - var NumberParseError = (function(_super) { - __extends(NumberParseError, _super); - function NumberParseError(message) { - _super.call(this); - this.message = message; - } - NumberParseError.prototype.toString = function() { - return this.message; - }; - return NumberParseError; - }(Error)); - exports.NumberParseError = NumberParseError; - var NumberWrapper = (function() { - function NumberWrapper() {} - NumberWrapper.toFixed = function(n, fractionDigits) { - return n.toFixed(fractionDigits); - }; - NumberWrapper.equal = function(a, b) { - return a === b; - }; - NumberWrapper.parseIntAutoRadix = function(text) { - var result = parseInt(text); - if (isNaN(result)) { - throw new NumberParseError("Invalid integer literal when parsing " + text); - } - return result; - }; - NumberWrapper.parseInt = function(text, radix) { - if (radix == 10) { - if (/^(\-|\+)?[0-9]+$/.test(text)) { - return parseInt(text, radix); - } - } else if (radix == 16) { - if (/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text)) { - return parseInt(text, radix); - } - } else { - var result = parseInt(text, radix); - if (!isNaN(result)) { - return result; - } - } - throw new NumberParseError("Invalid integer literal when parsing " + text + " in base " + radix); - }; - NumberWrapper.parseFloat = function(text) { - return parseFloat(text); - }; - Object.defineProperty(NumberWrapper, "NaN", { - get: function() { - return NaN; - }, - enumerable: true, - configurable: true - }); - NumberWrapper.isNaN = function(value) { - return isNaN(value); - }; - NumberWrapper.isInteger = function(value) { - return Number.isInteger(value); - }; - return NumberWrapper; - }()); - exports.NumberWrapper = NumberWrapper; - exports.RegExp = _global.RegExp; - var RegExpWrapper = (function() { - function RegExpWrapper() {} - RegExpWrapper.create = function(regExpStr, flags) { - if (flags === void 0) { - flags = ''; - } - flags = flags.replace(/g/g, ''); - return new _global.RegExp(regExpStr, flags + 'g'); - }; - RegExpWrapper.firstMatch = function(regExp, input) { - regExp.lastIndex = 0; - return regExp.exec(input); - }; - RegExpWrapper.test = function(regExp, input) { - regExp.lastIndex = 0; - return regExp.test(input); - }; - RegExpWrapper.matcher = function(regExp, input) { - regExp.lastIndex = 0; - return { - re: regExp, - input: input - }; - }; - RegExpWrapper.replaceAll = function(regExp, input, replace) { - var c = regExp.exec(input); - var res = ''; - regExp.lastIndex = 0; - var prev = 0; - while (c) { - res += input.substring(prev, c.index); - res += replace(c); - prev = c.index + c[0].length; - regExp.lastIndex = prev; - c = regExp.exec(input); - } - res += input.substring(prev); - return res; - }; - return RegExpWrapper; - }()); - exports.RegExpWrapper = RegExpWrapper; - var RegExpMatcherWrapper = (function() { - function RegExpMatcherWrapper() {} - RegExpMatcherWrapper.next = function(matcher) { - return matcher.re.exec(matcher.input); - }; - return RegExpMatcherWrapper; - }()); - exports.RegExpMatcherWrapper = RegExpMatcherWrapper; - var FunctionWrapper = (function() { - function FunctionWrapper() {} - FunctionWrapper.apply = function(fn, posArgs) { - return fn.apply(null, posArgs); - }; - return FunctionWrapper; - }()); - exports.FunctionWrapper = FunctionWrapper; - function looseIdentical(a, b) { - return a === b || typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b); - } - exports.looseIdentical = looseIdentical; - function getMapKey(value) { - return value; - } - exports.getMapKey = getMapKey; - function normalizeBlank(obj) { - return isBlank(obj) ? null : obj; - } - exports.normalizeBlank = normalizeBlank; - function normalizeBool(obj) { - return isBlank(obj) ? false : obj; - } - exports.normalizeBool = normalizeBool; - function isJsObject(o) { - return o !== null && (typeof o === "function" || typeof o === "object"); - } - exports.isJsObject = isJsObject; - function print(obj) { - console.log(obj); - } - exports.print = print; - var Json = (function() { - function Json() {} - Json.parse = function(s) { - return _global.JSON.parse(s); - }; - Json.stringify = function(data) { - return _global.JSON.stringify(data, null, 2); - }; - return Json; - }()); - exports.Json = Json; - var DateWrapper = (function() { - function DateWrapper() {} - DateWrapper.create = function(year, month, day, hour, minutes, seconds, milliseconds) { - if (month === void 0) { - month = 1; - } - if (day === void 0) { - day = 1; - } - if (hour === void 0) { - hour = 0; - } - if (minutes === void 0) { - minutes = 0; - } - if (seconds === void 0) { - seconds = 0; - } - if (milliseconds === void 0) { - milliseconds = 0; - } - return new exports.Date(year, month - 1, day, hour, minutes, seconds, milliseconds); - }; - DateWrapper.fromISOString = function(str) { - return new exports.Date(str); - }; - DateWrapper.fromMillis = function(ms) { - return new exports.Date(ms); - }; - DateWrapper.toMillis = function(date) { - return date.getTime(); - }; - DateWrapper.now = function() { - return new exports.Date(); - }; - DateWrapper.toJson = function(date) { - return date.toJSON(); - }; - return DateWrapper; - }()); - exports.DateWrapper = DateWrapper; - function setValueOnPath(global, path, value) { - var parts = path.split('.'); - var obj = global; - while (parts.length > 1) { - var name = parts.shift(); - if (obj.hasOwnProperty(name) && isPresent(obj[name])) { - obj = obj[name]; - } else { - obj = obj[name] = {}; - } - } - if (obj === undefined || obj === null) { - obj = {}; - } - obj[parts.shift()] = value; - } - exports.setValueOnPath = setValueOnPath; - var _symbolIterator = null; - function getSymbolIterator() { - if (isBlank(_symbolIterator)) { - if (isPresent(Symbol) && isPresent(Symbol.iterator)) { - _symbolIterator = Symbol.iterator; - } else { - var keys = Object.getOwnPropertyNames(Map.prototype); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (key !== 'entries' && key !== 'size' && Map.prototype[key] === Map.prototype['entries']) { - _symbolIterator = key; - } - } - } - } - return _symbolIterator; - } - exports.getSymbolIterator = getSymbolIterator; - function evalExpression(sourceUrl, expr, declarations, vars) { - var fnBody = declarations + "\nreturn " + expr + "\n//# sourceURL=" + sourceUrl; - var fnArgNames = []; - var fnArgValues = []; - for (var argName in vars) { - fnArgNames.push(argName); - fnArgValues.push(vars[argName]); - } - return new (Function.bind.apply(Function, [void 0].concat(fnArgNames.concat(fnBody))))().apply(void 0, fnArgValues); - } - exports.evalExpression = evalExpression; - function isPrimitive(obj) { - return !isJsObject(obj); - } - exports.isPrimitive = isPrimitive; - function hasConstructor(value, type) { - return value.constructor === type; - } - exports.hasConstructor = hasConstructor; - function bitWiseOr(values) { - return values.reduce(function(a, b) { - return a | b; - }); - } - exports.bitWiseOr = bitWiseOr; - function bitWiseAnd(values) { - return values.reduce(function(a, b) { - return a & b; - }); - } - exports.bitWiseAnd = bitWiseAnd; - function escape(s) { - return _global.encodeURI(s); - } - exports.escape = escape; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/di/metadata", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var InjectMetadata = (function() { - function InjectMetadata(token) { - this.token = token; - } - InjectMetadata.prototype.toString = function() { - return "@Inject(" + lang_1.stringify(this.token) + ")"; - }; - InjectMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], InjectMetadata); - return InjectMetadata; - }()); - exports.InjectMetadata = InjectMetadata; - var OptionalMetadata = (function() { - function OptionalMetadata() {} - OptionalMetadata.prototype.toString = function() { - return "@Optional()"; - }; - OptionalMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], OptionalMetadata); - return OptionalMetadata; - }()); - exports.OptionalMetadata = OptionalMetadata; - var DependencyMetadata = (function() { - function DependencyMetadata() {} - Object.defineProperty(DependencyMetadata.prototype, "token", { - get: function() { - return null; - }, - enumerable: true, - configurable: true - }); - DependencyMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DependencyMetadata); - return DependencyMetadata; - }()); - exports.DependencyMetadata = DependencyMetadata; - var InjectableMetadata = (function() { - function InjectableMetadata() {} - InjectableMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], InjectableMetadata); - return InjectableMetadata; - }()); - exports.InjectableMetadata = InjectableMetadata; - var SelfMetadata = (function() { - function SelfMetadata() {} - SelfMetadata.prototype.toString = function() { - return "@Self()"; - }; - SelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SelfMetadata); - return SelfMetadata; - }()); - exports.SelfMetadata = SelfMetadata; - var SkipSelfMetadata = (function() { - function SkipSelfMetadata() {} - SkipSelfMetadata.prototype.toString = function() { - return "@SkipSelf()"; - }; - SkipSelfMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], SkipSelfMetadata); - return SkipSelfMetadata; - }()); - exports.SkipSelfMetadata = SkipSelfMetadata; - var HostMetadata = (function() { - function HostMetadata() {} - HostMetadata.prototype.toString = function() { - return "@Host()"; - }; - HostMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], HostMetadata); - return HostMetadata; - }()); - exports.HostMetadata = HostMetadata; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/util/decorators", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var _nextClassId = 0; - function extractAnnotation(annotation) { - if (lang_1.isFunction(annotation) && annotation.hasOwnProperty('annotation')) { - annotation = annotation.annotation; - } - return annotation; - } - function applyParams(fnOrArray, key) { - if (fnOrArray === Object || fnOrArray === String || fnOrArray === Function || fnOrArray === Number || fnOrArray === Array) { - throw new Error("Can not use native " + lang_1.stringify(fnOrArray) + " as constructor"); - } - if (lang_1.isFunction(fnOrArray)) { - return fnOrArray; - } else if (fnOrArray instanceof Array) { - var annotations = fnOrArray; - var fn = fnOrArray[fnOrArray.length - 1]; - if (!lang_1.isFunction(fn)) { - throw new Error("Last position of Class method array must be Function in key " + key + " was '" + lang_1.stringify(fn) + "'"); - } - var annoLength = annotations.length - 1; - if (annoLength != fn.length) { - throw new Error("Number of annotations (" + annoLength + ") does not match number of arguments (" + fn.length + ") in the function: " + lang_1.stringify(fn)); - } - var paramsAnnotations = []; - for (var i = 0, - ii = annotations.length - 1; i < ii; i++) { - var paramAnnotations = []; - paramsAnnotations.push(paramAnnotations); - var annotation = annotations[i]; - if (annotation instanceof Array) { - for (var j = 0; j < annotation.length; j++) { - paramAnnotations.push(extractAnnotation(annotation[j])); - } - } else if (lang_1.isFunction(annotation)) { - paramAnnotations.push(extractAnnotation(annotation)); - } else { - paramAnnotations.push(annotation); - } - } - Reflect.defineMetadata('parameters', paramsAnnotations, fn); - return fn; - } else { - throw new Error("Only Function or Array is supported in Class definition for key '" + key + "' is '" + lang_1.stringify(fnOrArray) + "'"); - } - } - function Class(clsDef) { - var constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor'); - var proto = constructor.prototype; - if (clsDef.hasOwnProperty('extends')) { - if (lang_1.isFunction(clsDef.extends)) { - constructor.prototype = proto = Object.create(clsDef.extends.prototype); - } else { - throw new Error("Class definition 'extends' property must be a constructor function was: " + lang_1.stringify(clsDef.extends)); - } - } - for (var key in clsDef) { - if (key != 'extends' && key != 'prototype' && clsDef.hasOwnProperty(key)) { - proto[key] = applyParams(clsDef[key], key); - } - } - if (this && this.annotations instanceof Array) { - Reflect.defineMetadata('annotations', this.annotations, constructor); - } - if (!constructor['name']) { - constructor['overriddenName'] = "class" + _nextClassId++; - } - return constructor; - } - exports.Class = Class; - var Reflect = lang_1.global.Reflect; - (function checkReflect() { - if (!(Reflect && Reflect.getMetadata)) { - throw 'reflect-metadata shim is required when using class decorators'; - } - })(); - function makeDecorator(annotationCls, chainFn) { - if (chainFn === void 0) { - chainFn = null; - } - function DecoratorFactory(objOrType) { - var annotationInstance = new annotationCls(objOrType); - if (this instanceof annotationCls) { - return annotationInstance; - } else { - var chainAnnotation = lang_1.isFunction(this) && this.annotations instanceof Array ? this.annotations : []; - chainAnnotation.push(annotationInstance); - var TypeDecorator = function TypeDecorator(cls) { - var annotations = Reflect.getOwnMetadata('annotations', cls); - annotations = annotations || []; - annotations.push(annotationInstance); - Reflect.defineMetadata('annotations', annotations, cls); - return cls; - }; - TypeDecorator.annotations = chainAnnotation; - TypeDecorator.Class = Class; - if (chainFn) - chainFn(TypeDecorator); - return TypeDecorator; - } - } - DecoratorFactory.prototype = Object.create(annotationCls.prototype); - return DecoratorFactory; - } - exports.makeDecorator = makeDecorator; - function makeParamDecorator(annotationCls) { - function ParamDecoratorFactory() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i - 0] = arguments[_i]; - } - var annotationInstance = Object.create(annotationCls.prototype); - annotationCls.apply(annotationInstance, args); - if (this instanceof annotationCls) { - return annotationInstance; - } else { - ParamDecorator.annotation = annotationInstance; - return ParamDecorator; - } - function ParamDecorator(cls, unusedKey, index) { - var parameters = Reflect.getMetadata('parameters', cls); - parameters = parameters || []; - while (parameters.length <= index) { - parameters.push(null); - } - parameters[index] = parameters[index] || []; - var annotationsForParam = parameters[index]; - annotationsForParam.push(annotationInstance); - Reflect.defineMetadata('parameters', parameters, cls); - return cls; - } - } - ParamDecoratorFactory.prototype = Object.create(annotationCls.prototype); - return ParamDecoratorFactory; - } - exports.makeParamDecorator = makeParamDecorator; - function makePropDecorator(decoratorCls) { - function PropDecoratorFactory() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i - 0] = arguments[_i]; - } - var decoratorInstance = Object.create(decoratorCls.prototype); - decoratorCls.apply(decoratorInstance, args); - if (this instanceof decoratorCls) { - return decoratorInstance; - } else { - return function PropDecorator(target, name) { - var meta = Reflect.getOwnMetadata('propMetadata', target.constructor); - meta = meta || {}; - meta[name] = meta[name] || []; - meta[name].unshift(decoratorInstance); - Reflect.defineMetadata('propMetadata', meta, target.constructor); - }; - } - } - PropDecoratorFactory.prototype = Object.create(decoratorCls.prototype); - return PropDecoratorFactory; - } - exports.makePropDecorator = makePropDecorator; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/di/forward_ref", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - function forwardRef(forwardRefFn) { - forwardRefFn.__forward_ref__ = forwardRef; - forwardRefFn.toString = function() { - return lang_1.stringify(this()); - }; - return forwardRefFn; - } - exports.forwardRef = forwardRef; - function resolveForwardRef(type) { - if (lang_1.isFunction(type) && type.hasOwnProperty('__forward_ref__') && type.__forward_ref__ === forwardRef) { - return type(); - } else { - return type; - } - } - exports.resolveForwardRef = resolveForwardRef; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/facade/collection", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - exports.Map = lang_1.global.Map; - exports.Set = lang_1.global.Set; - var createMapFromPairs = (function() { - try { - if (new exports.Map([[1, 2]]).size === 1) { - return function createMapFromPairs(pairs) { - return new exports.Map(pairs); - }; - } - } catch (e) {} - return function createMapAndPopulateFromPairs(pairs) { - var map = new exports.Map(); - for (var i = 0; i < pairs.length; i++) { - var pair = pairs[i]; - map.set(pair[0], pair[1]); - } - return map; - }; - })(); - var createMapFromMap = (function() { - try { - if (new exports.Map(new exports.Map())) { - return function createMapFromMap(m) { - return new exports.Map(m); - }; - } - } catch (e) {} - return function createMapAndPopulateFromMap(m) { - var map = new exports.Map(); - m.forEach(function(v, k) { - map.set(k, v); - }); - return map; - }; - })(); - var _clearValues = (function() { - if ((new exports.Map()).keys().next) { - return function _clearValues(m) { - var keyIterator = m.keys(); - var k; - while (!((k = keyIterator.next()).done)) { - m.set(k.value, null); - } - }; - } else { - return function _clearValuesWithForeEach(m) { - m.forEach(function(v, k) { - m.set(k, null); - }); - }; - } - })(); - var _arrayFromMap = (function() { - try { - if ((new exports.Map()).values().next) { - return function createArrayFromMap(m, getValues) { - return getValues ? Array.from(m.values()) : Array.from(m.keys()); - }; - } - } catch (e) {} - return function createArrayFromMapWithForeach(m, getValues) { - var res = ListWrapper.createFixedSize(m.size), - i = 0; - m.forEach(function(v, k) { - res[i] = getValues ? v : k; - i++; - }); - return res; - }; - })(); - var MapWrapper = (function() { - function MapWrapper() {} - MapWrapper.clone = function(m) { - return createMapFromMap(m); - }; - MapWrapper.createFromStringMap = function(stringMap) { - var result = new exports.Map(); - for (var prop in stringMap) { - result.set(prop, stringMap[prop]); - } - return result; - }; - MapWrapper.toStringMap = function(m) { - var r = {}; - m.forEach(function(v, k) { - return r[k] = v; - }); - return r; - }; - MapWrapper.createFromPairs = function(pairs) { - return createMapFromPairs(pairs); - }; - MapWrapper.clearValues = function(m) { - _clearValues(m); - }; - MapWrapper.iterable = function(m) { - return m; - }; - MapWrapper.keys = function(m) { - return _arrayFromMap(m, false); - }; - MapWrapper.values = function(m) { - return _arrayFromMap(m, true); - }; - return MapWrapper; - }()); - exports.MapWrapper = MapWrapper; - var StringMapWrapper = (function() { - function StringMapWrapper() {} - StringMapWrapper.create = function() { - return {}; - }; - StringMapWrapper.contains = function(map, key) { - return map.hasOwnProperty(key); - }; - StringMapWrapper.get = function(map, key) { - return map.hasOwnProperty(key) ? map[key] : undefined; - }; - StringMapWrapper.set = function(map, key, value) { - map[key] = value; - }; - StringMapWrapper.keys = function(map) { - return Object.keys(map); - }; - StringMapWrapper.values = function(map) { - return Object.keys(map).reduce(function(r, a) { - r.push(map[a]); - return r; - }, []); - }; - StringMapWrapper.isEmpty = function(map) { - for (var prop in map) { - return false; - } - return true; - }; - StringMapWrapper.delete = function(map, key) { - delete map[key]; - }; - StringMapWrapper.forEach = function(map, callback) { - for (var prop in map) { - if (map.hasOwnProperty(prop)) { - callback(map[prop], prop); - } - } - }; - StringMapWrapper.merge = function(m1, m2) { - var m = {}; - for (var attr in m1) { - if (m1.hasOwnProperty(attr)) { - m[attr] = m1[attr]; - } - } - for (var attr in m2) { - if (m2.hasOwnProperty(attr)) { - m[attr] = m2[attr]; - } - } - return m; - }; - StringMapWrapper.equals = function(m1, m2) { - var k1 = Object.keys(m1); - var k2 = Object.keys(m2); - if (k1.length != k2.length) { - return false; - } - var key; - for (var i = 0; i < k1.length; i++) { - key = k1[i]; - if (m1[key] !== m2[key]) { - return false; - } - } - return true; - }; - return StringMapWrapper; - }()); - exports.StringMapWrapper = StringMapWrapper; - var ListWrapper = (function() { - function ListWrapper() {} - ListWrapper.createFixedSize = function(size) { - return new Array(size); - }; - ListWrapper.createGrowableSize = function(size) { - return new Array(size); - }; - ListWrapper.clone = function(array) { - return array.slice(0); - }; - ListWrapper.forEachWithIndex = function(array, fn) { - for (var i = 0; i < array.length; i++) { - fn(array[i], i); - } - }; - ListWrapper.first = function(array) { - if (!array) - return null; - return array[0]; - }; - ListWrapper.last = function(array) { - if (!array || array.length == 0) - return null; - return array[array.length - 1]; - }; - ListWrapper.indexOf = function(array, value, startIndex) { - if (startIndex === void 0) { - startIndex = 0; - } - return array.indexOf(value, startIndex); - }; - ListWrapper.contains = function(list, el) { - return list.indexOf(el) !== -1; - }; - ListWrapper.reversed = function(array) { - var a = ListWrapper.clone(array); - return a.reverse(); - }; - ListWrapper.concat = function(a, b) { - return a.concat(b); - }; - ListWrapper.insert = function(list, index, value) { - list.splice(index, 0, value); - }; - ListWrapper.removeAt = function(list, index) { - var res = list[index]; - list.splice(index, 1); - return res; - }; - ListWrapper.removeAll = function(list, items) { - for (var i = 0; i < items.length; ++i) { - var index = list.indexOf(items[i]); - list.splice(index, 1); - } - }; - ListWrapper.remove = function(list, el) { - var index = list.indexOf(el); - if (index > -1) { - list.splice(index, 1); - return true; - } - return false; - }; - ListWrapper.clear = function(list) { - list.length = 0; - }; - ListWrapper.isEmpty = function(list) { - return list.length == 0; - }; - ListWrapper.fill = function(list, value, start, end) { - if (start === void 0) { - start = 0; - } - if (end === void 0) { - end = null; - } - list.fill(value, start, end === null ? list.length : end); - }; - ListWrapper.equals = function(a, b) { - if (a.length != b.length) - return false; - for (var i = 0; i < a.length; ++i) { - if (a[i] !== b[i]) - return false; - } - return true; - }; - ListWrapper.slice = function(l, from, to) { - if (from === void 0) { - from = 0; - } - if (to === void 0) { - to = null; - } - return l.slice(from, to === null ? undefined : to); - }; - ListWrapper.splice = function(l, from, length) { - return l.splice(from, length); - }; - ListWrapper.sort = function(l, compareFn) { - if (lang_1.isPresent(compareFn)) { - l.sort(compareFn); - } else { - l.sort(); - } - }; - ListWrapper.toString = function(l) { - return l.toString(); - }; - ListWrapper.toJSON = function(l) { - return JSON.stringify(l); - }; - ListWrapper.maximum = function(list, predicate) { - if (list.length == 0) { - return null; - } - var solution = null; - var maxValue = -Infinity; - for (var index = 0; index < list.length; index++) { - var candidate = list[index]; - if (lang_1.isBlank(candidate)) { - continue; - } - var candidateValue = predicate(candidate); - if (candidateValue > maxValue) { - solution = candidate; - maxValue = candidateValue; - } - } - return solution; - }; - ListWrapper.flatten = function(array) { - var res = []; - array.forEach(function(a) { - return res = res.concat(a); - }); - return res; - }; - return ListWrapper; - }()); - exports.ListWrapper = ListWrapper; - function isListLikeIterable(obj) { - if (!lang_1.isJsObject(obj)) - return false; - return lang_1.isArray(obj) || (!(obj instanceof exports.Map) && lang_1.getSymbolIterator() in obj); - } - exports.isListLikeIterable = isListLikeIterable; - function areIterablesEqual(a, b, comparator) { - var iterator1 = a[lang_1.getSymbolIterator()](); - var iterator2 = b[lang_1.getSymbolIterator()](); - while (true) { - var item1 = iterator1.next(); - var item2 = iterator2.next(); - if (item1.done && item2.done) - return true; - if (item1.done || item2.done) - return false; - if (!comparator(item1.value, item2.value)) - return false; - } - } - exports.areIterablesEqual = areIterablesEqual; - function iterateListLike(obj, fn) { - if (lang_1.isArray(obj)) { - for (var i = 0; i < obj.length; i++) { - fn(obj[i]); - } - } else { - var iterator = obj[lang_1.getSymbolIterator()](); - var item; - while (!((item = iterator.next()).done)) { - fn(item.value); - } - } - } - exports.iterateListLike = iterateListLike; - var createSetFromList = (function() { - var test = new exports.Set([1, 2, 3]); - if (test.size === 3) { - return function createSetFromList(lst) { - return new exports.Set(lst); - }; - } else { - return function createSetAndPopulateFromList(lst) { - var res = new exports.Set(lst); - if (res.size !== lst.length) { - for (var i = 0; i < lst.length; i++) { - res.add(lst[i]); - } - } - return res; - }; - } - })(); - var SetWrapper = (function() { - function SetWrapper() {} - SetWrapper.createFromList = function(lst) { - return createSetFromList(lst); - }; - SetWrapper.has = function(s, key) { - return s.has(key); - }; - SetWrapper.delete = function(m, k) { - m.delete(k); - }; - return SetWrapper; - }()); - exports.SetWrapper = SetWrapper; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/facade/base_wrapped_exception", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var BaseWrappedException = (function(_super) { - __extends(BaseWrappedException, _super); - function BaseWrappedException(message) { - _super.call(this, message); - } - Object.defineProperty(BaseWrappedException.prototype, "wrapperMessage", { - get: function() { - return ''; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(BaseWrappedException.prototype, "wrapperStack", { - get: function() { - return null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(BaseWrappedException.prototype, "originalException", { - get: function() { - return null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(BaseWrappedException.prototype, "originalStack", { - get: function() { - return null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(BaseWrappedException.prototype, "context", { - get: function() { - return null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(BaseWrappedException.prototype, "message", { - get: function() { - return ''; - }, - enumerable: true, - configurable: true - }); - return BaseWrappedException; - }(Error)); - exports.BaseWrappedException = BaseWrappedException; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/facade/exception_handler", ["angular2/src/facade/lang", "angular2/src/facade/base_wrapped_exception", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var base_wrapped_exception_1 = require("angular2/src/facade/base_wrapped_exception"); - var collection_1 = require("angular2/src/facade/collection"); - var _ArrayLogger = (function() { - function _ArrayLogger() { - this.res = []; - } - _ArrayLogger.prototype.log = function(s) { - this.res.push(s); - }; - _ArrayLogger.prototype.logError = function(s) { - this.res.push(s); - }; - _ArrayLogger.prototype.logGroup = function(s) { - this.res.push(s); - }; - _ArrayLogger.prototype.logGroupEnd = function() {}; - ; - return _ArrayLogger; - }()); - var ExceptionHandler = (function() { - function ExceptionHandler(_logger, _rethrowException) { - if (_rethrowException === void 0) { - _rethrowException = true; - } - this._logger = _logger; - this._rethrowException = _rethrowException; - } - ExceptionHandler.exceptionToString = function(exception, stackTrace, reason) { - if (stackTrace === void 0) { - stackTrace = null; - } - if (reason === void 0) { - reason = null; - } - var l = new _ArrayLogger(); - var e = new ExceptionHandler(l, false); - e.call(exception, stackTrace, reason); - return l.res.join("\n"); - }; - ExceptionHandler.prototype.call = function(exception, stackTrace, reason) { - if (stackTrace === void 0) { - stackTrace = null; - } - if (reason === void 0) { - reason = null; - } - var originalException = this._findOriginalException(exception); - var originalStack = this._findOriginalStack(exception); - var context = this._findContext(exception); - this._logger.logGroup("EXCEPTION: " + this._extractMessage(exception)); - if (lang_1.isPresent(stackTrace) && lang_1.isBlank(originalStack)) { - this._logger.logError("STACKTRACE:"); - this._logger.logError(this._longStackTrace(stackTrace)); - } - if (lang_1.isPresent(reason)) { - this._logger.logError("REASON: " + reason); - } - if (lang_1.isPresent(originalException)) { - this._logger.logError("ORIGINAL EXCEPTION: " + this._extractMessage(originalException)); - } - if (lang_1.isPresent(originalStack)) { - this._logger.logError("ORIGINAL STACKTRACE:"); - this._logger.logError(this._longStackTrace(originalStack)); - } - if (lang_1.isPresent(context)) { - this._logger.logError("ERROR CONTEXT:"); - this._logger.logError(context); - } - this._logger.logGroupEnd(); - if (this._rethrowException) - throw exception; - }; - ExceptionHandler.prototype._extractMessage = function(exception) { - return exception instanceof base_wrapped_exception_1.BaseWrappedException ? exception.wrapperMessage : exception.toString(); - }; - ExceptionHandler.prototype._longStackTrace = function(stackTrace) { - return collection_1.isListLikeIterable(stackTrace) ? stackTrace.join("\n\n-----async gap-----\n") : stackTrace.toString(); - }; - ExceptionHandler.prototype._findContext = function(exception) { - try { - if (!(exception instanceof base_wrapped_exception_1.BaseWrappedException)) - return null; - return lang_1.isPresent(exception.context) ? exception.context : this._findContext(exception.originalException); - } catch (e) { - return null; - } - }; - ExceptionHandler.prototype._findOriginalException = function(exception) { - if (!(exception instanceof base_wrapped_exception_1.BaseWrappedException)) - return null; - var e = exception.originalException; - while (e instanceof base_wrapped_exception_1.BaseWrappedException && lang_1.isPresent(e.originalException)) { - e = e.originalException; - } - return e; - }; - ExceptionHandler.prototype._findOriginalStack = function(exception) { - if (!(exception instanceof base_wrapped_exception_1.BaseWrappedException)) - return null; - var e = exception; - var stack = exception.originalStack; - while (e instanceof base_wrapped_exception_1.BaseWrappedException && lang_1.isPresent(e.originalException)) { - e = e.originalException; - if (e instanceof base_wrapped_exception_1.BaseWrappedException && lang_1.isPresent(e.originalException)) { - stack = e.originalStack; - } - } - return stack; - }; - return ExceptionHandler; - }()); - exports.ExceptionHandler = ExceptionHandler; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/reflection/reflector_reader", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var ReflectorReader = (function() { - function ReflectorReader() {} - return ReflectorReader; - }()); - exports.ReflectorReader = ReflectorReader; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/reflection/reflection_capabilities", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var ReflectionCapabilities = (function() { - function ReflectionCapabilities(reflect) { - this._reflect = lang_1.isPresent(reflect) ? reflect : lang_1.global.Reflect; - } - ReflectionCapabilities.prototype.isReflectionEnabled = function() { - return true; - }; - ReflectionCapabilities.prototype.factory = function(t) { - switch (t.length) { - case 0: - return function() { - return new t(); - }; - case 1: - return function(a1) { - return new t(a1); - }; - case 2: - return function(a1, a2) { - return new t(a1, a2); - }; - case 3: - return function(a1, a2, a3) { - return new t(a1, a2, a3); - }; - case 4: - return function(a1, a2, a3, a4) { - return new t(a1, a2, a3, a4); - }; - case 5: - return function(a1, a2, a3, a4, a5) { - return new t(a1, a2, a3, a4, a5); - }; - case 6: - return function(a1, a2, a3, a4, a5, a6) { - return new t(a1, a2, a3, a4, a5, a6); - }; - case 7: - return function(a1, a2, a3, a4, a5, a6, a7) { - return new t(a1, a2, a3, a4, a5, a6, a7); - }; - case 8: - return function(a1, a2, a3, a4, a5, a6, a7, a8) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8); - }; - case 9: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9); - }; - case 10: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); - }; - case 11: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); - }; - case 12: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); - }; - case 13: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); - }; - case 14: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); - }; - case 15: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); - }; - case 16: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); - }; - case 17: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); - }; - case 18: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); - }; - case 19: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); - }; - case 20: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) { - return new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); - }; - } - ; - throw new Error("Cannot create a factory for '" + lang_1.stringify(t) + "' because its constructor has more than 20 arguments"); - }; - ReflectionCapabilities.prototype._zipTypesAndAnnotations = function(paramTypes, paramAnnotations) { - var result; - if (typeof paramTypes === 'undefined') { - result = new Array(paramAnnotations.length); - } else { - result = new Array(paramTypes.length); - } - for (var i = 0; i < result.length; i++) { - if (typeof paramTypes === 'undefined') { - result[i] = []; - } else if (paramTypes[i] != Object) { - result[i] = [paramTypes[i]]; - } else { - result[i] = []; - } - if (lang_1.isPresent(paramAnnotations) && lang_1.isPresent(paramAnnotations[i])) { - result[i] = result[i].concat(paramAnnotations[i]); - } - } - return result; - }; - ReflectionCapabilities.prototype.parameters = function(typeOrFunc) { - if (lang_1.isPresent(typeOrFunc.parameters)) { - return typeOrFunc.parameters; - } - if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { - var paramAnnotations = this._reflect.getMetadata('parameters', typeOrFunc); - var paramTypes = this._reflect.getMetadata('design:paramtypes', typeOrFunc); - if (lang_1.isPresent(paramTypes) || lang_1.isPresent(paramAnnotations)) { - return this._zipTypesAndAnnotations(paramTypes, paramAnnotations); - } - } - var parameters = new Array(typeOrFunc.length); - parameters.fill(undefined); - return parameters; - }; - ReflectionCapabilities.prototype.annotations = function(typeOrFunc) { - if (lang_1.isPresent(typeOrFunc.annotations)) { - var annotations = typeOrFunc.annotations; - if (lang_1.isFunction(annotations) && annotations.annotations) { - annotations = annotations.annotations; - } - return annotations; - } - if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { - var annotations = this._reflect.getMetadata('annotations', typeOrFunc); - if (lang_1.isPresent(annotations)) - return annotations; - } - return []; - }; - ReflectionCapabilities.prototype.propMetadata = function(typeOrFunc) { - if (lang_1.isPresent(typeOrFunc.propMetadata)) { - var propMetadata = typeOrFunc.propMetadata; - if (lang_1.isFunction(propMetadata) && propMetadata.propMetadata) { - propMetadata = propMetadata.propMetadata; - } - return propMetadata; - } - if (lang_1.isPresent(this._reflect) && lang_1.isPresent(this._reflect.getMetadata)) { - var propMetadata = this._reflect.getMetadata('propMetadata', typeOrFunc); - if (lang_1.isPresent(propMetadata)) - return propMetadata; - } - return {}; - }; - ReflectionCapabilities.prototype.interfaces = function(type) { - throw new exceptions_1.BaseException("JavaScript does not support interfaces"); - }; - ReflectionCapabilities.prototype.getter = function(name) { - return new Function('o', 'return o.' + name + ';'); - }; - ReflectionCapabilities.prototype.setter = function(name) { - return new Function('o', 'v', 'return o.' + name + ' = v;'); - }; - ReflectionCapabilities.prototype.method = function(name) { - var functionBody = "if (!o." + name + ") throw new Error('\"" + name + "\" is undefined');\n return o." + name + ".apply(o, args);"; - return new Function('o', 'args', functionBody); - }; - ReflectionCapabilities.prototype.importUri = function(type) { - return './'; - }; - return ReflectionCapabilities; - }()); - exports.ReflectionCapabilities = ReflectionCapabilities; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/di/key", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di/forward_ref"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var forward_ref_1 = require("angular2/src/core/di/forward_ref"); - var Key = (function() { - function Key(token, id) { - this.token = token; - this.id = id; - if (lang_1.isBlank(token)) { - throw new exceptions_1.BaseException('Token must be defined!'); - } - } - Object.defineProperty(Key.prototype, "displayName", { - get: function() { - return lang_1.stringify(this.token); - }, - enumerable: true, - configurable: true - }); - Key.get = function(token) { - return _globalKeyRegistry.get(forward_ref_1.resolveForwardRef(token)); - }; - Object.defineProperty(Key, "numberOfKeys", { - get: function() { - return _globalKeyRegistry.numberOfKeys; - }, - enumerable: true, - configurable: true - }); - return Key; - }()); - exports.Key = Key; - var KeyRegistry = (function() { - function KeyRegistry() { - this._allKeys = new Map(); - } - KeyRegistry.prototype.get = function(token) { - if (token instanceof Key) - return token; - if (this._allKeys.has(token)) { - return this._allKeys.get(token); - } - var newKey = new Key(token, Key.numberOfKeys); - this._allKeys.set(token, newKey); - return newKey; - }; - Object.defineProperty(KeyRegistry.prototype, "numberOfKeys", { - get: function() { - return this._allKeys.size; - }, - enumerable: true, - configurable: true - }); - return KeyRegistry; - }()); - exports.KeyRegistry = KeyRegistry; - var _globalKeyRegistry = new KeyRegistry(); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/di/exceptions", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - function findFirstClosedCycle(keys) { - var res = []; - for (var i = 0; i < keys.length; ++i) { - if (collection_1.ListWrapper.contains(res, keys[i])) { - res.push(keys[i]); - return res; - } else { - res.push(keys[i]); - } - } - return res; - } - function constructResolvingPath(keys) { - if (keys.length > 1) { - var reversed = findFirstClosedCycle(collection_1.ListWrapper.reversed(keys)); - var tokenStrs = reversed.map(function(k) { - return lang_1.stringify(k.token); - }); - return " (" + tokenStrs.join(' -> ') + ")"; - } else { - return ""; - } - } - var AbstractProviderError = (function(_super) { - __extends(AbstractProviderError, _super); - function AbstractProviderError(injector, key, constructResolvingMessage) { - _super.call(this, "DI Exception"); - this.keys = [key]; - this.injectors = [injector]; - this.constructResolvingMessage = constructResolvingMessage; - this.message = this.constructResolvingMessage(this.keys); - } - AbstractProviderError.prototype.addKey = function(injector, key) { - this.injectors.push(injector); - this.keys.push(key); - this.message = this.constructResolvingMessage(this.keys); - }; - Object.defineProperty(AbstractProviderError.prototype, "context", { - get: function() { - return this.injectors[this.injectors.length - 1].debugContext(); - }, - enumerable: true, - configurable: true - }); - return AbstractProviderError; - }(exceptions_1.BaseException)); - exports.AbstractProviderError = AbstractProviderError; - var NoProviderError = (function(_super) { - __extends(NoProviderError, _super); - function NoProviderError(injector, key) { - _super.call(this, injector, key, function(keys) { - var first = lang_1.stringify(collection_1.ListWrapper.first(keys).token); - return "No provider for " + first + "!" + constructResolvingPath(keys); - }); - } - return NoProviderError; - }(AbstractProviderError)); - exports.NoProviderError = NoProviderError; - var CyclicDependencyError = (function(_super) { - __extends(CyclicDependencyError, _super); - function CyclicDependencyError(injector, key) { - _super.call(this, injector, key, function(keys) { - return "Cannot instantiate cyclic dependency!" + constructResolvingPath(keys); - }); - } - return CyclicDependencyError; - }(AbstractProviderError)); - exports.CyclicDependencyError = CyclicDependencyError; - var InstantiationError = (function(_super) { - __extends(InstantiationError, _super); - function InstantiationError(injector, originalException, originalStack, key) { - _super.call(this, "DI Exception", originalException, originalStack, null); - this.keys = [key]; - this.injectors = [injector]; - } - InstantiationError.prototype.addKey = function(injector, key) { - this.injectors.push(injector); - this.keys.push(key); - }; - Object.defineProperty(InstantiationError.prototype, "wrapperMessage", { - get: function() { - var first = lang_1.stringify(collection_1.ListWrapper.first(this.keys).token); - return "Error during instantiation of " + first + "!" + constructResolvingPath(this.keys) + "."; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(InstantiationError.prototype, "causeKey", { - get: function() { - return this.keys[0]; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(InstantiationError.prototype, "context", { - get: function() { - return this.injectors[this.injectors.length - 1].debugContext(); - }, - enumerable: true, - configurable: true - }); - return InstantiationError; - }(exceptions_1.WrappedException)); - exports.InstantiationError = InstantiationError; - var InvalidProviderError = (function(_super) { - __extends(InvalidProviderError, _super); - function InvalidProviderError(provider) { - _super.call(this, "Invalid provider - only instances of Provider and Type are allowed, got: " + provider.toString()); - } - return InvalidProviderError; - }(exceptions_1.BaseException)); - exports.InvalidProviderError = InvalidProviderError; - var NoAnnotationError = (function(_super) { - __extends(NoAnnotationError, _super); - function NoAnnotationError(typeOrFunc, params) { - _super.call(this, NoAnnotationError._genMessage(typeOrFunc, params)); - } - NoAnnotationError._genMessage = function(typeOrFunc, params) { - var signature = []; - for (var i = 0, - ii = params.length; i < ii; i++) { - var parameter = params[i]; - if (lang_1.isBlank(parameter) || parameter.length == 0) { - signature.push('?'); - } else { - signature.push(parameter.map(lang_1.stringify).join(' ')); - } - } - return "Cannot resolve all parameters for '" + lang_1.stringify(typeOrFunc) + "'(" + signature.join(', ') + "). " + "Make sure that all the parameters are decorated with Inject or have valid type annotations and that '" + lang_1.stringify(typeOrFunc) + "' is decorated with Injectable."; - }; - return NoAnnotationError; - }(exceptions_1.BaseException)); - exports.NoAnnotationError = NoAnnotationError; - var OutOfBoundsError = (function(_super) { - __extends(OutOfBoundsError, _super); - function OutOfBoundsError(index) { - _super.call(this, "Index " + index + " is out-of-bounds."); - } - return OutOfBoundsError; - }(exceptions_1.BaseException)); - exports.OutOfBoundsError = OutOfBoundsError; - var MixingMultiProvidersWithRegularProvidersError = (function(_super) { - __extends(MixingMultiProvidersWithRegularProvidersError, _super); - function MixingMultiProvidersWithRegularProvidersError(provider1, provider2) { - _super.call(this, "Cannot mix multi providers and regular providers, got: " + provider1.toString() + " " + provider2.toString()); - } - return MixingMultiProvidersWithRegularProvidersError; - }(exceptions_1.BaseException)); - exports.MixingMultiProvidersWithRegularProvidersError = MixingMultiProvidersWithRegularProvidersError; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/di/opaque_token", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var OpaqueToken = (function() { - function OpaqueToken(_desc) { - this._desc = _desc; - } - OpaqueToken.prototype.toString = function() { - return "Token " + this._desc; - }; - OpaqueToken = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OpaqueToken); - return OpaqueToken; - }()); - exports.OpaqueToken = OpaqueToken; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/animate/css_animation_options", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var CssAnimationOptions = (function() { - function CssAnimationOptions() { - this.classesToAdd = []; - this.classesToRemove = []; - this.animationClasses = []; - } - return CssAnimationOptions; - }()); - exports.CssAnimationOptions = CssAnimationOptions; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/facade/math", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - exports.Math = lang_1.global.Math; - exports.NaN = typeof exports.NaN; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var CAMEL_CASE_REGEXP = /([A-Z])/g; - var DASH_CASE_REGEXP = /-([a-z])/g; - function camelCaseToDashCase(input) { - return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { - return '-' + m[1].toLowerCase(); - }); - } - exports.camelCaseToDashCase = camelCaseToDashCase; - function dashCaseToCamelCase(input) { - return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { - return m[1].toUpperCase(); - }); - } - exports.dashCaseToCamelCase = dashCaseToCamelCase; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/animate/browser_details", ["angular2/src/core/di", "angular2/src/facade/math", "angular2/src/platform/dom/dom_adapter"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = require("angular2/src/core/di"); - var math_1 = require("angular2/src/facade/math"); - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var BrowserDetails = (function() { - function BrowserDetails() { - this.elapsedTimeIncludesDelay = false; - this.doesElapsedTimeIncludesDelay(); - } - BrowserDetails.prototype.doesElapsedTimeIncludesDelay = function() { - var _this = this; - var div = dom_adapter_1.DOM.createElement('div'); - dom_adapter_1.DOM.setAttribute(div, 'style', "position: absolute; top: -9999px; left: -9999px; width: 1px;\n height: 1px; transition: all 1ms linear 1ms;"); - this.raf(function(timestamp) { - dom_adapter_1.DOM.on(div, 'transitionend', function(event) { - var elapsed = math_1.Math.round(event.elapsedTime * 1000); - _this.elapsedTimeIncludesDelay = elapsed == 2; - dom_adapter_1.DOM.remove(div); - }); - dom_adapter_1.DOM.setStyle(div, 'width', '2px'); - }, 2); - }; - BrowserDetails.prototype.raf = function(callback, frames) { - if (frames === void 0) { - frames = 1; - } - var queue = new RafQueue(callback, frames); - return function() { - return queue.cancel(); - }; - }; - BrowserDetails = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], BrowserDetails); - return BrowserDetails; - }()); - exports.BrowserDetails = BrowserDetails; - var RafQueue = (function() { - function RafQueue(callback, frames) { - this.callback = callback; - this.frames = frames; - this._raf(); - } - RafQueue.prototype._raf = function() { - var _this = this; - this.currentFrameId = dom_adapter_1.DOM.requestAnimationFrame(function(timestamp) { - return _this._nextFrame(timestamp); - }); - }; - RafQueue.prototype._nextFrame = function(timestamp) { - this.frames--; - if (this.frames > 0) { - this._raf(); - } else { - this.callback(timestamp); - } - }; - RafQueue.prototype.cancel = function() { - dom_adapter_1.DOM.cancelAnimationFrame(this.currentFrameId); - this.currentFrameId = null; - }; - return RafQueue; - }()); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/dom_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - exports.DOCUMENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('DocumentToken')); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/facade/promise", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var PromiseCompleter = (function() { - function PromiseCompleter() { - var _this = this; - this.promise = new Promise(function(res, rej) { - _this.resolve = res; - _this.reject = rej; - }); - } - return PromiseCompleter; - }()); - exports.PromiseCompleter = PromiseCompleter; - var PromiseWrapper = (function() { - function PromiseWrapper() {} - PromiseWrapper.resolve = function(obj) { - return Promise.resolve(obj); - }; - PromiseWrapper.reject = function(obj, _) { - return Promise.reject(obj); - }; - PromiseWrapper.catchError = function(promise, onError) { - return promise.catch(onError); - }; - PromiseWrapper.all = function(promises) { - if (promises.length == 0) - return Promise.resolve([]); - return Promise.all(promises); - }; - PromiseWrapper.then = function(promise, success, rejection) { - return promise.then(success, rejection); - }; - PromiseWrapper.wrap = function(computation) { - return new Promise(function(res, rej) { - try { - res(computation()); - } catch (e) { - rej(e); - } - }); - }; - PromiseWrapper.scheduleMicrotask = function(computation) { - PromiseWrapper.then(PromiseWrapper.resolve(null), computation, function(_) {}); - }; - PromiseWrapper.isPromise = function(obj) { - return obj instanceof Promise; - }; - PromiseWrapper.completer = function() { - return new PromiseCompleter(); - }; - return PromiseWrapper; - }()); - exports.PromiseWrapper = PromiseWrapper; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/zone/ng_zone_impl", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var NgZoneError = (function() { - function NgZoneError(error, stackTrace) { - this.error = error; - this.stackTrace = stackTrace; - } - return NgZoneError; - }()); - exports.NgZoneError = NgZoneError; - var NgZoneImpl = (function() { - function NgZoneImpl(_a) { - var _this = this; - var trace = _a.trace, - onEnter = _a.onEnter, - onLeave = _a.onLeave, - setMicrotask = _a.setMicrotask, - setMacrotask = _a.setMacrotask, - onError = _a.onError; - this.onEnter = onEnter; - this.onLeave = onLeave; - this.setMicrotask = setMicrotask; - this.setMacrotask = setMacrotask; - this.onError = onError; - if (Zone) { - this.outer = this.inner = Zone.current; - if (Zone['wtfZoneSpec']) { - this.inner = this.inner.fork(Zone['wtfZoneSpec']); - } - if (trace && Zone['longStackTraceZoneSpec']) { - this.inner = this.inner.fork(Zone['longStackTraceZoneSpec']); - } - this.inner = this.inner.fork({ - name: 'angular', - properties: {'isAngularZone': true}, - onInvokeTask: function(delegate, current, target, task, applyThis, applyArgs) { - try { - _this.onEnter(); - return delegate.invokeTask(target, task, applyThis, applyArgs); - } finally { - _this.onLeave(); - } - }, - onInvoke: function(delegate, current, target, callback, applyThis, applyArgs, source) { - try { - _this.onEnter(); - return delegate.invoke(target, callback, applyThis, applyArgs, source); - } finally { - _this.onLeave(); - } - }, - onHasTask: function(delegate, current, target, hasTaskState) { - delegate.hasTask(target, hasTaskState); - if (current == target) { - if (hasTaskState.change == 'microTask') { - _this.setMicrotask(hasTaskState.microTask); - } else if (hasTaskState.change == 'macroTask') { - _this.setMacrotask(hasTaskState.macroTask); - } - } - }, - onHandleError: function(delegate, current, target, error) { - delegate.handleError(target, error); - _this.onError(new NgZoneError(error, error.stack)); - return false; - } - }); - } else { - throw new Error('Angular2 needs to be run with Zone.js polyfill.'); - } - } - NgZoneImpl.isInAngularZone = function() { - return Zone.current.get('isAngularZone') === true; - }; - NgZoneImpl.prototype.runInner = function(fn) { - return this.inner.runGuarded(fn); - }; - ; - NgZoneImpl.prototype.runOuter = function(fn) { - return this.outer.run(fn); - }; - ; - return NgZoneImpl; - }()); - exports.NgZoneImpl = NgZoneImpl; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/metadata/di", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/di/metadata"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var di_1 = require("angular2/src/core/di"); - var metadata_1 = require("angular2/src/core/di/metadata"); - var AttributeMetadata = (function(_super) { - __extends(AttributeMetadata, _super); - function AttributeMetadata(attributeName) { - _super.call(this); - this.attributeName = attributeName; - } - Object.defineProperty(AttributeMetadata.prototype, "token", { - get: function() { - return this; - }, - enumerable: true, - configurable: true - }); - AttributeMetadata.prototype.toString = function() { - return "@Attribute(" + lang_1.stringify(this.attributeName) + ")"; - }; - AttributeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], AttributeMetadata); - return AttributeMetadata; - }(metadata_1.DependencyMetadata)); - exports.AttributeMetadata = AttributeMetadata; - var QueryMetadata = (function(_super) { - __extends(QueryMetadata, _super); - function QueryMetadata(_selector, _a) { - var _b = _a === void 0 ? {} : _a, - _c = _b.descendants, - descendants = _c === void 0 ? false : _c, - _d = _b.first, - first = _d === void 0 ? false : _d; - _super.call(this); - this._selector = _selector; - this.descendants = descendants; - this.first = first; - } - Object.defineProperty(QueryMetadata.prototype, "isViewQuery", { - get: function() { - return false; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(QueryMetadata.prototype, "selector", { - get: function() { - return di_1.resolveForwardRef(this._selector); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(QueryMetadata.prototype, "isVarBindingQuery", { - get: function() { - return lang_1.isString(this.selector); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(QueryMetadata.prototype, "varBindings", { - get: function() { - return this.selector.split(','); - }, - enumerable: true, - configurable: true - }); - QueryMetadata.prototype.toString = function() { - return "@Query(" + lang_1.stringify(this.selector) + ")"; - }; - QueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], QueryMetadata); - return QueryMetadata; - }(metadata_1.DependencyMetadata)); - exports.QueryMetadata = QueryMetadata; - var ContentChildrenMetadata = (function(_super) { - __extends(ContentChildrenMetadata, _super); - function ContentChildrenMetadata(_selector, _a) { - var _b = (_a === void 0 ? {} : _a).descendants, - descendants = _b === void 0 ? false : _b; - _super.call(this, _selector, {descendants: descendants}); - } - ContentChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ContentChildrenMetadata); - return ContentChildrenMetadata; - }(QueryMetadata)); - exports.ContentChildrenMetadata = ContentChildrenMetadata; - var ContentChildMetadata = (function(_super) { - __extends(ContentChildMetadata, _super); - function ContentChildMetadata(_selector) { - _super.call(this, _selector, { - descendants: true, - first: true - }); - } - ContentChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ContentChildMetadata); - return ContentChildMetadata; - }(QueryMetadata)); - exports.ContentChildMetadata = ContentChildMetadata; - var ViewQueryMetadata = (function(_super) { - __extends(ViewQueryMetadata, _super); - function ViewQueryMetadata(_selector, _a) { - var _b = _a === void 0 ? {} : _a, - _c = _b.descendants, - descendants = _c === void 0 ? false : _c, - _d = _b.first, - first = _d === void 0 ? false : _d; - _super.call(this, _selector, { - descendants: descendants, - first: first - }); - } - Object.defineProperty(ViewQueryMetadata.prototype, "isViewQuery", { - get: function() { - return true; - }, - enumerable: true, - configurable: true - }); - ViewQueryMetadata.prototype.toString = function() { - return "@ViewQuery(" + lang_1.stringify(this.selector) + ")"; - }; - ViewQueryMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], ViewQueryMetadata); - return ViewQueryMetadata; - }(QueryMetadata)); - exports.ViewQueryMetadata = ViewQueryMetadata; - var ViewChildrenMetadata = (function(_super) { - __extends(ViewChildrenMetadata, _super); - function ViewChildrenMetadata(_selector) { - _super.call(this, _selector, {descendants: true}); - } - ViewChildrenMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildrenMetadata); - return ViewChildrenMetadata; - }(ViewQueryMetadata)); - exports.ViewChildrenMetadata = ViewChildrenMetadata; - var ViewChildMetadata = (function(_super) { - __extends(ViewChildMetadata, _super); - function ViewChildMetadata(_selector) { - _super.call(this, _selector, { - descendants: true, - first: true - }); - } - ViewChildMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewChildMetadata); - return ViewChildMetadata; - }(ViewQueryMetadata)); - exports.ViewChildMetadata = ViewChildMetadata; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/differs/iterable_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var di_1 = require("angular2/src/core/di"); - var IterableDiffers = (function() { - function IterableDiffers(factories) { - this.factories = factories; - } - IterableDiffers.create = function(factories, parent) { - if (lang_1.isPresent(parent)) { - var copied = collection_1.ListWrapper.clone(parent.factories); - factories = factories.concat(copied); - return new IterableDiffers(factories); - } else { - return new IterableDiffers(factories); - } - }; - IterableDiffers.extend = function(factories) { - return new di_1.Provider(IterableDiffers, { - useFactory: function(parent) { - if (lang_1.isBlank(parent)) { - throw new exceptions_1.BaseException('Cannot extend IterableDiffers without a parent injector'); - } - return IterableDiffers.create(factories, parent); - }, - deps: [[IterableDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] - }); - }; - IterableDiffers.prototype.find = function(iterable) { - var factory = this.factories.find(function(f) { - return f.supports(iterable); - }); - if (lang_1.isPresent(factory)) { - return factory; - } else { - throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + iterable + "' of type '" + lang_1.getTypeNameForDebugging(iterable) + "'"); - } - }; - IterableDiffers = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Array])], IterableDiffers); - return IterableDiffers; - }()); - exports.IterableDiffers = IterableDiffers; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/differs/default_iterable_differ", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var lang_2 = require("angular2/src/facade/lang"); - var DefaultIterableDifferFactory = (function() { - function DefaultIterableDifferFactory() {} - DefaultIterableDifferFactory.prototype.supports = function(obj) { - return collection_1.isListLikeIterable(obj); - }; - DefaultIterableDifferFactory.prototype.create = function(cdRef, trackByFn) { - return new DefaultIterableDiffer(trackByFn); - }; - DefaultIterableDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultIterableDifferFactory); - return DefaultIterableDifferFactory; - }()); - exports.DefaultIterableDifferFactory = DefaultIterableDifferFactory; - var trackByIdentity = function(index, item) { - return item; - }; - var DefaultIterableDiffer = (function() { - function DefaultIterableDiffer(_trackByFn) { - this._trackByFn = _trackByFn; - this._length = null; - this._collection = null; - this._linkedRecords = null; - this._unlinkedRecords = null; - this._previousItHead = null; - this._itHead = null; - this._itTail = null; - this._additionsHead = null; - this._additionsTail = null; - this._movesHead = null; - this._movesTail = null; - this._removalsHead = null; - this._removalsTail = null; - this._identityChangesHead = null; - this._identityChangesTail = null; - this._trackByFn = lang_2.isPresent(this._trackByFn) ? this._trackByFn : trackByIdentity; - } - Object.defineProperty(DefaultIterableDiffer.prototype, "collection", { - get: function() { - return this._collection; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DefaultIterableDiffer.prototype, "length", { - get: function() { - return this._length; - }, - enumerable: true, - configurable: true - }); - DefaultIterableDiffer.prototype.forEachItem = function(fn) { - var record; - for (record = this._itHead; record !== null; record = record._next) { - fn(record); - } - }; - DefaultIterableDiffer.prototype.forEachPreviousItem = function(fn) { - var record; - for (record = this._previousItHead; record !== null; record = record._nextPrevious) { - fn(record); - } - }; - DefaultIterableDiffer.prototype.forEachAddedItem = function(fn) { - var record; - for (record = this._additionsHead; record !== null; record = record._nextAdded) { - fn(record); - } - }; - DefaultIterableDiffer.prototype.forEachMovedItem = function(fn) { - var record; - for (record = this._movesHead; record !== null; record = record._nextMoved) { - fn(record); - } - }; - DefaultIterableDiffer.prototype.forEachRemovedItem = function(fn) { - var record; - for (record = this._removalsHead; record !== null; record = record._nextRemoved) { - fn(record); - } - }; - DefaultIterableDiffer.prototype.forEachIdentityChange = function(fn) { - var record; - for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) { - fn(record); - } - }; - DefaultIterableDiffer.prototype.diff = function(collection) { - if (lang_2.isBlank(collection)) - collection = []; - if (!collection_1.isListLikeIterable(collection)) { - throw new exceptions_1.BaseException("Error trying to diff '" + collection + "'"); - } - if (this.check(collection)) { - return this; - } else { - return null; - } - }; - DefaultIterableDiffer.prototype.onDestroy = function() {}; - DefaultIterableDiffer.prototype.check = function(collection) { - var _this = this; - this._reset(); - var record = this._itHead; - var mayBeDirty = false; - var index; - var item; - var itemTrackBy; - if (lang_2.isArray(collection)) { - var list = collection; - this._length = collection.length; - for (index = 0; index < this._length; index++) { - item = list[index]; - itemTrackBy = this._trackByFn(index, item); - if (record === null || !lang_2.looseIdentical(record.trackById, itemTrackBy)) { - record = this._mismatch(record, item, itemTrackBy, index); - mayBeDirty = true; - } else { - if (mayBeDirty) { - record = this._verifyReinsertion(record, item, itemTrackBy, index); - } - if (!lang_2.looseIdentical(record.item, item)) - this._addIdentityChange(record, item); - } - record = record._next; - } - } else { - index = 0; - collection_1.iterateListLike(collection, function(item) { - itemTrackBy = _this._trackByFn(index, item); - if (record === null || !lang_2.looseIdentical(record.trackById, itemTrackBy)) { - record = _this._mismatch(record, item, itemTrackBy, index); - mayBeDirty = true; - } else { - if (mayBeDirty) { - record = _this._verifyReinsertion(record, item, itemTrackBy, index); - } - if (!lang_2.looseIdentical(record.item, item)) - _this._addIdentityChange(record, item); - } - record = record._next; - index++; - }); - this._length = index; - } - this._truncate(record); - this._collection = collection; - return this.isDirty; - }; - Object.defineProperty(DefaultIterableDiffer.prototype, "isDirty", { - get: function() { - return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null || this._identityChangesHead !== null; - }, - enumerable: true, - configurable: true - }); - DefaultIterableDiffer.prototype._reset = function() { - if (this.isDirty) { - var record; - var nextRecord; - for (record = this._previousItHead = this._itHead; record !== null; record = record._next) { - record._nextPrevious = record._next; - } - for (record = this._additionsHead; record !== null; record = record._nextAdded) { - record.previousIndex = record.currentIndex; - } - this._additionsHead = this._additionsTail = null; - for (record = this._movesHead; record !== null; record = nextRecord) { - record.previousIndex = record.currentIndex; - nextRecord = record._nextMoved; - } - this._movesHead = this._movesTail = null; - this._removalsHead = this._removalsTail = null; - this._identityChangesHead = this._identityChangesTail = null; - } - }; - DefaultIterableDiffer.prototype._mismatch = function(record, item, itemTrackBy, index) { - var previousRecord; - if (record === null) { - previousRecord = this._itTail; - } else { - previousRecord = record._prev; - this._remove(record); - } - record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index); - if (record !== null) { - if (!lang_2.looseIdentical(record.item, item)) - this._addIdentityChange(record, item); - this._moveAfter(record, previousRecord, index); - } else { - record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy); - if (record !== null) { - if (!lang_2.looseIdentical(record.item, item)) - this._addIdentityChange(record, item); - this._reinsertAfter(record, previousRecord, index); - } else { - record = this._addAfter(new CollectionChangeRecord(item, itemTrackBy), previousRecord, index); - } - } - return record; - }; - DefaultIterableDiffer.prototype._verifyReinsertion = function(record, item, itemTrackBy, index) { - var reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy); - if (reinsertRecord !== null) { - record = this._reinsertAfter(reinsertRecord, record._prev, index); - } else if (record.currentIndex != index) { - record.currentIndex = index; - this._addToMoves(record, index); - } - return record; - }; - DefaultIterableDiffer.prototype._truncate = function(record) { - while (record !== null) { - var nextRecord = record._next; - this._addToRemovals(this._unlink(record)); - record = nextRecord; - } - if (this._unlinkedRecords !== null) { - this._unlinkedRecords.clear(); - } - if (this._additionsTail !== null) { - this._additionsTail._nextAdded = null; - } - if (this._movesTail !== null) { - this._movesTail._nextMoved = null; - } - if (this._itTail !== null) { - this._itTail._next = null; - } - if (this._removalsTail !== null) { - this._removalsTail._nextRemoved = null; - } - if (this._identityChangesTail !== null) { - this._identityChangesTail._nextIdentityChange = null; - } - }; - DefaultIterableDiffer.prototype._reinsertAfter = function(record, prevRecord, index) { - if (this._unlinkedRecords !== null) { - this._unlinkedRecords.remove(record); - } - var prev = record._prevRemoved; - var next = record._nextRemoved; - if (prev === null) { - this._removalsHead = next; - } else { - prev._nextRemoved = next; - } - if (next === null) { - this._removalsTail = prev; - } else { - next._prevRemoved = prev; - } - this._insertAfter(record, prevRecord, index); - this._addToMoves(record, index); - return record; - }; - DefaultIterableDiffer.prototype._moveAfter = function(record, prevRecord, index) { - this._unlink(record); - this._insertAfter(record, prevRecord, index); - this._addToMoves(record, index); - return record; - }; - DefaultIterableDiffer.prototype._addAfter = function(record, prevRecord, index) { - this._insertAfter(record, prevRecord, index); - if (this._additionsTail === null) { - this._additionsTail = this._additionsHead = record; - } else { - this._additionsTail = this._additionsTail._nextAdded = record; - } - return record; - }; - DefaultIterableDiffer.prototype._insertAfter = function(record, prevRecord, index) { - var next = prevRecord === null ? this._itHead : prevRecord._next; - record._next = next; - record._prev = prevRecord; - if (next === null) { - this._itTail = record; - } else { - next._prev = record; - } - if (prevRecord === null) { - this._itHead = record; - } else { - prevRecord._next = record; - } - if (this._linkedRecords === null) { - this._linkedRecords = new _DuplicateMap(); - } - this._linkedRecords.put(record); - record.currentIndex = index; - return record; - }; - DefaultIterableDiffer.prototype._remove = function(record) { - return this._addToRemovals(this._unlink(record)); - }; - DefaultIterableDiffer.prototype._unlink = function(record) { - if (this._linkedRecords !== null) { - this._linkedRecords.remove(record); - } - var prev = record._prev; - var next = record._next; - if (prev === null) { - this._itHead = next; - } else { - prev._next = next; - } - if (next === null) { - this._itTail = prev; - } else { - next._prev = prev; - } - return record; - }; - DefaultIterableDiffer.prototype._addToMoves = function(record, toIndex) { - if (record.previousIndex === toIndex) { - return record; - } - if (this._movesTail === null) { - this._movesTail = this._movesHead = record; - } else { - this._movesTail = this._movesTail._nextMoved = record; - } - return record; - }; - DefaultIterableDiffer.prototype._addToRemovals = function(record) { - if (this._unlinkedRecords === null) { - this._unlinkedRecords = new _DuplicateMap(); - } - this._unlinkedRecords.put(record); - record.currentIndex = null; - record._nextRemoved = null; - if (this._removalsTail === null) { - this._removalsTail = this._removalsHead = record; - record._prevRemoved = null; - } else { - record._prevRemoved = this._removalsTail; - this._removalsTail = this._removalsTail._nextRemoved = record; - } - return record; - }; - DefaultIterableDiffer.prototype._addIdentityChange = function(record, item) { - record.item = item; - if (this._identityChangesTail === null) { - this._identityChangesTail = this._identityChangesHead = record; - } else { - this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record; - } - return record; - }; - DefaultIterableDiffer.prototype.toString = function() { - var list = []; - this.forEachItem(function(record) { - return list.push(record); - }); - var previous = []; - this.forEachPreviousItem(function(record) { - return previous.push(record); - }); - var additions = []; - this.forEachAddedItem(function(record) { - return additions.push(record); - }); - var moves = []; - this.forEachMovedItem(function(record) { - return moves.push(record); - }); - var removals = []; - this.forEachRemovedItem(function(record) { - return removals.push(record); - }); - var identityChanges = []; - this.forEachIdentityChange(function(record) { - return identityChanges.push(record); - }); - return "collection: " + list.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "moves: " + moves.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n" + "identityChanges: " + identityChanges.join(', ') + "\n"; - }; - return DefaultIterableDiffer; - }()); - exports.DefaultIterableDiffer = DefaultIterableDiffer; - var CollectionChangeRecord = (function() { - function CollectionChangeRecord(item, trackById) { - this.item = item; - this.trackById = trackById; - this.currentIndex = null; - this.previousIndex = null; - this._nextPrevious = null; - this._prev = null; - this._next = null; - this._prevDup = null; - this._nextDup = null; - this._prevRemoved = null; - this._nextRemoved = null; - this._nextAdded = null; - this._nextMoved = null; - this._nextIdentityChange = null; - } - CollectionChangeRecord.prototype.toString = function() { - return this.previousIndex === this.currentIndex ? lang_2.stringify(this.item) : lang_2.stringify(this.item) + '[' + lang_2.stringify(this.previousIndex) + '->' + lang_2.stringify(this.currentIndex) + ']'; - }; - return CollectionChangeRecord; - }()); - exports.CollectionChangeRecord = CollectionChangeRecord; - var _DuplicateItemRecordList = (function() { - function _DuplicateItemRecordList() { - this._head = null; - this._tail = null; - } - _DuplicateItemRecordList.prototype.add = function(record) { - if (this._head === null) { - this._head = this._tail = record; - record._nextDup = null; - record._prevDup = null; - } else { - this._tail._nextDup = record; - record._prevDup = this._tail; - record._nextDup = null; - this._tail = record; - } - }; - _DuplicateItemRecordList.prototype.get = function(trackById, afterIndex) { - var record; - for (record = this._head; record !== null; record = record._nextDup) { - if ((afterIndex === null || afterIndex < record.currentIndex) && lang_2.looseIdentical(record.trackById, trackById)) { - return record; - } - } - return null; - }; - _DuplicateItemRecordList.prototype.remove = function(record) { - var prev = record._prevDup; - var next = record._nextDup; - if (prev === null) { - this._head = next; - } else { - prev._nextDup = next; - } - if (next === null) { - this._tail = prev; - } else { - next._prevDup = prev; - } - return this._head === null; - }; - return _DuplicateItemRecordList; - }()); - var _DuplicateMap = (function() { - function _DuplicateMap() { - this.map = new Map(); - } - _DuplicateMap.prototype.put = function(record) { - var key = lang_2.getMapKey(record.trackById); - var duplicates = this.map.get(key); - if (!lang_2.isPresent(duplicates)) { - duplicates = new _DuplicateItemRecordList(); - this.map.set(key, duplicates); - } - duplicates.add(record); - }; - _DuplicateMap.prototype.get = function(trackById, afterIndex) { - if (afterIndex === void 0) { - afterIndex = null; - } - var key = lang_2.getMapKey(trackById); - var recordList = this.map.get(key); - return lang_2.isBlank(recordList) ? null : recordList.get(trackById, afterIndex); - }; - _DuplicateMap.prototype.remove = function(record) { - var key = lang_2.getMapKey(record.trackById); - var recordList = this.map.get(key); - if (recordList.remove(record)) { - this.map.delete(key); - } - return record; - }; - Object.defineProperty(_DuplicateMap.prototype, "isEmpty", { - get: function() { - return this.map.size === 0; - }, - enumerable: true, - configurable: true - }); - _DuplicateMap.prototype.clear = function() { - this.map.clear(); - }; - _DuplicateMap.prototype.toString = function() { - return '_DuplicateMap(' + lang_2.stringify(this.map) + ')'; - }; - return _DuplicateMap; - }()); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/differs/keyvalue_differs", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var di_1 = require("angular2/src/core/di"); - var KeyValueDiffers = (function() { - function KeyValueDiffers(factories) { - this.factories = factories; - } - KeyValueDiffers.create = function(factories, parent) { - if (lang_1.isPresent(parent)) { - var copied = collection_1.ListWrapper.clone(parent.factories); - factories = factories.concat(copied); - return new KeyValueDiffers(factories); - } else { - return new KeyValueDiffers(factories); - } - }; - KeyValueDiffers.extend = function(factories) { - return new di_1.Provider(KeyValueDiffers, { - useFactory: function(parent) { - if (lang_1.isBlank(parent)) { - throw new exceptions_1.BaseException('Cannot extend KeyValueDiffers without a parent injector'); - } - return KeyValueDiffers.create(factories, parent); - }, - deps: [[KeyValueDiffers, new di_1.SkipSelfMetadata(), new di_1.OptionalMetadata()]] - }); - }; - KeyValueDiffers.prototype.find = function(kv) { - var factory = this.factories.find(function(f) { - return f.supports(kv); - }); - if (lang_1.isPresent(factory)) { - return factory; - } else { - throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + kv + "'"); - } - }; - KeyValueDiffers = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Array])], KeyValueDiffers); - return KeyValueDiffers; - }()); - exports.KeyValueDiffers = KeyValueDiffers; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/differs/default_keyvalue_differ", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var DefaultKeyValueDifferFactory = (function() { - function DefaultKeyValueDifferFactory() {} - DefaultKeyValueDifferFactory.prototype.supports = function(obj) { - return obj instanceof Map || lang_1.isJsObject(obj); - }; - DefaultKeyValueDifferFactory.prototype.create = function(cdRef) { - return new DefaultKeyValueDiffer(); - }; - DefaultKeyValueDifferFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], DefaultKeyValueDifferFactory); - return DefaultKeyValueDifferFactory; - }()); - exports.DefaultKeyValueDifferFactory = DefaultKeyValueDifferFactory; - var DefaultKeyValueDiffer = (function() { - function DefaultKeyValueDiffer() { - this._records = new Map(); - this._mapHead = null; - this._previousMapHead = null; - this._changesHead = null; - this._changesTail = null; - this._additionsHead = null; - this._additionsTail = null; - this._removalsHead = null; - this._removalsTail = null; - } - Object.defineProperty(DefaultKeyValueDiffer.prototype, "isDirty", { - get: function() { - return this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null; - }, - enumerable: true, - configurable: true - }); - DefaultKeyValueDiffer.prototype.forEachItem = function(fn) { - var record; - for (record = this._mapHead; record !== null; record = record._next) { - fn(record); - } - }; - DefaultKeyValueDiffer.prototype.forEachPreviousItem = function(fn) { - var record; - for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { - fn(record); - } - }; - DefaultKeyValueDiffer.prototype.forEachChangedItem = function(fn) { - var record; - for (record = this._changesHead; record !== null; record = record._nextChanged) { - fn(record); - } - }; - DefaultKeyValueDiffer.prototype.forEachAddedItem = function(fn) { - var record; - for (record = this._additionsHead; record !== null; record = record._nextAdded) { - fn(record); - } - }; - DefaultKeyValueDiffer.prototype.forEachRemovedItem = function(fn) { - var record; - for (record = this._removalsHead; record !== null; record = record._nextRemoved) { - fn(record); - } - }; - DefaultKeyValueDiffer.prototype.diff = function(map) { - if (lang_1.isBlank(map)) - map = collection_1.MapWrapper.createFromPairs([]); - if (!(map instanceof Map || lang_1.isJsObject(map))) { - throw new exceptions_1.BaseException("Error trying to diff '" + map + "'"); - } - if (this.check(map)) { - return this; - } else { - return null; - } - }; - DefaultKeyValueDiffer.prototype.onDestroy = function() {}; - DefaultKeyValueDiffer.prototype.check = function(map) { - var _this = this; - this._reset(); - var records = this._records; - var oldSeqRecord = this._mapHead; - var lastOldSeqRecord = null; - var lastNewSeqRecord = null; - var seqChanged = false; - this._forEach(map, function(value, key) { - var newSeqRecord; - if (oldSeqRecord !== null && key === oldSeqRecord.key) { - newSeqRecord = oldSeqRecord; - if (!lang_1.looseIdentical(value, oldSeqRecord.currentValue)) { - oldSeqRecord.previousValue = oldSeqRecord.currentValue; - oldSeqRecord.currentValue = value; - _this._addToChanges(oldSeqRecord); - } - } else { - seqChanged = true; - if (oldSeqRecord !== null) { - oldSeqRecord._next = null; - _this._removeFromSeq(lastOldSeqRecord, oldSeqRecord); - _this._addToRemovals(oldSeqRecord); - } - if (records.has(key)) { - newSeqRecord = records.get(key); - } else { - newSeqRecord = new KeyValueChangeRecord(key); - records.set(key, newSeqRecord); - newSeqRecord.currentValue = value; - _this._addToAdditions(newSeqRecord); - } - } - if (seqChanged) { - if (_this._isInRemovals(newSeqRecord)) { - _this._removeFromRemovals(newSeqRecord); - } - if (lastNewSeqRecord == null) { - _this._mapHead = newSeqRecord; - } else { - lastNewSeqRecord._next = newSeqRecord; - } - } - lastOldSeqRecord = oldSeqRecord; - lastNewSeqRecord = newSeqRecord; - oldSeqRecord = oldSeqRecord === null ? null : oldSeqRecord._next; - }); - this._truncate(lastOldSeqRecord, oldSeqRecord); - return this.isDirty; - }; - DefaultKeyValueDiffer.prototype._reset = function() { - if (this.isDirty) { - var record; - for (record = this._previousMapHead = this._mapHead; record !== null; record = record._next) { - record._nextPrevious = record._next; - } - for (record = this._changesHead; record !== null; record = record._nextChanged) { - record.previousValue = record.currentValue; - } - for (record = this._additionsHead; record != null; record = record._nextAdded) { - record.previousValue = record.currentValue; - } - this._changesHead = this._changesTail = null; - this._additionsHead = this._additionsTail = null; - this._removalsHead = this._removalsTail = null; - } - }; - DefaultKeyValueDiffer.prototype._truncate = function(lastRecord, record) { - while (record !== null) { - if (lastRecord === null) { - this._mapHead = null; - } else { - lastRecord._next = null; - } - var nextRecord = record._next; - this._addToRemovals(record); - lastRecord = record; - record = nextRecord; - } - for (var rec = this._removalsHead; rec !== null; rec = rec._nextRemoved) { - rec.previousValue = rec.currentValue; - rec.currentValue = null; - this._records.delete(rec.key); - } - }; - DefaultKeyValueDiffer.prototype._isInRemovals = function(record) { - return record === this._removalsHead || record._nextRemoved !== null || record._prevRemoved !== null; - }; - DefaultKeyValueDiffer.prototype._addToRemovals = function(record) { - if (this._removalsHead === null) { - this._removalsHead = this._removalsTail = record; - } else { - this._removalsTail._nextRemoved = record; - record._prevRemoved = this._removalsTail; - this._removalsTail = record; - } - }; - DefaultKeyValueDiffer.prototype._removeFromSeq = function(prev, record) { - var next = record._next; - if (prev === null) { - this._mapHead = next; - } else { - prev._next = next; - } - }; - DefaultKeyValueDiffer.prototype._removeFromRemovals = function(record) { - var prev = record._prevRemoved; - var next = record._nextRemoved; - if (prev === null) { - this._removalsHead = next; - } else { - prev._nextRemoved = next; - } - if (next === null) { - this._removalsTail = prev; - } else { - next._prevRemoved = prev; - } - record._prevRemoved = record._nextRemoved = null; - }; - DefaultKeyValueDiffer.prototype._addToAdditions = function(record) { - if (this._additionsHead === null) { - this._additionsHead = this._additionsTail = record; - } else { - this._additionsTail._nextAdded = record; - this._additionsTail = record; - } - }; - DefaultKeyValueDiffer.prototype._addToChanges = function(record) { - if (this._changesHead === null) { - this._changesHead = this._changesTail = record; - } else { - this._changesTail._nextChanged = record; - this._changesTail = record; - } - }; - DefaultKeyValueDiffer.prototype.toString = function() { - var items = []; - var previous = []; - var changes = []; - var additions = []; - var removals = []; - var record; - for (record = this._mapHead; record !== null; record = record._next) { - items.push(lang_1.stringify(record)); - } - for (record = this._previousMapHead; record !== null; record = record._nextPrevious) { - previous.push(lang_1.stringify(record)); - } - for (record = this._changesHead; record !== null; record = record._nextChanged) { - changes.push(lang_1.stringify(record)); - } - for (record = this._additionsHead; record !== null; record = record._nextAdded) { - additions.push(lang_1.stringify(record)); - } - for (record = this._removalsHead; record !== null; record = record._nextRemoved) { - removals.push(lang_1.stringify(record)); - } - return "map: " + items.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" + "additions: " + additions.join(', ') + "\n" + "changes: " + changes.join(', ') + "\n" + "removals: " + removals.join(', ') + "\n"; - }; - DefaultKeyValueDiffer.prototype._forEach = function(obj, fn) { - if (obj instanceof Map) { - obj.forEach(fn); - } else { - collection_1.StringMapWrapper.forEach(obj, fn); - } - }; - return DefaultKeyValueDiffer; - }()); - exports.DefaultKeyValueDiffer = DefaultKeyValueDiffer; - var KeyValueChangeRecord = (function() { - function KeyValueChangeRecord(key) { - this.key = key; - this.previousValue = null; - this.currentValue = null; - this._nextPrevious = null; - this._next = null; - this._nextAdded = null; - this._nextRemoved = null; - this._prevRemoved = null; - this._nextChanged = null; - } - KeyValueChangeRecord.prototype.toString = function() { - return lang_1.looseIdentical(this.previousValue, this.currentValue) ? lang_1.stringify(this.key) : (lang_1.stringify(this.key) + '[' + lang_1.stringify(this.previousValue) + '->' + lang_1.stringify(this.currentValue) + ']'); - }; - return KeyValueChangeRecord; - }()); - exports.KeyValueChangeRecord = KeyValueChangeRecord; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/parser/ast", ["angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var collection_1 = require("angular2/src/facade/collection"); - var AST = (function() { - function AST() {} - AST.prototype.visit = function(visitor) { - return null; - }; - AST.prototype.toString = function() { - return "AST"; - }; - return AST; - }()); - exports.AST = AST; - var Quote = (function(_super) { - __extends(Quote, _super); - function Quote(prefix, uninterpretedExpression, location) { - _super.call(this); - this.prefix = prefix; - this.uninterpretedExpression = uninterpretedExpression; - this.location = location; - } - Quote.prototype.visit = function(visitor) { - return visitor.visitQuote(this); - }; - Quote.prototype.toString = function() { - return "Quote"; - }; - return Quote; - }(AST)); - exports.Quote = Quote; - var EmptyExpr = (function(_super) { - __extends(EmptyExpr, _super); - function EmptyExpr() { - _super.apply(this, arguments); - } - EmptyExpr.prototype.visit = function(visitor) {}; - return EmptyExpr; - }(AST)); - exports.EmptyExpr = EmptyExpr; - var ImplicitReceiver = (function(_super) { - __extends(ImplicitReceiver, _super); - function ImplicitReceiver() { - _super.apply(this, arguments); - } - ImplicitReceiver.prototype.visit = function(visitor) { - return visitor.visitImplicitReceiver(this); - }; - return ImplicitReceiver; - }(AST)); - exports.ImplicitReceiver = ImplicitReceiver; - var Chain = (function(_super) { - __extends(Chain, _super); - function Chain(expressions) { - _super.call(this); - this.expressions = expressions; - } - Chain.prototype.visit = function(visitor) { - return visitor.visitChain(this); - }; - return Chain; - }(AST)); - exports.Chain = Chain; - var Conditional = (function(_super) { - __extends(Conditional, _super); - function Conditional(condition, trueExp, falseExp) { - _super.call(this); - this.condition = condition; - this.trueExp = trueExp; - this.falseExp = falseExp; - } - Conditional.prototype.visit = function(visitor) { - return visitor.visitConditional(this); - }; - return Conditional; - }(AST)); - exports.Conditional = Conditional; - var PropertyRead = (function(_super) { - __extends(PropertyRead, _super); - function PropertyRead(receiver, name, getter) { - _super.call(this); - this.receiver = receiver; - this.name = name; - this.getter = getter; - } - PropertyRead.prototype.visit = function(visitor) { - return visitor.visitPropertyRead(this); - }; - return PropertyRead; - }(AST)); - exports.PropertyRead = PropertyRead; - var PropertyWrite = (function(_super) { - __extends(PropertyWrite, _super); - function PropertyWrite(receiver, name, setter, value) { - _super.call(this); - this.receiver = receiver; - this.name = name; - this.setter = setter; - this.value = value; - } - PropertyWrite.prototype.visit = function(visitor) { - return visitor.visitPropertyWrite(this); - }; - return PropertyWrite; - }(AST)); - exports.PropertyWrite = PropertyWrite; - var SafePropertyRead = (function(_super) { - __extends(SafePropertyRead, _super); - function SafePropertyRead(receiver, name, getter) { - _super.call(this); - this.receiver = receiver; - this.name = name; - this.getter = getter; - } - SafePropertyRead.prototype.visit = function(visitor) { - return visitor.visitSafePropertyRead(this); - }; - return SafePropertyRead; - }(AST)); - exports.SafePropertyRead = SafePropertyRead; - var KeyedRead = (function(_super) { - __extends(KeyedRead, _super); - function KeyedRead(obj, key) { - _super.call(this); - this.obj = obj; - this.key = key; - } - KeyedRead.prototype.visit = function(visitor) { - return visitor.visitKeyedRead(this); - }; - return KeyedRead; - }(AST)); - exports.KeyedRead = KeyedRead; - var KeyedWrite = (function(_super) { - __extends(KeyedWrite, _super); - function KeyedWrite(obj, key, value) { - _super.call(this); - this.obj = obj; - this.key = key; - this.value = value; - } - KeyedWrite.prototype.visit = function(visitor) { - return visitor.visitKeyedWrite(this); - }; - return KeyedWrite; - }(AST)); - exports.KeyedWrite = KeyedWrite; - var BindingPipe = (function(_super) { - __extends(BindingPipe, _super); - function BindingPipe(exp, name, args) { - _super.call(this); - this.exp = exp; - this.name = name; - this.args = args; - } - BindingPipe.prototype.visit = function(visitor) { - return visitor.visitPipe(this); - }; - return BindingPipe; - }(AST)); - exports.BindingPipe = BindingPipe; - var LiteralPrimitive = (function(_super) { - __extends(LiteralPrimitive, _super); - function LiteralPrimitive(value) { - _super.call(this); - this.value = value; - } - LiteralPrimitive.prototype.visit = function(visitor) { - return visitor.visitLiteralPrimitive(this); - }; - return LiteralPrimitive; - }(AST)); - exports.LiteralPrimitive = LiteralPrimitive; - var LiteralArray = (function(_super) { - __extends(LiteralArray, _super); - function LiteralArray(expressions) { - _super.call(this); - this.expressions = expressions; - } - LiteralArray.prototype.visit = function(visitor) { - return visitor.visitLiteralArray(this); - }; - return LiteralArray; - }(AST)); - exports.LiteralArray = LiteralArray; - var LiteralMap = (function(_super) { - __extends(LiteralMap, _super); - function LiteralMap(keys, values) { - _super.call(this); - this.keys = keys; - this.values = values; - } - LiteralMap.prototype.visit = function(visitor) { - return visitor.visitLiteralMap(this); - }; - return LiteralMap; - }(AST)); - exports.LiteralMap = LiteralMap; - var Interpolation = (function(_super) { - __extends(Interpolation, _super); - function Interpolation(strings, expressions) { - _super.call(this); - this.strings = strings; - this.expressions = expressions; - } - Interpolation.prototype.visit = function(visitor) { - return visitor.visitInterpolation(this); - }; - return Interpolation; - }(AST)); - exports.Interpolation = Interpolation; - var Binary = (function(_super) { - __extends(Binary, _super); - function Binary(operation, left, right) { - _super.call(this); - this.operation = operation; - this.left = left; - this.right = right; - } - Binary.prototype.visit = function(visitor) { - return visitor.visitBinary(this); - }; - return Binary; - }(AST)); - exports.Binary = Binary; - var PrefixNot = (function(_super) { - __extends(PrefixNot, _super); - function PrefixNot(expression) { - _super.call(this); - this.expression = expression; - } - PrefixNot.prototype.visit = function(visitor) { - return visitor.visitPrefixNot(this); - }; - return PrefixNot; - }(AST)); - exports.PrefixNot = PrefixNot; - var MethodCall = (function(_super) { - __extends(MethodCall, _super); - function MethodCall(receiver, name, fn, args) { - _super.call(this); - this.receiver = receiver; - this.name = name; - this.fn = fn; - this.args = args; - } - MethodCall.prototype.visit = function(visitor) { - return visitor.visitMethodCall(this); - }; - return MethodCall; - }(AST)); - exports.MethodCall = MethodCall; - var SafeMethodCall = (function(_super) { - __extends(SafeMethodCall, _super); - function SafeMethodCall(receiver, name, fn, args) { - _super.call(this); - this.receiver = receiver; - this.name = name; - this.fn = fn; - this.args = args; - } - SafeMethodCall.prototype.visit = function(visitor) { - return visitor.visitSafeMethodCall(this); - }; - return SafeMethodCall; - }(AST)); - exports.SafeMethodCall = SafeMethodCall; - var FunctionCall = (function(_super) { - __extends(FunctionCall, _super); - function FunctionCall(target, args) { - _super.call(this); - this.target = target; - this.args = args; - } - FunctionCall.prototype.visit = function(visitor) { - return visitor.visitFunctionCall(this); - }; - return FunctionCall; - }(AST)); - exports.FunctionCall = FunctionCall; - var ASTWithSource = (function(_super) { - __extends(ASTWithSource, _super); - function ASTWithSource(ast, source, location) { - _super.call(this); - this.ast = ast; - this.source = source; - this.location = location; - } - ASTWithSource.prototype.visit = function(visitor) { - return this.ast.visit(visitor); - }; - ASTWithSource.prototype.toString = function() { - return this.source + " in " + this.location; - }; - return ASTWithSource; - }(AST)); - exports.ASTWithSource = ASTWithSource; - var TemplateBinding = (function() { - function TemplateBinding(key, keyIsVar, name, expression) { - this.key = key; - this.keyIsVar = keyIsVar; - this.name = name; - this.expression = expression; - } - return TemplateBinding; - }()); - exports.TemplateBinding = TemplateBinding; - var RecursiveAstVisitor = (function() { - function RecursiveAstVisitor() {} - RecursiveAstVisitor.prototype.visitBinary = function(ast) { - ast.left.visit(this); - ast.right.visit(this); - return null; - }; - RecursiveAstVisitor.prototype.visitChain = function(ast) { - return this.visitAll(ast.expressions); - }; - RecursiveAstVisitor.prototype.visitConditional = function(ast) { - ast.condition.visit(this); - ast.trueExp.visit(this); - ast.falseExp.visit(this); - return null; - }; - RecursiveAstVisitor.prototype.visitPipe = function(ast) { - ast.exp.visit(this); - this.visitAll(ast.args); - return null; - }; - RecursiveAstVisitor.prototype.visitFunctionCall = function(ast) { - ast.target.visit(this); - this.visitAll(ast.args); - return null; - }; - RecursiveAstVisitor.prototype.visitImplicitReceiver = function(ast) { - return null; - }; - RecursiveAstVisitor.prototype.visitInterpolation = function(ast) { - return this.visitAll(ast.expressions); - }; - RecursiveAstVisitor.prototype.visitKeyedRead = function(ast) { - ast.obj.visit(this); - ast.key.visit(this); - return null; - }; - RecursiveAstVisitor.prototype.visitKeyedWrite = function(ast) { - ast.obj.visit(this); - ast.key.visit(this); - ast.value.visit(this); - return null; - }; - RecursiveAstVisitor.prototype.visitLiteralArray = function(ast) { - return this.visitAll(ast.expressions); - }; - RecursiveAstVisitor.prototype.visitLiteralMap = function(ast) { - return this.visitAll(ast.values); - }; - RecursiveAstVisitor.prototype.visitLiteralPrimitive = function(ast) { - return null; - }; - RecursiveAstVisitor.prototype.visitMethodCall = function(ast) { - ast.receiver.visit(this); - return this.visitAll(ast.args); - }; - RecursiveAstVisitor.prototype.visitPrefixNot = function(ast) { - ast.expression.visit(this); - return null; - }; - RecursiveAstVisitor.prototype.visitPropertyRead = function(ast) { - ast.receiver.visit(this); - return null; - }; - RecursiveAstVisitor.prototype.visitPropertyWrite = function(ast) { - ast.receiver.visit(this); - ast.value.visit(this); - return null; - }; - RecursiveAstVisitor.prototype.visitSafePropertyRead = function(ast) { - ast.receiver.visit(this); - return null; - }; - RecursiveAstVisitor.prototype.visitSafeMethodCall = function(ast) { - ast.receiver.visit(this); - return this.visitAll(ast.args); - }; - RecursiveAstVisitor.prototype.visitAll = function(asts) { - var _this = this; - asts.forEach(function(ast) { - return ast.visit(_this); - }); - return null; - }; - RecursiveAstVisitor.prototype.visitQuote = function(ast) { - return null; - }; - return RecursiveAstVisitor; - }()); - exports.RecursiveAstVisitor = RecursiveAstVisitor; - var AstTransformer = (function() { - function AstTransformer() {} - AstTransformer.prototype.visitImplicitReceiver = function(ast) { - return ast; - }; - AstTransformer.prototype.visitInterpolation = function(ast) { - return new Interpolation(ast.strings, this.visitAll(ast.expressions)); - }; - AstTransformer.prototype.visitLiteralPrimitive = function(ast) { - return new LiteralPrimitive(ast.value); - }; - AstTransformer.prototype.visitPropertyRead = function(ast) { - return new PropertyRead(ast.receiver.visit(this), ast.name, ast.getter); - }; - AstTransformer.prototype.visitPropertyWrite = function(ast) { - return new PropertyWrite(ast.receiver.visit(this), ast.name, ast.setter, ast.value); - }; - AstTransformer.prototype.visitSafePropertyRead = function(ast) { - return new SafePropertyRead(ast.receiver.visit(this), ast.name, ast.getter); - }; - AstTransformer.prototype.visitMethodCall = function(ast) { - return new MethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); - }; - AstTransformer.prototype.visitSafeMethodCall = function(ast) { - return new SafeMethodCall(ast.receiver.visit(this), ast.name, ast.fn, this.visitAll(ast.args)); - }; - AstTransformer.prototype.visitFunctionCall = function(ast) { - return new FunctionCall(ast.target.visit(this), this.visitAll(ast.args)); - }; - AstTransformer.prototype.visitLiteralArray = function(ast) { - return new LiteralArray(this.visitAll(ast.expressions)); - }; - AstTransformer.prototype.visitLiteralMap = function(ast) { - return new LiteralMap(ast.keys, this.visitAll(ast.values)); - }; - AstTransformer.prototype.visitBinary = function(ast) { - return new Binary(ast.operation, ast.left.visit(this), ast.right.visit(this)); - }; - AstTransformer.prototype.visitPrefixNot = function(ast) { - return new PrefixNot(ast.expression.visit(this)); - }; - AstTransformer.prototype.visitConditional = function(ast) { - return new Conditional(ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this)); - }; - AstTransformer.prototype.visitPipe = function(ast) { - return new BindingPipe(ast.exp.visit(this), ast.name, this.visitAll(ast.args)); - }; - AstTransformer.prototype.visitKeyedRead = function(ast) { - return new KeyedRead(ast.obj.visit(this), ast.key.visit(this)); - }; - AstTransformer.prototype.visitKeyedWrite = function(ast) { - return new KeyedWrite(ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this)); - }; - AstTransformer.prototype.visitAll = function(asts) { - var res = collection_1.ListWrapper.createFixedSize(asts.length); - for (var i = 0; i < asts.length; ++i) { - res[i] = asts[i].visit(this); - } - return res; - }; - AstTransformer.prototype.visitChain = function(ast) { - return new Chain(this.visitAll(ast.expressions)); - }; - AstTransformer.prototype.visitQuote = function(ast) { - return new Quote(ast.prefix, ast.uninterpretedExpression, ast.location); - }; - return AstTransformer; - }()); - exports.AstTransformer = AstTransformer; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/parser/lexer", ["angular2/src/core/di/decorators", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var decorators_1 = require("angular2/src/core/di/decorators"); - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - (function(TokenType) { - TokenType[TokenType["Character"] = 0] = "Character"; - TokenType[TokenType["Identifier"] = 1] = "Identifier"; - TokenType[TokenType["Keyword"] = 2] = "Keyword"; - TokenType[TokenType["String"] = 3] = "String"; - TokenType[TokenType["Operator"] = 4] = "Operator"; - TokenType[TokenType["Number"] = 5] = "Number"; - })(exports.TokenType || (exports.TokenType = {})); - var TokenType = exports.TokenType; - var Lexer = (function() { - function Lexer() {} - Lexer.prototype.tokenize = function(text) { - var scanner = new _Scanner(text); - var tokens = []; - var token = scanner.scanToken(); - while (token != null) { - tokens.push(token); - token = scanner.scanToken(); - } - return tokens; - }; - Lexer = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [])], Lexer); - return Lexer; - }()); - exports.Lexer = Lexer; - var Token = (function() { - function Token(index, type, numValue, strValue) { - this.index = index; - this.type = type; - this.numValue = numValue; - this.strValue = strValue; - } - Token.prototype.isCharacter = function(code) { - return (this.type == TokenType.Character && this.numValue == code); - }; - Token.prototype.isNumber = function() { - return (this.type == TokenType.Number); - }; - Token.prototype.isString = function() { - return (this.type == TokenType.String); - }; - Token.prototype.isOperator = function(operater) { - return (this.type == TokenType.Operator && this.strValue == operater); - }; - Token.prototype.isIdentifier = function() { - return (this.type == TokenType.Identifier); - }; - Token.prototype.isKeyword = function() { - return (this.type == TokenType.Keyword); - }; - Token.prototype.isKeywordVar = function() { - return (this.type == TokenType.Keyword && this.strValue == "var"); - }; - Token.prototype.isKeywordNull = function() { - return (this.type == TokenType.Keyword && this.strValue == "null"); - }; - Token.prototype.isKeywordUndefined = function() { - return (this.type == TokenType.Keyword && this.strValue == "undefined"); - }; - Token.prototype.isKeywordTrue = function() { - return (this.type == TokenType.Keyword && this.strValue == "true"); - }; - Token.prototype.isKeywordFalse = function() { - return (this.type == TokenType.Keyword && this.strValue == "false"); - }; - Token.prototype.toNumber = function() { - return (this.type == TokenType.Number) ? this.numValue : -1; - }; - Token.prototype.toString = function() { - switch (this.type) { - case TokenType.Character: - case TokenType.Identifier: - case TokenType.Keyword: - case TokenType.Operator: - case TokenType.String: - return this.strValue; - case TokenType.Number: - return this.numValue.toString(); - default: - return null; - } - }; - return Token; - }()); - exports.Token = Token; - function newCharacterToken(index, code) { - return new Token(index, TokenType.Character, code, lang_1.StringWrapper.fromCharCode(code)); - } - function newIdentifierToken(index, text) { - return new Token(index, TokenType.Identifier, 0, text); - } - function newKeywordToken(index, text) { - return new Token(index, TokenType.Keyword, 0, text); - } - function newOperatorToken(index, text) { - return new Token(index, TokenType.Operator, 0, text); - } - function newStringToken(index, text) { - return new Token(index, TokenType.String, 0, text); - } - function newNumberToken(index, n) { - return new Token(index, TokenType.Number, n, ""); - } - exports.EOF = new Token(-1, TokenType.Character, 0, ""); - exports.$EOF = 0; - exports.$TAB = 9; - exports.$LF = 10; - exports.$VTAB = 11; - exports.$FF = 12; - exports.$CR = 13; - exports.$SPACE = 32; - exports.$BANG = 33; - exports.$DQ = 34; - exports.$HASH = 35; - exports.$$ = 36; - exports.$PERCENT = 37; - exports.$AMPERSAND = 38; - exports.$SQ = 39; - exports.$LPAREN = 40; - exports.$RPAREN = 41; - exports.$STAR = 42; - exports.$PLUS = 43; - exports.$COMMA = 44; - exports.$MINUS = 45; - exports.$PERIOD = 46; - exports.$SLASH = 47; - exports.$COLON = 58; - exports.$SEMICOLON = 59; - exports.$LT = 60; - exports.$EQ = 61; - exports.$GT = 62; - exports.$QUESTION = 63; - var $0 = 48; - var $9 = 57; - var $A = 65, - $E = 69, - $Z = 90; - exports.$LBRACKET = 91; - exports.$BACKSLASH = 92; - exports.$RBRACKET = 93; - var $CARET = 94; - var $_ = 95; - var $a = 97, - $e = 101, - $f = 102, - $n = 110, - $r = 114, - $t = 116, - $u = 117, - $v = 118, - $z = 122; - exports.$LBRACE = 123; - exports.$BAR = 124; - exports.$RBRACE = 125; - var $NBSP = 160; - var ScannerError = (function(_super) { - __extends(ScannerError, _super); - function ScannerError(message) { - _super.call(this); - this.message = message; - } - ScannerError.prototype.toString = function() { - return this.message; - }; - return ScannerError; - }(exceptions_1.BaseException)); - exports.ScannerError = ScannerError; - var _Scanner = (function() { - function _Scanner(input) { - this.input = input; - this.peek = 0; - this.index = -1; - this.length = input.length; - this.advance(); - } - _Scanner.prototype.advance = function() { - this.peek = ++this.index >= this.length ? exports.$EOF : lang_1.StringWrapper.charCodeAt(this.input, this.index); - }; - _Scanner.prototype.scanToken = function() { - var input = this.input, - length = this.length, - peek = this.peek, - index = this.index; - while (peek <= exports.$SPACE) { - if (++index >= length) { - peek = exports.$EOF; - break; - } else { - peek = lang_1.StringWrapper.charCodeAt(input, index); - } - } - this.peek = peek; - this.index = index; - if (index >= length) { - return null; - } - if (isIdentifierStart(peek)) - return this.scanIdentifier(); - if (isDigit(peek)) - return this.scanNumber(index); - var start = index; - switch (peek) { - case exports.$PERIOD: - this.advance(); - return isDigit(this.peek) ? this.scanNumber(start) : newCharacterToken(start, exports.$PERIOD); - case exports.$LPAREN: - case exports.$RPAREN: - case exports.$LBRACE: - case exports.$RBRACE: - case exports.$LBRACKET: - case exports.$RBRACKET: - case exports.$COMMA: - case exports.$COLON: - case exports.$SEMICOLON: - return this.scanCharacter(start, peek); - case exports.$SQ: - case exports.$DQ: - return this.scanString(); - case exports.$HASH: - case exports.$PLUS: - case exports.$MINUS: - case exports.$STAR: - case exports.$SLASH: - case exports.$PERCENT: - case $CARET: - return this.scanOperator(start, lang_1.StringWrapper.fromCharCode(peek)); - case exports.$QUESTION: - return this.scanComplexOperator(start, '?', exports.$PERIOD, '.'); - case exports.$LT: - case exports.$GT: - return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '='); - case exports.$BANG: - case exports.$EQ: - return this.scanComplexOperator(start, lang_1.StringWrapper.fromCharCode(peek), exports.$EQ, '=', exports.$EQ, '='); - case exports.$AMPERSAND: - return this.scanComplexOperator(start, '&', exports.$AMPERSAND, '&'); - case exports.$BAR: - return this.scanComplexOperator(start, '|', exports.$BAR, '|'); - case $NBSP: - while (isWhitespace(this.peek)) - this.advance(); - return this.scanToken(); - } - this.error("Unexpected character [" + lang_1.StringWrapper.fromCharCode(peek) + "]", 0); - return null; - }; - _Scanner.prototype.scanCharacter = function(start, code) { - this.advance(); - return newCharacterToken(start, code); - }; - _Scanner.prototype.scanOperator = function(start, str) { - this.advance(); - return newOperatorToken(start, str); - }; - _Scanner.prototype.scanComplexOperator = function(start, one, twoCode, two, threeCode, three) { - this.advance(); - var str = one; - if (this.peek == twoCode) { - this.advance(); - str += two; - } - if (lang_1.isPresent(threeCode) && this.peek == threeCode) { - this.advance(); - str += three; - } - return newOperatorToken(start, str); - }; - _Scanner.prototype.scanIdentifier = function() { - var start = this.index; - this.advance(); - while (isIdentifierPart(this.peek)) - this.advance(); - var str = this.input.substring(start, this.index); - if (collection_1.SetWrapper.has(KEYWORDS, str)) { - return newKeywordToken(start, str); - } else { - return newIdentifierToken(start, str); - } - }; - _Scanner.prototype.scanNumber = function(start) { - var simple = (this.index === start); - this.advance(); - while (true) { - if (isDigit(this.peek)) {} else if (this.peek == exports.$PERIOD) { - simple = false; - } else if (isExponentStart(this.peek)) { - this.advance(); - if (isExponentSign(this.peek)) - this.advance(); - if (!isDigit(this.peek)) - this.error('Invalid exponent', -1); - simple = false; - } else { - break; - } - this.advance(); - } - var str = this.input.substring(start, this.index); - var value = simple ? lang_1.NumberWrapper.parseIntAutoRadix(str) : lang_1.NumberWrapper.parseFloat(str); - return newNumberToken(start, value); - }; - _Scanner.prototype.scanString = function() { - var start = this.index; - var quote = this.peek; - this.advance(); - var buffer; - var marker = this.index; - var input = this.input; - while (this.peek != quote) { - if (this.peek == exports.$BACKSLASH) { - if (buffer == null) - buffer = new lang_1.StringJoiner(); - buffer.add(input.substring(marker, this.index)); - this.advance(); - var unescapedCode; - if (this.peek == $u) { - var hex = input.substring(this.index + 1, this.index + 5); - try { - unescapedCode = lang_1.NumberWrapper.parseInt(hex, 16); - } catch (e) { - this.error("Invalid unicode escape [\\u" + hex + "]", 0); - } - for (var i = 0; i < 5; i++) { - this.advance(); - } - } else { - unescapedCode = unescape(this.peek); - this.advance(); - } - buffer.add(lang_1.StringWrapper.fromCharCode(unescapedCode)); - marker = this.index; - } else if (this.peek == exports.$EOF) { - this.error('Unterminated quote', 0); - } else { - this.advance(); - } - } - var last = input.substring(marker, this.index); - this.advance(); - var unescaped = last; - if (buffer != null) { - buffer.add(last); - unescaped = buffer.toString(); - } - return newStringToken(start, unescaped); - }; - _Scanner.prototype.error = function(message, offset) { - var position = this.index + offset; - throw new ScannerError("Lexer Error: " + message + " at column " + position + " in expression [" + this.input + "]"); - }; - return _Scanner; - }()); - function isWhitespace(code) { - return (code >= exports.$TAB && code <= exports.$SPACE) || (code == $NBSP); - } - function isIdentifierStart(code) { - return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || (code == $_) || (code == exports.$$); - } - function isIdentifier(input) { - if (input.length == 0) - return false; - var scanner = new _Scanner(input); - if (!isIdentifierStart(scanner.peek)) - return false; - scanner.advance(); - while (scanner.peek !== exports.$EOF) { - if (!isIdentifierPart(scanner.peek)) - return false; - scanner.advance(); - } - return true; - } - exports.isIdentifier = isIdentifier; - function isIdentifierPart(code) { - return ($a <= code && code <= $z) || ($A <= code && code <= $Z) || ($0 <= code && code <= $9) || (code == $_) || (code == exports.$$); - } - function isDigit(code) { - return $0 <= code && code <= $9; - } - function isExponentStart(code) { - return code == $e || code == $E; - } - function isExponentSign(code) { - return code == exports.$MINUS || code == exports.$PLUS; - } - function unescape(code) { - switch (code) { - case $n: - return exports.$LF; - case $f: - return exports.$FF; - case $r: - return exports.$CR; - case $t: - return exports.$TAB; - case $v: - return exports.$VTAB; - default: - return code; - } - } - var OPERATORS = collection_1.SetWrapper.createFromList(['+', '-', '*', '/', '%', '^', '=', '==', '!=', '===', '!==', '<', '>', '<=', '>=', '&&', '||', '&', '|', '!', '?', '#', '?.']); - var KEYWORDS = collection_1.SetWrapper.createFromList(['var', 'null', 'undefined', 'true', 'false', 'if', 'else']); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/parser/parser", ["angular2/src/core/di/decorators", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/parser/ast"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var decorators_1 = require("angular2/src/core/di/decorators"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); - var reflection_1 = require("angular2/src/core/reflection/reflection"); - var ast_1 = require("angular2/src/core/change_detection/parser/ast"); - var _implicitReceiver = new ast_1.ImplicitReceiver(); - var INTERPOLATION_REGEXP = /\{\{([\s\S]*?)\}\}/g; - var ParseException = (function(_super) { - __extends(ParseException, _super); - function ParseException(message, input, errLocation, ctxLocation) { - _super.call(this, "Parser Error: " + message + " " + errLocation + " [" + input + "] in " + ctxLocation); - } - return ParseException; - }(exceptions_1.BaseException)); - var SplitInterpolation = (function() { - function SplitInterpolation(strings, expressions) { - this.strings = strings; - this.expressions = expressions; - } - return SplitInterpolation; - }()); - exports.SplitInterpolation = SplitInterpolation; - var Parser = (function() { - function Parser(_lexer, providedReflector) { - if (providedReflector === void 0) { - providedReflector = null; - } - this._lexer = _lexer; - this._reflector = lang_1.isPresent(providedReflector) ? providedReflector : reflection_1.reflector; - } - Parser.prototype.parseAction = function(input, location) { - this._checkNoInterpolation(input, location); - var tokens = this._lexer.tokenize(input); - var ast = new _ParseAST(input, location, tokens, this._reflector, true).parseChain(); - return new ast_1.ASTWithSource(ast, input, location); - }; - Parser.prototype.parseBinding = function(input, location) { - var ast = this._parseBindingAst(input, location); - return new ast_1.ASTWithSource(ast, input, location); - }; - Parser.prototype.parseSimpleBinding = function(input, location) { - var ast = this._parseBindingAst(input, location); - if (!SimpleExpressionChecker.check(ast)) { - throw new ParseException('Host binding expression can only contain field access and constants', input, location); - } - return new ast_1.ASTWithSource(ast, input, location); - }; - Parser.prototype._parseBindingAst = function(input, location) { - var quote = this._parseQuote(input, location); - if (lang_1.isPresent(quote)) { - return quote; - } - this._checkNoInterpolation(input, location); - var tokens = this._lexer.tokenize(input); - return new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); - }; - Parser.prototype._parseQuote = function(input, location) { - if (lang_1.isBlank(input)) - return null; - var prefixSeparatorIndex = input.indexOf(':'); - if (prefixSeparatorIndex == -1) - return null; - var prefix = input.substring(0, prefixSeparatorIndex).trim(); - if (!lexer_1.isIdentifier(prefix)) - return null; - var uninterpretedExpression = input.substring(prefixSeparatorIndex + 1); - return new ast_1.Quote(prefix, uninterpretedExpression, location); - }; - Parser.prototype.parseTemplateBindings = function(input, location) { - var tokens = this._lexer.tokenize(input); - return new _ParseAST(input, location, tokens, this._reflector, false).parseTemplateBindings(); - }; - Parser.prototype.parseInterpolation = function(input, location) { - var split = this.splitInterpolation(input, location); - if (split == null) - return null; - var expressions = []; - for (var i = 0; i < split.expressions.length; ++i) { - var tokens = this._lexer.tokenize(split.expressions[i]); - var ast = new _ParseAST(input, location, tokens, this._reflector, false).parseChain(); - expressions.push(ast); - } - return new ast_1.ASTWithSource(new ast_1.Interpolation(split.strings, expressions), input, location); - }; - Parser.prototype.splitInterpolation = function(input, location) { - var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); - if (parts.length <= 1) { - return null; - } - var strings = []; - var expressions = []; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (i % 2 === 0) { - strings.push(part); - } else if (part.trim().length > 0) { - expressions.push(part); - } else { - throw new ParseException('Blank expressions are not allowed in interpolated strings', input, "at column " + this._findInterpolationErrorColumn(parts, i) + " in", location); - } - } - return new SplitInterpolation(strings, expressions); - }; - Parser.prototype.wrapLiteralPrimitive = function(input, location) { - return new ast_1.ASTWithSource(new ast_1.LiteralPrimitive(input), input, location); - }; - Parser.prototype._checkNoInterpolation = function(input, location) { - var parts = lang_1.StringWrapper.split(input, INTERPOLATION_REGEXP); - if (parts.length > 1) { - throw new ParseException('Got interpolation ({{}}) where expression was expected', input, "at column " + this._findInterpolationErrorColumn(parts, 1) + " in", location); - } - }; - Parser.prototype._findInterpolationErrorColumn = function(parts, partInErrIdx) { - var errLocation = ''; - for (var j = 0; j < partInErrIdx; j++) { - errLocation += j % 2 === 0 ? parts[j] : "{{" + parts[j] + "}}"; - } - return errLocation.length; - }; - Parser = __decorate([decorators_1.Injectable(), __metadata('design:paramtypes', [lexer_1.Lexer, reflection_1.Reflector])], Parser); - return Parser; - }()); - exports.Parser = Parser; - var _ParseAST = (function() { - function _ParseAST(input, location, tokens, reflector, parseAction) { - this.input = input; - this.location = location; - this.tokens = tokens; - this.reflector = reflector; - this.parseAction = parseAction; - this.index = 0; - } - _ParseAST.prototype.peek = function(offset) { - var i = this.index + offset; - return i < this.tokens.length ? this.tokens[i] : lexer_1.EOF; - }; - Object.defineProperty(_ParseAST.prototype, "next", { - get: function() { - return this.peek(0); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(_ParseAST.prototype, "inputIndex", { - get: function() { - return (this.index < this.tokens.length) ? this.next.index : this.input.length; - }, - enumerable: true, - configurable: true - }); - _ParseAST.prototype.advance = function() { - this.index++; - }; - _ParseAST.prototype.optionalCharacter = function(code) { - if (this.next.isCharacter(code)) { - this.advance(); - return true; - } else { - return false; - } - }; - _ParseAST.prototype.optionalKeywordVar = function() { - if (this.peekKeywordVar()) { - this.advance(); - return true; - } else { - return false; - } - }; - _ParseAST.prototype.peekKeywordVar = function() { - return this.next.isKeywordVar() || this.next.isOperator('#'); - }; - _ParseAST.prototype.expectCharacter = function(code) { - if (this.optionalCharacter(code)) - return ; - this.error("Missing expected " + lang_1.StringWrapper.fromCharCode(code)); - }; - _ParseAST.prototype.optionalOperator = function(op) { - if (this.next.isOperator(op)) { - this.advance(); - return true; - } else { - return false; - } - }; - _ParseAST.prototype.expectOperator = function(operator) { - if (this.optionalOperator(operator)) - return ; - this.error("Missing expected operator " + operator); - }; - _ParseAST.prototype.expectIdentifierOrKeyword = function() { - var n = this.next; - if (!n.isIdentifier() && !n.isKeyword()) { - this.error("Unexpected token " + n + ", expected identifier or keyword"); - } - this.advance(); - return n.toString(); - }; - _ParseAST.prototype.expectIdentifierOrKeywordOrString = function() { - var n = this.next; - if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) { - this.error("Unexpected token " + n + ", expected identifier, keyword, or string"); - } - this.advance(); - return n.toString(); - }; - _ParseAST.prototype.parseChain = function() { - var exprs = []; - while (this.index < this.tokens.length) { - var expr = this.parsePipe(); - exprs.push(expr); - if (this.optionalCharacter(lexer_1.$SEMICOLON)) { - if (!this.parseAction) { - this.error("Binding expression cannot contain chained expression"); - } - while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} - } else if (this.index < this.tokens.length) { - this.error("Unexpected token '" + this.next + "'"); - } - } - if (exprs.length == 0) - return new ast_1.EmptyExpr(); - if (exprs.length == 1) - return exprs[0]; - return new ast_1.Chain(exprs); - }; - _ParseAST.prototype.parsePipe = function() { - var result = this.parseExpression(); - if (this.optionalOperator("|")) { - if (this.parseAction) { - this.error("Cannot have a pipe in an action expression"); - } - do { - var name = this.expectIdentifierOrKeyword(); - var args = []; - while (this.optionalCharacter(lexer_1.$COLON)) { - args.push(this.parseExpression()); - } - result = new ast_1.BindingPipe(result, name, args); - } while (this.optionalOperator("|")); - } - return result; - }; - _ParseAST.prototype.parseExpression = function() { - return this.parseConditional(); - }; - _ParseAST.prototype.parseConditional = function() { - var start = this.inputIndex; - var result = this.parseLogicalOr(); - if (this.optionalOperator('?')) { - var yes = this.parsePipe(); - if (!this.optionalCharacter(lexer_1.$COLON)) { - var end = this.inputIndex; - var expression = this.input.substring(start, end); - this.error("Conditional expression " + expression + " requires all 3 expressions"); - } - var no = this.parsePipe(); - return new ast_1.Conditional(result, yes, no); - } else { - return result; - } - }; - _ParseAST.prototype.parseLogicalOr = function() { - var result = this.parseLogicalAnd(); - while (this.optionalOperator('||')) { - result = new ast_1.Binary('||', result, this.parseLogicalAnd()); - } - return result; - }; - _ParseAST.prototype.parseLogicalAnd = function() { - var result = this.parseEquality(); - while (this.optionalOperator('&&')) { - result = new ast_1.Binary('&&', result, this.parseEquality()); - } - return result; - }; - _ParseAST.prototype.parseEquality = function() { - var result = this.parseRelational(); - while (true) { - if (this.optionalOperator('==')) { - result = new ast_1.Binary('==', result, this.parseRelational()); - } else if (this.optionalOperator('===')) { - result = new ast_1.Binary('===', result, this.parseRelational()); - } else if (this.optionalOperator('!=')) { - result = new ast_1.Binary('!=', result, this.parseRelational()); - } else if (this.optionalOperator('!==')) { - result = new ast_1.Binary('!==', result, this.parseRelational()); - } else { - return result; - } - } - }; - _ParseAST.prototype.parseRelational = function() { - var result = this.parseAdditive(); - while (true) { - if (this.optionalOperator('<')) { - result = new ast_1.Binary('<', result, this.parseAdditive()); - } else if (this.optionalOperator('>')) { - result = new ast_1.Binary('>', result, this.parseAdditive()); - } else if (this.optionalOperator('<=')) { - result = new ast_1.Binary('<=', result, this.parseAdditive()); - } else if (this.optionalOperator('>=')) { - result = new ast_1.Binary('>=', result, this.parseAdditive()); - } else { - return result; - } - } - }; - _ParseAST.prototype.parseAdditive = function() { - var result = this.parseMultiplicative(); - while (true) { - if (this.optionalOperator('+')) { - result = new ast_1.Binary('+', result, this.parseMultiplicative()); - } else if (this.optionalOperator('-')) { - result = new ast_1.Binary('-', result, this.parseMultiplicative()); - } else { - return result; - } - } - }; - _ParseAST.prototype.parseMultiplicative = function() { - var result = this.parsePrefix(); - while (true) { - if (this.optionalOperator('*')) { - result = new ast_1.Binary('*', result, this.parsePrefix()); - } else if (this.optionalOperator('%')) { - result = new ast_1.Binary('%', result, this.parsePrefix()); - } else if (this.optionalOperator('/')) { - result = new ast_1.Binary('/', result, this.parsePrefix()); - } else { - return result; - } - } - }; - _ParseAST.prototype.parsePrefix = function() { - if (this.optionalOperator('+')) { - return this.parsePrefix(); - } else if (this.optionalOperator('-')) { - return new ast_1.Binary('-', new ast_1.LiteralPrimitive(0), this.parsePrefix()); - } else if (this.optionalOperator('!')) { - return new ast_1.PrefixNot(this.parsePrefix()); - } else { - return this.parseCallChain(); - } - }; - _ParseAST.prototype.parseCallChain = function() { - var result = this.parsePrimary(); - while (true) { - if (this.optionalCharacter(lexer_1.$PERIOD)) { - result = this.parseAccessMemberOrMethodCall(result, false); - } else if (this.optionalOperator('?.')) { - result = this.parseAccessMemberOrMethodCall(result, true); - } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { - var key = this.parsePipe(); - this.expectCharacter(lexer_1.$RBRACKET); - if (this.optionalOperator("=")) { - var value = this.parseConditional(); - result = new ast_1.KeyedWrite(result, key, value); - } else { - result = new ast_1.KeyedRead(result, key); - } - } else if (this.optionalCharacter(lexer_1.$LPAREN)) { - var args = this.parseCallArguments(); - this.expectCharacter(lexer_1.$RPAREN); - result = new ast_1.FunctionCall(result, args); - } else { - return result; - } - } - }; - _ParseAST.prototype.parsePrimary = function() { - if (this.optionalCharacter(lexer_1.$LPAREN)) { - var result = this.parsePipe(); - this.expectCharacter(lexer_1.$RPAREN); - return result; - } else if (this.next.isKeywordNull() || this.next.isKeywordUndefined()) { - this.advance(); - return new ast_1.LiteralPrimitive(null); - } else if (this.next.isKeywordTrue()) { - this.advance(); - return new ast_1.LiteralPrimitive(true); - } else if (this.next.isKeywordFalse()) { - this.advance(); - return new ast_1.LiteralPrimitive(false); - } else if (this.optionalCharacter(lexer_1.$LBRACKET)) { - var elements = this.parseExpressionList(lexer_1.$RBRACKET); - this.expectCharacter(lexer_1.$RBRACKET); - return new ast_1.LiteralArray(elements); - } else if (this.next.isCharacter(lexer_1.$LBRACE)) { - return this.parseLiteralMap(); - } else if (this.next.isIdentifier()) { - return this.parseAccessMemberOrMethodCall(_implicitReceiver, false); - } else if (this.next.isNumber()) { - var value = this.next.toNumber(); - this.advance(); - return new ast_1.LiteralPrimitive(value); - } else if (this.next.isString()) { - var literalValue = this.next.toString(); - this.advance(); - return new ast_1.LiteralPrimitive(literalValue); - } else if (this.index >= this.tokens.length) { - this.error("Unexpected end of expression: " + this.input); - } else { - this.error("Unexpected token " + this.next); - } - throw new exceptions_1.BaseException("Fell through all cases in parsePrimary"); - }; - _ParseAST.prototype.parseExpressionList = function(terminator) { - var result = []; - if (!this.next.isCharacter(terminator)) { - do { - result.push(this.parsePipe()); - } while (this.optionalCharacter(lexer_1.$COMMA)); - } - return result; - }; - _ParseAST.prototype.parseLiteralMap = function() { - var keys = []; - var values = []; - this.expectCharacter(lexer_1.$LBRACE); - if (!this.optionalCharacter(lexer_1.$RBRACE)) { - do { - var key = this.expectIdentifierOrKeywordOrString(); - keys.push(key); - this.expectCharacter(lexer_1.$COLON); - values.push(this.parsePipe()); - } while (this.optionalCharacter(lexer_1.$COMMA)); - this.expectCharacter(lexer_1.$RBRACE); - } - return new ast_1.LiteralMap(keys, values); - }; - _ParseAST.prototype.parseAccessMemberOrMethodCall = function(receiver, isSafe) { - if (isSafe === void 0) { - isSafe = false; - } - var id = this.expectIdentifierOrKeyword(); - if (this.optionalCharacter(lexer_1.$LPAREN)) { - var args = this.parseCallArguments(); - this.expectCharacter(lexer_1.$RPAREN); - var fn = this.reflector.method(id); - return isSafe ? new ast_1.SafeMethodCall(receiver, id, fn, args) : new ast_1.MethodCall(receiver, id, fn, args); - } else { - if (isSafe) { - if (this.optionalOperator("=")) { - this.error("The '?.' operator cannot be used in the assignment"); - } else { - return new ast_1.SafePropertyRead(receiver, id, this.reflector.getter(id)); - } - } else { - if (this.optionalOperator("=")) { - if (!this.parseAction) { - this.error("Bindings cannot contain assignments"); - } - var value = this.parseConditional(); - return new ast_1.PropertyWrite(receiver, id, this.reflector.setter(id), value); - } else { - return new ast_1.PropertyRead(receiver, id, this.reflector.getter(id)); - } - } - } - return null; - }; - _ParseAST.prototype.parseCallArguments = function() { - if (this.next.isCharacter(lexer_1.$RPAREN)) - return []; - var positionals = []; - do { - positionals.push(this.parsePipe()); - } while (this.optionalCharacter(lexer_1.$COMMA)); - return positionals; - }; - _ParseAST.prototype.parseBlockContent = function() { - if (!this.parseAction) { - this.error("Binding expression cannot contain chained expression"); - } - var exprs = []; - while (this.index < this.tokens.length && !this.next.isCharacter(lexer_1.$RBRACE)) { - var expr = this.parseExpression(); - exprs.push(expr); - if (this.optionalCharacter(lexer_1.$SEMICOLON)) { - while (this.optionalCharacter(lexer_1.$SEMICOLON)) {} - } - } - if (exprs.length == 0) - return new ast_1.EmptyExpr(); - if (exprs.length == 1) - return exprs[0]; - return new ast_1.Chain(exprs); - }; - _ParseAST.prototype.expectTemplateBindingKey = function() { - var result = ''; - var operatorFound = false; - do { - result += this.expectIdentifierOrKeywordOrString(); - operatorFound = this.optionalOperator('-'); - if (operatorFound) { - result += '-'; - } - } while (operatorFound); - return result.toString(); - }; - _ParseAST.prototype.parseTemplateBindings = function() { - var bindings = []; - var prefix = null; - while (this.index < this.tokens.length) { - var keyIsVar = this.optionalKeywordVar(); - var key = this.expectTemplateBindingKey(); - if (!keyIsVar) { - if (prefix == null) { - prefix = key; - } else { - key = prefix + key[0].toUpperCase() + key.substring(1); - } - } - this.optionalCharacter(lexer_1.$COLON); - var name = null; - var expression = null; - if (keyIsVar) { - if (this.optionalOperator("=")) { - name = this.expectTemplateBindingKey(); - } else { - name = '\$implicit'; - } - } else if (this.next !== lexer_1.EOF && !this.peekKeywordVar()) { - var start = this.inputIndex; - var ast = this.parsePipe(); - var source = this.input.substring(start, this.inputIndex); - expression = new ast_1.ASTWithSource(ast, source, this.location); - } - bindings.push(new ast_1.TemplateBinding(key, keyIsVar, name, expression)); - if (!this.optionalCharacter(lexer_1.$SEMICOLON)) { - this.optionalCharacter(lexer_1.$COMMA); - } - } - return bindings; - }; - _ParseAST.prototype.error = function(message, index) { - if (index === void 0) { - index = null; - } - if (lang_1.isBlank(index)) - index = this.index; - var location = (index < this.tokens.length) ? "at column " + (this.tokens[index].index + 1) + " in" : "at the end of the expression"; - throw new ParseException(message, this.input, location, this.location); - }; - return _ParseAST; - }()); - exports._ParseAST = _ParseAST; - var SimpleExpressionChecker = (function() { - function SimpleExpressionChecker() { - this.simple = true; - } - SimpleExpressionChecker.check = function(ast) { - var s = new SimpleExpressionChecker(); - ast.visit(s); - return s.simple; - }; - SimpleExpressionChecker.prototype.visitImplicitReceiver = function(ast) {}; - SimpleExpressionChecker.prototype.visitInterpolation = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitLiteralPrimitive = function(ast) {}; - SimpleExpressionChecker.prototype.visitPropertyRead = function(ast) {}; - SimpleExpressionChecker.prototype.visitPropertyWrite = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitSafePropertyRead = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitMethodCall = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitSafeMethodCall = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitFunctionCall = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitLiteralArray = function(ast) { - this.visitAll(ast.expressions); - }; - SimpleExpressionChecker.prototype.visitLiteralMap = function(ast) { - this.visitAll(ast.values); - }; - SimpleExpressionChecker.prototype.visitBinary = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitPrefixNot = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitConditional = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitPipe = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitKeyedRead = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitKeyedWrite = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitAll = function(asts) { - var res = collection_1.ListWrapper.createFixedSize(asts.length); - for (var i = 0; i < asts.length; ++i) { - res[i] = asts[i].visit(this); - } - return res; - }; - SimpleExpressionChecker.prototype.visitChain = function(ast) { - this.simple = false; - }; - SimpleExpressionChecker.prototype.visitQuote = function(ast) { - this.simple = false; - }; - return SimpleExpressionChecker; - }()); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/parser/locals", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var Locals = (function() { - function Locals(parent, current) { - this.parent = parent; - this.current = current; - } - Locals.prototype.contains = function(name) { - if (this.current.has(name)) { - return true; - } - if (lang_1.isPresent(this.parent)) { - return this.parent.contains(name); - } - return false; - }; - Locals.prototype.get = function(name) { - if (this.current.has(name)) { - return this.current.get(name); - } - if (lang_1.isPresent(this.parent)) { - return this.parent.get(name); - } - throw new exceptions_1.BaseException("Cannot find '" + name + "'"); - }; - Locals.prototype.set = function(name, value) { - if (this.current.has(name)) { - this.current.set(name, value); - } else { - throw new exceptions_1.BaseException("Setting of new keys post-construction is not supported. Key: " + name + "."); - } - }; - Locals.prototype.clearLocalValues = function() { - collection_1.MapWrapper.clearValues(this.current); - }; - return Locals; - }()); - exports.Locals = Locals; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/exceptions", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var exceptions_1 = require("angular2/src/facade/exceptions"); - var ExpressionChangedAfterItHasBeenCheckedException = (function(_super) { - __extends(ExpressionChangedAfterItHasBeenCheckedException, _super); - function ExpressionChangedAfterItHasBeenCheckedException(exp, oldValue, currValue, context) { - _super.call(this, ("Expression '" + exp + "' has changed after it was checked. ") + ("Previous value: '" + oldValue + "'. Current value: '" + currValue + "'")); - } - return ExpressionChangedAfterItHasBeenCheckedException; - }(exceptions_1.BaseException)); - exports.ExpressionChangedAfterItHasBeenCheckedException = ExpressionChangedAfterItHasBeenCheckedException; - var ChangeDetectionError = (function(_super) { - __extends(ChangeDetectionError, _super); - function ChangeDetectionError(exp, originalException, originalStack, context) { - _super.call(this, originalException + " in [" + exp + "]", originalException, originalStack, context); - this.location = exp; - } - return ChangeDetectionError; - }(exceptions_1.WrappedException)); - exports.ChangeDetectionError = ChangeDetectionError; - var DehydratedException = (function(_super) { - __extends(DehydratedException, _super); - function DehydratedException(details) { - _super.call(this, "Attempt to use a dehydrated detector: " + details); - } - return DehydratedException; - }(exceptions_1.BaseException)); - exports.DehydratedException = DehydratedException; - var EventEvaluationError = (function(_super) { - __extends(EventEvaluationError, _super); - function EventEvaluationError(eventName, originalException, originalStack, context) { - _super.call(this, "Error during evaluation of \"" + eventName + "\"", originalException, originalStack, context); - } - return EventEvaluationError; - }(exceptions_1.WrappedException)); - exports.EventEvaluationError = EventEvaluationError; - var EventEvaluationErrorContext = (function() { - function EventEvaluationErrorContext(element, componentElement, context, locals, injector) { - this.element = element; - this.componentElement = componentElement; - this.context = context; - this.locals = locals; - this.injector = injector; - } - return EventEvaluationErrorContext; - }()); - exports.EventEvaluationErrorContext = EventEvaluationErrorContext; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/interfaces", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var DebugContext = (function() { - function DebugContext(element, componentElement, directive, context, locals, injector) { - this.element = element; - this.componentElement = componentElement; - this.directive = directive; - this.context = context; - this.locals = locals; - this.injector = injector; - } - return DebugContext; - }()); - exports.DebugContext = DebugContext; - var ChangeDetectorGenConfig = (function() { - function ChangeDetectorGenConfig(genDebugInfo, logBindingUpdate, useJit) { - this.genDebugInfo = genDebugInfo; - this.logBindingUpdate = logBindingUpdate; - this.useJit = useJit; - } - return ChangeDetectorGenConfig; - }()); - exports.ChangeDetectorGenConfig = ChangeDetectorGenConfig; - var ChangeDetectorDefinition = (function() { - function ChangeDetectorDefinition(id, strategy, variableNames, bindingRecords, eventRecords, directiveRecords, genConfig) { - this.id = id; - this.strategy = strategy; - this.variableNames = variableNames; - this.bindingRecords = bindingRecords; - this.eventRecords = eventRecords; - this.directiveRecords = directiveRecords; - this.genConfig = genConfig; - } - return ChangeDetectorDefinition; - }()); - exports.ChangeDetectorDefinition = ChangeDetectorDefinition; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/constants", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - (function(ChangeDetectorState) { - ChangeDetectorState[ChangeDetectorState["NeverChecked"] = 0] = "NeverChecked"; - ChangeDetectorState[ChangeDetectorState["CheckedBefore"] = 1] = "CheckedBefore"; - ChangeDetectorState[ChangeDetectorState["Errored"] = 2] = "Errored"; - })(exports.ChangeDetectorState || (exports.ChangeDetectorState = {})); - var ChangeDetectorState = exports.ChangeDetectorState; - (function(ChangeDetectionStrategy) { - ChangeDetectionStrategy[ChangeDetectionStrategy["CheckOnce"] = 0] = "CheckOnce"; - ChangeDetectionStrategy[ChangeDetectionStrategy["Checked"] = 1] = "Checked"; - ChangeDetectionStrategy[ChangeDetectionStrategy["CheckAlways"] = 2] = "CheckAlways"; - ChangeDetectionStrategy[ChangeDetectionStrategy["Detached"] = 3] = "Detached"; - ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 4] = "OnPush"; - ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 5] = "Default"; - })(exports.ChangeDetectionStrategy || (exports.ChangeDetectionStrategy = {})); - var ChangeDetectionStrategy = exports.ChangeDetectionStrategy; - exports.CHANGE_DETECTION_STRATEGY_VALUES = [ChangeDetectionStrategy.CheckOnce, ChangeDetectionStrategy.Checked, ChangeDetectionStrategy.CheckAlways, ChangeDetectionStrategy.Detached, ChangeDetectionStrategy.OnPush, ChangeDetectionStrategy.Default]; - exports.CHANGE_DETECTOR_STATE_VALUES = [ChangeDetectorState.NeverChecked, ChangeDetectorState.CheckedBefore, ChangeDetectorState.Errored]; - function isDefaultChangeDetectionStrategy(changeDetectionStrategy) { - return lang_1.isBlank(changeDetectionStrategy) || changeDetectionStrategy === ChangeDetectionStrategy.Default; - } - exports.isDefaultChangeDetectionStrategy = isDefaultChangeDetectionStrategy; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/pipe_lifecycle_reflector", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function implementsOnDestroy(pipe) { - return pipe.constructor.prototype.ngOnDestroy; - } - exports.implementsOnDestroy = implementsOnDestroy; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/binding_record", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var DIRECTIVE_LIFECYCLE = "directiveLifecycle"; - var BINDING = "native"; - var DIRECTIVE = "directive"; - var ELEMENT_PROPERTY = "elementProperty"; - var ELEMENT_ATTRIBUTE = "elementAttribute"; - var ELEMENT_CLASS = "elementClass"; - var ELEMENT_STYLE = "elementStyle"; - var TEXT_NODE = "textNode"; - var EVENT = "event"; - var HOST_EVENT = "hostEvent"; - var BindingTarget = (function() { - function BindingTarget(mode, elementIndex, name, unit, debug) { - this.mode = mode; - this.elementIndex = elementIndex; - this.name = name; - this.unit = unit; - this.debug = debug; - } - BindingTarget.prototype.isDirective = function() { - return this.mode === DIRECTIVE; - }; - BindingTarget.prototype.isElementProperty = function() { - return this.mode === ELEMENT_PROPERTY; - }; - BindingTarget.prototype.isElementAttribute = function() { - return this.mode === ELEMENT_ATTRIBUTE; - }; - BindingTarget.prototype.isElementClass = function() { - return this.mode === ELEMENT_CLASS; - }; - BindingTarget.prototype.isElementStyle = function() { - return this.mode === ELEMENT_STYLE; - }; - BindingTarget.prototype.isTextNode = function() { - return this.mode === TEXT_NODE; - }; - return BindingTarget; - }()); - exports.BindingTarget = BindingTarget; - var BindingRecord = (function() { - function BindingRecord(mode, target, implicitReceiver, ast, setter, lifecycleEvent, directiveRecord) { - this.mode = mode; - this.target = target; - this.implicitReceiver = implicitReceiver; - this.ast = ast; - this.setter = setter; - this.lifecycleEvent = lifecycleEvent; - this.directiveRecord = directiveRecord; - } - BindingRecord.prototype.isDirectiveLifecycle = function() { - return this.mode === DIRECTIVE_LIFECYCLE; - }; - BindingRecord.prototype.callOnChanges = function() { - return lang_1.isPresent(this.directiveRecord) && this.directiveRecord.callOnChanges; - }; - BindingRecord.prototype.isDefaultChangeDetection = function() { - return lang_1.isBlank(this.directiveRecord) || this.directiveRecord.isDefaultChangeDetection(); - }; - BindingRecord.createDirectiveDoCheck = function(directiveRecord) { - return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "DoCheck", directiveRecord); - }; - BindingRecord.createDirectiveOnInit = function(directiveRecord) { - return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnInit", directiveRecord); - }; - BindingRecord.createDirectiveOnChanges = function(directiveRecord) { - return new BindingRecord(DIRECTIVE_LIFECYCLE, null, 0, null, null, "OnChanges", directiveRecord); - }; - BindingRecord.createForDirective = function(ast, propertyName, setter, directiveRecord) { - var elementIndex = directiveRecord.directiveIndex.elementIndex; - var t = new BindingTarget(DIRECTIVE, elementIndex, propertyName, null, ast.toString()); - return new BindingRecord(DIRECTIVE, t, 0, ast, setter, null, directiveRecord); - }; - BindingRecord.createForElementProperty = function(ast, elementIndex, propertyName) { - var t = new BindingTarget(ELEMENT_PROPERTY, elementIndex, propertyName, null, ast.toString()); - return new BindingRecord(BINDING, t, 0, ast, null, null, null); - }; - BindingRecord.createForElementAttribute = function(ast, elementIndex, attributeName) { - var t = new BindingTarget(ELEMENT_ATTRIBUTE, elementIndex, attributeName, null, ast.toString()); - return new BindingRecord(BINDING, t, 0, ast, null, null, null); - }; - BindingRecord.createForElementClass = function(ast, elementIndex, className) { - var t = new BindingTarget(ELEMENT_CLASS, elementIndex, className, null, ast.toString()); - return new BindingRecord(BINDING, t, 0, ast, null, null, null); - }; - BindingRecord.createForElementStyle = function(ast, elementIndex, styleName, unit) { - var t = new BindingTarget(ELEMENT_STYLE, elementIndex, styleName, unit, ast.toString()); - return new BindingRecord(BINDING, t, 0, ast, null, null, null); - }; - BindingRecord.createForHostProperty = function(directiveIndex, ast, propertyName) { - var t = new BindingTarget(ELEMENT_PROPERTY, directiveIndex.elementIndex, propertyName, null, ast.toString()); - return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); - }; - BindingRecord.createForHostAttribute = function(directiveIndex, ast, attributeName) { - var t = new BindingTarget(ELEMENT_ATTRIBUTE, directiveIndex.elementIndex, attributeName, null, ast.toString()); - return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); - }; - BindingRecord.createForHostClass = function(directiveIndex, ast, className) { - var t = new BindingTarget(ELEMENT_CLASS, directiveIndex.elementIndex, className, null, ast.toString()); - return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); - }; - BindingRecord.createForHostStyle = function(directiveIndex, ast, styleName, unit) { - var t = new BindingTarget(ELEMENT_STYLE, directiveIndex.elementIndex, styleName, unit, ast.toString()); - return new BindingRecord(BINDING, t, directiveIndex, ast, null, null, null); - }; - BindingRecord.createForTextNode = function(ast, elementIndex) { - var t = new BindingTarget(TEXT_NODE, elementIndex, null, null, ast.toString()); - return new BindingRecord(BINDING, t, 0, ast, null, null, null); - }; - BindingRecord.createForEvent = function(ast, eventName, elementIndex) { - var t = new BindingTarget(EVENT, elementIndex, eventName, null, ast.toString()); - return new BindingRecord(EVENT, t, 0, ast, null, null, null); - }; - BindingRecord.createForHostEvent = function(ast, eventName, directiveRecord) { - var directiveIndex = directiveRecord.directiveIndex; - var t = new BindingTarget(HOST_EVENT, directiveIndex.elementIndex, eventName, null, ast.toString()); - return new BindingRecord(HOST_EVENT, t, directiveIndex, ast, null, null, directiveRecord); - }; - return BindingRecord; - }()); - exports.BindingRecord = BindingRecord; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/directive_record", ["angular2/src/facade/lang", "angular2/src/core/change_detection/constants"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var constants_1 = require("angular2/src/core/change_detection/constants"); - var DirectiveIndex = (function() { - function DirectiveIndex(elementIndex, directiveIndex) { - this.elementIndex = elementIndex; - this.directiveIndex = directiveIndex; - } - Object.defineProperty(DirectiveIndex.prototype, "name", { - get: function() { - return this.elementIndex + "_" + this.directiveIndex; - }, - enumerable: true, - configurable: true - }); - return DirectiveIndex; - }()); - exports.DirectiveIndex = DirectiveIndex; - var DirectiveRecord = (function() { - function DirectiveRecord(_a) { - var _b = _a === void 0 ? {} : _a, - directiveIndex = _b.directiveIndex, - callAfterContentInit = _b.callAfterContentInit, - callAfterContentChecked = _b.callAfterContentChecked, - callAfterViewInit = _b.callAfterViewInit, - callAfterViewChecked = _b.callAfterViewChecked, - callOnChanges = _b.callOnChanges, - callDoCheck = _b.callDoCheck, - callOnInit = _b.callOnInit, - callOnDestroy = _b.callOnDestroy, - changeDetection = _b.changeDetection, - outputs = _b.outputs; - this.directiveIndex = directiveIndex; - this.callAfterContentInit = lang_1.normalizeBool(callAfterContentInit); - this.callAfterContentChecked = lang_1.normalizeBool(callAfterContentChecked); - this.callOnChanges = lang_1.normalizeBool(callOnChanges); - this.callAfterViewInit = lang_1.normalizeBool(callAfterViewInit); - this.callAfterViewChecked = lang_1.normalizeBool(callAfterViewChecked); - this.callDoCheck = lang_1.normalizeBool(callDoCheck); - this.callOnInit = lang_1.normalizeBool(callOnInit); - this.callOnDestroy = lang_1.normalizeBool(callOnDestroy); - this.changeDetection = changeDetection; - this.outputs = outputs; - } - DirectiveRecord.prototype.isDefaultChangeDetection = function() { - return constants_1.isDefaultChangeDetectionStrategy(this.changeDetection); - }; - return DirectiveRecord; - }()); - exports.DirectiveRecord = DirectiveRecord; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/change_detector_ref", ["angular2/src/core/change_detection/constants"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var constants_1 = require("angular2/src/core/change_detection/constants"); - var ChangeDetectorRef = (function() { - function ChangeDetectorRef() {} - return ChangeDetectorRef; - }()); - exports.ChangeDetectorRef = ChangeDetectorRef; - var ChangeDetectorRef_ = (function(_super) { - __extends(ChangeDetectorRef_, _super); - function ChangeDetectorRef_(_cd) { - _super.call(this); - this._cd = _cd; - } - ChangeDetectorRef_.prototype.markForCheck = function() { - this._cd.markPathToRootAsCheckOnce(); - }; - ChangeDetectorRef_.prototype.detach = function() { - this._cd.mode = constants_1.ChangeDetectionStrategy.Detached; - }; - ChangeDetectorRef_.prototype.detectChanges = function() { - this._cd.detectChanges(); - }; - ChangeDetectorRef_.prototype.checkNoChanges = function() { - this._cd.checkNoChanges(); - }; - ChangeDetectorRef_.prototype.reattach = function() { - this._cd.mode = constants_1.ChangeDetectionStrategy.CheckAlways; - this.markForCheck(); - }; - return ChangeDetectorRef_; - }(ChangeDetectorRef)); - exports.ChangeDetectorRef_ = ChangeDetectorRef_; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/profile/wtf_impl", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var trace; - var events; - function detectWTF() { - var wtf = lang_1.global['wtf']; - if (wtf) { - trace = wtf['trace']; - if (trace) { - events = trace['events']; - return true; - } - } - return false; - } - exports.detectWTF = detectWTF; - function createScope(signature, flags) { - if (flags === void 0) { - flags = null; - } - return events.createScope(signature, flags); - } - exports.createScope = createScope; - function leave(scope, returnValue) { - trace.leaveScope(scope, returnValue); - return returnValue; - } - exports.leave = leave; - function startTimeRange(rangeType, action) { - return trace.beginTimeRange(rangeType, action); - } - exports.startTimeRange = startTimeRange; - function endTimeRange(range) { - trace.endTimeRange(range); - } - exports.endTimeRange = endTimeRange; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/proto_record", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - (function(RecordType) { - RecordType[RecordType["Self"] = 0] = "Self"; - RecordType[RecordType["Const"] = 1] = "Const"; - RecordType[RecordType["PrimitiveOp"] = 2] = "PrimitiveOp"; - RecordType[RecordType["PropertyRead"] = 3] = "PropertyRead"; - RecordType[RecordType["PropertyWrite"] = 4] = "PropertyWrite"; - RecordType[RecordType["Local"] = 5] = "Local"; - RecordType[RecordType["InvokeMethod"] = 6] = "InvokeMethod"; - RecordType[RecordType["InvokeClosure"] = 7] = "InvokeClosure"; - RecordType[RecordType["KeyedRead"] = 8] = "KeyedRead"; - RecordType[RecordType["KeyedWrite"] = 9] = "KeyedWrite"; - RecordType[RecordType["Pipe"] = 10] = "Pipe"; - RecordType[RecordType["Interpolate"] = 11] = "Interpolate"; - RecordType[RecordType["SafeProperty"] = 12] = "SafeProperty"; - RecordType[RecordType["CollectionLiteral"] = 13] = "CollectionLiteral"; - RecordType[RecordType["SafeMethodInvoke"] = 14] = "SafeMethodInvoke"; - RecordType[RecordType["DirectiveLifecycle"] = 15] = "DirectiveLifecycle"; - RecordType[RecordType["Chain"] = 16] = "Chain"; - RecordType[RecordType["SkipRecordsIf"] = 17] = "SkipRecordsIf"; - RecordType[RecordType["SkipRecordsIfNot"] = 18] = "SkipRecordsIfNot"; - RecordType[RecordType["SkipRecords"] = 19] = "SkipRecords"; - })(exports.RecordType || (exports.RecordType = {})); - var RecordType = exports.RecordType; - var ProtoRecord = (function() { - function ProtoRecord(mode, name, funcOrValue, args, fixedArgs, contextIndex, directiveIndex, selfIndex, bindingRecord, lastInBinding, lastInDirective, argumentToPureFunction, referencedBySelf, propertyBindingIndex) { - this.mode = mode; - this.name = name; - this.funcOrValue = funcOrValue; - this.args = args; - this.fixedArgs = fixedArgs; - this.contextIndex = contextIndex; - this.directiveIndex = directiveIndex; - this.selfIndex = selfIndex; - this.bindingRecord = bindingRecord; - this.lastInBinding = lastInBinding; - this.lastInDirective = lastInDirective; - this.argumentToPureFunction = argumentToPureFunction; - this.referencedBySelf = referencedBySelf; - this.propertyBindingIndex = propertyBindingIndex; - } - ProtoRecord.prototype.isPureFunction = function() { - return this.mode === RecordType.Interpolate || this.mode === RecordType.CollectionLiteral; - }; - ProtoRecord.prototype.isUsedByOtherRecord = function() { - return !this.lastInBinding || this.referencedBySelf; - }; - ProtoRecord.prototype.shouldBeChecked = function() { - return this.argumentToPureFunction || this.lastInBinding || this.isPureFunction() || this.isPipeRecord(); - }; - ProtoRecord.prototype.isPipeRecord = function() { - return this.mode === RecordType.Pipe; - }; - ProtoRecord.prototype.isConditionalSkipRecord = function() { - return this.mode === RecordType.SkipRecordsIfNot || this.mode === RecordType.SkipRecordsIf; - }; - ProtoRecord.prototype.isUnconditionalSkipRecord = function() { - return this.mode === RecordType.SkipRecords; - }; - ProtoRecord.prototype.isSkipRecord = function() { - return this.isConditionalSkipRecord() || this.isUnconditionalSkipRecord(); - }; - ProtoRecord.prototype.isLifeCycleRecord = function() { - return this.mode === RecordType.DirectiveLifecycle; - }; - return ProtoRecord; - }()); - exports.ProtoRecord = ProtoRecord; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/event_binding", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var EventBinding = (function() { - function EventBinding(eventName, elIndex, dirIndex, records) { - this.eventName = eventName; - this.elIndex = elIndex; - this.dirIndex = dirIndex; - this.records = records; - } - return EventBinding; - }()); - exports.EventBinding = EventBinding; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/coalesce", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); - function coalesce(srcRecords) { - var dstRecords = []; - var excludedIdxs = []; - var indexMap = new collection_1.Map(); - var skipDepth = 0; - var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); - for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { - var skipRecord = skipSources[protoIndex]; - if (lang_1.isPresent(skipRecord)) { - skipDepth--; - skipRecord.fixedArgs[0] = dstRecords.length; - } - var src = srcRecords[protoIndex]; - var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); - if (dst.isSkipRecord()) { - dstRecords.push(dst); - skipDepth++; - skipSources[dst.fixedArgs[0]] = dst; - } else { - var record = _mayBeAddRecord(dst, dstRecords, excludedIdxs, skipDepth > 0); - indexMap.set(src.selfIndex, record.selfIndex); - } - } - return _optimizeSkips(dstRecords); - } - exports.coalesce = coalesce; - function _optimizeSkips(srcRecords) { - var dstRecords = []; - var skipSources = collection_1.ListWrapper.createFixedSize(srcRecords.length); - var indexMap = new collection_1.Map(); - for (var protoIndex = 0; protoIndex < srcRecords.length; protoIndex++) { - var skipRecord = skipSources[protoIndex]; - if (lang_1.isPresent(skipRecord)) { - skipRecord.fixedArgs[0] = dstRecords.length; - } - var src = srcRecords[protoIndex]; - if (src.isSkipRecord()) { - if (src.isConditionalSkipRecord() && src.fixedArgs[0] === protoIndex + 2 && protoIndex < srcRecords.length - 1 && srcRecords[protoIndex + 1].mode === proto_record_1.RecordType.SkipRecords) { - src.mode = src.mode === proto_record_1.RecordType.SkipRecordsIf ? proto_record_1.RecordType.SkipRecordsIfNot : proto_record_1.RecordType.SkipRecordsIf; - src.fixedArgs[0] = srcRecords[protoIndex + 1].fixedArgs[0]; - protoIndex++; - } - if (src.fixedArgs[0] > protoIndex + 1) { - var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); - dstRecords.push(dst); - skipSources[dst.fixedArgs[0]] = dst; - } - } else { - var dst = _cloneAndUpdateIndexes(src, dstRecords, indexMap); - dstRecords.push(dst); - indexMap.set(src.selfIndex, dst.selfIndex); - } - } - return dstRecords; - } - function _mayBeAddRecord(record, dstRecords, excludedIdxs, excluded) { - var match = _findFirstMatch(record, dstRecords, excludedIdxs); - if (lang_1.isPresent(match)) { - if (record.lastInBinding) { - dstRecords.push(_createSelfRecord(record, match.selfIndex, dstRecords.length + 1)); - match.referencedBySelf = true; - } else { - if (record.argumentToPureFunction) { - match.argumentToPureFunction = true; - } - } - return match; - } - if (excluded) { - excludedIdxs.push(record.selfIndex); - } - dstRecords.push(record); - return record; - } - function _findFirstMatch(record, dstRecords, excludedIdxs) { - return dstRecords.find(function(rr) { - return excludedIdxs.indexOf(rr.selfIndex) == -1 && rr.mode !== proto_record_1.RecordType.DirectiveLifecycle && _haveSameDirIndex(rr, record) && rr.mode === record.mode && lang_1.looseIdentical(rr.funcOrValue, record.funcOrValue) && rr.contextIndex === record.contextIndex && lang_1.looseIdentical(rr.name, record.name) && collection_1.ListWrapper.equals(rr.args, record.args); - }); - } - function _cloneAndUpdateIndexes(record, dstRecords, indexMap) { - var args = record.args.map(function(src) { - return _srcToDstSelfIndex(indexMap, src); - }); - var contextIndex = _srcToDstSelfIndex(indexMap, record.contextIndex); - var selfIndex = dstRecords.length + 1; - return new proto_record_1.ProtoRecord(record.mode, record.name, record.funcOrValue, args, record.fixedArgs, contextIndex, record.directiveIndex, selfIndex, record.bindingRecord, record.lastInBinding, record.lastInDirective, record.argumentToPureFunction, record.referencedBySelf, record.propertyBindingIndex); - } - function _srcToDstSelfIndex(indexMap, srcIdx) { - var dstIdx = indexMap.get(srcIdx); - return lang_1.isPresent(dstIdx) ? dstIdx : srcIdx; - } - function _createSelfRecord(r, contextIndex, selfIndex) { - return new proto_record_1.ProtoRecord(proto_record_1.RecordType.Self, "self", null, [], r.fixedArgs, contextIndex, r.directiveIndex, selfIndex, r.bindingRecord, r.lastInBinding, r.lastInDirective, false, false, r.propertyBindingIndex); - } - function _haveSameDirIndex(a, b) { - var di1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.directiveIndex; - var ei1 = lang_1.isBlank(a.directiveIndex) ? null : a.directiveIndex.elementIndex; - var di2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.directiveIndex; - var ei2 = lang_1.isBlank(b.directiveIndex) ? null : b.directiveIndex.elementIndex; - return di1 === di2 && ei1 === ei2; - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/codegen_name_util", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var _STATE_ACCESSOR = "state"; - var _CONTEXT_ACCESSOR = "context"; - var _PROP_BINDING_INDEX = "propertyBindingIndex"; - var _DIRECTIVES_ACCESSOR = "directiveIndices"; - var _DISPATCHER_ACCESSOR = "dispatcher"; - var _LOCALS_ACCESSOR = "locals"; - var _MODE_ACCESSOR = "mode"; - var _PIPES_ACCESSOR = "pipes"; - var _PROTOS_ACCESSOR = "protos"; - exports.CONTEXT_ACCESSOR = "context"; - exports.CONTEXT_INDEX = 0; - var _FIELD_PREFIX = 'this.'; - var _whiteSpaceRegExp = /\W/g; - function sanitizeName(s) { - return lang_1.StringWrapper.replaceAll(s, _whiteSpaceRegExp, ''); - } - exports.sanitizeName = sanitizeName; - var CodegenNameUtil = (function() { - function CodegenNameUtil(_records, _eventBindings, _directiveRecords, _utilName) { - this._records = _records; - this._eventBindings = _eventBindings; - this._directiveRecords = _directiveRecords; - this._utilName = _utilName; - this._sanitizedEventNames = new collection_1.Map(); - this._sanitizedNames = collection_1.ListWrapper.createFixedSize(this._records.length + 1); - this._sanitizedNames[exports.CONTEXT_INDEX] = exports.CONTEXT_ACCESSOR; - for (var i = 0, - iLen = this._records.length; i < iLen; ++i) { - this._sanitizedNames[i + 1] = sanitizeName("" + this._records[i].name + i); - } - for (var ebIndex = 0; ebIndex < _eventBindings.length; ++ebIndex) { - var eb = _eventBindings[ebIndex]; - var names = [exports.CONTEXT_ACCESSOR]; - for (var i = 0, - iLen = eb.records.length; i < iLen; ++i) { - names.push(sanitizeName("" + eb.records[i].name + i + "_" + ebIndex)); - } - this._sanitizedEventNames.set(eb, names); - } - } - CodegenNameUtil.prototype._addFieldPrefix = function(name) { - return "" + _FIELD_PREFIX + name; - }; - CodegenNameUtil.prototype.getDispatcherName = function() { - return this._addFieldPrefix(_DISPATCHER_ACCESSOR); - }; - CodegenNameUtil.prototype.getPipesAccessorName = function() { - return this._addFieldPrefix(_PIPES_ACCESSOR); - }; - CodegenNameUtil.prototype.getProtosName = function() { - return this._addFieldPrefix(_PROTOS_ACCESSOR); - }; - CodegenNameUtil.prototype.getDirectivesAccessorName = function() { - return this._addFieldPrefix(_DIRECTIVES_ACCESSOR); - }; - CodegenNameUtil.prototype.getLocalsAccessorName = function() { - return this._addFieldPrefix(_LOCALS_ACCESSOR); - }; - CodegenNameUtil.prototype.getStateName = function() { - return this._addFieldPrefix(_STATE_ACCESSOR); - }; - CodegenNameUtil.prototype.getModeName = function() { - return this._addFieldPrefix(_MODE_ACCESSOR); - }; - CodegenNameUtil.prototype.getPropertyBindingIndex = function() { - return this._addFieldPrefix(_PROP_BINDING_INDEX); - }; - CodegenNameUtil.prototype.getLocalName = function(idx) { - return "l_" + this._sanitizedNames[idx]; - }; - CodegenNameUtil.prototype.getEventLocalName = function(eb, idx) { - return "l_" + this._sanitizedEventNames.get(eb)[idx]; - }; - CodegenNameUtil.prototype.getChangeName = function(idx) { - return "c_" + this._sanitizedNames[idx]; - }; - CodegenNameUtil.prototype.genInitLocals = function() { - var declarations = []; - var assignments = []; - for (var i = 0, - iLen = this.getFieldCount(); i < iLen; ++i) { - if (i == exports.CONTEXT_INDEX) { - declarations.push(this.getLocalName(i) + " = " + this.getFieldName(i)); - } else { - var rec = this._records[i - 1]; - if (rec.argumentToPureFunction) { - var changeName = this.getChangeName(i); - declarations.push(this.getLocalName(i) + "," + changeName); - assignments.push(changeName); - } else { - declarations.push("" + this.getLocalName(i)); - } - } - } - var assignmentsCode = collection_1.ListWrapper.isEmpty(assignments) ? '' : assignments.join('=') + " = false;"; - return "var " + declarations.join(',') + ";" + assignmentsCode; - }; - CodegenNameUtil.prototype.genInitEventLocals = function() { - var _this = this; - var res = [(this.getLocalName(exports.CONTEXT_INDEX) + " = " + this.getFieldName(exports.CONTEXT_INDEX))]; - this._sanitizedEventNames.forEach(function(names, eb) { - for (var i = 0; i < names.length; ++i) { - if (i !== exports.CONTEXT_INDEX) { - res.push("" + _this.getEventLocalName(eb, i)); - } - } - }); - return res.length > 1 ? "var " + res.join(',') + ";" : ''; - }; - CodegenNameUtil.prototype.getPreventDefaultAccesor = function() { - return "preventDefault"; - }; - CodegenNameUtil.prototype.getFieldCount = function() { - return this._sanitizedNames.length; - }; - CodegenNameUtil.prototype.getFieldName = function(idx) { - return this._addFieldPrefix(this._sanitizedNames[idx]); - }; - CodegenNameUtil.prototype.getAllFieldNames = function() { - var fieldList = []; - for (var k = 0, - kLen = this.getFieldCount(); k < kLen; ++k) { - if (k === 0 || this._records[k - 1].shouldBeChecked()) { - fieldList.push(this.getFieldName(k)); - } - } - for (var i = 0, - iLen = this._records.length; i < iLen; ++i) { - var rec = this._records[i]; - if (rec.isPipeRecord()) { - fieldList.push(this.getPipeName(rec.selfIndex)); - } - } - for (var j = 0, - jLen = this._directiveRecords.length; j < jLen; ++j) { - var dRec = this._directiveRecords[j]; - fieldList.push(this.getDirectiveName(dRec.directiveIndex)); - if (!dRec.isDefaultChangeDetection()) { - fieldList.push(this.getDetectorName(dRec.directiveIndex)); - } - } - return fieldList; - }; - CodegenNameUtil.prototype.genDehydrateFields = function() { - var fields = this.getAllFieldNames(); - collection_1.ListWrapper.removeAt(fields, exports.CONTEXT_INDEX); - if (collection_1.ListWrapper.isEmpty(fields)) - return ''; - fields.push(this._utilName + ".uninitialized;"); - return fields.join(' = '); - }; - CodegenNameUtil.prototype.genPipeOnDestroy = function() { - var _this = this; - return this._records.filter(function(r) { - return r.isPipeRecord(); - }).map(function(r) { - return (_this._utilName + ".callPipeOnDestroy(" + _this.getPipeName(r.selfIndex) + ");"); - }).join('\n'); - }; - CodegenNameUtil.prototype.getPipeName = function(idx) { - return this._addFieldPrefix(this._sanitizedNames[idx] + "_pipe"); - }; - CodegenNameUtil.prototype.getDirectiveName = function(d) { - return this._addFieldPrefix("directive_" + d.name); - }; - CodegenNameUtil.prototype.getDetectorName = function(d) { - return this._addFieldPrefix("detector_" + d.name); - }; - return CodegenNameUtil; - }()); - exports.CodegenNameUtil = CodegenNameUtil; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/codegen_facade", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function codify(obj) { - return JSON.stringify(obj); - } - exports.codify = codify; - function rawString(str) { - return "'" + str + "'"; - } - exports.rawString = rawString; - function combineGeneratedStrings(vals) { - return vals.join(' + '); - } - exports.combineGeneratedStrings = combineGeneratedStrings; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/metadata/view", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - (function(ViewEncapsulation) { - ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; - ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native"; - ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; - })(exports.ViewEncapsulation || (exports.ViewEncapsulation = {})); - var ViewEncapsulation = exports.ViewEncapsulation; - exports.VIEW_ENCAPSULATION_VALUES = [ViewEncapsulation.Emulated, ViewEncapsulation.Native, ViewEncapsulation.None]; - var ViewMetadata = (function() { - function ViewMetadata(_a) { - var _b = _a === void 0 ? {} : _a, - templateUrl = _b.templateUrl, - template = _b.template, - directives = _b.directives, - pipes = _b.pipes, - encapsulation = _b.encapsulation, - styles = _b.styles, - styleUrls = _b.styleUrls; - this.templateUrl = templateUrl; - this.template = template; - this.styleUrls = styleUrls; - this.styles = styles; - this.directives = directives; - this.pipes = pipes; - this.encapsulation = encapsulation; - } - ViewMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ViewMetadata); - return ViewMetadata; - }()); - exports.ViewMetadata = ViewMetadata; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/util", ["angular2/src/core/util/decorators"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var decorators_1 = require("angular2/src/core/util/decorators"); - exports.Class = decorators_1.Class; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/prod_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - exports.enableProdMode = lang_1.enableProdMode; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/facade/facade", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/exceptions", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - exports.Type = lang_1.Type; - var async_1 = require("angular2/src/facade/async"); - exports.EventEmitter = async_1.EventEmitter; - var exceptions_1 = require("angular2/src/facade/exceptions"); - exports.WrappedException = exceptions_1.WrappedException; - var exception_handler_1 = require("angular2/src/facade/exception_handler"); - exports.ExceptionHandler = exception_handler_1.ExceptionHandler; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/application_tokens", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - exports.APP_COMPONENT_REF_PROMISE = lang_1.CONST_EXPR(new di_1.OpaqueToken('Promise')); - exports.APP_COMPONENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppComponent')); - exports.APP_ID = lang_1.CONST_EXPR(new di_1.OpaqueToken('AppId')); - function _appIdRandomProviderFactory() { - return "" + _randomChar() + _randomChar() + _randomChar(); - } - exports.APP_ID_RANDOM_PROVIDER = lang_1.CONST_EXPR(new di_1.Provider(exports.APP_ID, { - useFactory: _appIdRandomProviderFactory, - deps: [] - })); - function _randomChar() { - return lang_1.StringWrapper.fromCharCode(97 + lang_1.Math.floor(lang_1.Math.random() * 25)); - } - exports.PLATFORM_INITIALIZER = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Initializer")); - exports.APP_INITIALIZER = lang_1.CONST_EXPR(new di_1.OpaqueToken("Application Initializer")); - exports.PACKAGE_ROOT_URL = lang_1.CONST_EXPR(new di_1.OpaqueToken("Application Packages Root URL")); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/testability/testability", ["angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/zone/ng_zone", "angular2/src/facade/async"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = require("angular2/src/core/di"); - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); - var async_1 = require("angular2/src/facade/async"); - var Testability = (function() { - function Testability(_ngZone) { - this._ngZone = _ngZone; - this._pendingCount = 0; - this._isZoneStable = true; - this._didWork = false; - this._callbacks = []; - this._watchAngularEvents(); - } - Testability.prototype._watchAngularEvents = function() { - var _this = this; - async_1.ObservableWrapper.subscribe(this._ngZone.onUnstable, function(_) { - _this._didWork = true; - _this._isZoneStable = false; - }); - this._ngZone.runOutsideAngular(function() { - async_1.ObservableWrapper.subscribe(_this._ngZone.onStable, function(_) { - ng_zone_1.NgZone.assertNotInAngularZone(); - lang_1.scheduleMicroTask(function() { - _this._isZoneStable = true; - _this._runCallbacksIfReady(); - }); - }); - }); - }; - Testability.prototype.increasePendingRequestCount = function() { - this._pendingCount += 1; - this._didWork = true; - return this._pendingCount; - }; - Testability.prototype.decreasePendingRequestCount = function() { - this._pendingCount -= 1; - if (this._pendingCount < 0) { - throw new exceptions_1.BaseException('pending async requests below zero'); - } - this._runCallbacksIfReady(); - return this._pendingCount; - }; - Testability.prototype.isStable = function() { - return this._isZoneStable && this._pendingCount == 0 && !this._ngZone.hasPendingMacrotasks; - }; - Testability.prototype._runCallbacksIfReady = function() { - var _this = this; - if (this.isStable()) { - lang_1.scheduleMicroTask(function() { - while (_this._callbacks.length !== 0) { - (_this._callbacks.pop())(_this._didWork); - } - _this._didWork = false; - }); - } else { - this._didWork = true; - } - }; - Testability.prototype.whenStable = function(callback) { - this._callbacks.push(callback); - this._runCallbacksIfReady(); - }; - Testability.prototype.getPendingRequestCount = function() { - return this._pendingCount; - }; - Testability.prototype.findBindings = function(using, provider, exactMatch) { - return []; - }; - Testability.prototype.findProviders = function(using, provider, exactMatch) { - return []; - }; - Testability = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [ng_zone_1.NgZone])], Testability); - return Testability; - }()); - exports.Testability = Testability; - var TestabilityRegistry = (function() { - function TestabilityRegistry() { - this._applications = new collection_1.Map(); - _testabilityGetter.addToWindow(this); - } - TestabilityRegistry.prototype.registerApplication = function(token, testability) { - this._applications.set(token, testability); - }; - TestabilityRegistry.prototype.getTestability = function(elem) { - return this._applications.get(elem); - }; - TestabilityRegistry.prototype.getAllTestabilities = function() { - return collection_1.MapWrapper.values(this._applications); - }; - TestabilityRegistry.prototype.getAllRootElements = function() { - return collection_1.MapWrapper.keys(this._applications); - }; - TestabilityRegistry.prototype.findTestabilityInTree = function(elem, findInAncestors) { - if (findInAncestors === void 0) { - findInAncestors = true; - } - return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors); - }; - TestabilityRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], TestabilityRegistry); - return TestabilityRegistry; - }()); - exports.TestabilityRegistry = TestabilityRegistry; - var _NoopGetTestability = (function() { - function _NoopGetTestability() {} - _NoopGetTestability.prototype.addToWindow = function(registry) {}; - _NoopGetTestability.prototype.findTestabilityInTree = function(registry, elem, findInAncestors) { - return null; - }; - _NoopGetTestability = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [])], _NoopGetTestability); - return _NoopGetTestability; - }()); - function setTestabilityGetter(getter) { - _testabilityGetter = getter; - } - exports.setTestabilityGetter = setTestabilityGetter; - var _testabilityGetter = lang_1.CONST_EXPR(new _NoopGetTestability()); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/view_type", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - (function(ViewType) { - ViewType[ViewType["HOST"] = 0] = "HOST"; - ViewType[ViewType["COMPONENT"] = 1] = "COMPONENT"; - ViewType[ViewType["EMBEDDED"] = 2] = "EMBEDDED"; - })(exports.ViewType || (exports.ViewType = {})); - var ViewType = exports.ViewType; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/element_ref", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var exceptions_1 = require("angular2/src/facade/exceptions"); - var ElementRef = (function() { - function ElementRef() {} - Object.defineProperty(ElementRef.prototype, "nativeElement", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - return ElementRef; - }()); - exports.ElementRef = ElementRef; - var ElementRef_ = (function() { - function ElementRef_(_appElement) { - this._appElement = _appElement; - } - Object.defineProperty(ElementRef_.prototype, "internalElement", { - get: function() { - return this._appElement; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(ElementRef_.prototype, "nativeElement", { - get: function() { - return this._appElement.nativeElement; - }, - enumerable: true, - configurable: true - }); - return ElementRef_; - }()); - exports.ElementRef_ = ElementRef_; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/view_container_ref", ["angular2/src/facade/collection", "angular2/src/facade/exceptions", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var collection_1 = require("angular2/src/facade/collection"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var lang_1 = require("angular2/src/facade/lang"); - var ViewContainerRef = (function() { - function ViewContainerRef() {} - Object.defineProperty(ViewContainerRef.prototype, "element", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - ViewContainerRef.prototype.clear = function() { - for (var i = this.length - 1; i >= 0; i--) { - this.remove(i); - } - }; - Object.defineProperty(ViewContainerRef.prototype, "length", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - ; - return ViewContainerRef; - }()); - exports.ViewContainerRef = ViewContainerRef; - var ViewContainerRef_ = (function(_super) { - __extends(ViewContainerRef_, _super); - function ViewContainerRef_(_element) { - _super.call(this); - this._element = _element; - } - ViewContainerRef_.prototype.get = function(index) { - return this._element.nestedViews[index].ref; - }; - Object.defineProperty(ViewContainerRef_.prototype, "length", { - get: function() { - var views = this._element.nestedViews; - return lang_1.isPresent(views) ? views.length : 0; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(ViewContainerRef_.prototype, "element", { - get: function() { - return this._element.ref; - }, - enumerable: true, - configurable: true - }); - ViewContainerRef_.prototype.createEmbeddedView = function(templateRef, index) { - if (index === void 0) { - index = -1; - } - if (index == -1) - index = this.length; - var vm = this._element.parentView.viewManager; - return vm.createEmbeddedViewInContainer(this._element.ref, index, templateRef); - }; - ViewContainerRef_.prototype.createHostView = function(hostViewFactoryRef, index, dynamicallyCreatedProviders, projectableNodes) { - if (index === void 0) { - index = -1; - } - if (dynamicallyCreatedProviders === void 0) { - dynamicallyCreatedProviders = null; - } - if (projectableNodes === void 0) { - projectableNodes = null; - } - if (index == -1) - index = this.length; - var vm = this._element.parentView.viewManager; - return vm.createHostViewInContainer(this._element.ref, index, hostViewFactoryRef, dynamicallyCreatedProviders, projectableNodes); - }; - ViewContainerRef_.prototype.insert = function(viewRef, index) { - if (index === void 0) { - index = -1; - } - if (index == -1) - index = this.length; - var vm = this._element.parentView.viewManager; - return vm.attachViewInContainer(this._element.ref, index, viewRef); - }; - ViewContainerRef_.prototype.indexOf = function(viewRef) { - return collection_1.ListWrapper.indexOf(this._element.nestedViews, viewRef.internalView); - }; - ViewContainerRef_.prototype.remove = function(index) { - if (index === void 0) { - index = -1; - } - if (index == -1) - index = this.length - 1; - var vm = this._element.parentView.viewManager; - return vm.destroyViewInContainer(this._element.ref, index); - }; - ViewContainerRef_.prototype.detach = function(index) { - if (index === void 0) { - index = -1; - } - if (index == -1) - index = this.length - 1; - var vm = this._element.parentView.viewManager; - return vm.detachViewInContainer(this._element.ref, index); - }; - return ViewContainerRef_; - }(ViewContainerRef)); - exports.ViewContainerRef_ = ViewContainerRef_; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/render/api", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var RenderComponentType = (function() { - function RenderComponentType(id, encapsulation, styles) { - this.id = id; - this.encapsulation = encapsulation; - this.styles = styles; - } - return RenderComponentType; - }()); - exports.RenderComponentType = RenderComponentType; - var RenderDebugInfo = (function() { - function RenderDebugInfo(injector, component, providerTokens, locals) { - this.injector = injector; - this.component = component; - this.providerTokens = providerTokens; - this.locals = locals; - } - return RenderDebugInfo; - }()); - exports.RenderDebugInfo = RenderDebugInfo; - var Renderer = (function() { - function Renderer() {} - return Renderer; - }()); - exports.Renderer = Renderer; - var RootRenderer = (function() { - function RootRenderer() {} - return RootRenderer; - }()); - exports.RootRenderer = RootRenderer; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/template_ref", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var TemplateRef = (function() { - function TemplateRef() {} - Object.defineProperty(TemplateRef.prototype, "elementRef", { - get: function() { - return null; - }, - enumerable: true, - configurable: true - }); - return TemplateRef; - }()); - exports.TemplateRef = TemplateRef; - var TemplateRef_ = (function(_super) { - __extends(TemplateRef_, _super); - function TemplateRef_(_elementRef) { - _super.call(this); - this._elementRef = _elementRef; - } - Object.defineProperty(TemplateRef_.prototype, "elementRef", { - get: function() { - return this._elementRef; - }, - enumerable: true, - configurable: true - }); - return TemplateRef_; - }(TemplateRef)); - exports.TemplateRef_ = TemplateRef_; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/query_list", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/async"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var async_1 = require("angular2/src/facade/async"); - var QueryList = (function() { - function QueryList() { - this._results = []; - this._emitter = new async_1.EventEmitter(); - } - Object.defineProperty(QueryList.prototype, "changes", { - get: function() { - return this._emitter; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(QueryList.prototype, "length", { - get: function() { - return this._results.length; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(QueryList.prototype, "first", { - get: function() { - return collection_1.ListWrapper.first(this._results); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(QueryList.prototype, "last", { - get: function() { - return collection_1.ListWrapper.last(this._results); - }, - enumerable: true, - configurable: true - }); - QueryList.prototype.map = function(fn) { - return this._results.map(fn); - }; - QueryList.prototype.filter = function(fn) { - return this._results.filter(fn); - }; - QueryList.prototype.reduce = function(fn, init) { - return this._results.reduce(fn, init); - }; - QueryList.prototype.forEach = function(fn) { - this._results.forEach(fn); - }; - QueryList.prototype.toArray = function() { - return collection_1.ListWrapper.clone(this._results); - }; - QueryList.prototype[lang_1.getSymbolIterator()] = function() { - return this._results[lang_1.getSymbolIterator()](); - }; - QueryList.prototype.toString = function() { - return this._results.toString(); - }; - QueryList.prototype.reset = function(res) { - this._results = res; - }; - QueryList.prototype.notifyOnChanges = function() { - this._emitter.emit(this); - }; - return QueryList; - }()); - exports.QueryList = QueryList; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/pipes/pipe_provider", ["angular2/src/core/di/provider", "angular2/src/core/di"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var provider_1 = require("angular2/src/core/di/provider"); - var di_1 = require("angular2/src/core/di"); - var PipeProvider = (function(_super) { - __extends(PipeProvider, _super); - function PipeProvider(name, pure, key, resolvedFactories, multiBinding) { - _super.call(this, key, resolvedFactories, multiBinding); - this.name = name; - this.pure = pure; - } - PipeProvider.createFromType = function(type, metadata) { - var provider = new di_1.Provider(type, {useClass: type}); - var rb = provider_1.resolveProvider(provider); - return new PipeProvider(metadata.name, metadata.pure, rb.key, rb.resolvedFactories, rb.multiProvider); - }; - return PipeProvider; - }(provider_1.ResolvedProvider_)); - exports.PipeProvider = PipeProvider; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/view_ref", ["angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var exceptions_1 = require("angular2/src/facade/exceptions"); - var ViewRef = (function() { - function ViewRef() {} - Object.defineProperty(ViewRef.prototype, "changeDetectorRef", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - ; - Object.defineProperty(ViewRef.prototype, "destroyed", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - return ViewRef; - }()); - exports.ViewRef = ViewRef; - var HostViewRef = (function(_super) { - __extends(HostViewRef, _super); - function HostViewRef() { - _super.apply(this, arguments); - } - Object.defineProperty(HostViewRef.prototype, "rootNodes", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - ; - return HostViewRef; - }(ViewRef)); - exports.HostViewRef = HostViewRef; - var EmbeddedViewRef = (function(_super) { - __extends(EmbeddedViewRef, _super); - function EmbeddedViewRef() { - _super.apply(this, arguments); - } - Object.defineProperty(EmbeddedViewRef.prototype, "rootNodes", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - ; - return EmbeddedViewRef; - }(ViewRef)); - exports.EmbeddedViewRef = EmbeddedViewRef; - var ViewRef_ = (function() { - function ViewRef_(_view) { - this._view = _view; - this._view = _view; - } - Object.defineProperty(ViewRef_.prototype, "internalView", { - get: function() { - return this._view; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(ViewRef_.prototype, "changeDetectorRef", { - get: function() { - return this._view.changeDetector.ref; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(ViewRef_.prototype, "rootNodes", { - get: function() { - return this._view.flatRootNodes; - }, - enumerable: true, - configurable: true - }); - ViewRef_.prototype.setLocal = function(variableName, value) { - this._view.setLocal(variableName, value); - }; - ViewRef_.prototype.hasLocal = function(variableName) { - return this._view.hasLocal(variableName); - }; - Object.defineProperty(ViewRef_.prototype, "destroyed", { - get: function() { - return this._view.destroyed; - }, - enumerable: true, - configurable: true - }); - return ViewRef_; - }()); - exports.ViewRef_ = ViewRef_; - var HostViewFactoryRef = (function() { - function HostViewFactoryRef() {} - return HostViewFactoryRef; - }()); - exports.HostViewFactoryRef = HostViewFactoryRef; - var HostViewFactoryRef_ = (function() { - function HostViewFactoryRef_(_hostViewFactory) { - this._hostViewFactory = _hostViewFactory; - } - Object.defineProperty(HostViewFactoryRef_.prototype, "internalHostViewFactory", { - get: function() { - return this._hostViewFactory; - }, - enumerable: true, - configurable: true - }); - return HostViewFactoryRef_; - }()); - exports.HostViewFactoryRef_ = HostViewFactoryRef_; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/pipes", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var SelectedPipe = (function() { - function SelectedPipe(pipe, pure) { - this.pipe = pipe; - this.pure = pure; - } - return SelectedPipe; - }()); - exports.SelectedPipe = SelectedPipe; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/render/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var CAMEL_CASE_REGEXP = /([A-Z])/g; - var DASH_CASE_REGEXP = /-([a-z])/g; - function camelCaseToDashCase(input) { - return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { - return '-' + m[1].toLowerCase(); - }); - } - exports.camelCaseToDashCase = camelCaseToDashCase; - function dashCaseToCamelCase(input) { - return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { - return m[1].toUpperCase(); - }); - } - exports.dashCaseToCamelCase = dashCaseToCamelCase; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/view_manager", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/exceptions", "angular2/src/core/linker/view", "angular2/src/core/render/api", "angular2/src/core/profile/profile", "angular2/src/core/application_tokens", "angular2/src/core/linker/view_type"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var view_1 = require("angular2/src/core/linker/view"); - var api_1 = require("angular2/src/core/render/api"); - var profile_1 = require("angular2/src/core/profile/profile"); - var application_tokens_1 = require("angular2/src/core/application_tokens"); - var view_type_1 = require("angular2/src/core/linker/view_type"); - var AppViewManager = (function() { - function AppViewManager() {} - return AppViewManager; - }()); - exports.AppViewManager = AppViewManager; - var AppViewManager_ = (function(_super) { - __extends(AppViewManager_, _super); - function AppViewManager_(_renderer, _appId) { - _super.call(this); - this._renderer = _renderer; - this._appId = _appId; - this._nextCompTypeId = 0; - this._createRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#createRootHostView()'); - this._destroyRootHostViewScope = profile_1.wtfCreateScope('AppViewManager#destroyRootHostView()'); - this._createEmbeddedViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createEmbeddedViewInContainer()'); - this._createHostViewInContainerScope = profile_1.wtfCreateScope('AppViewManager#createHostViewInContainer()'); - this._destroyViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#destroyViewInContainer()'); - this._attachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#attachViewInContainer()'); - this._detachViewInContainerScope = profile_1.wtfCreateScope('AppViewMananger#detachViewInContainer()'); - } - AppViewManager_.prototype.getViewContainer = function(location) { - return location.internalElement.getViewContainerRef(); - }; - AppViewManager_.prototype.getHostElement = function(hostViewRef) { - var hostView = hostViewRef.internalView; - if (hostView.proto.type !== view_type_1.ViewType.HOST) { - throw new exceptions_1.BaseException('This operation is only allowed on host views'); - } - return hostView.appElements[0].ref; - }; - AppViewManager_.prototype.getNamedElementInComponentView = function(hostLocation, variableName) { - var appEl = hostLocation.internalElement; - var componentView = appEl.componentView; - if (lang_1.isBlank(componentView)) { - throw new exceptions_1.BaseException("There is no component directive at element " + hostLocation); - } - for (var i = 0; i < componentView.appElements.length; i++) { - var compAppEl = componentView.appElements[i]; - if (collection_1.StringMapWrapper.contains(compAppEl.proto.directiveVariableBindings, variableName)) { - return compAppEl.ref; - } - } - throw new exceptions_1.BaseException("Could not find variable " + variableName); - }; - AppViewManager_.prototype.getComponent = function(hostLocation) { - return hostLocation.internalElement.getComponent(); - }; - AppViewManager_.prototype.createRootHostView = function(hostViewFactoryRef, overrideSelector, injector, projectableNodes) { - if (projectableNodes === void 0) { - projectableNodes = null; - } - var s = this._createRootHostViewScope(); - var hostViewFactory = hostViewFactoryRef.internalHostViewFactory; - var selector = lang_1.isPresent(overrideSelector) ? overrideSelector : hostViewFactory.selector; - var view = hostViewFactory.viewFactory(this._renderer, this, null, projectableNodes, selector, null, injector); - return profile_1.wtfLeave(s, view.ref); - }; - AppViewManager_.prototype.destroyRootHostView = function(hostViewRef) { - var s = this._destroyRootHostViewScope(); - var hostView = hostViewRef.internalView; - hostView.renderer.detachView(view_1.flattenNestedViewRenderNodes(hostView.rootNodesOrAppElements)); - hostView.destroy(); - profile_1.wtfLeave(s); - }; - AppViewManager_.prototype.createEmbeddedViewInContainer = function(viewContainerLocation, index, templateRef) { - var s = this._createEmbeddedViewInContainerScope(); - var contextEl = templateRef.elementRef.internalElement; - var view = contextEl.embeddedViewFactory(contextEl.parentView.renderer, this, contextEl, contextEl.parentView.projectableNodes, null, null, null); - this._attachViewToContainer(view, viewContainerLocation.internalElement, index); - return profile_1.wtfLeave(s, view.ref); - }; - AppViewManager_.prototype.createHostViewInContainer = function(viewContainerLocation, index, hostViewFactoryRef, dynamicallyCreatedProviders, projectableNodes) { - var s = this._createHostViewInContainerScope(); - var viewContainerLocation_ = viewContainerLocation; - var contextEl = viewContainerLocation_.internalElement; - var hostViewFactory = hostViewFactoryRef.internalHostViewFactory; - var view = hostViewFactory.viewFactory(contextEl.parentView.renderer, contextEl.parentView.viewManager, contextEl, projectableNodes, null, dynamicallyCreatedProviders, null); - this._attachViewToContainer(view, viewContainerLocation_.internalElement, index); - return profile_1.wtfLeave(s, view.ref); - }; - AppViewManager_.prototype.destroyViewInContainer = function(viewContainerLocation, index) { - var s = this._destroyViewInContainerScope(); - var view = this._detachViewInContainer(viewContainerLocation.internalElement, index); - view.destroy(); - profile_1.wtfLeave(s); - }; - AppViewManager_.prototype.attachViewInContainer = function(viewContainerLocation, index, viewRef) { - var viewRef_ = viewRef; - var s = this._attachViewInContainerScope(); - this._attachViewToContainer(viewRef_.internalView, viewContainerLocation.internalElement, index); - return profile_1.wtfLeave(s, viewRef_); - }; - AppViewManager_.prototype.detachViewInContainer = function(viewContainerLocation, index) { - var s = this._detachViewInContainerScope(); - var view = this._detachViewInContainer(viewContainerLocation.internalElement, index); - return profile_1.wtfLeave(s, view.ref); - }; - AppViewManager_.prototype.onViewCreated = function(view) {}; - AppViewManager_.prototype.onViewDestroyed = function(view) {}; - AppViewManager_.prototype.createRenderComponentType = function(encapsulation, styles) { - return new api_1.RenderComponentType(this._appId + "-" + this._nextCompTypeId++, encapsulation, styles); - }; - AppViewManager_.prototype._attachViewToContainer = function(view, vcAppElement, viewIndex) { - if (view.proto.type === view_type_1.ViewType.COMPONENT) { - throw new exceptions_1.BaseException("Component views can't be moved!"); - } - var nestedViews = vcAppElement.nestedViews; - if (nestedViews == null) { - nestedViews = []; - vcAppElement.nestedViews = nestedViews; - } - collection_1.ListWrapper.insert(nestedViews, viewIndex, view); - var refNode; - if (viewIndex > 0) { - var prevView = nestedViews[viewIndex - 1]; - refNode = prevView.rootNodesOrAppElements.length > 0 ? prevView.rootNodesOrAppElements[prevView.rootNodesOrAppElements.length - 1] : null; - } else { - refNode = vcAppElement.nativeElement; - } - if (lang_1.isPresent(refNode)) { - var refRenderNode = view_1.findLastRenderNode(refNode); - view.renderer.attachViewAfter(refRenderNode, view_1.flattenNestedViewRenderNodes(view.rootNodesOrAppElements)); - } - vcAppElement.parentView.changeDetector.addContentChild(view.changeDetector); - vcAppElement.traverseAndSetQueriesAsDirty(); - }; - AppViewManager_.prototype._detachViewInContainer = function(vcAppElement, viewIndex) { - var view = collection_1.ListWrapper.removeAt(vcAppElement.nestedViews, viewIndex); - if (view.proto.type === view_type_1.ViewType.COMPONENT) { - throw new exceptions_1.BaseException("Component views can't be moved!"); - } - vcAppElement.traverseAndSetQueriesAsDirty(); - view.renderer.detachView(view_1.flattenNestedViewRenderNodes(view.rootNodesOrAppElements)); - view.changeDetector.remove(); - return view; - }; - AppViewManager_ = __decorate([di_1.Injectable(), __param(1, di_1.Inject(application_tokens_1.APP_ID)), __metadata('design:paramtypes', [api_1.RootRenderer, String])], AppViewManager_); - return AppViewManager_; - }(AppViewManager)); - exports.AppViewManager_ = AppViewManager_; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/console", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - var Console = (function() { - function Console() {} - Console.prototype.log = function(message) { - lang_1.print(message); - }; - Console = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], Console); - return Console; - }()); - exports.Console = Console; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/zone", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); - exports.NgZone = ng_zone_1.NgZone; - exports.NgZoneError = ng_zone_1.NgZoneError; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/render", ["angular2/src/core/render/api"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var api_1 = require("angular2/src/core/render/api"); - exports.RootRenderer = api_1.RootRenderer; - exports.Renderer = api_1.Renderer; - exports.RenderComponentType = api_1.RenderComponentType; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/directive_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/metadata", "angular2/src/core/reflection/reflection", "angular2/src/core/reflection/reflector_reader"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var metadata_1 = require("angular2/src/core/metadata"); - var reflection_1 = require("angular2/src/core/reflection/reflection"); - var reflector_reader_1 = require("angular2/src/core/reflection/reflector_reader"); - function _isDirectiveMetadata(type) { - return type instanceof metadata_1.DirectiveMetadata; - } - var DirectiveResolver = (function() { - function DirectiveResolver(_reflector) { - if (lang_1.isPresent(_reflector)) { - this._reflector = _reflector; - } else { - this._reflector = reflection_1.reflector; - } - } - DirectiveResolver.prototype.resolve = function(type) { - var typeMetadata = this._reflector.annotations(di_1.resolveForwardRef(type)); - if (lang_1.isPresent(typeMetadata)) { - var metadata = typeMetadata.find(_isDirectiveMetadata); - if (lang_1.isPresent(metadata)) { - var propertyMetadata = this._reflector.propMetadata(type); - return this._mergeWithPropertyMetadata(metadata, propertyMetadata, type); - } - } - throw new exceptions_1.BaseException("No Directive annotation found on " + lang_1.stringify(type)); - }; - DirectiveResolver.prototype._mergeWithPropertyMetadata = function(dm, propertyMetadata, directiveType) { - var inputs = []; - var outputs = []; - var host = {}; - var queries = {}; - collection_1.StringMapWrapper.forEach(propertyMetadata, function(metadata, propName) { - metadata.forEach(function(a) { - if (a instanceof metadata_1.InputMetadata) { - if (lang_1.isPresent(a.bindingPropertyName)) { - inputs.push(propName + ": " + a.bindingPropertyName); - } else { - inputs.push(propName); - } - } - if (a instanceof metadata_1.OutputMetadata) { - if (lang_1.isPresent(a.bindingPropertyName)) { - outputs.push(propName + ": " + a.bindingPropertyName); - } else { - outputs.push(propName); - } - } - if (a instanceof metadata_1.HostBindingMetadata) { - if (lang_1.isPresent(a.hostPropertyName)) { - host[("[" + a.hostPropertyName + "]")] = propName; - } else { - host[("[" + propName + "]")] = propName; - } - } - if (a instanceof metadata_1.HostListenerMetadata) { - var args = lang_1.isPresent(a.args) ? a.args.join(', ') : ''; - host[("(" + a.eventName + ")")] = propName + "(" + args + ")"; - } - if (a instanceof metadata_1.ContentChildrenMetadata) { - queries[propName] = a; - } - if (a instanceof metadata_1.ViewChildrenMetadata) { - queries[propName] = a; - } - if (a instanceof metadata_1.ContentChildMetadata) { - queries[propName] = a; - } - if (a instanceof metadata_1.ViewChildMetadata) { - queries[propName] = a; - } - }); - }); - return this._merge(dm, inputs, outputs, host, queries, directiveType); - }; - DirectiveResolver.prototype._merge = function(dm, inputs, outputs, host, queries, directiveType) { - var mergedInputs = lang_1.isPresent(dm.inputs) ? collection_1.ListWrapper.concat(dm.inputs, inputs) : inputs; - var mergedOutputs; - if (lang_1.isPresent(dm.outputs)) { - dm.outputs.forEach(function(propName) { - if (collection_1.ListWrapper.contains(outputs, propName)) { - throw new exceptions_1.BaseException("Output event '" + propName + "' defined multiple times in '" + lang_1.stringify(directiveType) + "'"); - } - }); - mergedOutputs = collection_1.ListWrapper.concat(dm.outputs, outputs); - } else { - mergedOutputs = outputs; - } - var mergedHost = lang_1.isPresent(dm.host) ? collection_1.StringMapWrapper.merge(dm.host, host) : host; - var mergedQueries = lang_1.isPresent(dm.queries) ? collection_1.StringMapWrapper.merge(dm.queries, queries) : queries; - if (dm instanceof metadata_1.ComponentMetadata) { - return new metadata_1.ComponentMetadata({ - selector: dm.selector, - inputs: mergedInputs, - outputs: mergedOutputs, - host: mergedHost, - exportAs: dm.exportAs, - moduleId: dm.moduleId, - queries: mergedQueries, - changeDetection: dm.changeDetection, - providers: dm.providers, - viewProviders: dm.viewProviders - }); - } else { - return new metadata_1.DirectiveMetadata({ - selector: dm.selector, - inputs: mergedInputs, - outputs: mergedOutputs, - host: mergedHost, - exportAs: dm.exportAs, - queries: mergedQueries, - providers: dm.providers - }); - } - }; - DirectiveResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [reflector_reader_1.ReflectorReader])], DirectiveResolver); - return DirectiveResolver; - }()); - exports.DirectiveResolver = DirectiveResolver; - exports.CODEGEN_DIRECTIVE_RESOLVER = new DirectiveResolver(reflection_1.reflector); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/view_resolver", ["angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/core/metadata/directives", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflector_reader", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = require("angular2/src/core/di"); - var view_1 = require("angular2/src/core/metadata/view"); - var directives_1 = require("angular2/src/core/metadata/directives"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var reflector_reader_1 = require("angular2/src/core/reflection/reflector_reader"); - var reflection_1 = require("angular2/src/core/reflection/reflection"); - var ViewResolver = (function() { - function ViewResolver(_reflector) { - this._cache = new collection_1.Map(); - if (lang_1.isPresent(_reflector)) { - this._reflector = _reflector; - } else { - this._reflector = reflection_1.reflector; - } - } - ViewResolver.prototype.resolve = function(component) { - var view = this._cache.get(component); - if (lang_1.isBlank(view)) { - view = this._resolve(component); - this._cache.set(component, view); - } - return view; - }; - ViewResolver.prototype._resolve = function(component) { - var compMeta; - var viewMeta; - this._reflector.annotations(component).forEach(function(m) { - if (m instanceof view_1.ViewMetadata) { - viewMeta = m; - } - if (m instanceof directives_1.ComponentMetadata) { - compMeta = m; - } - }); - if (lang_1.isPresent(compMeta)) { - if (lang_1.isBlank(compMeta.template) && lang_1.isBlank(compMeta.templateUrl) && lang_1.isBlank(viewMeta)) { - throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' must have either 'template' or 'templateUrl' set."); - } else if (lang_1.isPresent(compMeta.template) && lang_1.isPresent(viewMeta)) { - this._throwMixingViewAndComponent("template", component); - } else if (lang_1.isPresent(compMeta.templateUrl) && lang_1.isPresent(viewMeta)) { - this._throwMixingViewAndComponent("templateUrl", component); - } else if (lang_1.isPresent(compMeta.directives) && lang_1.isPresent(viewMeta)) { - this._throwMixingViewAndComponent("directives", component); - } else if (lang_1.isPresent(compMeta.pipes) && lang_1.isPresent(viewMeta)) { - this._throwMixingViewAndComponent("pipes", component); - } else if (lang_1.isPresent(compMeta.encapsulation) && lang_1.isPresent(viewMeta)) { - this._throwMixingViewAndComponent("encapsulation", component); - } else if (lang_1.isPresent(compMeta.styles) && lang_1.isPresent(viewMeta)) { - this._throwMixingViewAndComponent("styles", component); - } else if (lang_1.isPresent(compMeta.styleUrls) && lang_1.isPresent(viewMeta)) { - this._throwMixingViewAndComponent("styleUrls", component); - } else if (lang_1.isPresent(viewMeta)) { - return viewMeta; - } else { - return new view_1.ViewMetadata({ - templateUrl: compMeta.templateUrl, - template: compMeta.template, - directives: compMeta.directives, - pipes: compMeta.pipes, - encapsulation: compMeta.encapsulation, - styles: compMeta.styles, - styleUrls: compMeta.styleUrls - }); - } - } else { - if (lang_1.isBlank(viewMeta)) { - throw new exceptions_1.BaseException("Could not compile '" + lang_1.stringify(component) + "' because it is not a component."); - } else { - return viewMeta; - } - } - return null; - }; - ViewResolver.prototype._throwMixingViewAndComponent = function(propertyName, component) { - throw new exceptions_1.BaseException("Component '" + lang_1.stringify(component) + "' cannot have both '" + propertyName + "' and '@View' set at the same time\""); - }; - ViewResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [reflector_reader_1.ReflectorReader])], ViewResolver); - return ViewResolver; - }()); - exports.ViewResolver = ViewResolver; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/debug/debug_node", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var EventListener = (function() { - function EventListener(name, callback) { - this.name = name; - this.callback = callback; - } - ; - return EventListener; - }()); - exports.EventListener = EventListener; - var DebugNode = (function() { - function DebugNode(nativeNode, parent) { - this.nativeNode = nativeNode; - if (lang_1.isPresent(parent) && parent instanceof DebugElement) { - parent.addChild(this); - } else { - this.parent = null; - } - this.listeners = []; - this.providerTokens = []; - } - DebugNode.prototype.setDebugInfo = function(info) { - this.injector = info.injector; - this.providerTokens = info.providerTokens; - this.locals = info.locals; - this.componentInstance = info.component; - }; - DebugNode.prototype.inject = function(token) { - return this.injector.get(token); - }; - DebugNode.prototype.getLocal = function(name) { - return this.locals.get(name); - }; - return DebugNode; - }()); - exports.DebugNode = DebugNode; - var DebugElement = (function(_super) { - __extends(DebugElement, _super); - function DebugElement(nativeNode, parent) { - _super.call(this, nativeNode, parent); - this.properties = new Map(); - this.attributes = new Map(); - this.childNodes = []; - this.nativeElement = nativeNode; - } - DebugElement.prototype.addChild = function(child) { - if (lang_1.isPresent(child)) { - this.childNodes.push(child); - child.parent = this; - } - }; - DebugElement.prototype.removeChild = function(child) { - var childIndex = this.childNodes.indexOf(child); - if (childIndex !== -1) { - child.parent = null; - this.childNodes.splice(childIndex, 1); - } - }; - DebugElement.prototype.insertChildrenAfter = function(child, newChildren) { - var siblingIndex = this.childNodes.indexOf(child); - if (siblingIndex !== -1) { - var previousChildren = this.childNodes.slice(0, siblingIndex + 1); - var nextChildren = this.childNodes.slice(siblingIndex + 1); - this.childNodes = collection_1.ListWrapper.concat(collection_1.ListWrapper.concat(previousChildren, newChildren), nextChildren); - for (var i = 0; i < newChildren.length; ++i) { - var newChild = newChildren[i]; - if (lang_1.isPresent(newChild.parent)) { - newChild.parent.removeChild(newChild); - } - newChild.parent = this; - } - } - }; - DebugElement.prototype.query = function(predicate) { - var results = this.queryAll(predicate); - return results.length > 0 ? results[0] : null; - }; - DebugElement.prototype.queryAll = function(predicate) { - var matches = []; - _queryElementChildren(this, predicate, matches); - return matches; - }; - DebugElement.prototype.queryAllNodes = function(predicate) { - var matches = []; - _queryNodeChildren(this, predicate, matches); - return matches; - }; - Object.defineProperty(DebugElement.prototype, "children", { - get: function() { - var children = []; - this.childNodes.forEach(function(node) { - if (node instanceof DebugElement) { - children.push(node); - } - }); - return children; - }, - enumerable: true, - configurable: true - }); - DebugElement.prototype.triggerEventHandler = function(eventName, eventObj) { - this.listeners.forEach(function(listener) { - if (listener.name == eventName) { - listener.callback(eventObj); - } - }); - }; - return DebugElement; - }(DebugNode)); - exports.DebugElement = DebugElement; - function asNativeElements(debugEls) { - return debugEls.map(function(el) { - return el.nativeElement; - }); - } - exports.asNativeElements = asNativeElements; - function _queryElementChildren(element, predicate, matches) { - element.childNodes.forEach(function(node) { - if (node instanceof DebugElement) { - if (predicate(node)) { - matches.push(node); - } - _queryElementChildren(node, predicate, matches); - } - }); - } - function _queryNodeChildren(parentNode, predicate, matches) { - if (parentNode instanceof DebugElement) { - parentNode.childNodes.forEach(function(node) { - if (predicate(node)) { - matches.push(node); - } - if (node instanceof DebugElement) { - _queryNodeChildren(node, predicate, matches); - } - }); - } - } - var _nativeNodeToDebugNode = new Map(); - function getDebugNode(nativeNode) { - return _nativeNodeToDebugNode.get(nativeNode); - } - exports.getDebugNode = getDebugNode; - function getAllDebugNodes() { - return collection_1.MapWrapper.values(_nativeNodeToDebugNode); - } - exports.getAllDebugNodes = getAllDebugNodes; - function indexDebugNode(node) { - _nativeNodeToDebugNode.set(node.nativeNode, node); - } - exports.indexDebugNode = indexDebugNode; - function removeDebugNodeFromIndex(node) { - _nativeNodeToDebugNode.delete(node.nativeNode); - } - exports.removeDebugNodeFromIndex = removeDebugNodeFromIndex; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/platform_directives_and_pipes", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - exports.PLATFORM_DIRECTIVES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Directives")); - exports.PLATFORM_PIPES = lang_1.CONST_EXPR(new di_1.OpaqueToken("Platform Pipes")); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/platform_common_providers", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/console", "angular2/src/core/reflection/reflection", "angular2/src/core/reflection/reflector_reader", "angular2/src/core/testability/testability"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var di_1 = require("angular2/src/core/di"); - var console_1 = require("angular2/src/core/console"); - var reflection_1 = require("angular2/src/core/reflection/reflection"); - var reflector_reader_1 = require("angular2/src/core/reflection/reflector_reader"); - var testability_1 = require("angular2/src/core/testability/testability"); - function _reflector() { - return reflection_1.reflector; - } - exports.PLATFORM_COMMON_PROVIDERS = lang_1.CONST_EXPR([new di_1.Provider(reflection_1.Reflector, { - useFactory: _reflector, - deps: [] - }), new di_1.Provider(reflector_reader_1.ReflectorReader, {useExisting: reflection_1.Reflector}), testability_1.TestabilityRegistry, console_1.Console]); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/pipe_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/metadata", "angular2/src/core/reflection/reflector_reader", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var metadata_1 = require("angular2/src/core/metadata"); - var reflector_reader_1 = require("angular2/src/core/reflection/reflector_reader"); - var reflection_1 = require("angular2/src/core/reflection/reflection"); - function _isPipeMetadata(type) { - return type instanceof metadata_1.PipeMetadata; - } - var PipeResolver = (function() { - function PipeResolver(_reflector) { - if (lang_1.isPresent(_reflector)) { - this._reflector = _reflector; - } else { - this._reflector = reflection_1.reflector; - } - } - PipeResolver.prototype.resolve = function(type) { - var metas = this._reflector.annotations(di_1.resolveForwardRef(type)); - if (lang_1.isPresent(metas)) { - var annotation = metas.find(_isPipeMetadata); - if (lang_1.isPresent(annotation)) { - return annotation; - } - } - throw new exceptions_1.BaseException("No Pipe decorator found on " + lang_1.stringify(type)); - }; - PipeResolver = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [reflector_reader_1.ReflectorReader])], PipeResolver); - return PipeResolver; - }()); - exports.PipeResolver = PipeResolver; - exports.CODEGEN_PIPE_RESOLVER = new PipeResolver(reflection_1.reflector); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/debug/by", ["angular2/src/facade/lang", "angular2/src/platform/dom/dom_adapter"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var By = (function() { - function By() {} - By.all = function() { - return function(debugElement) { - return true; - }; - }; - By.css = function(selector) { - return function(debugElement) { - return lang_1.isPresent(debugElement.nativeElement) ? dom_adapter_1.DOM.elementMatches(debugElement.nativeElement, selector) : false; - }; - }; - By.directive = function(type) { - return function(debugElement) { - return debugElement.providerTokens.indexOf(type) !== -1; - }; - }; - return By; - }()); - exports.By = By; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/debug/debug_renderer", ["angular2/src/facade/lang", "angular2/src/core/debug/debug_node"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var debug_node_1 = require("angular2/src/core/debug/debug_node"); - var DebugDomRootRenderer = (function() { - function DebugDomRootRenderer(_delegate) { - this._delegate = _delegate; - } - DebugDomRootRenderer.prototype.renderComponent = function(componentProto) { - return new DebugDomRenderer(this, this._delegate.renderComponent(componentProto)); - }; - return DebugDomRootRenderer; - }()); - exports.DebugDomRootRenderer = DebugDomRootRenderer; - var DebugDomRenderer = (function() { - function DebugDomRenderer(_rootRenderer, _delegate) { - this._rootRenderer = _rootRenderer; - this._delegate = _delegate; - } - DebugDomRenderer.prototype.renderComponent = function(componentType) { - return this._rootRenderer.renderComponent(componentType); - }; - DebugDomRenderer.prototype.selectRootElement = function(selector) { - var nativeEl = this._delegate.selectRootElement(selector); - var debugEl = new debug_node_1.DebugElement(nativeEl, null); - debug_node_1.indexDebugNode(debugEl); - return nativeEl; - }; - DebugDomRenderer.prototype.createElement = function(parentElement, name) { - var nativeEl = this._delegate.createElement(parentElement, name); - var debugEl = new debug_node_1.DebugElement(nativeEl, debug_node_1.getDebugNode(parentElement)); - debugEl.name = name; - debug_node_1.indexDebugNode(debugEl); - return nativeEl; - }; - DebugDomRenderer.prototype.createViewRoot = function(hostElement) { - return this._delegate.createViewRoot(hostElement); - }; - DebugDomRenderer.prototype.createTemplateAnchor = function(parentElement) { - var comment = this._delegate.createTemplateAnchor(parentElement); - var debugEl = new debug_node_1.DebugNode(comment, debug_node_1.getDebugNode(parentElement)); - debug_node_1.indexDebugNode(debugEl); - return comment; - }; - DebugDomRenderer.prototype.createText = function(parentElement, value) { - var text = this._delegate.createText(parentElement, value); - var debugEl = new debug_node_1.DebugNode(text, debug_node_1.getDebugNode(parentElement)); - debug_node_1.indexDebugNode(debugEl); - return text; - }; - DebugDomRenderer.prototype.projectNodes = function(parentElement, nodes) { - var debugParent = debug_node_1.getDebugNode(parentElement); - if (lang_1.isPresent(debugParent) && debugParent instanceof debug_node_1.DebugElement) { - var debugElement_1 = debugParent; - nodes.forEach(function(node) { - debugElement_1.addChild(debug_node_1.getDebugNode(node)); - }); - } - this._delegate.projectNodes(parentElement, nodes); - }; - DebugDomRenderer.prototype.attachViewAfter = function(node, viewRootNodes) { - var debugNode = debug_node_1.getDebugNode(node); - if (lang_1.isPresent(debugNode)) { - var debugParent = debugNode.parent; - if (viewRootNodes.length > 0 && lang_1.isPresent(debugParent)) { - var debugViewRootNodes = []; - viewRootNodes.forEach(function(rootNode) { - return debugViewRootNodes.push(debug_node_1.getDebugNode(rootNode)); - }); - debugParent.insertChildrenAfter(debugNode, debugViewRootNodes); - } - } - this._delegate.attachViewAfter(node, viewRootNodes); - }; - DebugDomRenderer.prototype.detachView = function(viewRootNodes) { - viewRootNodes.forEach(function(node) { - var debugNode = debug_node_1.getDebugNode(node); - if (lang_1.isPresent(debugNode) && lang_1.isPresent(debugNode.parent)) { - debugNode.parent.removeChild(debugNode); - } - }); - this._delegate.detachView(viewRootNodes); - }; - DebugDomRenderer.prototype.destroyView = function(hostElement, viewAllNodes) { - viewAllNodes.forEach(function(node) { - debug_node_1.removeDebugNodeFromIndex(debug_node_1.getDebugNode(node)); - }); - this._delegate.destroyView(hostElement, viewAllNodes); - }; - DebugDomRenderer.prototype.listen = function(renderElement, name, callback) { - var debugEl = debug_node_1.getDebugNode(renderElement); - if (lang_1.isPresent(debugEl)) { - debugEl.listeners.push(new debug_node_1.EventListener(name, callback)); - } - return this._delegate.listen(renderElement, name, callback); - }; - DebugDomRenderer.prototype.listenGlobal = function(target, name, callback) { - return this._delegate.listenGlobal(target, name, callback); - }; - DebugDomRenderer.prototype.setElementProperty = function(renderElement, propertyName, propertyValue) { - var debugEl = debug_node_1.getDebugNode(renderElement); - if (lang_1.isPresent(debugEl) && debugEl instanceof debug_node_1.DebugElement) { - debugEl.properties.set(propertyName, propertyValue); - } - this._delegate.setElementProperty(renderElement, propertyName, propertyValue); - }; - DebugDomRenderer.prototype.setElementAttribute = function(renderElement, attributeName, attributeValue) { - var debugEl = debug_node_1.getDebugNode(renderElement); - if (lang_1.isPresent(debugEl) && debugEl instanceof debug_node_1.DebugElement) { - debugEl.attributes.set(attributeName, attributeValue); - } - this._delegate.setElementAttribute(renderElement, attributeName, attributeValue); - }; - DebugDomRenderer.prototype.setBindingDebugInfo = function(renderElement, propertyName, propertyValue) { - this._delegate.setBindingDebugInfo(renderElement, propertyName, propertyValue); - }; - DebugDomRenderer.prototype.setElementDebugInfo = function(renderElement, info) { - var debugEl = debug_node_1.getDebugNode(renderElement); - debugEl.setDebugInfo(info); - this._delegate.setElementDebugInfo(renderElement, info); - }; - DebugDomRenderer.prototype.setElementClass = function(renderElement, className, isAdd) { - this._delegate.setElementClass(renderElement, className, isAdd); - }; - DebugDomRenderer.prototype.setElementStyle = function(renderElement, styleName, styleValue) { - this._delegate.setElementStyle(renderElement, styleName, styleValue); - }; - DebugDomRenderer.prototype.invokeElementMethod = function(renderElement, methodName, args) { - this._delegate.invokeElementMethod(renderElement, methodName, args); - }; - DebugDomRenderer.prototype.setText = function(renderNode, text) { - this._delegate.setText(renderNode, text); - }; - return DebugDomRenderer; - }()); - exports.DebugDomRenderer = DebugDomRenderer; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/dom_adapter", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - exports.DOM = null; - function setRootDomAdapter(adapter) { - if (lang_1.isBlank(exports.DOM)) { - exports.DOM = adapter; - } - } - exports.setRootDomAdapter = setRootDomAdapter; - var DomAdapter = (function() { - function DomAdapter() {} - Object.defineProperty(DomAdapter.prototype, "attrToPropMap", { - get: function() { - return this._attrToPropMap; - }, - set: function(value) { - this._attrToPropMap = value; - }, - enumerable: true, - configurable: true - }); - ; - ; - return DomAdapter; - }()); - exports.DomAdapter = DomAdapter; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/di/decorators", ["angular2/src/core/di/metadata", "angular2/src/core/util/decorators"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var metadata_1 = require("angular2/src/core/di/metadata"); - var decorators_1 = require("angular2/src/core/util/decorators"); - exports.Inject = decorators_1.makeParamDecorator(metadata_1.InjectMetadata); - exports.Optional = decorators_1.makeParamDecorator(metadata_1.OptionalMetadata); - exports.Injectable = decorators_1.makeDecorator(metadata_1.InjectableMetadata); - exports.Self = decorators_1.makeParamDecorator(metadata_1.SelfMetadata); - exports.Host = decorators_1.makeParamDecorator(metadata_1.HostMetadata); - exports.SkipSelf = decorators_1.makeParamDecorator(metadata_1.SkipSelfMetadata); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/facade/exceptions", ["angular2/src/facade/base_wrapped_exception", "angular2/src/facade/exception_handler", "angular2/src/facade/exception_handler"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var base_wrapped_exception_1 = require("angular2/src/facade/base_wrapped_exception"); - var exception_handler_1 = require("angular2/src/facade/exception_handler"); - var exception_handler_2 = require("angular2/src/facade/exception_handler"); - exports.ExceptionHandler = exception_handler_2.ExceptionHandler; - var BaseException = (function(_super) { - __extends(BaseException, _super); - function BaseException(message) { - if (message === void 0) { - message = "--"; - } - _super.call(this, message); - this.message = message; - this.stack = (new Error(message)).stack; - } - BaseException.prototype.toString = function() { - return this.message; - }; - return BaseException; - }(Error)); - exports.BaseException = BaseException; - var WrappedException = (function(_super) { - __extends(WrappedException, _super); - function WrappedException(_wrapperMessage, _originalException, _originalStack, _context) { - _super.call(this, _wrapperMessage); - this._wrapperMessage = _wrapperMessage; - this._originalException = _originalException; - this._originalStack = _originalStack; - this._context = _context; - this._wrapperStack = (new Error(_wrapperMessage)).stack; - } - Object.defineProperty(WrappedException.prototype, "wrapperMessage", { - get: function() { - return this._wrapperMessage; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(WrappedException.prototype, "wrapperStack", { - get: function() { - return this._wrapperStack; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(WrappedException.prototype, "originalException", { - get: function() { - return this._originalException; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(WrappedException.prototype, "originalStack", { - get: function() { - return this._originalStack; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(WrappedException.prototype, "context", { - get: function() { - return this._context; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(WrappedException.prototype, "message", { - get: function() { - return exception_handler_1.ExceptionHandler.exceptionToString(this); - }, - enumerable: true, - configurable: true - }); - WrappedException.prototype.toString = function() { - return this.message; - }; - return WrappedException; - }(base_wrapped_exception_1.BaseWrappedException)); - exports.WrappedException = WrappedException; - function makeTypeError(message) { - return new TypeError(message); - } - exports.makeTypeError = makeTypeError; - function unimplemented() { - throw new BaseException('unimplemented'); - } - exports.unimplemented = unimplemented; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/reflection/reflector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflector_reader"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var reflector_reader_1 = require("angular2/src/core/reflection/reflector_reader"); - var ReflectionInfo = (function() { - function ReflectionInfo(annotations, parameters, factory, interfaces, propMetadata) { - this.annotations = annotations; - this.parameters = parameters; - this.factory = factory; - this.interfaces = interfaces; - this.propMetadata = propMetadata; - } - return ReflectionInfo; - }()); - exports.ReflectionInfo = ReflectionInfo; - var Reflector = (function(_super) { - __extends(Reflector, _super); - function Reflector(reflectionCapabilities) { - _super.call(this); - this._injectableInfo = new collection_1.Map(); - this._getters = new collection_1.Map(); - this._setters = new collection_1.Map(); - this._methods = new collection_1.Map(); - this._usedKeys = null; - this.reflectionCapabilities = reflectionCapabilities; - } - Reflector.prototype.isReflectionEnabled = function() { - return this.reflectionCapabilities.isReflectionEnabled(); - }; - Reflector.prototype.trackUsage = function() { - this._usedKeys = new collection_1.Set(); - }; - Reflector.prototype.listUnusedKeys = function() { - var _this = this; - if (this._usedKeys == null) { - throw new exceptions_1.BaseException('Usage tracking is disabled'); - } - var allTypes = collection_1.MapWrapper.keys(this._injectableInfo); - return allTypes.filter(function(key) { - return !collection_1.SetWrapper.has(_this._usedKeys, key); - }); - }; - Reflector.prototype.registerFunction = function(func, funcInfo) { - this._injectableInfo.set(func, funcInfo); - }; - Reflector.prototype.registerType = function(type, typeInfo) { - this._injectableInfo.set(type, typeInfo); - }; - Reflector.prototype.registerGetters = function(getters) { - _mergeMaps(this._getters, getters); - }; - Reflector.prototype.registerSetters = function(setters) { - _mergeMaps(this._setters, setters); - }; - Reflector.prototype.registerMethods = function(methods) { - _mergeMaps(this._methods, methods); - }; - Reflector.prototype.factory = function(type) { - if (this._containsReflectionInfo(type)) { - var res = this._getReflectionInfo(type).factory; - return lang_1.isPresent(res) ? res : null; - } else { - return this.reflectionCapabilities.factory(type); - } - }; - Reflector.prototype.parameters = function(typeOrFunc) { - if (this._injectableInfo.has(typeOrFunc)) { - var res = this._getReflectionInfo(typeOrFunc).parameters; - return lang_1.isPresent(res) ? res : []; - } else { - return this.reflectionCapabilities.parameters(typeOrFunc); - } - }; - Reflector.prototype.annotations = function(typeOrFunc) { - if (this._injectableInfo.has(typeOrFunc)) { - var res = this._getReflectionInfo(typeOrFunc).annotations; - return lang_1.isPresent(res) ? res : []; - } else { - return this.reflectionCapabilities.annotations(typeOrFunc); - } - }; - Reflector.prototype.propMetadata = function(typeOrFunc) { - if (this._injectableInfo.has(typeOrFunc)) { - var res = this._getReflectionInfo(typeOrFunc).propMetadata; - return lang_1.isPresent(res) ? res : {}; - } else { - return this.reflectionCapabilities.propMetadata(typeOrFunc); - } - }; - Reflector.prototype.interfaces = function(type) { - if (this._injectableInfo.has(type)) { - var res = this._getReflectionInfo(type).interfaces; - return lang_1.isPresent(res) ? res : []; - } else { - return this.reflectionCapabilities.interfaces(type); - } - }; - Reflector.prototype.getter = function(name) { - if (this._getters.has(name)) { - return this._getters.get(name); - } else { - return this.reflectionCapabilities.getter(name); - } - }; - Reflector.prototype.setter = function(name) { - if (this._setters.has(name)) { - return this._setters.get(name); - } else { - return this.reflectionCapabilities.setter(name); - } - }; - Reflector.prototype.method = function(name) { - if (this._methods.has(name)) { - return this._methods.get(name); - } else { - return this.reflectionCapabilities.method(name); - } - }; - Reflector.prototype._getReflectionInfo = function(typeOrFunc) { - if (lang_1.isPresent(this._usedKeys)) { - this._usedKeys.add(typeOrFunc); - } - return this._injectableInfo.get(typeOrFunc); - }; - Reflector.prototype._containsReflectionInfo = function(typeOrFunc) { - return this._injectableInfo.has(typeOrFunc); - }; - Reflector.prototype.importUri = function(type) { - return this.reflectionCapabilities.importUri(type); - }; - return Reflector; - }(reflector_reader_1.ReflectorReader)); - exports.Reflector = Reflector; - function _mergeMaps(target, config) { - collection_1.StringMapWrapper.forEach(config, function(v, k) { - return target.set(k, v); - }); - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/animate/animation", ["angular2/src/facade/lang", "angular2/src/facade/math", "angular2/src/platform/dom/util", "angular2/src/facade/collection", "angular2/src/platform/dom/dom_adapter"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var math_1 = require("angular2/src/facade/math"); - var util_1 = require("angular2/src/platform/dom/util"); - var collection_1 = require("angular2/src/facade/collection"); - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var Animation = (function() { - function Animation(element, data, browserDetails) { - var _this = this; - this.element = element; - this.data = data; - this.browserDetails = browserDetails; - this.callbacks = []; - this.eventClearFunctions = []; - this.completed = false; - this._stringPrefix = ''; - this.startTime = lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); - this._stringPrefix = dom_adapter_1.DOM.getAnimationPrefix(); - this.setup(); - this.wait(function(timestamp) { - return _this.start(); - }); - } - Object.defineProperty(Animation.prototype, "totalTime", { - get: function() { - var delay = this.computedDelay != null ? this.computedDelay : 0; - var duration = this.computedDuration != null ? this.computedDuration : 0; - return delay + duration; - }, - enumerable: true, - configurable: true - }); - Animation.prototype.wait = function(callback) { - this.browserDetails.raf(callback, 2); - }; - Animation.prototype.setup = function() { - if (this.data.fromStyles != null) - this.applyStyles(this.data.fromStyles); - if (this.data.duration != null) - this.applyStyles({'transitionDuration': this.data.duration.toString() + 'ms'}); - if (this.data.delay != null) - this.applyStyles({'transitionDelay': this.data.delay.toString() + 'ms'}); - }; - Animation.prototype.start = function() { - this.addClasses(this.data.classesToAdd); - this.addClasses(this.data.animationClasses); - this.removeClasses(this.data.classesToRemove); - if (this.data.toStyles != null) - this.applyStyles(this.data.toStyles); - var computedStyles = dom_adapter_1.DOM.getComputedStyle(this.element); - this.computedDelay = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-delay')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-delay'))); - this.computedDuration = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-duration')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-duration'))); - this.addEvents(); - }; - Animation.prototype.applyStyles = function(styles) { - var _this = this; - collection_1.StringMapWrapper.forEach(styles, function(value, key) { - var dashCaseKey = util_1.camelCaseToDashCase(key); - if (lang_1.isPresent(dom_adapter_1.DOM.getStyle(_this.element, dashCaseKey))) { - dom_adapter_1.DOM.setStyle(_this.element, dashCaseKey, value.toString()); - } else { - dom_adapter_1.DOM.setStyle(_this.element, _this._stringPrefix + dashCaseKey, value.toString()); - } - }); - }; - Animation.prototype.addClasses = function(classes) { - for (var i = 0, - len = classes.length; i < len; i++) - dom_adapter_1.DOM.addClass(this.element, classes[i]); - }; - Animation.prototype.removeClasses = function(classes) { - for (var i = 0, - len = classes.length; i < len; i++) - dom_adapter_1.DOM.removeClass(this.element, classes[i]); - }; - Animation.prototype.addEvents = function() { - var _this = this; - if (this.totalTime > 0) { - this.eventClearFunctions.push(dom_adapter_1.DOM.onAndCancel(this.element, dom_adapter_1.DOM.getTransitionEnd(), function(event) { - return _this.handleAnimationEvent(event); - })); - } else { - this.handleAnimationCompleted(); - } - }; - Animation.prototype.handleAnimationEvent = function(event) { - var elapsedTime = math_1.Math.round(event.elapsedTime * 1000); - if (!this.browserDetails.elapsedTimeIncludesDelay) - elapsedTime += this.computedDelay; - event.stopPropagation(); - if (elapsedTime >= this.totalTime) - this.handleAnimationCompleted(); - }; - Animation.prototype.handleAnimationCompleted = function() { - this.removeClasses(this.data.animationClasses); - this.callbacks.forEach(function(callback) { - return callback(); - }); - this.callbacks = []; - this.eventClearFunctions.forEach(function(fn) { - return fn(); - }); - this.eventClearFunctions = []; - this.completed = true; - }; - Animation.prototype.onComplete = function(callback) { - if (this.completed) { - callback(); - } else { - this.callbacks.push(callback); - } - return this; - }; - Animation.prototype.parseDurationString = function(duration) { - var maxValue = 0; - if (duration == null || duration.length < 2) { - return maxValue; - } else if (duration.substring(duration.length - 2) == 'ms') { - var value = lang_1.NumberWrapper.parseInt(this.stripLetters(duration), 10); - if (value > maxValue) - maxValue = value; - } else if (duration.substring(duration.length - 1) == 's') { - var ms = lang_1.NumberWrapper.parseFloat(this.stripLetters(duration)) * 1000; - var value = math_1.Math.floor(ms); - if (value > maxValue) - maxValue = value; - } - return maxValue; - }; - Animation.prototype.stripLetters = function(str) { - return lang_1.StringWrapper.replaceAll(str, lang_1.RegExpWrapper.create('[^0-9]+$', ''), ''); - }; - return Animation; - }()); - exports.Animation = Animation; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/shared_styles_host", ["angular2/src/platform/dom/dom_adapter", "angular2/src/core/di", "angular2/src/facade/collection", "angular2/src/platform/dom/dom_tokens"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var di_1 = require("angular2/src/core/di"); - var collection_1 = require("angular2/src/facade/collection"); - var dom_tokens_1 = require("angular2/src/platform/dom/dom_tokens"); - var SharedStylesHost = (function() { - function SharedStylesHost() { - this._styles = []; - this._stylesSet = new Set(); - } - SharedStylesHost.prototype.addStyles = function(styles) { - var _this = this; - var additions = []; - styles.forEach(function(style) { - if (!collection_1.SetWrapper.has(_this._stylesSet, style)) { - _this._stylesSet.add(style); - _this._styles.push(style); - additions.push(style); - } - }); - this.onStylesAdded(additions); - }; - SharedStylesHost.prototype.onStylesAdded = function(additions) {}; - SharedStylesHost.prototype.getAllStyles = function() { - return this._styles; - }; - SharedStylesHost = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], SharedStylesHost); - return SharedStylesHost; - }()); - exports.SharedStylesHost = SharedStylesHost; - var DomSharedStylesHost = (function(_super) { - __extends(DomSharedStylesHost, _super); - function DomSharedStylesHost(doc) { - _super.call(this); - this._hostNodes = new Set(); - this._hostNodes.add(doc.head); - } - DomSharedStylesHost.prototype._addStylesToHost = function(styles, host) { - for (var i = 0; i < styles.length; i++) { - var style = styles[i]; - dom_adapter_1.DOM.appendChild(host, dom_adapter_1.DOM.createStyleElement(style)); - } - }; - DomSharedStylesHost.prototype.addHost = function(hostNode) { - this._addStylesToHost(this._styles, hostNode); - this._hostNodes.add(hostNode); - }; - DomSharedStylesHost.prototype.removeHost = function(hostNode) { - collection_1.SetWrapper.delete(this._hostNodes, hostNode); - }; - DomSharedStylesHost.prototype.onStylesAdded = function(additions) { - var _this = this; - this._hostNodes.forEach(function(hostNode) { - _this._addStylesToHost(additions, hostNode); - }); - }; - DomSharedStylesHost = __decorate([di_1.Injectable(), __param(0, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [Object])], DomSharedStylesHost); - return DomSharedStylesHost; - }(SharedStylesHost)); - exports.DomSharedStylesHost = DomSharedStylesHost; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/change_detection_util", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/pipe_lifecycle_reflector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var constants_1 = require("angular2/src/core/change_detection/constants"); - var pipe_lifecycle_reflector_1 = require("angular2/src/core/change_detection/pipe_lifecycle_reflector"); - var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); - var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); - var WrappedValue = (function() { - function WrappedValue(wrapped) { - this.wrapped = wrapped; - } - WrappedValue.wrap = function(value) { - var w = _wrappedValues[_wrappedIndex++ % 5]; - w.wrapped = value; - return w; - }; - return WrappedValue; - }()); - exports.WrappedValue = WrappedValue; - var _wrappedValues = [new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null), new WrappedValue(null)]; - var _wrappedIndex = 0; - var SimpleChange = (function() { - function SimpleChange(previousValue, currentValue) { - this.previousValue = previousValue; - this.currentValue = currentValue; - } - SimpleChange.prototype.isFirstChange = function() { - return this.previousValue === ChangeDetectionUtil.uninitialized; - }; - return SimpleChange; - }()); - exports.SimpleChange = SimpleChange; - function _simpleChange(previousValue, currentValue) { - return new SimpleChange(previousValue, currentValue); - } - var ChangeDetectionUtil = (function() { - function ChangeDetectionUtil() {} - ChangeDetectionUtil.arrayFn0 = function() { - return []; - }; - ChangeDetectionUtil.arrayFn1 = function(a1) { - return [a1]; - }; - ChangeDetectionUtil.arrayFn2 = function(a1, a2) { - return [a1, a2]; - }; - ChangeDetectionUtil.arrayFn3 = function(a1, a2, a3) { - return [a1, a2, a3]; - }; - ChangeDetectionUtil.arrayFn4 = function(a1, a2, a3, a4) { - return [a1, a2, a3, a4]; - }; - ChangeDetectionUtil.arrayFn5 = function(a1, a2, a3, a4, a5) { - return [a1, a2, a3, a4, a5]; - }; - ChangeDetectionUtil.arrayFn6 = function(a1, a2, a3, a4, a5, a6) { - return [a1, a2, a3, a4, a5, a6]; - }; - ChangeDetectionUtil.arrayFn7 = function(a1, a2, a3, a4, a5, a6, a7) { - return [a1, a2, a3, a4, a5, a6, a7]; - }; - ChangeDetectionUtil.arrayFn8 = function(a1, a2, a3, a4, a5, a6, a7, a8) { - return [a1, a2, a3, a4, a5, a6, a7, a8]; - }; - ChangeDetectionUtil.arrayFn9 = function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { - return [a1, a2, a3, a4, a5, a6, a7, a8, a9]; - }; - ChangeDetectionUtil.operation_negate = function(value) { - return !value; - }; - ChangeDetectionUtil.operation_add = function(left, right) { - return left + right; - }; - ChangeDetectionUtil.operation_subtract = function(left, right) { - return left - right; - }; - ChangeDetectionUtil.operation_multiply = function(left, right) { - return left * right; - }; - ChangeDetectionUtil.operation_divide = function(left, right) { - return left / right; - }; - ChangeDetectionUtil.operation_remainder = function(left, right) { - return left % right; - }; - ChangeDetectionUtil.operation_equals = function(left, right) { - return left == right; - }; - ChangeDetectionUtil.operation_not_equals = function(left, right) { - return left != right; - }; - ChangeDetectionUtil.operation_identical = function(left, right) { - return left === right; - }; - ChangeDetectionUtil.operation_not_identical = function(left, right) { - return left !== right; - }; - ChangeDetectionUtil.operation_less_then = function(left, right) { - return left < right; - }; - ChangeDetectionUtil.operation_greater_then = function(left, right) { - return left > right; - }; - ChangeDetectionUtil.operation_less_or_equals_then = function(left, right) { - return left <= right; - }; - ChangeDetectionUtil.operation_greater_or_equals_then = function(left, right) { - return left >= right; - }; - ChangeDetectionUtil.cond = function(cond, trueVal, falseVal) { - return cond ? trueVal : falseVal; - }; - ChangeDetectionUtil.mapFn = function(keys) { - function buildMap(values) { - var res = collection_1.StringMapWrapper.create(); - for (var i = 0; i < keys.length; ++i) { - collection_1.StringMapWrapper.set(res, keys[i], values[i]); - } - return res; - } - switch (keys.length) { - case 0: - return function() { - return []; - }; - case 1: - return function(a1) { - return buildMap([a1]); - }; - case 2: - return function(a1, a2) { - return buildMap([a1, a2]); - }; - case 3: - return function(a1, a2, a3) { - return buildMap([a1, a2, a3]); - }; - case 4: - return function(a1, a2, a3, a4) { - return buildMap([a1, a2, a3, a4]); - }; - case 5: - return function(a1, a2, a3, a4, a5) { - return buildMap([a1, a2, a3, a4, a5]); - }; - case 6: - return function(a1, a2, a3, a4, a5, a6) { - return buildMap([a1, a2, a3, a4, a5, a6]); - }; - case 7: - return function(a1, a2, a3, a4, a5, a6, a7) { - return buildMap([a1, a2, a3, a4, a5, a6, a7]); - }; - case 8: - return function(a1, a2, a3, a4, a5, a6, a7, a8) { - return buildMap([a1, a2, a3, a4, a5, a6, a7, a8]); - }; - case 9: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { - return buildMap([a1, a2, a3, a4, a5, a6, a7, a8, a9]); - }; - default: - throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); - } - }; - ChangeDetectionUtil.keyedAccess = function(obj, args) { - return obj[args[0]]; - }; - ChangeDetectionUtil.unwrapValue = function(value) { - if (value instanceof WrappedValue) { - return value.wrapped; - } else { - return value; - } - }; - ChangeDetectionUtil.changeDetectionMode = function(strategy) { - return constants_1.isDefaultChangeDetectionStrategy(strategy) ? constants_1.ChangeDetectionStrategy.CheckAlways : constants_1.ChangeDetectionStrategy.CheckOnce; - }; - ChangeDetectionUtil.simpleChange = function(previousValue, currentValue) { - return _simpleChange(previousValue, currentValue); - }; - ChangeDetectionUtil.isValueBlank = function(value) { - return lang_1.isBlank(value); - }; - ChangeDetectionUtil.s = function(value) { - return lang_1.isPresent(value) ? "" + value : ''; - }; - ChangeDetectionUtil.protoByIndex = function(protos, selfIndex) { - return selfIndex < 1 ? null : protos[selfIndex - 1]; - }; - ChangeDetectionUtil.callPipeOnDestroy = function(selectedPipe) { - if (pipe_lifecycle_reflector_1.implementsOnDestroy(selectedPipe.pipe)) { - selectedPipe.pipe.ngOnDestroy(); - } - }; - ChangeDetectionUtil.bindingTarget = function(mode, elementIndex, name, unit, debug) { - return new binding_record_1.BindingTarget(mode, elementIndex, name, unit, debug); - }; - ChangeDetectionUtil.directiveIndex = function(elementIndex, directiveIndex) { - return new directive_record_1.DirectiveIndex(elementIndex, directiveIndex); - }; - ChangeDetectionUtil.looseNotIdentical = function(a, b) { - return !lang_1.looseIdentical(a, b); - }; - ChangeDetectionUtil.devModeEqual = function(a, b) { - if (collection_1.isListLikeIterable(a) && collection_1.isListLikeIterable(b)) { - return collection_1.areIterablesEqual(a, b, ChangeDetectionUtil.devModeEqual); - } else if (!collection_1.isListLikeIterable(a) && !lang_1.isPrimitive(a) && !collection_1.isListLikeIterable(b) && !lang_1.isPrimitive(b)) { - return true; - } else { - return lang_1.looseIdentical(a, b); - } - }; - ChangeDetectionUtil.uninitialized = lang_1.CONST_EXPR(new Object()); - return ChangeDetectionUtil; - }()); - exports.ChangeDetectionUtil = ChangeDetectionUtil; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/profile/profile", ["angular2/src/core/profile/wtf_impl"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var impl = require("angular2/src/core/profile/wtf_impl"); - exports.wtfEnabled = impl.detectWTF(); - function noopScope(arg0, arg1) { - return null; - } - exports.wtfCreateScope = exports.wtfEnabled ? impl.createScope : function(signature, flags) { - return noopScope; - }; - exports.wtfLeave = exports.wtfEnabled ? impl.leave : function(s, r) { - return r; - }; - exports.wtfStartTimeRange = exports.wtfEnabled ? impl.startTimeRange : function(rangeType, action) { - return null; - }; - exports.wtfEndTimeRange = exports.wtfEnabled ? impl.endTimeRange : function(r) { - return null; - }; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/codegen_logic_util", ["angular2/src/facade/lang", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/proto_record", "angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); - var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var CodegenLogicUtil = (function() { - function CodegenLogicUtil(_names, _utilName, _changeDetectorStateName) { - this._names = _names; - this._utilName = _utilName; - this._changeDetectorStateName = _changeDetectorStateName; - } - CodegenLogicUtil.prototype.genPropertyBindingEvalValue = function(protoRec) { - var _this = this; - return this._genEvalValue(protoRec, function(idx) { - return _this._names.getLocalName(idx); - }, this._names.getLocalsAccessorName()); - }; - CodegenLogicUtil.prototype.genEventBindingEvalValue = function(eventRecord, protoRec) { - var _this = this; - return this._genEvalValue(protoRec, function(idx) { - return _this._names.getEventLocalName(eventRecord, idx); - }, "locals"); - }; - CodegenLogicUtil.prototype._genEvalValue = function(protoRec, getLocalName, localsAccessor) { - var context = (protoRec.contextIndex == -1) ? this._names.getDirectiveName(protoRec.directiveIndex) : getLocalName(protoRec.contextIndex); - var argString = protoRec.args.map(function(arg) { - return getLocalName(arg); - }).join(", "); - var rhs; - switch (protoRec.mode) { - case proto_record_1.RecordType.Self: - rhs = context; - break; - case proto_record_1.RecordType.Const: - rhs = codegen_facade_1.codify(protoRec.funcOrValue); - break; - case proto_record_1.RecordType.PropertyRead: - rhs = context + "." + protoRec.name; - break; - case proto_record_1.RecordType.SafeProperty: - var read = context + "." + protoRec.name; - rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + read; - break; - case proto_record_1.RecordType.PropertyWrite: - rhs = context + "." + protoRec.name + " = " + getLocalName(protoRec.args[0]); - break; - case proto_record_1.RecordType.Local: - rhs = localsAccessor + ".get(" + codegen_facade_1.rawString(protoRec.name) + ")"; - break; - case proto_record_1.RecordType.InvokeMethod: - rhs = context + "." + protoRec.name + "(" + argString + ")"; - break; - case proto_record_1.RecordType.SafeMethodInvoke: - var invoke = context + "." + protoRec.name + "(" + argString + ")"; - rhs = this._utilName + ".isValueBlank(" + context + ") ? null : " + invoke; - break; - case proto_record_1.RecordType.InvokeClosure: - rhs = context + "(" + argString + ")"; - break; - case proto_record_1.RecordType.PrimitiveOp: - rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; - break; - case proto_record_1.RecordType.CollectionLiteral: - rhs = this._utilName + "." + protoRec.name + "(" + argString + ")"; - break; - case proto_record_1.RecordType.Interpolate: - rhs = this._genInterpolation(protoRec); - break; - case proto_record_1.RecordType.KeyedRead: - rhs = context + "[" + getLocalName(protoRec.args[0]) + "]"; - break; - case proto_record_1.RecordType.KeyedWrite: - rhs = context + "[" + getLocalName(protoRec.args[0]) + "] = " + getLocalName(protoRec.args[1]); - break; - case proto_record_1.RecordType.Chain: - rhs = "" + getLocalName(protoRec.args[protoRec.args.length - 1]); - break; - default: - throw new exceptions_1.BaseException("Unknown operation " + protoRec.mode); - } - return getLocalName(protoRec.selfIndex) + " = " + rhs + ";"; - }; - CodegenLogicUtil.prototype.genPropertyBindingTargets = function(propertyBindingTargets, genDebugInfo) { - var _this = this; - var bs = propertyBindingTargets.map(function(b) { - if (lang_1.isBlank(b)) - return "null"; - var debug = genDebugInfo ? codegen_facade_1.codify(b.debug) : "null"; - return _this._utilName + ".bindingTarget(" + codegen_facade_1.codify(b.mode) + ", " + b.elementIndex + ", " + codegen_facade_1.codify(b.name) + ", " + codegen_facade_1.codify(b.unit) + ", " + debug + ")"; - }); - return "[" + bs.join(", ") + "]"; - }; - CodegenLogicUtil.prototype.genDirectiveIndices = function(directiveRecords) { - var _this = this; - var bs = directiveRecords.map(function(b) { - return (_this._utilName + ".directiveIndex(" + b.directiveIndex.elementIndex + ", " + b.directiveIndex.directiveIndex + ")"); - }); - return "[" + bs.join(", ") + "]"; - }; - CodegenLogicUtil.prototype._genInterpolation = function(protoRec) { - var iVals = []; - for (var i = 0; i < protoRec.args.length; ++i) { - iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[i])); - iVals.push(this._utilName + ".s(" + this._names.getLocalName(protoRec.args[i]) + ")"); - } - iVals.push(codegen_facade_1.codify(protoRec.fixedArgs[protoRec.args.length])); - return codegen_facade_1.combineGeneratedStrings(iVals); - }; - CodegenLogicUtil.prototype.genHydrateDirectives = function(directiveRecords) { - var _this = this; - var res = []; - var outputCount = 0; - for (var i = 0; i < directiveRecords.length; ++i) { - var r = directiveRecords[i]; - var dirVarName = this._names.getDirectiveName(r.directiveIndex); - res.push(dirVarName + " = " + this._genReadDirective(i) + ";"); - if (lang_1.isPresent(r.outputs)) { - r.outputs.forEach(function(output) { - var eventHandlerExpr = _this._genEventHandler(r.directiveIndex.elementIndex, output[1]); - var statementStart = "this.outputSubscriptions[" + outputCount++ + "] = " + dirVarName + "." + output[0]; - if (lang_1.IS_DART) { - res.push(statementStart + ".listen(" + eventHandlerExpr + ");"); - } else { - res.push(statementStart + ".subscribe({next: " + eventHandlerExpr + "});"); - } - }); - } - } - if (outputCount > 0) { - var statementStart = 'this.outputSubscriptions'; - if (lang_1.IS_DART) { - res.unshift(statementStart + " = new List(" + outputCount + ");"); - } else { - res.unshift(statementStart + " = new Array(" + outputCount + ");"); - } - } - return res.join("\n"); - }; - CodegenLogicUtil.prototype.genDirectivesOnDestroy = function(directiveRecords) { - var res = []; - for (var i = 0; i < directiveRecords.length; ++i) { - var r = directiveRecords[i]; - if (r.callOnDestroy) { - var dirVarName = this._names.getDirectiveName(r.directiveIndex); - res.push(dirVarName + ".ngOnDestroy();"); - } - } - return res.join("\n"); - }; - CodegenLogicUtil.prototype._genEventHandler = function(boundElementIndex, eventName) { - if (lang_1.IS_DART) { - return "(event) => this.handleEvent('" + eventName + "', " + boundElementIndex + ", event)"; - } else { - return "(function(event) { return this.handleEvent('" + eventName + "', " + boundElementIndex + ", event); }).bind(this)"; - } - }; - CodegenLogicUtil.prototype._genReadDirective = function(index) { - return "this.getDirectiveFor(directives, " + index + ")"; - }; - CodegenLogicUtil.prototype.genHydrateDetectors = function(directiveRecords) { - var res = []; - for (var i = 0; i < directiveRecords.length; ++i) { - var r = directiveRecords[i]; - if (!r.isDefaultChangeDetection()) { - res.push(this._names.getDetectorName(r.directiveIndex) + " = this.getDetectorFor(directives, " + i + ");"); - } - } - return res.join("\n"); - }; - CodegenLogicUtil.prototype.genContentLifecycleCallbacks = function(directiveRecords) { - var res = []; - var eq = lang_1.IS_DART ? '==' : '==='; - for (var i = directiveRecords.length - 1; i >= 0; --i) { - var dir = directiveRecords[i]; - if (dir.callAfterContentInit) { - res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".ngAfterContentInit();"); - } - if (dir.callAfterContentChecked) { - res.push(this._names.getDirectiveName(dir.directiveIndex) + ".ngAfterContentChecked();"); - } - } - return res; - }; - CodegenLogicUtil.prototype.genViewLifecycleCallbacks = function(directiveRecords) { - var res = []; - var eq = lang_1.IS_DART ? '==' : '==='; - for (var i = directiveRecords.length - 1; i >= 0; --i) { - var dir = directiveRecords[i]; - if (dir.callAfterViewInit) { - res.push("if(" + this._names.getStateName() + " " + eq + " " + this._changeDetectorStateName + ".NeverChecked) " + this._names.getDirectiveName(dir.directiveIndex) + ".ngAfterViewInit();"); - } - if (dir.callAfterViewChecked) { - res.push(this._names.getDirectiveName(dir.directiveIndex) + ".ngAfterViewChecked();"); - } - } - return res; - }; - return CodegenLogicUtil; - }()); - exports.CodegenLogicUtil = CodegenLogicUtil; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/element", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/di", "angular2/src/core/di/provider", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/metadata/di", "angular2/src/core/linker/view_type", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/element_ref", "angular2/src/core/render/api", "angular2/src/core/linker/template_ref", "angular2/src/core/metadata/directives", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/query_list", "angular2/src/core/reflection/reflection", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/linker/view_container_ref"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var di_1 = require("angular2/src/core/di"); - var provider_1 = require("angular2/src/core/di/provider"); - var injector_1 = require("angular2/src/core/di/injector"); - var provider_2 = require("angular2/src/core/di/provider"); - var di_2 = require("angular2/src/core/metadata/di"); - var view_type_1 = require("angular2/src/core/linker/view_type"); - var element_ref_1 = require("angular2/src/core/linker/element_ref"); - var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); - var element_ref_2 = require("angular2/src/core/linker/element_ref"); - var api_1 = require("angular2/src/core/render/api"); - var template_ref_1 = require("angular2/src/core/linker/template_ref"); - var directives_1 = require("angular2/src/core/metadata/directives"); - var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); - var query_list_1 = require("angular2/src/core/linker/query_list"); - var reflection_1 = require("angular2/src/core/reflection/reflection"); - var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); - var view_container_ref_2 = require("angular2/src/core/linker/view_container_ref"); - var _staticKeys; - var StaticKeys = (function() { - function StaticKeys() { - this.templateRefId = di_1.Key.get(template_ref_1.TemplateRef).id; - this.viewContainerId = di_1.Key.get(view_container_ref_1.ViewContainerRef).id; - this.changeDetectorRefId = di_1.Key.get(change_detection_1.ChangeDetectorRef).id; - this.elementRefId = di_1.Key.get(element_ref_2.ElementRef).id; - this.rendererId = di_1.Key.get(api_1.Renderer).id; - } - StaticKeys.instance = function() { - if (lang_1.isBlank(_staticKeys)) - _staticKeys = new StaticKeys(); - return _staticKeys; - }; - return StaticKeys; - }()); - exports.StaticKeys = StaticKeys; - var DirectiveDependency = (function(_super) { - __extends(DirectiveDependency, _super); - function DirectiveDependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties, attributeName, queryDecorator) { - _super.call(this, key, optional, lowerBoundVisibility, upperBoundVisibility, properties); - this.attributeName = attributeName; - this.queryDecorator = queryDecorator; - this._verify(); - } - DirectiveDependency.prototype._verify = function() { - var count = 0; - if (lang_1.isPresent(this.queryDecorator)) - count++; - if (lang_1.isPresent(this.attributeName)) - count++; - if (count > 1) - throw new exceptions_1.BaseException('A directive injectable can contain only one of the following @Attribute or @Query.'); - }; - DirectiveDependency.createFrom = function(d) { - return new DirectiveDependency(d.key, d.optional, d.lowerBoundVisibility, d.upperBoundVisibility, d.properties, DirectiveDependency._attributeName(d.properties), DirectiveDependency._query(d.properties)); - }; - DirectiveDependency._attributeName = function(properties) { - var p = properties.find(function(p) { - return p instanceof di_2.AttributeMetadata; - }); - return lang_1.isPresent(p) ? p.attributeName : null; - }; - DirectiveDependency._query = function(properties) { - return properties.find(function(p) { - return p instanceof di_2.QueryMetadata; - }); - }; - return DirectiveDependency; - }(di_1.Dependency)); - exports.DirectiveDependency = DirectiveDependency; - var DirectiveProvider = (function(_super) { - __extends(DirectiveProvider, _super); - function DirectiveProvider(key, factory, deps, isComponent, providers, viewProviders, queries) { - _super.call(this, key, [new provider_2.ResolvedFactory(factory, deps)], false); - this.isComponent = isComponent; - this.providers = providers; - this.viewProviders = viewProviders; - this.queries = queries; - } - Object.defineProperty(DirectiveProvider.prototype, "displayName", { - get: function() { - return this.key.displayName; - }, - enumerable: true, - configurable: true - }); - DirectiveProvider.createFromType = function(type, meta) { - var provider = new di_1.Provider(type, {useClass: type}); - if (lang_1.isBlank(meta)) { - meta = new directives_1.DirectiveMetadata(); - } - var rb = provider_2.resolveProvider(provider); - var rf = rb.resolvedFactories[0]; - var deps = rf.dependencies.map(DirectiveDependency.createFrom); - var isComponent = meta instanceof directives_1.ComponentMetadata; - var resolvedProviders = lang_1.isPresent(meta.providers) ? di_1.Injector.resolve(meta.providers) : null; - var resolvedViewProviders = meta instanceof directives_1.ComponentMetadata && lang_1.isPresent(meta.viewProviders) ? di_1.Injector.resolve(meta.viewProviders) : null; - var queries = []; - if (lang_1.isPresent(meta.queries)) { - collection_1.StringMapWrapper.forEach(meta.queries, function(meta, fieldName) { - var setter = reflection_1.reflector.setter(fieldName); - queries.push(new QueryMetadataWithSetter(setter, meta)); - }); - } - deps.forEach(function(d) { - if (lang_1.isPresent(d.queryDecorator)) { - queries.push(new QueryMetadataWithSetter(null, d.queryDecorator)); - } - }); - return new DirectiveProvider(rb.key, rf.factory, deps, isComponent, resolvedProviders, resolvedViewProviders, queries); - }; - return DirectiveProvider; - }(provider_2.ResolvedProvider_)); - exports.DirectiveProvider = DirectiveProvider; - var QueryMetadataWithSetter = (function() { - function QueryMetadataWithSetter(setter, metadata) { - this.setter = setter; - this.metadata = metadata; - } - return QueryMetadataWithSetter; - }()); - exports.QueryMetadataWithSetter = QueryMetadataWithSetter; - function setProvidersVisibility(providers, visibility, result) { - for (var i = 0; i < providers.length; i++) { - result.set(providers[i].key.id, visibility); - } - } - var AppProtoElement = (function() { - function AppProtoElement(firstProviderIsComponent, index, attributes, pwvs, protoQueryRefs, directiveVariableBindings) { - this.firstProviderIsComponent = firstProviderIsComponent; - this.index = index; - this.attributes = attributes; - this.protoQueryRefs = protoQueryRefs; - this.directiveVariableBindings = directiveVariableBindings; - var length = pwvs.length; - if (length > 0) { - this.protoInjector = new injector_1.ProtoInjector(pwvs); - } else { - this.protoInjector = null; - this.protoQueryRefs = []; - } - } - AppProtoElement.create = function(metadataCache, index, attributes, directiveTypes, directiveVariableBindings) { - var componentDirProvider = null; - var mergedProvidersMap = new Map(); - var providerVisibilityMap = new Map(); - var providers = collection_1.ListWrapper.createGrowableSize(directiveTypes.length); - var protoQueryRefs = []; - for (var i = 0; i < directiveTypes.length; i++) { - var dirProvider = metadataCache.getResolvedDirectiveMetadata(directiveTypes[i]); - providers[i] = new injector_1.ProviderWithVisibility(dirProvider, dirProvider.isComponent ? injector_1.Visibility.PublicAndPrivate : injector_1.Visibility.Public); - if (dirProvider.isComponent) { - componentDirProvider = dirProvider; - } else { - if (lang_1.isPresent(dirProvider.providers)) { - provider_1.mergeResolvedProviders(dirProvider.providers, mergedProvidersMap); - setProvidersVisibility(dirProvider.providers, injector_1.Visibility.Public, providerVisibilityMap); - } - } - if (lang_1.isPresent(dirProvider.viewProviders)) { - provider_1.mergeResolvedProviders(dirProvider.viewProviders, mergedProvidersMap); - setProvidersVisibility(dirProvider.viewProviders, injector_1.Visibility.Private, providerVisibilityMap); - } - for (var queryIdx = 0; queryIdx < dirProvider.queries.length; queryIdx++) { - var q = dirProvider.queries[queryIdx]; - protoQueryRefs.push(new ProtoQueryRef(i, q.setter, q.metadata)); - } - } - if (lang_1.isPresent(componentDirProvider) && lang_1.isPresent(componentDirProvider.providers)) { - provider_1.mergeResolvedProviders(componentDirProvider.providers, mergedProvidersMap); - setProvidersVisibility(componentDirProvider.providers, injector_1.Visibility.Public, providerVisibilityMap); - } - mergedProvidersMap.forEach(function(provider, _) { - providers.push(new injector_1.ProviderWithVisibility(provider, providerVisibilityMap.get(provider.key.id))); - }); - return new AppProtoElement(lang_1.isPresent(componentDirProvider), index, attributes, providers, protoQueryRefs, directiveVariableBindings); - }; - AppProtoElement.prototype.getProviderAtIndex = function(index) { - return this.protoInjector.getProviderAtIndex(index); - }; - return AppProtoElement; - }()); - exports.AppProtoElement = AppProtoElement; - var _Context = (function() { - function _Context(element, componentElement, injector) { - this.element = element; - this.componentElement = componentElement; - this.injector = injector; - } - return _Context; - }()); - var InjectorWithHostBoundary = (function() { - function InjectorWithHostBoundary(injector, hostInjectorBoundary) { - this.injector = injector; - this.hostInjectorBoundary = hostInjectorBoundary; - } - return InjectorWithHostBoundary; - }()); - exports.InjectorWithHostBoundary = InjectorWithHostBoundary; - var AppElement = (function() { - function AppElement(proto, parentView, parent, nativeElement, embeddedViewFactory) { - var _this = this; - this.proto = proto; - this.parentView = parentView; - this.parent = parent; - this.nativeElement = nativeElement; - this.embeddedViewFactory = embeddedViewFactory; - this.nestedViews = null; - this.componentView = null; - this.ref = new element_ref_1.ElementRef_(this); - var parentInjector = lang_1.isPresent(parent) ? parent._injector : parentView.parentInjector; - if (lang_1.isPresent(this.proto.protoInjector)) { - var isBoundary; - if (lang_1.isPresent(parent) && lang_1.isPresent(parent.proto.protoInjector)) { - isBoundary = false; - } else { - isBoundary = parentView.hostInjectorBoundary; - } - this._queryStrategy = this._buildQueryStrategy(); - this._injector = new di_1.Injector(this.proto.protoInjector, parentInjector, isBoundary, this, function() { - return _this._debugContext(); - }); - var injectorStrategy = this._injector.internalStrategy; - this._strategy = injectorStrategy instanceof injector_1.InjectorInlineStrategy ? new ElementDirectiveInlineStrategy(injectorStrategy, this) : new ElementDirectiveDynamicStrategy(injectorStrategy, this); - this._strategy.init(); - } else { - this._queryStrategy = null; - this._injector = parentInjector; - this._strategy = null; - } - } - AppElement.getViewParentInjector = function(parentViewType, containerAppElement, imperativelyCreatedProviders, rootInjector) { - var parentInjector; - var hostInjectorBoundary; - switch (parentViewType) { - case view_type_1.ViewType.COMPONENT: - parentInjector = containerAppElement._injector; - hostInjectorBoundary = true; - break; - case view_type_1.ViewType.EMBEDDED: - parentInjector = lang_1.isPresent(containerAppElement.proto.protoInjector) ? containerAppElement._injector.parent : containerAppElement._injector; - hostInjectorBoundary = containerAppElement._injector.hostBoundary; - break; - case view_type_1.ViewType.HOST: - if (lang_1.isPresent(containerAppElement)) { - parentInjector = lang_1.isPresent(containerAppElement.proto.protoInjector) ? containerAppElement._injector.parent : containerAppElement._injector; - if (lang_1.isPresent(imperativelyCreatedProviders)) { - var imperativeProvidersWithVisibility = imperativelyCreatedProviders.map(function(p) { - return new injector_1.ProviderWithVisibility(p, injector_1.Visibility.Public); - }); - parentInjector = new di_1.Injector(new injector_1.ProtoInjector(imperativeProvidersWithVisibility), parentInjector, true, null, null); - hostInjectorBoundary = false; - } else { - hostInjectorBoundary = containerAppElement._injector.hostBoundary; - } - } else { - parentInjector = rootInjector; - hostInjectorBoundary = true; - } - break; - } - return new InjectorWithHostBoundary(parentInjector, hostInjectorBoundary); - }; - AppElement.prototype.attachComponentView = function(componentView) { - this.componentView = componentView; - }; - AppElement.prototype._debugContext = function() { - var c = this.parentView.getDebugContext(this, null, null); - return lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.injector) : null; - }; - AppElement.prototype.hasVariableBinding = function(name) { - var vb = this.proto.directiveVariableBindings; - return lang_1.isPresent(vb) && collection_1.StringMapWrapper.contains(vb, name); - }; - AppElement.prototype.getVariableBinding = function(name) { - var index = this.proto.directiveVariableBindings[name]; - return lang_1.isPresent(index) ? this.getDirectiveAtIndex(index) : this.getElementRef(); - }; - AppElement.prototype.get = function(token) { - return this._injector.get(token); - }; - AppElement.prototype.hasDirective = function(type) { - return lang_1.isPresent(this._injector.getOptional(type)); - }; - AppElement.prototype.getComponent = function() { - return lang_1.isPresent(this._strategy) ? this._strategy.getComponent() : null; - }; - AppElement.prototype.getInjector = function() { - return this._injector; - }; - AppElement.prototype.getElementRef = function() { - return this.ref; - }; - AppElement.prototype.getViewContainerRef = function() { - return new view_container_ref_2.ViewContainerRef_(this); - }; - AppElement.prototype.getTemplateRef = function() { - if (lang_1.isPresent(this.embeddedViewFactory)) { - return new template_ref_1.TemplateRef_(this.ref); - } - return null; - }; - AppElement.prototype.getDependency = function(injector, provider, dep) { - if (provider instanceof DirectiveProvider) { - var dirDep = dep; - if (lang_1.isPresent(dirDep.attributeName)) - return this._buildAttribute(dirDep); - if (lang_1.isPresent(dirDep.queryDecorator)) - return this._queryStrategy.findQuery(dirDep.queryDecorator).list; - if (dirDep.key.id === StaticKeys.instance().changeDetectorRefId) { - if (this.proto.firstProviderIsComponent) { - return new _ComponentViewChangeDetectorRef(this); - } else { - return this.parentView.changeDetector.ref; - } - } - if (dirDep.key.id === StaticKeys.instance().elementRefId) { - return this.getElementRef(); - } - if (dirDep.key.id === StaticKeys.instance().viewContainerId) { - return this.getViewContainerRef(); - } - if (dirDep.key.id === StaticKeys.instance().templateRefId) { - var tr = this.getTemplateRef(); - if (lang_1.isBlank(tr) && !dirDep.optional) { - throw new di_1.NoProviderError(null, dirDep.key); - } - return tr; - } - if (dirDep.key.id === StaticKeys.instance().rendererId) { - return this.parentView.renderer; - } - } else if (provider instanceof pipe_provider_1.PipeProvider) { - if (dep.key.id === StaticKeys.instance().changeDetectorRefId) { - if (this.proto.firstProviderIsComponent) { - return new _ComponentViewChangeDetectorRef(this); - } else { - return this.parentView.changeDetector; - } - } - } - return injector_1.UNDEFINED; - }; - AppElement.prototype._buildAttribute = function(dep) { - var attributes = this.proto.attributes; - if (lang_1.isPresent(attributes) && collection_1.StringMapWrapper.contains(attributes, dep.attributeName)) { - return attributes[dep.attributeName]; - } else { - return null; - } - }; - AppElement.prototype.addDirectivesMatchingQuery = function(query, list) { - var templateRef = this.getTemplateRef(); - if (query.selector === template_ref_1.TemplateRef && lang_1.isPresent(templateRef)) { - list.push(templateRef); - } - if (this._strategy != null) { - this._strategy.addDirectivesMatchingQuery(query, list); - } - }; - AppElement.prototype._buildQueryStrategy = function() { - if (this.proto.protoQueryRefs.length === 0) { - return _emptyQueryStrategy; - } else if (this.proto.protoQueryRefs.length <= InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES) { - return new InlineQueryStrategy(this); - } else { - return new DynamicQueryStrategy(this); - } - }; - AppElement.prototype.getDirectiveAtIndex = function(index) { - return this._injector.getAt(index); - }; - AppElement.prototype.ngAfterViewChecked = function() { - if (lang_1.isPresent(this._queryStrategy)) - this._queryStrategy.updateViewQueries(); - }; - AppElement.prototype.ngAfterContentChecked = function() { - if (lang_1.isPresent(this._queryStrategy)) - this._queryStrategy.updateContentQueries(); - }; - AppElement.prototype.traverseAndSetQueriesAsDirty = function() { - var inj = this; - while (lang_1.isPresent(inj)) { - inj._setQueriesAsDirty(); - if (lang_1.isBlank(inj.parent) && inj.parentView.proto.type === view_type_1.ViewType.EMBEDDED) { - inj = inj.parentView.containerAppElement; - } else { - inj = inj.parent; - } - } - }; - AppElement.prototype._setQueriesAsDirty = function() { - if (lang_1.isPresent(this._queryStrategy)) { - this._queryStrategy.setContentQueriesAsDirty(); - } - if (this.parentView.proto.type === view_type_1.ViewType.COMPONENT) { - this.parentView.containerAppElement._queryStrategy.setViewQueriesAsDirty(); - } - }; - return AppElement; - }()); - exports.AppElement = AppElement; - var _EmptyQueryStrategy = (function() { - function _EmptyQueryStrategy() {} - _EmptyQueryStrategy.prototype.setContentQueriesAsDirty = function() {}; - _EmptyQueryStrategy.prototype.setViewQueriesAsDirty = function() {}; - _EmptyQueryStrategy.prototype.updateContentQueries = function() {}; - _EmptyQueryStrategy.prototype.updateViewQueries = function() {}; - _EmptyQueryStrategy.prototype.findQuery = function(query) { - throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); - }; - return _EmptyQueryStrategy; - }()); - var _emptyQueryStrategy = new _EmptyQueryStrategy(); - var InlineQueryStrategy = (function() { - function InlineQueryStrategy(ei) { - var protoRefs = ei.proto.protoQueryRefs; - if (protoRefs.length > 0) - this.query0 = new QueryRef(protoRefs[0], ei); - if (protoRefs.length > 1) - this.query1 = new QueryRef(protoRefs[1], ei); - if (protoRefs.length > 2) - this.query2 = new QueryRef(protoRefs[2], ei); - } - InlineQueryStrategy.prototype.setContentQueriesAsDirty = function() { - if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) - this.query0.dirty = true; - if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) - this.query1.dirty = true; - if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) - this.query2.dirty = true; - }; - InlineQueryStrategy.prototype.setViewQueriesAsDirty = function() { - if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) - this.query0.dirty = true; - if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) - this.query1.dirty = true; - if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) - this.query2.dirty = true; - }; - InlineQueryStrategy.prototype.updateContentQueries = function() { - if (lang_1.isPresent(this.query0) && !this.query0.isViewQuery) { - this.query0.update(); - } - if (lang_1.isPresent(this.query1) && !this.query1.isViewQuery) { - this.query1.update(); - } - if (lang_1.isPresent(this.query2) && !this.query2.isViewQuery) { - this.query2.update(); - } - }; - InlineQueryStrategy.prototype.updateViewQueries = function() { - if (lang_1.isPresent(this.query0) && this.query0.isViewQuery) { - this.query0.update(); - } - if (lang_1.isPresent(this.query1) && this.query1.isViewQuery) { - this.query1.update(); - } - if (lang_1.isPresent(this.query2) && this.query2.isViewQuery) { - this.query2.update(); - } - }; - InlineQueryStrategy.prototype.findQuery = function(query) { - if (lang_1.isPresent(this.query0) && this.query0.protoQueryRef.query === query) { - return this.query0; - } - if (lang_1.isPresent(this.query1) && this.query1.protoQueryRef.query === query) { - return this.query1; - } - if (lang_1.isPresent(this.query2) && this.query2.protoQueryRef.query === query) { - return this.query2; - } - throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); - }; - InlineQueryStrategy.NUMBER_OF_SUPPORTED_QUERIES = 3; - return InlineQueryStrategy; - }()); - var DynamicQueryStrategy = (function() { - function DynamicQueryStrategy(ei) { - this.queries = ei.proto.protoQueryRefs.map(function(p) { - return new QueryRef(p, ei); - }); - } - DynamicQueryStrategy.prototype.setContentQueriesAsDirty = function() { - for (var i = 0; i < this.queries.length; ++i) { - var q = this.queries[i]; - if (!q.isViewQuery) - q.dirty = true; - } - }; - DynamicQueryStrategy.prototype.setViewQueriesAsDirty = function() { - for (var i = 0; i < this.queries.length; ++i) { - var q = this.queries[i]; - if (q.isViewQuery) - q.dirty = true; - } - }; - DynamicQueryStrategy.prototype.updateContentQueries = function() { - for (var i = 0; i < this.queries.length; ++i) { - var q = this.queries[i]; - if (!q.isViewQuery) { - q.update(); - } - } - }; - DynamicQueryStrategy.prototype.updateViewQueries = function() { - for (var i = 0; i < this.queries.length; ++i) { - var q = this.queries[i]; - if (q.isViewQuery) { - q.update(); - } - } - }; - DynamicQueryStrategy.prototype.findQuery = function(query) { - for (var i = 0; i < this.queries.length; ++i) { - var q = this.queries[i]; - if (q.protoQueryRef.query === query) { - return q; - } - } - throw new exceptions_1.BaseException("Cannot find query for directive " + query + "."); - }; - return DynamicQueryStrategy; - }()); - var ElementDirectiveInlineStrategy = (function() { - function ElementDirectiveInlineStrategy(injectorStrategy, _ei) { - this.injectorStrategy = injectorStrategy; - this._ei = _ei; - } - ElementDirectiveInlineStrategy.prototype.init = function() { - var i = this.injectorStrategy; - var p = i.protoStrategy; - i.resetConstructionCounter(); - if (p.provider0 instanceof DirectiveProvider && lang_1.isPresent(p.keyId0) && i.obj0 === injector_1.UNDEFINED) - i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); - if (p.provider1 instanceof DirectiveProvider && lang_1.isPresent(p.keyId1) && i.obj1 === injector_1.UNDEFINED) - i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); - if (p.provider2 instanceof DirectiveProvider && lang_1.isPresent(p.keyId2) && i.obj2 === injector_1.UNDEFINED) - i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); - if (p.provider3 instanceof DirectiveProvider && lang_1.isPresent(p.keyId3) && i.obj3 === injector_1.UNDEFINED) - i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); - if (p.provider4 instanceof DirectiveProvider && lang_1.isPresent(p.keyId4) && i.obj4 === injector_1.UNDEFINED) - i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); - if (p.provider5 instanceof DirectiveProvider && lang_1.isPresent(p.keyId5) && i.obj5 === injector_1.UNDEFINED) - i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); - if (p.provider6 instanceof DirectiveProvider && lang_1.isPresent(p.keyId6) && i.obj6 === injector_1.UNDEFINED) - i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); - if (p.provider7 instanceof DirectiveProvider && lang_1.isPresent(p.keyId7) && i.obj7 === injector_1.UNDEFINED) - i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); - if (p.provider8 instanceof DirectiveProvider && lang_1.isPresent(p.keyId8) && i.obj8 === injector_1.UNDEFINED) - i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); - if (p.provider9 instanceof DirectiveProvider && lang_1.isPresent(p.keyId9) && i.obj9 === injector_1.UNDEFINED) - i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); - }; - ElementDirectiveInlineStrategy.prototype.getComponent = function() { - return this.injectorStrategy.obj0; - }; - ElementDirectiveInlineStrategy.prototype.isComponentKey = function(key) { - return this._ei.proto.firstProviderIsComponent && lang_1.isPresent(key) && key.id === this.injectorStrategy.protoStrategy.keyId0; - }; - ElementDirectiveInlineStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { - var i = this.injectorStrategy; - var p = i.protoStrategy; - if (lang_1.isPresent(p.provider0) && p.provider0.key.token === query.selector) { - if (i.obj0 === injector_1.UNDEFINED) - i.obj0 = i.instantiateProvider(p.provider0, p.visibility0); - list.push(i.obj0); - } - if (lang_1.isPresent(p.provider1) && p.provider1.key.token === query.selector) { - if (i.obj1 === injector_1.UNDEFINED) - i.obj1 = i.instantiateProvider(p.provider1, p.visibility1); - list.push(i.obj1); - } - if (lang_1.isPresent(p.provider2) && p.provider2.key.token === query.selector) { - if (i.obj2 === injector_1.UNDEFINED) - i.obj2 = i.instantiateProvider(p.provider2, p.visibility2); - list.push(i.obj2); - } - if (lang_1.isPresent(p.provider3) && p.provider3.key.token === query.selector) { - if (i.obj3 === injector_1.UNDEFINED) - i.obj3 = i.instantiateProvider(p.provider3, p.visibility3); - list.push(i.obj3); - } - if (lang_1.isPresent(p.provider4) && p.provider4.key.token === query.selector) { - if (i.obj4 === injector_1.UNDEFINED) - i.obj4 = i.instantiateProvider(p.provider4, p.visibility4); - list.push(i.obj4); - } - if (lang_1.isPresent(p.provider5) && p.provider5.key.token === query.selector) { - if (i.obj5 === injector_1.UNDEFINED) - i.obj5 = i.instantiateProvider(p.provider5, p.visibility5); - list.push(i.obj5); - } - if (lang_1.isPresent(p.provider6) && p.provider6.key.token === query.selector) { - if (i.obj6 === injector_1.UNDEFINED) - i.obj6 = i.instantiateProvider(p.provider6, p.visibility6); - list.push(i.obj6); - } - if (lang_1.isPresent(p.provider7) && p.provider7.key.token === query.selector) { - if (i.obj7 === injector_1.UNDEFINED) - i.obj7 = i.instantiateProvider(p.provider7, p.visibility7); - list.push(i.obj7); - } - if (lang_1.isPresent(p.provider8) && p.provider8.key.token === query.selector) { - if (i.obj8 === injector_1.UNDEFINED) - i.obj8 = i.instantiateProvider(p.provider8, p.visibility8); - list.push(i.obj8); - } - if (lang_1.isPresent(p.provider9) && p.provider9.key.token === query.selector) { - if (i.obj9 === injector_1.UNDEFINED) - i.obj9 = i.instantiateProvider(p.provider9, p.visibility9); - list.push(i.obj9); - } - }; - return ElementDirectiveInlineStrategy; - }()); - var ElementDirectiveDynamicStrategy = (function() { - function ElementDirectiveDynamicStrategy(injectorStrategy, _ei) { - this.injectorStrategy = injectorStrategy; - this._ei = _ei; - } - ElementDirectiveDynamicStrategy.prototype.init = function() { - var inj = this.injectorStrategy; - var p = inj.protoStrategy; - inj.resetConstructionCounter(); - for (var i = 0; i < p.keyIds.length; i++) { - if (p.providers[i] instanceof DirectiveProvider && lang_1.isPresent(p.keyIds[i]) && inj.objs[i] === injector_1.UNDEFINED) { - inj.objs[i] = inj.instantiateProvider(p.providers[i], p.visibilities[i]); - } - } - }; - ElementDirectiveDynamicStrategy.prototype.getComponent = function() { - return this.injectorStrategy.objs[0]; - }; - ElementDirectiveDynamicStrategy.prototype.isComponentKey = function(key) { - var p = this.injectorStrategy.protoStrategy; - return this._ei.proto.firstProviderIsComponent && lang_1.isPresent(key) && key.id === p.keyIds[0]; - }; - ElementDirectiveDynamicStrategy.prototype.addDirectivesMatchingQuery = function(query, list) { - var ist = this.injectorStrategy; - var p = ist.protoStrategy; - for (var i = 0; i < p.providers.length; i++) { - if (p.providers[i].key.token === query.selector) { - if (ist.objs[i] === injector_1.UNDEFINED) { - ist.objs[i] = ist.instantiateProvider(p.providers[i], p.visibilities[i]); - } - list.push(ist.objs[i]); - } - } - }; - return ElementDirectiveDynamicStrategy; - }()); - var ProtoQueryRef = (function() { - function ProtoQueryRef(dirIndex, setter, query) { - this.dirIndex = dirIndex; - this.setter = setter; - this.query = query; - } - Object.defineProperty(ProtoQueryRef.prototype, "usesPropertySyntax", { - get: function() { - return lang_1.isPresent(this.setter); - }, - enumerable: true, - configurable: true - }); - return ProtoQueryRef; - }()); - exports.ProtoQueryRef = ProtoQueryRef; - var QueryRef = (function() { - function QueryRef(protoQueryRef, originator) { - this.protoQueryRef = protoQueryRef; - this.originator = originator; - this.list = new query_list_1.QueryList(); - this.dirty = true; - } - Object.defineProperty(QueryRef.prototype, "isViewQuery", { - get: function() { - return this.protoQueryRef.query.isViewQuery; - }, - enumerable: true, - configurable: true - }); - QueryRef.prototype.update = function() { - if (!this.dirty) - return ; - this._update(); - this.dirty = false; - if (this.protoQueryRef.usesPropertySyntax) { - var dir = this.originator.getDirectiveAtIndex(this.protoQueryRef.dirIndex); - if (this.protoQueryRef.query.first) { - this.protoQueryRef.setter(dir, this.list.length > 0 ? this.list.first : null); - } else { - this.protoQueryRef.setter(dir, this.list); - } - } - this.list.notifyOnChanges(); - }; - QueryRef.prototype._update = function() { - var aggregator = []; - if (this.protoQueryRef.query.isViewQuery) { - var nestedView = this.originator.componentView; - if (lang_1.isPresent(nestedView)) - this._visitView(nestedView, aggregator); - } else { - this._visit(this.originator, aggregator); - } - this.list.reset(aggregator); - }; - ; - QueryRef.prototype._visit = function(inj, aggregator) { - var view = inj.parentView; - var startIdx = inj.proto.index; - for (var i = startIdx; i < view.appElements.length; i++) { - var curInj = view.appElements[i]; - if (i > startIdx && (lang_1.isBlank(curInj.parent) || curInj.parent.proto.index < startIdx)) { - break; - } - if (!this.protoQueryRef.query.descendants && !(curInj.parent == this.originator || curInj == this.originator)) - continue; - this._visitInjector(curInj, aggregator); - this._visitViewContainerViews(curInj.nestedViews, aggregator); - } - }; - QueryRef.prototype._visitInjector = function(inj, aggregator) { - if (this.protoQueryRef.query.isVarBindingQuery) { - this._aggregateVariableBinding(inj, aggregator); - } else { - this._aggregateDirective(inj, aggregator); - } - }; - QueryRef.prototype._visitViewContainerViews = function(views, aggregator) { - if (lang_1.isPresent(views)) { - for (var j = 0; j < views.length; j++) { - this._visitView(views[j], aggregator); - } - } - }; - QueryRef.prototype._visitView = function(view, aggregator) { - for (var i = 0; i < view.appElements.length; i++) { - var inj = view.appElements[i]; - this._visitInjector(inj, aggregator); - this._visitViewContainerViews(inj.nestedViews, aggregator); - } - }; - QueryRef.prototype._aggregateVariableBinding = function(inj, aggregator) { - var vb = this.protoQueryRef.query.varBindings; - for (var i = 0; i < vb.length; ++i) { - if (inj.hasVariableBinding(vb[i])) { - aggregator.push(inj.getVariableBinding(vb[i])); - } - } - }; - QueryRef.prototype._aggregateDirective = function(inj, aggregator) { - inj.addDirectivesMatchingQuery(this.protoQueryRef.query, aggregator); - }; - return QueryRef; - }()); - exports.QueryRef = QueryRef; - var _ComponentViewChangeDetectorRef = (function(_super) { - __extends(_ComponentViewChangeDetectorRef, _super); - function _ComponentViewChangeDetectorRef(_appElement) { - _super.call(this); - this._appElement = _appElement; - } - _ComponentViewChangeDetectorRef.prototype.markForCheck = function() { - this._appElement.componentView.changeDetector.ref.markForCheck(); - }; - _ComponentViewChangeDetectorRef.prototype.detach = function() { - this._appElement.componentView.changeDetector.ref.detach(); - }; - _ComponentViewChangeDetectorRef.prototype.detectChanges = function() { - this._appElement.componentView.changeDetector.ref.detectChanges(); - }; - _ComponentViewChangeDetectorRef.prototype.checkNoChanges = function() { - this._appElement.componentView.changeDetector.ref.checkNoChanges(); - }; - _ComponentViewChangeDetectorRef.prototype.reattach = function() { - this._appElement.componentView.changeDetector.ref.reattach(); - }; - return _ComponentViewChangeDetectorRef; - }(change_detection_1.ChangeDetectorRef)); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/pipes/pipes", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/pipes"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var cd = require("angular2/src/core/change_detection/pipes"); - var ProtoPipes = (function() { - function ProtoPipes(config) { - this.config = config; - this.config = config; - } - ProtoPipes.fromProviders = function(providers) { - var config = {}; - providers.forEach(function(b) { - return config[b.name] = b; - }); - return new ProtoPipes(config); - }; - ProtoPipes.prototype.get = function(name) { - var provider = this.config[name]; - if (lang_1.isBlank(provider)) - throw new exceptions_1.BaseException("Cannot find pipe '" + name + "'."); - return provider; - }; - return ProtoPipes; - }()); - exports.ProtoPipes = ProtoPipes; - var Pipes = (function() { - function Pipes(proto, injector) { - this.proto = proto; - this.injector = injector; - this._config = {}; - } - Pipes.prototype.get = function(name) { - var cached = collection_1.StringMapWrapper.get(this._config, name); - if (lang_1.isPresent(cached)) - return cached; - var p = this.proto.get(name); - var transform = this.injector.instantiateResolved(p); - var res = new cd.SelectedPipe(transform, p.pure); - if (p.pure) { - collection_1.StringMapWrapper.set(this._config, name, res); - } - return res; - }; - return Pipes; - }()); - exports.Pipes = Pipes; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker", ["angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/query_list", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/element_ref", "angular2/src/core/linker/template_ref", "angular2/src/core/linker/view_ref", "angular2/src/core/linker/view_container_ref", "angular2/src/core/linker/dynamic_component_loader"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); - exports.DirectiveResolver = directive_resolver_1.DirectiveResolver; - var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); - exports.ViewResolver = view_resolver_1.ViewResolver; - var compiler_1 = require("angular2/src/core/linker/compiler"); - exports.Compiler = compiler_1.Compiler; - var view_manager_1 = require("angular2/src/core/linker/view_manager"); - exports.AppViewManager = view_manager_1.AppViewManager; - var query_list_1 = require("angular2/src/core/linker/query_list"); - exports.QueryList = query_list_1.QueryList; - var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); - exports.DynamicComponentLoader = dynamic_component_loader_1.DynamicComponentLoader; - var element_ref_1 = require("angular2/src/core/linker/element_ref"); - exports.ElementRef = element_ref_1.ElementRef; - var template_ref_1 = require("angular2/src/core/linker/template_ref"); - exports.TemplateRef = template_ref_1.TemplateRef; - var view_ref_1 = require("angular2/src/core/linker/view_ref"); - exports.EmbeddedViewRef = view_ref_1.EmbeddedViewRef; - exports.HostViewRef = view_ref_1.HostViewRef; - exports.ViewRef = view_ref_1.ViewRef; - exports.HostViewFactoryRef = view_ref_1.HostViewFactoryRef; - var view_container_ref_1 = require("angular2/src/core/linker/view_container_ref"); - exports.ViewContainerRef = view_container_ref_1.ViewContainerRef; - var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); - exports.ComponentRef = dynamic_component_loader_2.ComponentRef; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/resolved_metadata_cache", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/linker/element", "angular2/src/core/linker/directive_resolver", "angular2/src/core/pipes/pipe_provider", "angular2/src/core/linker/pipe_resolver"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - var element_1 = require("angular2/src/core/linker/element"); - var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); - var pipe_provider_1 = require("angular2/src/core/pipes/pipe_provider"); - var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); - var ResolvedMetadataCache = (function() { - function ResolvedMetadataCache(_directiveResolver, _pipeResolver) { - this._directiveResolver = _directiveResolver; - this._pipeResolver = _pipeResolver; - this._directiveCache = new Map(); - this._pipeCache = new Map(); - } - ResolvedMetadataCache.prototype.getResolvedDirectiveMetadata = function(type) { - var result = this._directiveCache.get(type); - if (lang_1.isBlank(result)) { - result = element_1.DirectiveProvider.createFromType(type, this._directiveResolver.resolve(type)); - this._directiveCache.set(type, result); - } - return result; - }; - ResolvedMetadataCache.prototype.getResolvedPipeMetadata = function(type) { - var result = this._pipeCache.get(type); - if (lang_1.isBlank(result)) { - result = pipe_provider_1.PipeProvider.createFromType(type, this._pipeResolver.resolve(type)); - this._pipeCache.set(type, result); - } - return result; - }; - ResolvedMetadataCache = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [directive_resolver_1.DirectiveResolver, pipe_resolver_1.PipeResolver])], ResolvedMetadataCache); - return ResolvedMetadataCache; - }()); - exports.ResolvedMetadataCache = ResolvedMetadataCache; - exports.CODEGEN_RESOLVED_METADATA_CACHE = new ResolvedMetadataCache(directive_resolver_1.CODEGEN_DIRECTIVE_RESOLVER, pipe_resolver_1.CODEGEN_PIPE_RESOLVER); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/debug/ng_probe", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/platform/dom/dom_adapter", "angular2/src/core/debug/debug_node", "angular2/src/platform/dom/dom_renderer", "angular2/core", "angular2/src/core/debug/debug_renderer"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var di_1 = require("angular2/src/core/di"); - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var debug_node_1 = require("angular2/src/core/debug/debug_node"); - var dom_renderer_1 = require("angular2/src/platform/dom/dom_renderer"); - var core_1 = require("angular2/core"); - var debug_renderer_1 = require("angular2/src/core/debug/debug_renderer"); - var CORE_TOKENS = lang_1.CONST_EXPR({ - 'ApplicationRef': core_1.ApplicationRef, - 'NgZone': core_1.NgZone - }); - var INSPECT_GLOBAL_NAME = 'ng.probe'; - var CORE_TOKENS_GLOBAL_NAME = 'ng.coreTokens'; - function inspectNativeElement(element) { - return debug_node_1.getDebugNode(element); - } - exports.inspectNativeElement = inspectNativeElement; - function _createConditionalRootRenderer(rootRenderer) { - if (lang_1.assertionsEnabled()) { - return _createRootRenderer(rootRenderer); - } - return rootRenderer; - } - function _createRootRenderer(rootRenderer) { - dom_adapter_1.DOM.setGlobalVar(INSPECT_GLOBAL_NAME, inspectNativeElement); - dom_adapter_1.DOM.setGlobalVar(CORE_TOKENS_GLOBAL_NAME, CORE_TOKENS); - return new debug_renderer_1.DebugDomRootRenderer(rootRenderer); - } - exports.ELEMENT_PROBE_PROVIDERS = lang_1.CONST_EXPR([new di_1.Provider(core_1.RootRenderer, { - useFactory: _createConditionalRootRenderer, - deps: [dom_renderer_1.DomRootRenderer] - })]); - exports.ELEMENT_PROBE_PROVIDERS_PROD_MODE = lang_1.CONST_EXPR([new di_1.Provider(core_1.RootRenderer, { - useFactory: _createRootRenderer, - deps: [dom_renderer_1.DomRootRenderer] - })]); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/reflection/reflection", ["angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflector", "angular2/src/core/reflection/reflection_capabilities"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var reflector_1 = require("angular2/src/core/reflection/reflector"); - var reflector_2 = require("angular2/src/core/reflection/reflector"); - exports.Reflector = reflector_2.Reflector; - exports.ReflectionInfo = reflector_2.ReflectionInfo; - var reflection_capabilities_1 = require("angular2/src/core/reflection/reflection_capabilities"); - exports.reflector = new reflector_1.Reflector(new reflection_capabilities_1.ReflectionCapabilities()); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/animate/css_animation_builder", ["angular2/src/animate/css_animation_options", "angular2/src/animate/animation"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var css_animation_options_1 = require("angular2/src/animate/css_animation_options"); - var animation_1 = require("angular2/src/animate/animation"); - var CssAnimationBuilder = (function() { - function CssAnimationBuilder(browserDetails) { - this.browserDetails = browserDetails; - this.data = new css_animation_options_1.CssAnimationOptions(); - } - CssAnimationBuilder.prototype.addAnimationClass = function(className) { - this.data.animationClasses.push(className); - return this; - }; - CssAnimationBuilder.prototype.addClass = function(className) { - this.data.classesToAdd.push(className); - return this; - }; - CssAnimationBuilder.prototype.removeClass = function(className) { - this.data.classesToRemove.push(className); - return this; - }; - CssAnimationBuilder.prototype.setDuration = function(duration) { - this.data.duration = duration; - return this; - }; - CssAnimationBuilder.prototype.setDelay = function(delay) { - this.data.delay = delay; - return this; - }; - CssAnimationBuilder.prototype.setStyles = function(from, to) { - return this.setFromStyles(from).setToStyles(to); - }; - CssAnimationBuilder.prototype.setFromStyles = function(from) { - this.data.fromStyles = from; - return this; - }; - CssAnimationBuilder.prototype.setToStyles = function(to) { - this.data.toStyles = to; - return this; - }; - CssAnimationBuilder.prototype.start = function(element) { - return new animation_1.Animation(element, this.data, this.browserDetails); - }; - return CssAnimationBuilder; - }()); - exports.CssAnimationBuilder = CssAnimationBuilder; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/abstract_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/parser/locals", "angular2/src/core/change_detection/constants", "angular2/src/core/profile/profile", "angular2/src/facade/async"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); - var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); - var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); - var locals_1 = require("angular2/src/core/change_detection/parser/locals"); - var constants_1 = require("angular2/src/core/change_detection/constants"); - var profile_1 = require("angular2/src/core/profile/profile"); - var async_1 = require("angular2/src/facade/async"); - var _scope_check = profile_1.wtfCreateScope("ChangeDetector#check(ascii id, bool throwOnChange)"); - var _Context = (function() { - function _Context(element, componentElement, context, locals, injector, expression) { - this.element = element; - this.componentElement = componentElement; - this.context = context; - this.locals = locals; - this.injector = injector; - this.expression = expression; - } - return _Context; - }()); - var AbstractChangeDetector = (function() { - function AbstractChangeDetector(id, numberOfPropertyProtoRecords, bindingTargets, directiveIndices, strategy) { - this.id = id; - this.numberOfPropertyProtoRecords = numberOfPropertyProtoRecords; - this.bindingTargets = bindingTargets; - this.directiveIndices = directiveIndices; - this.strategy = strategy; - this.contentChildren = []; - this.viewChildren = []; - this.state = constants_1.ChangeDetectorState.NeverChecked; - this.locals = null; - this.mode = null; - this.pipes = null; - this.ref = new change_detector_ref_1.ChangeDetectorRef_(this); - } - AbstractChangeDetector.prototype.addContentChild = function(cd) { - this.contentChildren.push(cd); - cd.parent = this; - }; - AbstractChangeDetector.prototype.removeContentChild = function(cd) { - collection_1.ListWrapper.remove(this.contentChildren, cd); - }; - AbstractChangeDetector.prototype.addViewChild = function(cd) { - this.viewChildren.push(cd); - cd.parent = this; - }; - AbstractChangeDetector.prototype.removeViewChild = function(cd) { - collection_1.ListWrapper.remove(this.viewChildren, cd); - }; - AbstractChangeDetector.prototype.remove = function() { - this.parent.removeContentChild(this); - }; - AbstractChangeDetector.prototype.handleEvent = function(eventName, elIndex, event) { - if (!this.hydrated()) { - this.throwDehydratedError(this.id + " -> " + eventName); - } - try { - var locals = new Map(); - locals.set('$event', event); - var res = !this.handleEventInternal(eventName, elIndex, new locals_1.Locals(this.locals, locals)); - this.markPathToRootAsCheckOnce(); - return res; - } catch (e) { - var c = this.dispatcher.getDebugContext(null, elIndex, null); - var context = lang_1.isPresent(c) ? new exceptions_1.EventEvaluationErrorContext(c.element, c.componentElement, c.context, c.locals, c.injector) : null; - throw new exceptions_1.EventEvaluationError(eventName, e, e.stack, context); - } - }; - AbstractChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { - return false; - }; - AbstractChangeDetector.prototype.detectChanges = function() { - this.runDetectChanges(false); - }; - AbstractChangeDetector.prototype.checkNoChanges = function() { - if (lang_1.assertionsEnabled()) { - this.runDetectChanges(true); - } - }; - AbstractChangeDetector.prototype.runDetectChanges = function(throwOnChange) { - if (this.mode === constants_1.ChangeDetectionStrategy.Detached || this.mode === constants_1.ChangeDetectionStrategy.Checked || this.state === constants_1.ChangeDetectorState.Errored) - return ; - var s = _scope_check(this.id, throwOnChange); - this.detectChangesInRecords(throwOnChange); - this._detectChangesContentChildren(throwOnChange); - if (!throwOnChange) - this.afterContentLifecycleCallbacks(); - this._detectChangesInViewChildren(throwOnChange); - if (!throwOnChange) - this.afterViewLifecycleCallbacks(); - if (this.mode === constants_1.ChangeDetectionStrategy.CheckOnce) - this.mode = constants_1.ChangeDetectionStrategy.Checked; - this.state = constants_1.ChangeDetectorState.CheckedBefore; - profile_1.wtfLeave(s); - }; - AbstractChangeDetector.prototype.detectChangesInRecords = function(throwOnChange) { - if (!this.hydrated()) { - this.throwDehydratedError(this.id); - } - try { - this.detectChangesInRecordsInternal(throwOnChange); - } catch (e) { - if (!(e instanceof exceptions_1.ExpressionChangedAfterItHasBeenCheckedException)) { - this.state = constants_1.ChangeDetectorState.Errored; - } - this._throwError(e, e.stack); - } - }; - AbstractChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) {}; - AbstractChangeDetector.prototype.hydrate = function(context, locals, dispatcher, pipes) { - this.dispatcher = dispatcher; - this.mode = change_detection_util_1.ChangeDetectionUtil.changeDetectionMode(this.strategy); - this.context = context; - this.locals = locals; - this.pipes = pipes; - this.hydrateDirectives(dispatcher); - this.state = constants_1.ChangeDetectorState.NeverChecked; - }; - AbstractChangeDetector.prototype.hydrateDirectives = function(dispatcher) {}; - AbstractChangeDetector.prototype.dehydrate = function() { - this.dehydrateDirectives(true); - this._unsubscribeFromOutputs(); - this.dispatcher = null; - this.context = null; - this.locals = null; - this.pipes = null; - }; - AbstractChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) {}; - AbstractChangeDetector.prototype.hydrated = function() { - return lang_1.isPresent(this.context); - }; - AbstractChangeDetector.prototype.destroyRecursive = function() { - this.dispatcher.notifyOnDestroy(); - this.dehydrate(); - var children = this.contentChildren; - for (var i = 0; i < children.length; i++) { - children[i].destroyRecursive(); - } - children = this.viewChildren; - for (var i = 0; i < children.length; i++) { - children[i].destroyRecursive(); - } - }; - AbstractChangeDetector.prototype.afterContentLifecycleCallbacks = function() { - this.dispatcher.notifyAfterContentChecked(); - this.afterContentLifecycleCallbacksInternal(); - }; - AbstractChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() {}; - AbstractChangeDetector.prototype.afterViewLifecycleCallbacks = function() { - this.dispatcher.notifyAfterViewChecked(); - this.afterViewLifecycleCallbacksInternal(); - }; - AbstractChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() {}; - AbstractChangeDetector.prototype._detectChangesContentChildren = function(throwOnChange) { - var c = this.contentChildren; - for (var i = 0; i < c.length; ++i) { - c[i].runDetectChanges(throwOnChange); - } - }; - AbstractChangeDetector.prototype._detectChangesInViewChildren = function(throwOnChange) { - var c = this.viewChildren; - for (var i = 0; i < c.length; ++i) { - c[i].runDetectChanges(throwOnChange); - } - }; - AbstractChangeDetector.prototype.markAsCheckOnce = function() { - this.mode = constants_1.ChangeDetectionStrategy.CheckOnce; - }; - AbstractChangeDetector.prototype.markPathToRootAsCheckOnce = function() { - var c = this; - while (lang_1.isPresent(c) && c.mode !== constants_1.ChangeDetectionStrategy.Detached) { - if (c.mode === constants_1.ChangeDetectionStrategy.Checked) - c.mode = constants_1.ChangeDetectionStrategy.CheckOnce; - c = c.parent; - } - }; - AbstractChangeDetector.prototype._unsubscribeFromOutputs = function() { - if (lang_1.isPresent(this.outputSubscriptions)) { - for (var i = 0; i < this.outputSubscriptions.length; ++i) { - async_1.ObservableWrapper.dispose(this.outputSubscriptions[i]); - this.outputSubscriptions[i] = null; - } - } - }; - AbstractChangeDetector.prototype.getDirectiveFor = function(directives, index) { - return directives.getDirectiveFor(this.directiveIndices[index]); - }; - AbstractChangeDetector.prototype.getDetectorFor = function(directives, index) { - return directives.getDetectorFor(this.directiveIndices[index]); - }; - AbstractChangeDetector.prototype.notifyDispatcher = function(value) { - this.dispatcher.notifyOnBinding(this._currentBinding(), value); - }; - AbstractChangeDetector.prototype.logBindingUpdate = function(value) { - this.dispatcher.logBindingUpdate(this._currentBinding(), value); - }; - AbstractChangeDetector.prototype.addChange = function(changes, oldValue, newValue) { - if (lang_1.isBlank(changes)) { - changes = {}; - } - changes[this._currentBinding().name] = change_detection_util_1.ChangeDetectionUtil.simpleChange(oldValue, newValue); - return changes; - }; - AbstractChangeDetector.prototype._throwError = function(exception, stack) { - var error; - try { - var c = this.dispatcher.getDebugContext(null, this._currentBinding().elementIndex, null); - var context = lang_1.isPresent(c) ? new _Context(c.element, c.componentElement, c.context, c.locals, c.injector, this._currentBinding().debug) : null; - error = new exceptions_1.ChangeDetectionError(this._currentBinding().debug, exception, stack, context); - } catch (e) { - error = new exceptions_1.ChangeDetectionError(null, exception, stack, null); - } - throw error; - }; - AbstractChangeDetector.prototype.throwOnChangeError = function(oldValue, newValue) { - throw new exceptions_1.ExpressionChangedAfterItHasBeenCheckedException(this._currentBinding().debug, oldValue, newValue, null); - }; - AbstractChangeDetector.prototype.throwDehydratedError = function(detail) { - throw new exceptions_1.DehydratedException(detail); - }; - AbstractChangeDetector.prototype._currentBinding = function() { - return this.bindingTargets[this.propertyBindingIndex]; - }; - return AbstractChangeDetector; - }()); - exports.AbstractChangeDetector = AbstractChangeDetector; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/change_detection_jit_generator", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/proto_record", "angular2/src/core/change_detection/codegen_name_util", "angular2/src/core/change_detection/codegen_logic_util", "angular2/src/core/change_detection/codegen_facade", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); - var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); - var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); - var codegen_name_util_1 = require("angular2/src/core/change_detection/codegen_name_util"); - var codegen_logic_util_1 = require("angular2/src/core/change_detection/codegen_logic_util"); - var codegen_facade_1 = require("angular2/src/core/change_detection/codegen_facade"); - var constants_1 = require("angular2/src/core/change_detection/constants"); - var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); - var IS_CHANGED_LOCAL = "isChanged"; - var CHANGES_LOCAL = "changes"; - var ChangeDetectorJITGenerator = (function() { - function ChangeDetectorJITGenerator(definition, changeDetectionUtilVarName, abstractChangeDetectorVarName, changeDetectorStateVarName) { - this.changeDetectionUtilVarName = changeDetectionUtilVarName; - this.abstractChangeDetectorVarName = abstractChangeDetectorVarName; - this.changeDetectorStateVarName = changeDetectorStateVarName; - var propertyBindingRecords = proto_change_detector_1.createPropertyRecords(definition); - var eventBindingRecords = proto_change_detector_1.createEventRecords(definition); - var propertyBindingTargets = definition.bindingRecords.map(function(b) { - return b.target; - }); - this.id = definition.id; - this.changeDetectionStrategy = definition.strategy; - this.genConfig = definition.genConfig; - this.records = propertyBindingRecords; - this.propertyBindingTargets = propertyBindingTargets; - this.eventBindings = eventBindingRecords; - this.directiveRecords = definition.directiveRecords; - this._names = new codegen_name_util_1.CodegenNameUtil(this.records, this.eventBindings, this.directiveRecords, this.changeDetectionUtilVarName); - this._logic = new codegen_logic_util_1.CodegenLogicUtil(this._names, this.changeDetectionUtilVarName, this.changeDetectorStateVarName); - this.typeName = codegen_name_util_1.sanitizeName("ChangeDetector_" + this.id); - } - ChangeDetectorJITGenerator.prototype.generate = function() { - var factorySource = "\n " + this.generateSource() + "\n return function() {\n return new " + this.typeName + "();\n }\n "; - return new Function(this.abstractChangeDetectorVarName, this.changeDetectionUtilVarName, this.changeDetectorStateVarName, factorySource)(abstract_change_detector_1.AbstractChangeDetector, change_detection_util_1.ChangeDetectionUtil, constants_1.ChangeDetectorState); - }; - ChangeDetectorJITGenerator.prototype.generateSource = function() { - return "\n var " + this.typeName + " = function " + this.typeName + "() {\n " + this.abstractChangeDetectorVarName + ".call(\n this, " + JSON.stringify(this.id) + ", " + this.records.length + ",\n " + this.typeName + ".gen_propertyBindingTargets, " + this.typeName + ".gen_directiveIndices,\n " + codegen_facade_1.codify(this.changeDetectionStrategy) + ");\n this.dehydrateDirectives(false);\n }\n\n " + this.typeName + ".prototype = Object.create(" + this.abstractChangeDetectorVarName + ".prototype);\n\n " + this.typeName + ".prototype.detectChangesInRecordsInternal = function(throwOnChange) {\n " + this._names.genInitLocals() + "\n var " + IS_CHANGED_LOCAL + " = false;\n var " + CHANGES_LOCAL + " = null;\n\n " + this._genAllRecords(this.records) + "\n }\n\n " + this._maybeGenHandleEventInternal() + "\n\n " + this._maybeGenAfterContentLifecycleCallbacks() + "\n\n " + this._maybeGenAfterViewLifecycleCallbacks() + "\n\n " + this._maybeGenHydrateDirectives() + "\n\n " + this._maybeGenDehydrateDirectives() + "\n\n " + this._genPropertyBindingTargets() + "\n\n " + this._genDirectiveIndices() + "\n "; - }; - ChangeDetectorJITGenerator.prototype._genPropertyBindingTargets = function() { - var targets = this._logic.genPropertyBindingTargets(this.propertyBindingTargets, this.genConfig.genDebugInfo); - return this.typeName + ".gen_propertyBindingTargets = " + targets + ";"; - }; - ChangeDetectorJITGenerator.prototype._genDirectiveIndices = function() { - var indices = this._logic.genDirectiveIndices(this.directiveRecords); - return this.typeName + ".gen_directiveIndices = " + indices + ";"; - }; - ChangeDetectorJITGenerator.prototype._maybeGenHandleEventInternal = function() { - var _this = this; - if (this.eventBindings.length > 0) { - var handlers = this.eventBindings.map(function(eb) { - return _this._genEventBinding(eb); - }).join("\n"); - return "\n " + this.typeName + ".prototype.handleEventInternal = function(eventName, elIndex, locals) {\n var " + this._names.getPreventDefaultAccesor() + " = false;\n " + this._names.genInitEventLocals() + "\n " + handlers + "\n return " + this._names.getPreventDefaultAccesor() + ";\n }\n "; - } else { - return ''; - } - }; - ChangeDetectorJITGenerator.prototype._genEventBinding = function(eb) { - var _this = this; - var codes = []; - this._endOfBlockIdxs = []; - collection_1.ListWrapper.forEachWithIndex(eb.records, function(r, i) { - var code; - if (r.isConditionalSkipRecord()) { - code = _this._genConditionalSkip(r, _this._names.getEventLocalName(eb, i)); - } else if (r.isUnconditionalSkipRecord()) { - code = _this._genUnconditionalSkip(r); - } else { - code = _this._genEventBindingEval(eb, r); - } - code += _this._genEndOfSkipBlock(i); - codes.push(code); - }); - return "\n if (eventName === \"" + eb.eventName + "\" && elIndex === " + eb.elIndex + ") {\n " + codes.join("\n") + "\n }"; - }; - ChangeDetectorJITGenerator.prototype._genEventBindingEval = function(eb, r) { - if (r.lastInBinding) { - var evalRecord = this._logic.genEventBindingEvalValue(eb, r); - var markPath = this._genMarkPathToRootAsCheckOnce(r); - var prevDefault = this._genUpdatePreventDefault(eb, r); - return markPath + "\n" + evalRecord + "\n" + prevDefault; - } else { - return this._logic.genEventBindingEvalValue(eb, r); - } - }; - ChangeDetectorJITGenerator.prototype._genMarkPathToRootAsCheckOnce = function(r) { - var br = r.bindingRecord; - if (br.isDefaultChangeDetection()) { - return ""; - } else { - return this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markPathToRootAsCheckOnce();"; - } - }; - ChangeDetectorJITGenerator.prototype._genUpdatePreventDefault = function(eb, r) { - var local = this._names.getEventLocalName(eb, r.selfIndex); - return "if (" + local + " === false) { " + this._names.getPreventDefaultAccesor() + " = true};"; - }; - ChangeDetectorJITGenerator.prototype._maybeGenDehydrateDirectives = function() { - var destroyPipesCode = this._names.genPipeOnDestroy(); - var destroyDirectivesCode = this._logic.genDirectivesOnDestroy(this.directiveRecords); - var dehydrateFieldsCode = this._names.genDehydrateFields(); - if (!destroyPipesCode && !destroyDirectivesCode && !dehydrateFieldsCode) - return ''; - return this.typeName + ".prototype.dehydrateDirectives = function(destroyPipes) {\n if (destroyPipes) {\n " + destroyPipesCode + "\n " + destroyDirectivesCode + "\n }\n " + dehydrateFieldsCode + "\n }"; - }; - ChangeDetectorJITGenerator.prototype._maybeGenHydrateDirectives = function() { - var hydrateDirectivesCode = this._logic.genHydrateDirectives(this.directiveRecords); - var hydrateDetectorsCode = this._logic.genHydrateDetectors(this.directiveRecords); - if (!hydrateDirectivesCode && !hydrateDetectorsCode) - return ''; - return this.typeName + ".prototype.hydrateDirectives = function(directives) {\n " + hydrateDirectivesCode + "\n " + hydrateDetectorsCode + "\n }"; - }; - ChangeDetectorJITGenerator.prototype._maybeGenAfterContentLifecycleCallbacks = function() { - var notifications = this._logic.genContentLifecycleCallbacks(this.directiveRecords); - if (notifications.length > 0) { - var directiveNotifications = notifications.join("\n"); - return "\n " + this.typeName + ".prototype.afterContentLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; - } else { - return ''; - } - }; - ChangeDetectorJITGenerator.prototype._maybeGenAfterViewLifecycleCallbacks = function() { - var notifications = this._logic.genViewLifecycleCallbacks(this.directiveRecords); - if (notifications.length > 0) { - var directiveNotifications = notifications.join("\n"); - return "\n " + this.typeName + ".prototype.afterViewLifecycleCallbacksInternal = function() {\n " + directiveNotifications + "\n }\n "; - } else { - return ''; - } - }; - ChangeDetectorJITGenerator.prototype._genAllRecords = function(rs) { - var codes = []; - this._endOfBlockIdxs = []; - for (var i = 0; i < rs.length; i++) { - var code = void 0; - var r = rs[i]; - if (r.isLifeCycleRecord()) { - code = this._genDirectiveLifecycle(r); - } else if (r.isPipeRecord()) { - code = this._genPipeCheck(r); - } else if (r.isConditionalSkipRecord()) { - code = this._genConditionalSkip(r, this._names.getLocalName(r.contextIndex)); - } else if (r.isUnconditionalSkipRecord()) { - code = this._genUnconditionalSkip(r); - } else { - code = this._genReferenceCheck(r); - } - code = "\n " + this._maybeFirstInBinding(r) + "\n " + code + "\n " + this._maybeGenLastInDirective(r) + "\n " + this._genEndOfSkipBlock(i) + "\n "; - codes.push(code); - } - return codes.join("\n"); - }; - ChangeDetectorJITGenerator.prototype._genConditionalSkip = function(r, condition) { - var maybeNegate = r.mode === proto_record_1.RecordType.SkipRecordsIf ? '!' : ''; - this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); - return "if (" + maybeNegate + condition + ") {"; - }; - ChangeDetectorJITGenerator.prototype._genUnconditionalSkip = function(r) { - this._endOfBlockIdxs.pop(); - this._endOfBlockIdxs.push(r.fixedArgs[0] - 1); - return "} else {"; - }; - ChangeDetectorJITGenerator.prototype._genEndOfSkipBlock = function(protoIndex) { - if (!collection_1.ListWrapper.isEmpty(this._endOfBlockIdxs)) { - var endOfBlock = collection_1.ListWrapper.last(this._endOfBlockIdxs); - if (protoIndex === endOfBlock) { - this._endOfBlockIdxs.pop(); - return '}'; - } - } - return ''; - }; - ChangeDetectorJITGenerator.prototype._genDirectiveLifecycle = function(r) { - if (r.name === "DoCheck") { - return this._genOnCheck(r); - } else if (r.name === "OnInit") { - return this._genOnInit(r); - } else if (r.name === "OnChanges") { - return this._genOnChange(r); - } else { - throw new exceptions_1.BaseException("Unknown lifecycle event '" + r.name + "'"); - } - }; - ChangeDetectorJITGenerator.prototype._genPipeCheck = function(r) { - var _this = this; - var context = this._names.getLocalName(r.contextIndex); - var argString = r.args.map(function(arg) { - return _this._names.getLocalName(arg); - }).join(", "); - var oldValue = this._names.getFieldName(r.selfIndex); - var newValue = this._names.getLocalName(r.selfIndex); - var pipe = this._names.getPipeName(r.selfIndex); - var pipeName = r.name; - var init = "\n if (" + pipe + " === " + this.changeDetectionUtilVarName + ".uninitialized) {\n " + pipe + " = " + this._names.getPipesAccessorName() + ".get('" + pipeName + "');\n }\n "; - var read = newValue + " = " + pipe + ".pipe.transform(" + context + ", [" + argString + "]);"; - var contexOrArgCheck = r.args.map(function(a) { - return _this._names.getChangeName(a); - }); - contexOrArgCheck.push(this._names.getChangeName(r.contextIndex)); - var condition = "!" + pipe + ".pure || (" + contexOrArgCheck.join(" || ") + ")"; - var check = "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + newValue + " = " + this.changeDetectionUtilVarName + ".unwrapValue(" + newValue + ")\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; - var genCode = r.shouldBeChecked() ? "" + read + check : read; - if (r.isUsedByOtherRecord()) { - return init + " if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; - } else { - return init + " if (" + condition + ") { " + genCode + " }"; - } - }; - ChangeDetectorJITGenerator.prototype._genReferenceCheck = function(r) { - var _this = this; - var oldValue = this._names.getFieldName(r.selfIndex); - var newValue = this._names.getLocalName(r.selfIndex); - var read = "\n " + this._logic.genPropertyBindingEvalValue(r) + "\n "; - var check = "\n " + this._genThrowOnChangeCheck(oldValue, newValue) + "\n if (" + this.changeDetectionUtilVarName + ".looseNotIdentical(" + oldValue + ", " + newValue + ")) {\n " + this._genChangeMarker(r) + "\n " + this._genUpdateDirectiveOrElement(r) + "\n " + this._genAddToChanges(r) + "\n " + oldValue + " = " + newValue + ";\n }\n "; - var genCode = r.shouldBeChecked() ? "" + read + check : read; - if (r.isPureFunction()) { - var condition = r.args.map(function(a) { - return _this._names.getChangeName(a); - }).join(" || "); - if (r.isUsedByOtherRecord()) { - return "if (" + condition + ") { " + genCode + " } else { " + newValue + " = " + oldValue + "; }"; - } else { - return "if (" + condition + ") { " + genCode + " }"; - } - } else { - return genCode; - } - }; - ChangeDetectorJITGenerator.prototype._genChangeMarker = function(r) { - return r.argumentToPureFunction ? this._names.getChangeName(r.selfIndex) + " = true" : ""; - }; - ChangeDetectorJITGenerator.prototype._genUpdateDirectiveOrElement = function(r) { - if (!r.lastInBinding) - return ""; - var newValue = this._names.getLocalName(r.selfIndex); - var notifyDebug = this.genConfig.logBindingUpdate ? "this.logBindingUpdate(" + newValue + ");" : ""; - var br = r.bindingRecord; - if (br.target.isDirective()) { - var directiveProperty = this._names.getDirectiveName(br.directiveRecord.directiveIndex) + "." + br.target.name; - return "\n " + directiveProperty + " = " + newValue + ";\n " + notifyDebug + "\n " + IS_CHANGED_LOCAL + " = true;\n "; - } else { - return "\n this.notifyDispatcher(" + newValue + ");\n " + notifyDebug + "\n "; - } - }; - ChangeDetectorJITGenerator.prototype._genThrowOnChangeCheck = function(oldValue, newValue) { - if (lang_1.assertionsEnabled()) { - return "\n if (throwOnChange && !" + this.changeDetectionUtilVarName + ".devModeEqual(" + oldValue + ", " + newValue + ")) {\n this.throwOnChangeError(" + oldValue + ", " + newValue + ");\n }\n "; - } else { - return ''; - } - }; - ChangeDetectorJITGenerator.prototype._genAddToChanges = function(r) { - var newValue = this._names.getLocalName(r.selfIndex); - var oldValue = this._names.getFieldName(r.selfIndex); - if (!r.bindingRecord.callOnChanges()) - return ""; - return CHANGES_LOCAL + " = this.addChange(" + CHANGES_LOCAL + ", " + oldValue + ", " + newValue + ");"; - }; - ChangeDetectorJITGenerator.prototype._maybeFirstInBinding = function(r) { - var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this.records, r.selfIndex - 1); - var firstInBinding = lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; - return firstInBinding && !r.bindingRecord.isDirectiveLifecycle() ? this._names.getPropertyBindingIndex() + " = " + r.propertyBindingIndex + ";" : ''; - }; - ChangeDetectorJITGenerator.prototype._maybeGenLastInDirective = function(r) { - if (!r.lastInDirective) - return ""; - return "\n " + CHANGES_LOCAL + " = null;\n " + this._genNotifyOnPushDetectors(r) + "\n " + IS_CHANGED_LOCAL + " = false;\n "; - }; - ChangeDetectorJITGenerator.prototype._genOnCheck = function(r) { - var br = r.bindingRecord; - return "if (!throwOnChange) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".ngDoCheck();"; - }; - ChangeDetectorJITGenerator.prototype._genOnInit = function(r) { - var br = r.bindingRecord; - return "if (!throwOnChange && " + this._names.getStateName() + " === " + this.changeDetectorStateVarName + ".NeverChecked) " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".ngOnInit();"; - }; - ChangeDetectorJITGenerator.prototype._genOnChange = function(r) { - var br = r.bindingRecord; - return "if (!throwOnChange && " + CHANGES_LOCAL + ") " + this._names.getDirectiveName(br.directiveRecord.directiveIndex) + ".ngOnChanges(" + CHANGES_LOCAL + ");"; - }; - ChangeDetectorJITGenerator.prototype._genNotifyOnPushDetectors = function(r) { - var br = r.bindingRecord; - if (!r.lastInDirective || br.isDefaultChangeDetection()) - return ""; - var retVal = "\n if(" + IS_CHANGED_LOCAL + ") {\n " + this._names.getDetectorName(br.directiveRecord.directiveIndex) + ".markAsCheckOnce();\n }\n "; - return retVal; - }; - return ChangeDetectorJITGenerator; - }()); - exports.ChangeDetectorJITGenerator = ChangeDetectorJITGenerator; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/view", ["angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/change_detection/interfaces", "angular2/src/core/linker/element", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/render/api", "angular2/src/core/linker/view_ref", "angular2/src/core/pipes/pipes", "angular2/src/core/render/util", "angular2/src/core/change_detection/interfaces", "angular2/src/core/pipes/pipes", "angular2/src/core/linker/view_type"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var collection_1 = require("angular2/src/facade/collection"); - var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); - var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); - var element_1 = require("angular2/src/core/linker/element"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var api_1 = require("angular2/src/core/render/api"); - var view_ref_1 = require("angular2/src/core/linker/view_ref"); - var pipes_1 = require("angular2/src/core/pipes/pipes"); - var util_1 = require("angular2/src/core/render/util"); - var interfaces_2 = require("angular2/src/core/change_detection/interfaces"); - exports.DebugContext = interfaces_2.DebugContext; - var pipes_2 = require("angular2/src/core/pipes/pipes"); - var view_type_1 = require("angular2/src/core/linker/view_type"); - var REFLECT_PREFIX = 'ng-reflect-'; - var EMPTY_CONTEXT = lang_1.CONST_EXPR(new Object()); - var AppView = (function() { - function AppView(proto, renderer, viewManager, projectableNodes, containerAppElement, imperativelyCreatedProviders, rootInjector, changeDetector) { - this.proto = proto; - this.renderer = renderer; - this.viewManager = viewManager; - this.projectableNodes = projectableNodes; - this.containerAppElement = containerAppElement; - this.changeDetector = changeDetector; - this.context = null; - this.destroyed = false; - this.ref = new view_ref_1.ViewRef_(this); - var injectorWithHostBoundary = element_1.AppElement.getViewParentInjector(this.proto.type, containerAppElement, imperativelyCreatedProviders, rootInjector); - this.parentInjector = injectorWithHostBoundary.injector; - this.hostInjectorBoundary = injectorWithHostBoundary.hostInjectorBoundary; - var pipes; - var context; - switch (proto.type) { - case view_type_1.ViewType.COMPONENT: - pipes = new pipes_2.Pipes(proto.protoPipes, containerAppElement.getInjector()); - context = containerAppElement.getComponent(); - break; - case view_type_1.ViewType.EMBEDDED: - pipes = containerAppElement.parentView.pipes; - context = containerAppElement.parentView.context; - break; - case view_type_1.ViewType.HOST: - pipes = null; - context = EMPTY_CONTEXT; - break; - } - this.pipes = pipes; - this.context = context; - } - AppView.prototype.init = function(rootNodesOrAppElements, allNodes, disposables, appElements) { - this.rootNodesOrAppElements = rootNodesOrAppElements; - this.allNodes = allNodes; - this.disposables = disposables; - this.appElements = appElements; - var localsMap = new collection_1.Map(); - collection_1.StringMapWrapper.forEach(this.proto.templateVariableBindings, function(templateName, _) { - localsMap.set(templateName, null); - }); - for (var i = 0; i < appElements.length; i++) { - var appEl = appElements[i]; - var providerTokens = []; - if (lang_1.isPresent(appEl.proto.protoInjector)) { - for (var j = 0; j < appEl.proto.protoInjector.numberOfProviders; j++) { - providerTokens.push(appEl.proto.protoInjector.getProviderAtIndex(j).key.token); - } - } - collection_1.StringMapWrapper.forEach(appEl.proto.directiveVariableBindings, function(directiveIndex, name) { - if (lang_1.isBlank(directiveIndex)) { - localsMap.set(name, appEl.nativeElement); - } else { - localsMap.set(name, appEl.getDirectiveAtIndex(directiveIndex)); - } - }); - this.renderer.setElementDebugInfo(appEl.nativeElement, new api_1.RenderDebugInfo(appEl.getInjector(), appEl.getComponent(), providerTokens, localsMap)); - } - var parentLocals = null; - if (this.proto.type !== view_type_1.ViewType.COMPONENT) { - parentLocals = lang_1.isPresent(this.containerAppElement) ? this.containerAppElement.parentView.locals : null; - } - if (this.proto.type === view_type_1.ViewType.COMPONENT) { - this.containerAppElement.attachComponentView(this); - this.containerAppElement.parentView.changeDetector.addViewChild(this.changeDetector); - } - this.locals = new change_detection_1.Locals(parentLocals, localsMap); - this.changeDetector.hydrate(this.context, this.locals, this, this.pipes); - this.viewManager.onViewCreated(this); - }; - AppView.prototype.destroy = function() { - if (this.destroyed) { - throw new exceptions_1.BaseException('This view has already been destroyed!'); - } - this.changeDetector.destroyRecursive(); - }; - AppView.prototype.notifyOnDestroy = function() { - this.destroyed = true; - var hostElement = this.proto.type === view_type_1.ViewType.COMPONENT ? this.containerAppElement.nativeElement : null; - this.renderer.destroyView(hostElement, this.allNodes); - for (var i = 0; i < this.disposables.length; i++) { - this.disposables[i](); - } - this.viewManager.onViewDestroyed(this); - }; - Object.defineProperty(AppView.prototype, "changeDetectorRef", { - get: function() { - return this.changeDetector.ref; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AppView.prototype, "flatRootNodes", { - get: function() { - return flattenNestedViewRenderNodes(this.rootNodesOrAppElements); - }, - enumerable: true, - configurable: true - }); - AppView.prototype.hasLocal = function(contextName) { - return collection_1.StringMapWrapper.contains(this.proto.templateVariableBindings, contextName); - }; - AppView.prototype.setLocal = function(contextName, value) { - if (!this.hasLocal(contextName)) { - return ; - } - var templateName = this.proto.templateVariableBindings[contextName]; - this.locals.set(templateName, value); - }; - AppView.prototype.notifyOnBinding = function(b, currentValue) { - if (b.isTextNode()) { - this.renderer.setText(this.allNodes[b.elementIndex], currentValue); - } else { - var nativeElement = this.appElements[b.elementIndex].nativeElement; - if (b.isElementProperty()) { - this.renderer.setElementProperty(nativeElement, b.name, currentValue); - } else if (b.isElementAttribute()) { - this.renderer.setElementAttribute(nativeElement, b.name, lang_1.isPresent(currentValue) ? "" + currentValue : null); - } else if (b.isElementClass()) { - this.renderer.setElementClass(nativeElement, b.name, currentValue); - } else if (b.isElementStyle()) { - var unit = lang_1.isPresent(b.unit) ? b.unit : ''; - this.renderer.setElementStyle(nativeElement, b.name, lang_1.isPresent(currentValue) ? "" + currentValue + unit : null); - } else { - throw new exceptions_1.BaseException('Unsupported directive record'); - } - } - }; - AppView.prototype.logBindingUpdate = function(b, value) { - if (b.isDirective() || b.isElementProperty()) { - var nativeElement = this.appElements[b.elementIndex].nativeElement; - this.renderer.setBindingDebugInfo(nativeElement, "" + REFLECT_PREFIX + util_1.camelCaseToDashCase(b.name), "" + value); - } - }; - AppView.prototype.notifyAfterContentChecked = function() { - var count = this.appElements.length; - for (var i = count - 1; i >= 0; i--) { - this.appElements[i].ngAfterContentChecked(); - } - }; - AppView.prototype.notifyAfterViewChecked = function() { - var count = this.appElements.length; - for (var i = count - 1; i >= 0; i--) { - this.appElements[i].ngAfterViewChecked(); - } - }; - AppView.prototype.getDebugContext = function(appElement, elementIndex, directiveIndex) { - try { - if (lang_1.isBlank(appElement) && elementIndex < this.appElements.length) { - appElement = this.appElements[elementIndex]; - } - var container = this.containerAppElement; - var element = lang_1.isPresent(appElement) ? appElement.nativeElement : null; - var componentElement = lang_1.isPresent(container) ? container.nativeElement : null; - var directive = lang_1.isPresent(directiveIndex) ? appElement.getDirectiveAtIndex(directiveIndex) : null; - var injector = lang_1.isPresent(appElement) ? appElement.getInjector() : null; - return new interfaces_1.DebugContext(element, componentElement, directive, this.context, _localsToStringMap(this.locals), injector); - } catch (e) { - return null; - } - }; - AppView.prototype.getDirectiveFor = function(directive) { - return this.appElements[directive.elementIndex].getDirectiveAtIndex(directive.directiveIndex); - }; - AppView.prototype.getDetectorFor = function(directive) { - var componentView = this.appElements[directive.elementIndex].componentView; - return lang_1.isPresent(componentView) ? componentView.changeDetector : null; - }; - AppView.prototype.triggerEventHandlers = function(eventName, eventObj, boundElementIndex) { - return this.changeDetector.handleEvent(eventName, boundElementIndex, eventObj); - }; - return AppView; - }()); - exports.AppView = AppView; - function _localsToStringMap(locals) { - var res = {}; - var c = locals; - while (lang_1.isPresent(c)) { - res = collection_1.StringMapWrapper.merge(res, collection_1.MapWrapper.toStringMap(c.current)); - c = c.parent; - } - return res; - } - var AppProtoView = (function() { - function AppProtoView(type, protoPipes, templateVariableBindings) { - this.type = type; - this.protoPipes = protoPipes; - this.templateVariableBindings = templateVariableBindings; - } - AppProtoView.create = function(metadataCache, type, pipes, templateVariableBindings) { - var protoPipes = null; - if (lang_1.isPresent(pipes) && pipes.length > 0) { - var boundPipes = collection_1.ListWrapper.createFixedSize(pipes.length); - for (var i = 0; i < pipes.length; i++) { - boundPipes[i] = metadataCache.getResolvedPipeMetadata(pipes[i]); - } - protoPipes = pipes_1.ProtoPipes.fromProviders(boundPipes); - } - return new AppProtoView(type, protoPipes, templateVariableBindings); - }; - return AppProtoView; - }()); - exports.AppProtoView = AppProtoView; - var HostViewFactory = (function() { - function HostViewFactory(selector, viewFactory) { - this.selector = selector; - this.viewFactory = viewFactory; - } - HostViewFactory = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Function])], HostViewFactory); - return HostViewFactory; - }()); - exports.HostViewFactory = HostViewFactory; - function flattenNestedViewRenderNodes(nodes) { - return _flattenNestedViewRenderNodes(nodes, []); - } - exports.flattenNestedViewRenderNodes = flattenNestedViewRenderNodes; - function _flattenNestedViewRenderNodes(nodes, renderNodes) { - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - if (node instanceof element_1.AppElement) { - var appEl = node; - renderNodes.push(appEl.nativeElement); - if (lang_1.isPresent(appEl.nestedViews)) { - for (var k = 0; k < appEl.nestedViews.length; k++) { - _flattenNestedViewRenderNodes(appEl.nestedViews[k].rootNodesOrAppElements, renderNodes); - } - } - } else { - renderNodes.push(node); - } - } - return renderNodes; - } - function findLastRenderNode(node) { - var lastNode; - if (node instanceof element_1.AppElement) { - var appEl = node; - lastNode = appEl.nativeElement; - if (lang_1.isPresent(appEl.nestedViews)) { - for (var i = appEl.nestedViews.length - 1; i >= 0; i--) { - var nestedView = appEl.nestedViews[i]; - if (nestedView.rootNodesOrAppElements.length > 0) { - lastNode = findLastRenderNode(nestedView.rootNodesOrAppElements[nestedView.rootNodesOrAppElements.length - 1]); - } - } - } - } else { - lastNode = node; - } - return lastNode; - } - exports.findLastRenderNode = findLastRenderNode; - function checkSlotCount(componentName, expectedSlotCount, projectableNodes) { - var givenSlotCount = lang_1.isPresent(projectableNodes) ? projectableNodes.length : 0; - if (givenSlotCount < expectedSlotCount) { - throw new exceptions_1.BaseException(("The component " + componentName + " has " + expectedSlotCount + " elements,") + (" but only " + givenSlotCount + " slots were provided.")); - } - } - exports.checkSlotCount = checkSlotCount; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/application_common_providers", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/resolved_metadata_cache", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_manager", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/linker/compiler", "angular2/src/core/linker/compiler", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/core/linker/dynamic_component_loader"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var di_1 = require("angular2/src/core/di"); - var application_tokens_1 = require("angular2/src/core/application_tokens"); - var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); - var resolved_metadata_cache_1 = require("angular2/src/core/linker/resolved_metadata_cache"); - var view_manager_1 = require("angular2/src/core/linker/view_manager"); - var view_manager_2 = require("angular2/src/core/linker/view_manager"); - var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); - var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); - var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); - var compiler_1 = require("angular2/src/core/linker/compiler"); - var compiler_2 = require("angular2/src/core/linker/compiler"); - var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); - var dynamic_component_loader_2 = require("angular2/src/core/linker/dynamic_component_loader"); - exports.APPLICATION_COMMON_PROVIDERS = lang_1.CONST_EXPR([new di_1.Provider(compiler_1.Compiler, {useClass: compiler_2.Compiler_}), application_tokens_1.APP_ID_RANDOM_PROVIDER, resolved_metadata_cache_1.ResolvedMetadataCache, new di_1.Provider(view_manager_1.AppViewManager, {useClass: view_manager_2.AppViewManager_}), view_resolver_1.ViewResolver, new di_1.Provider(change_detection_1.IterableDiffers, {useValue: change_detection_1.defaultIterableDiffers}), new di_1.Provider(change_detection_1.KeyValueDiffers, {useValue: change_detection_1.defaultKeyValueDiffers}), directive_resolver_1.DirectiveResolver, pipe_resolver_1.PipeResolver, new di_1.Provider(dynamic_component_loader_1.DynamicComponentLoader, {useClass: dynamic_component_loader_2.DynamicComponentLoader_})]); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/di/provider", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/reflection/reflection", "angular2/src/core/di/key", "angular2/src/core/di/metadata", "angular2/src/core/di/exceptions", "angular2/src/core/di/forward_ref"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var reflection_1 = require("angular2/src/core/reflection/reflection"); - var key_1 = require("angular2/src/core/di/key"); - var metadata_1 = require("angular2/src/core/di/metadata"); - var exceptions_2 = require("angular2/src/core/di/exceptions"); - var forward_ref_1 = require("angular2/src/core/di/forward_ref"); - var Dependency = (function() { - function Dependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties) { - this.key = key; - this.optional = optional; - this.lowerBoundVisibility = lowerBoundVisibility; - this.upperBoundVisibility = upperBoundVisibility; - this.properties = properties; - } - Dependency.fromKey = function(key) { - return new Dependency(key, false, null, null, []); - }; - return Dependency; - }()); - exports.Dependency = Dependency; - var _EMPTY_LIST = lang_1.CONST_EXPR([]); - var Provider = (function() { - function Provider(token, _a) { - var useClass = _a.useClass, - useValue = _a.useValue, - useExisting = _a.useExisting, - useFactory = _a.useFactory, - deps = _a.deps, - multi = _a.multi; - this.token = token; - this.useClass = useClass; - this.useValue = useValue; - this.useExisting = useExisting; - this.useFactory = useFactory; - this.dependencies = deps; - this._multi = multi; - } - Object.defineProperty(Provider.prototype, "multi", { - get: function() { - return lang_1.normalizeBool(this._multi); - }, - enumerable: true, - configurable: true - }); - Provider = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Provider); - return Provider; - }()); - exports.Provider = Provider; - var Binding = (function(_super) { - __extends(Binding, _super); - function Binding(token, _a) { - var toClass = _a.toClass, - toValue = _a.toValue, - toAlias = _a.toAlias, - toFactory = _a.toFactory, - deps = _a.deps, - multi = _a.multi; - _super.call(this, token, { - useClass: toClass, - useValue: toValue, - useExisting: toAlias, - useFactory: toFactory, - deps: deps, - multi: multi - }); - } - Object.defineProperty(Binding.prototype, "toClass", { - get: function() { - return this.useClass; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Binding.prototype, "toAlias", { - get: function() { - return this.useExisting; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Binding.prototype, "toFactory", { - get: function() { - return this.useFactory; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Binding.prototype, "toValue", { - get: function() { - return this.useValue; - }, - enumerable: true, - configurable: true - }); - Binding = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object, Object])], Binding); - return Binding; - }(Provider)); - exports.Binding = Binding; - var ResolvedProvider_ = (function() { - function ResolvedProvider_(key, resolvedFactories, multiProvider) { - this.key = key; - this.resolvedFactories = resolvedFactories; - this.multiProvider = multiProvider; - } - Object.defineProperty(ResolvedProvider_.prototype, "resolvedFactory", { - get: function() { - return this.resolvedFactories[0]; - }, - enumerable: true, - configurable: true - }); - return ResolvedProvider_; - }()); - exports.ResolvedProvider_ = ResolvedProvider_; - var ResolvedFactory = (function() { - function ResolvedFactory(factory, dependencies) { - this.factory = factory; - this.dependencies = dependencies; - } - return ResolvedFactory; - }()); - exports.ResolvedFactory = ResolvedFactory; - function bind(token) { - return new ProviderBuilder(token); - } - exports.bind = bind; - function provide(token, _a) { - var useClass = _a.useClass, - useValue = _a.useValue, - useExisting = _a.useExisting, - useFactory = _a.useFactory, - deps = _a.deps, - multi = _a.multi; - return new Provider(token, { - useClass: useClass, - useValue: useValue, - useExisting: useExisting, - useFactory: useFactory, - deps: deps, - multi: multi - }); - } - exports.provide = provide; - var ProviderBuilder = (function() { - function ProviderBuilder(token) { - this.token = token; - } - ProviderBuilder.prototype.toClass = function(type) { - if (!lang_1.isType(type)) { - throw new exceptions_1.BaseException("Trying to create a class provider but \"" + lang_1.stringify(type) + "\" is not a class!"); - } - return new Provider(this.token, {useClass: type}); - }; - ProviderBuilder.prototype.toValue = function(value) { - return new Provider(this.token, {useValue: value}); - }; - ProviderBuilder.prototype.toAlias = function(aliasToken) { - if (lang_1.isBlank(aliasToken)) { - throw new exceptions_1.BaseException("Can not alias " + lang_1.stringify(this.token) + " to a blank value!"); - } - return new Provider(this.token, {useExisting: aliasToken}); - }; - ProviderBuilder.prototype.toFactory = function(factory, dependencies) { - if (!lang_1.isFunction(factory)) { - throw new exceptions_1.BaseException("Trying to create a factory provider but \"" + lang_1.stringify(factory) + "\" is not a function!"); - } - return new Provider(this.token, { - useFactory: factory, - deps: dependencies - }); - }; - return ProviderBuilder; - }()); - exports.ProviderBuilder = ProviderBuilder; - function resolveFactory(provider) { - var factoryFn; - var resolvedDeps; - if (lang_1.isPresent(provider.useClass)) { - var useClass = forward_ref_1.resolveForwardRef(provider.useClass); - factoryFn = reflection_1.reflector.factory(useClass); - resolvedDeps = _dependenciesFor(useClass); - } else if (lang_1.isPresent(provider.useExisting)) { - factoryFn = function(aliasInstance) { - return aliasInstance; - }; - resolvedDeps = [Dependency.fromKey(key_1.Key.get(provider.useExisting))]; - } else if (lang_1.isPresent(provider.useFactory)) { - factoryFn = provider.useFactory; - resolvedDeps = _constructDependencies(provider.useFactory, provider.dependencies); - } else { - factoryFn = function() { - return provider.useValue; - }; - resolvedDeps = _EMPTY_LIST; - } - return new ResolvedFactory(factoryFn, resolvedDeps); - } - exports.resolveFactory = resolveFactory; - function resolveProvider(provider) { - return new ResolvedProvider_(key_1.Key.get(provider.token), [resolveFactory(provider)], provider.multi); - } - exports.resolveProvider = resolveProvider; - function resolveProviders(providers) { - var normalized = _normalizeProviders(providers, []); - var resolved = normalized.map(resolveProvider); - return collection_1.MapWrapper.values(mergeResolvedProviders(resolved, new Map())); - } - exports.resolveProviders = resolveProviders; - function mergeResolvedProviders(providers, normalizedProvidersMap) { - for (var i = 0; i < providers.length; i++) { - var provider = providers[i]; - var existing = normalizedProvidersMap.get(provider.key.id); - if (lang_1.isPresent(existing)) { - if (provider.multiProvider !== existing.multiProvider) { - throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existing, provider); - } - if (provider.multiProvider) { - for (var j = 0; j < provider.resolvedFactories.length; j++) { - existing.resolvedFactories.push(provider.resolvedFactories[j]); - } - } else { - normalizedProvidersMap.set(provider.key.id, provider); - } - } else { - var resolvedProvider; - if (provider.multiProvider) { - resolvedProvider = new ResolvedProvider_(provider.key, collection_1.ListWrapper.clone(provider.resolvedFactories), provider.multiProvider); - } else { - resolvedProvider = provider; - } - normalizedProvidersMap.set(provider.key.id, resolvedProvider); - } - } - return normalizedProvidersMap; - } - exports.mergeResolvedProviders = mergeResolvedProviders; - function _normalizeProviders(providers, res) { - providers.forEach(function(b) { - if (b instanceof lang_1.Type) { - res.push(provide(b, {useClass: b})); - } else if (b instanceof Provider) { - res.push(b); - } else if (b instanceof Array) { - _normalizeProviders(b, res); - } else if (b instanceof ProviderBuilder) { - throw new exceptions_2.InvalidProviderError(b.token); - } else { - throw new exceptions_2.InvalidProviderError(b); - } - }); - return res; - } - function _constructDependencies(factoryFunction, dependencies) { - if (lang_1.isBlank(dependencies)) { - return _dependenciesFor(factoryFunction); - } else { - var params = dependencies.map(function(t) { - return [t]; - }); - return dependencies.map(function(t) { - return _extractToken(factoryFunction, t, params); - }); - } - } - function _dependenciesFor(typeOrFunc) { - var params = reflection_1.reflector.parameters(typeOrFunc); - if (lang_1.isBlank(params)) - return []; - if (params.some(lang_1.isBlank)) { - throw new exceptions_2.NoAnnotationError(typeOrFunc, params); - } - return params.map(function(p) { - return _extractToken(typeOrFunc, p, params); - }); - } - function _extractToken(typeOrFunc, metadata, params) { - var depProps = []; - var token = null; - var optional = false; - if (!lang_1.isArray(metadata)) { - if (metadata instanceof metadata_1.InjectMetadata) { - return _createDependency(metadata.token, optional, null, null, depProps); - } else { - return _createDependency(metadata, optional, null, null, depProps); - } - } - var lowerBoundVisibility = null; - var upperBoundVisibility = null; - for (var i = 0; i < metadata.length; ++i) { - var paramMetadata = metadata[i]; - if (paramMetadata instanceof lang_1.Type) { - token = paramMetadata; - } else if (paramMetadata instanceof metadata_1.InjectMetadata) { - token = paramMetadata.token; - } else if (paramMetadata instanceof metadata_1.OptionalMetadata) { - optional = true; - } else if (paramMetadata instanceof metadata_1.SelfMetadata) { - upperBoundVisibility = paramMetadata; - } else if (paramMetadata instanceof metadata_1.HostMetadata) { - upperBoundVisibility = paramMetadata; - } else if (paramMetadata instanceof metadata_1.SkipSelfMetadata) { - lowerBoundVisibility = paramMetadata; - } else if (paramMetadata instanceof metadata_1.DependencyMetadata) { - if (lang_1.isPresent(paramMetadata.token)) { - token = paramMetadata.token; - } - depProps.push(paramMetadata); - } - } - token = forward_ref_1.resolveForwardRef(token); - if (lang_1.isPresent(token)) { - return _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps); - } else { - throw new exceptions_2.NoAnnotationError(typeOrFunc, params); - } - } - function _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps) { - return new Dependency(key_1.Key.get(token), optional, lowerBoundVisibility, upperBoundVisibility, depProps); - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/animate/animation_builder", ["angular2/src/core/di", "angular2/src/animate/css_animation_builder", "angular2/src/animate/browser_details"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = require("angular2/src/core/di"); - var css_animation_builder_1 = require("angular2/src/animate/css_animation_builder"); - var browser_details_1 = require("angular2/src/animate/browser_details"); - var AnimationBuilder = (function() { - function AnimationBuilder(browserDetails) { - this.browserDetails = browserDetails; - } - AnimationBuilder.prototype.css = function() { - return new css_animation_builder_1.CssAnimationBuilder(this.browserDetails); - }; - AnimationBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [browser_details_1.BrowserDetails])], AnimationBuilder); - return AnimationBuilder; - }()); - exports.AnimationBuilder = AnimationBuilder; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/dynamic_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_record", "angular2/src/core/reflection/reflection", "angular2/src/facade/async"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); - var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); - var constants_1 = require("angular2/src/core/change_detection/constants"); - var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); - var reflection_1 = require("angular2/src/core/reflection/reflection"); - var async_1 = require("angular2/src/facade/async"); - var DynamicChangeDetector = (function(_super) { - __extends(DynamicChangeDetector, _super); - function DynamicChangeDetector(id, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy, _records, _eventBindings, _directiveRecords, _genConfig) { - _super.call(this, id, numberOfPropertyProtoRecords, propertyBindingTargets, directiveIndices, strategy); - this._records = _records; - this._eventBindings = _eventBindings; - this._directiveRecords = _directiveRecords; - this._genConfig = _genConfig; - var len = _records.length + 1; - this.values = collection_1.ListWrapper.createFixedSize(len); - this.localPipes = collection_1.ListWrapper.createFixedSize(len); - this.prevContexts = collection_1.ListWrapper.createFixedSize(len); - this.changes = collection_1.ListWrapper.createFixedSize(len); - this.dehydrateDirectives(false); - } - DynamicChangeDetector.prototype.handleEventInternal = function(eventName, elIndex, locals) { - var _this = this; - var preventDefault = false; - this._matchingEventBindings(eventName, elIndex).forEach(function(rec) { - var res = _this._processEventBinding(rec, locals); - if (res === false) { - preventDefault = true; - } - }); - return preventDefault; - }; - DynamicChangeDetector.prototype._processEventBinding = function(eb, locals) { - var values = collection_1.ListWrapper.createFixedSize(eb.records.length); - values[0] = this.values[0]; - for (var protoIdx = 0; protoIdx < eb.records.length; ++protoIdx) { - var proto = eb.records[protoIdx]; - if (proto.isSkipRecord()) { - protoIdx += this._computeSkipLength(protoIdx, proto, values); - } else { - if (proto.lastInBinding) { - this._markPathAsCheckOnce(proto); - } - var res = this._calculateCurrValue(proto, values, locals); - if (proto.lastInBinding) { - return res; - } else { - this._writeSelf(proto, res, values); - } - } - } - throw new exceptions_1.BaseException("Cannot be reached"); - }; - DynamicChangeDetector.prototype._computeSkipLength = function(protoIndex, proto, values) { - if (proto.mode === proto_record_1.RecordType.SkipRecords) { - return proto.fixedArgs[0] - protoIndex - 1; - } - if (proto.mode === proto_record_1.RecordType.SkipRecordsIf) { - var condition = this._readContext(proto, values); - return condition ? proto.fixedArgs[0] - protoIndex - 1 : 0; - } - if (proto.mode === proto_record_1.RecordType.SkipRecordsIfNot) { - var condition = this._readContext(proto, values); - return condition ? 0 : proto.fixedArgs[0] - protoIndex - 1; - } - throw new exceptions_1.BaseException("Cannot be reached"); - }; - DynamicChangeDetector.prototype._markPathAsCheckOnce = function(proto) { - if (!proto.bindingRecord.isDefaultChangeDetection()) { - var dir = proto.bindingRecord.directiveRecord; - this._getDetectorFor(dir.directiveIndex).markPathToRootAsCheckOnce(); - } - }; - DynamicChangeDetector.prototype._matchingEventBindings = function(eventName, elIndex) { - return this._eventBindings.filter(function(eb) { - return eb.eventName == eventName && eb.elIndex === elIndex; - }); - }; - DynamicChangeDetector.prototype.hydrateDirectives = function(dispatcher) { - var _this = this; - this.values[0] = this.context; - this.dispatcher = dispatcher; - this.outputSubscriptions = []; - for (var i = 0; i < this._directiveRecords.length; ++i) { - var r = this._directiveRecords[i]; - if (lang_1.isPresent(r.outputs)) { - r.outputs.forEach(function(output) { - var eventHandler = _this._createEventHandler(r.directiveIndex.elementIndex, output[1]); - var directive = _this._getDirectiveFor(r.directiveIndex); - var getter = reflection_1.reflector.getter(output[0]); - _this.outputSubscriptions.push(async_1.ObservableWrapper.subscribe(getter(directive), eventHandler)); - }); - } - } - }; - DynamicChangeDetector.prototype._createEventHandler = function(boundElementIndex, eventName) { - var _this = this; - return function(event) { - return _this.handleEvent(eventName, boundElementIndex, event); - }; - }; - DynamicChangeDetector.prototype.dehydrateDirectives = function(destroyPipes) { - if (destroyPipes) { - this._destroyPipes(); - this._destroyDirectives(); - } - this.values[0] = null; - collection_1.ListWrapper.fill(this.values, change_detection_util_1.ChangeDetectionUtil.uninitialized, 1); - collection_1.ListWrapper.fill(this.changes, false); - collection_1.ListWrapper.fill(this.localPipes, null); - collection_1.ListWrapper.fill(this.prevContexts, change_detection_util_1.ChangeDetectionUtil.uninitialized); - }; - DynamicChangeDetector.prototype._destroyPipes = function() { - for (var i = 0; i < this.localPipes.length; ++i) { - if (lang_1.isPresent(this.localPipes[i])) { - change_detection_util_1.ChangeDetectionUtil.callPipeOnDestroy(this.localPipes[i]); - } - } - }; - DynamicChangeDetector.prototype._destroyDirectives = function() { - for (var i = 0; i < this._directiveRecords.length; ++i) { - var record = this._directiveRecords[i]; - if (record.callOnDestroy) { - this._getDirectiveFor(record.directiveIndex).ngOnDestroy(); - } - } - }; - DynamicChangeDetector.prototype.checkNoChanges = function() { - this.runDetectChanges(true); - }; - DynamicChangeDetector.prototype.detectChangesInRecordsInternal = function(throwOnChange) { - var protos = this._records; - var changes = null; - var isChanged = false; - for (var protoIdx = 0; protoIdx < protos.length; ++protoIdx) { - var proto = protos[protoIdx]; - var bindingRecord = proto.bindingRecord; - var directiveRecord = bindingRecord.directiveRecord; - if (this._firstInBinding(proto)) { - this.propertyBindingIndex = proto.propertyBindingIndex; - } - if (proto.isLifeCycleRecord()) { - if (proto.name === "DoCheck" && !throwOnChange) { - this._getDirectiveFor(directiveRecord.directiveIndex).ngDoCheck(); - } else if (proto.name === "OnInit" && !throwOnChange && this.state == constants_1.ChangeDetectorState.NeverChecked) { - this._getDirectiveFor(directiveRecord.directiveIndex).ngOnInit(); - } else if (proto.name === "OnChanges" && lang_1.isPresent(changes) && !throwOnChange) { - this._getDirectiveFor(directiveRecord.directiveIndex).ngOnChanges(changes); - } - } else if (proto.isSkipRecord()) { - protoIdx += this._computeSkipLength(protoIdx, proto, this.values); - } else { - var change = this._check(proto, throwOnChange, this.values, this.locals); - if (lang_1.isPresent(change)) { - this._updateDirectiveOrElement(change, bindingRecord); - isChanged = true; - changes = this._addChange(bindingRecord, change, changes); - } - } - if (proto.lastInDirective) { - changes = null; - if (isChanged && !bindingRecord.isDefaultChangeDetection()) { - this._getDetectorFor(directiveRecord.directiveIndex).markAsCheckOnce(); - } - isChanged = false; - } - } - }; - DynamicChangeDetector.prototype._firstInBinding = function(r) { - var prev = change_detection_util_1.ChangeDetectionUtil.protoByIndex(this._records, r.selfIndex - 1); - return lang_1.isBlank(prev) || prev.bindingRecord !== r.bindingRecord; - }; - DynamicChangeDetector.prototype.afterContentLifecycleCallbacksInternal = function() { - var dirs = this._directiveRecords; - for (var i = dirs.length - 1; i >= 0; --i) { - var dir = dirs[i]; - if (dir.callAfterContentInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { - this._getDirectiveFor(dir.directiveIndex).ngAfterContentInit(); - } - if (dir.callAfterContentChecked) { - this._getDirectiveFor(dir.directiveIndex).ngAfterContentChecked(); - } - } - }; - DynamicChangeDetector.prototype.afterViewLifecycleCallbacksInternal = function() { - var dirs = this._directiveRecords; - for (var i = dirs.length - 1; i >= 0; --i) { - var dir = dirs[i]; - if (dir.callAfterViewInit && this.state == constants_1.ChangeDetectorState.NeverChecked) { - this._getDirectiveFor(dir.directiveIndex).ngAfterViewInit(); - } - if (dir.callAfterViewChecked) { - this._getDirectiveFor(dir.directiveIndex).ngAfterViewChecked(); - } - } - }; - DynamicChangeDetector.prototype._updateDirectiveOrElement = function(change, bindingRecord) { - if (lang_1.isBlank(bindingRecord.directiveRecord)) { - _super.prototype.notifyDispatcher.call(this, change.currentValue); - } else { - var directiveIndex = bindingRecord.directiveRecord.directiveIndex; - bindingRecord.setter(this._getDirectiveFor(directiveIndex), change.currentValue); - } - if (this._genConfig.logBindingUpdate) { - _super.prototype.logBindingUpdate.call(this, change.currentValue); - } - }; - DynamicChangeDetector.prototype._addChange = function(bindingRecord, change, changes) { - if (bindingRecord.callOnChanges()) { - return _super.prototype.addChange.call(this, changes, change.previousValue, change.currentValue); - } else { - return changes; - } - }; - DynamicChangeDetector.prototype._getDirectiveFor = function(directiveIndex) { - return this.dispatcher.getDirectiveFor(directiveIndex); - }; - DynamicChangeDetector.prototype._getDetectorFor = function(directiveIndex) { - return this.dispatcher.getDetectorFor(directiveIndex); - }; - DynamicChangeDetector.prototype._check = function(proto, throwOnChange, values, locals) { - if (proto.isPipeRecord()) { - return this._pipeCheck(proto, throwOnChange, values); - } else { - return this._referenceCheck(proto, throwOnChange, values, locals); - } - }; - DynamicChangeDetector.prototype._referenceCheck = function(proto, throwOnChange, values, locals) { - if (this._pureFuncAndArgsDidNotChange(proto)) { - this._setChanged(proto, false); - return null; - } - var currValue = this._calculateCurrValue(proto, values, locals); - if (proto.shouldBeChecked()) { - var prevValue = this._readSelf(proto, values); - var detectedChange = throwOnChange ? !change_detection_util_1.ChangeDetectionUtil.devModeEqual(prevValue, currValue) : change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue); - if (detectedChange) { - if (proto.lastInBinding) { - var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); - if (throwOnChange) - this.throwOnChangeError(prevValue, currValue); - this._writeSelf(proto, currValue, values); - this._setChanged(proto, true); - return change; - } else { - this._writeSelf(proto, currValue, values); - this._setChanged(proto, true); - return null; - } - } else { - this._setChanged(proto, false); - return null; - } - } else { - this._writeSelf(proto, currValue, values); - this._setChanged(proto, true); - return null; - } - }; - DynamicChangeDetector.prototype._calculateCurrValue = function(proto, values, locals) { - switch (proto.mode) { - case proto_record_1.RecordType.Self: - return this._readContext(proto, values); - case proto_record_1.RecordType.Const: - return proto.funcOrValue; - case proto_record_1.RecordType.PropertyRead: - var context = this._readContext(proto, values); - return proto.funcOrValue(context); - case proto_record_1.RecordType.SafeProperty: - var context = this._readContext(proto, values); - return lang_1.isBlank(context) ? null : proto.funcOrValue(context); - case proto_record_1.RecordType.PropertyWrite: - var context = this._readContext(proto, values); - var value = this._readArgs(proto, values)[0]; - proto.funcOrValue(context, value); - return value; - case proto_record_1.RecordType.KeyedWrite: - var context = this._readContext(proto, values); - var key = this._readArgs(proto, values)[0]; - var value = this._readArgs(proto, values)[1]; - context[key] = value; - return value; - case proto_record_1.RecordType.Local: - return locals.get(proto.name); - case proto_record_1.RecordType.InvokeMethod: - var context = this._readContext(proto, values); - var args = this._readArgs(proto, values); - return proto.funcOrValue(context, args); - case proto_record_1.RecordType.SafeMethodInvoke: - var context = this._readContext(proto, values); - if (lang_1.isBlank(context)) { - return null; - } - var args = this._readArgs(proto, values); - return proto.funcOrValue(context, args); - case proto_record_1.RecordType.KeyedRead: - var arg = this._readArgs(proto, values)[0]; - return this._readContext(proto, values)[arg]; - case proto_record_1.RecordType.Chain: - var args = this._readArgs(proto, values); - return args[args.length - 1]; - case proto_record_1.RecordType.InvokeClosure: - return lang_1.FunctionWrapper.apply(this._readContext(proto, values), this._readArgs(proto, values)); - case proto_record_1.RecordType.Interpolate: - case proto_record_1.RecordType.PrimitiveOp: - case proto_record_1.RecordType.CollectionLiteral: - return lang_1.FunctionWrapper.apply(proto.funcOrValue, this._readArgs(proto, values)); - default: - throw new exceptions_1.BaseException("Unknown operation " + proto.mode); - } - }; - DynamicChangeDetector.prototype._pipeCheck = function(proto, throwOnChange, values) { - var context = this._readContext(proto, values); - var selectedPipe = this._pipeFor(proto, context); - if (!selectedPipe.pure || this._argsOrContextChanged(proto)) { - var args = this._readArgs(proto, values); - var currValue = selectedPipe.pipe.transform(context, args); - if (proto.shouldBeChecked()) { - var prevValue = this._readSelf(proto, values); - var detectedChange = throwOnChange ? !change_detection_util_1.ChangeDetectionUtil.devModeEqual(prevValue, currValue) : change_detection_util_1.ChangeDetectionUtil.looseNotIdentical(prevValue, currValue); - if (detectedChange) { - currValue = change_detection_util_1.ChangeDetectionUtil.unwrapValue(currValue); - if (proto.lastInBinding) { - var change = change_detection_util_1.ChangeDetectionUtil.simpleChange(prevValue, currValue); - if (throwOnChange) - this.throwOnChangeError(prevValue, currValue); - this._writeSelf(proto, currValue, values); - this._setChanged(proto, true); - return change; - } else { - this._writeSelf(proto, currValue, values); - this._setChanged(proto, true); - return null; - } - } else { - this._setChanged(proto, false); - return null; - } - } else { - this._writeSelf(proto, currValue, values); - this._setChanged(proto, true); - return null; - } - } - }; - DynamicChangeDetector.prototype._pipeFor = function(proto, context) { - var storedPipe = this._readPipe(proto); - if (lang_1.isPresent(storedPipe)) - return storedPipe; - var pipe = this.pipes.get(proto.name); - this._writePipe(proto, pipe); - return pipe; - }; - DynamicChangeDetector.prototype._readContext = function(proto, values) { - if (proto.contextIndex == -1) { - return this._getDirectiveFor(proto.directiveIndex); - } - return values[proto.contextIndex]; - }; - DynamicChangeDetector.prototype._readSelf = function(proto, values) { - return values[proto.selfIndex]; - }; - DynamicChangeDetector.prototype._writeSelf = function(proto, value, values) { - values[proto.selfIndex] = value; - }; - DynamicChangeDetector.prototype._readPipe = function(proto) { - return this.localPipes[proto.selfIndex]; - }; - DynamicChangeDetector.prototype._writePipe = function(proto, value) { - this.localPipes[proto.selfIndex] = value; - }; - DynamicChangeDetector.prototype._setChanged = function(proto, value) { - if (proto.argumentToPureFunction) - this.changes[proto.selfIndex] = value; - }; - DynamicChangeDetector.prototype._pureFuncAndArgsDidNotChange = function(proto) { - return proto.isPureFunction() && !this._argsChanged(proto); - }; - DynamicChangeDetector.prototype._argsChanged = function(proto) { - var args = proto.args; - for (var i = 0; i < args.length; ++i) { - if (this.changes[args[i]]) { - return true; - } - } - return false; - }; - DynamicChangeDetector.prototype._argsOrContextChanged = function(proto) { - return this._argsChanged(proto) || this.changes[proto.contextIndex]; - }; - DynamicChangeDetector.prototype._readArgs = function(proto, values) { - var res = collection_1.ListWrapper.createFixedSize(proto.args.length); - var args = proto.args; - for (var i = 0; i < args.length; ++i) { - res[i] = values[args[i]]; - } - return res; - }; - return DynamicChangeDetector; - }(abstract_change_detector_1.AbstractChangeDetector)); - exports.DynamicChangeDetector = DynamicChangeDetector; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/jit_proto_change_detector", ["angular2/src/core/change_detection/change_detection_jit_generator"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); - var JitProtoChangeDetector = (function() { - function JitProtoChangeDetector(definition) { - this.definition = definition; - this._factory = this._createFactory(definition); - } - JitProtoChangeDetector.isSupported = function() { - return true; - }; - JitProtoChangeDetector.prototype.instantiate = function() { - return this._factory(); - }; - JitProtoChangeDetector.prototype._createFactory = function(definition) { - return new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, 'util', 'AbstractChangeDetector', 'ChangeDetectorStatus').generate(); - }; - return JitProtoChangeDetector; - }()); - exports.JitProtoChangeDetector = JitProtoChangeDetector; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/compiler", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/core/reflection/reflection", "angular2/src/core/linker/view", "angular2/src/core/linker/view_ref"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var async_1 = require("angular2/src/facade/async"); - var reflection_1 = require("angular2/src/core/reflection/reflection"); - var view_1 = require("angular2/src/core/linker/view"); - var view_ref_1 = require("angular2/src/core/linker/view_ref"); - var Compiler = (function() { - function Compiler() {} - return Compiler; - }()); - exports.Compiler = Compiler; - function isHostViewFactory(type) { - return type instanceof view_1.HostViewFactory; - } - var Compiler_ = (function(_super) { - __extends(Compiler_, _super); - function Compiler_() { - _super.apply(this, arguments); - } - Compiler_.prototype.compileInHost = function(componentType) { - var metadatas = reflection_1.reflector.annotations(componentType); - var hostViewFactory = metadatas.find(isHostViewFactory); - if (lang_1.isBlank(hostViewFactory)) { - throw new exceptions_1.BaseException("No precompiled component " + lang_1.stringify(componentType) + " found"); - } - return async_1.PromiseWrapper.resolve(new view_ref_1.HostViewFactoryRef_(hostViewFactory)); - }; - Compiler_.prototype.clearCache = function() {}; - Compiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], Compiler_); - return Compiler_; - }(Compiler)); - exports.Compiler_ = Compiler_; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/di/injector", ["angular2/src/facade/collection", "angular2/src/core/di/provider", "angular2/src/core/di/exceptions", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di/key", "angular2/src/core/di/metadata"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var collection_1 = require("angular2/src/facade/collection"); - var provider_1 = require("angular2/src/core/di/provider"); - var exceptions_1 = require("angular2/src/core/di/exceptions"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_2 = require("angular2/src/facade/exceptions"); - var key_1 = require("angular2/src/core/di/key"); - var metadata_1 = require("angular2/src/core/di/metadata"); - var _MAX_CONSTRUCTION_COUNTER = 10; - exports.UNDEFINED = lang_1.CONST_EXPR(new Object()); - (function(Visibility) { - Visibility[Visibility["Public"] = 0] = "Public"; - Visibility[Visibility["Private"] = 1] = "Private"; - Visibility[Visibility["PublicAndPrivate"] = 2] = "PublicAndPrivate"; - })(exports.Visibility || (exports.Visibility = {})); - var Visibility = exports.Visibility; - function canSee(src, dst) { - return (src === dst) || (dst === Visibility.PublicAndPrivate || src === Visibility.PublicAndPrivate); - } - var ProtoInjectorInlineStrategy = (function() { - function ProtoInjectorInlineStrategy(protoEI, bwv) { - this.provider0 = null; - this.provider1 = null; - this.provider2 = null; - this.provider3 = null; - this.provider4 = null; - this.provider5 = null; - this.provider6 = null; - this.provider7 = null; - this.provider8 = null; - this.provider9 = null; - this.keyId0 = null; - this.keyId1 = null; - this.keyId2 = null; - this.keyId3 = null; - this.keyId4 = null; - this.keyId5 = null; - this.keyId6 = null; - this.keyId7 = null; - this.keyId8 = null; - this.keyId9 = null; - this.visibility0 = null; - this.visibility1 = null; - this.visibility2 = null; - this.visibility3 = null; - this.visibility4 = null; - this.visibility5 = null; - this.visibility6 = null; - this.visibility7 = null; - this.visibility8 = null; - this.visibility9 = null; - var length = bwv.length; - if (length > 0) { - this.provider0 = bwv[0].provider; - this.keyId0 = bwv[0].getKeyId(); - this.visibility0 = bwv[0].visibility; - } - if (length > 1) { - this.provider1 = bwv[1].provider; - this.keyId1 = bwv[1].getKeyId(); - this.visibility1 = bwv[1].visibility; - } - if (length > 2) { - this.provider2 = bwv[2].provider; - this.keyId2 = bwv[2].getKeyId(); - this.visibility2 = bwv[2].visibility; - } - if (length > 3) { - this.provider3 = bwv[3].provider; - this.keyId3 = bwv[3].getKeyId(); - this.visibility3 = bwv[3].visibility; - } - if (length > 4) { - this.provider4 = bwv[4].provider; - this.keyId4 = bwv[4].getKeyId(); - this.visibility4 = bwv[4].visibility; - } - if (length > 5) { - this.provider5 = bwv[5].provider; - this.keyId5 = bwv[5].getKeyId(); - this.visibility5 = bwv[5].visibility; - } - if (length > 6) { - this.provider6 = bwv[6].provider; - this.keyId6 = bwv[6].getKeyId(); - this.visibility6 = bwv[6].visibility; - } - if (length > 7) { - this.provider7 = bwv[7].provider; - this.keyId7 = bwv[7].getKeyId(); - this.visibility7 = bwv[7].visibility; - } - if (length > 8) { - this.provider8 = bwv[8].provider; - this.keyId8 = bwv[8].getKeyId(); - this.visibility8 = bwv[8].visibility; - } - if (length > 9) { - this.provider9 = bwv[9].provider; - this.keyId9 = bwv[9].getKeyId(); - this.visibility9 = bwv[9].visibility; - } - } - ProtoInjectorInlineStrategy.prototype.getProviderAtIndex = function(index) { - if (index == 0) - return this.provider0; - if (index == 1) - return this.provider1; - if (index == 2) - return this.provider2; - if (index == 3) - return this.provider3; - if (index == 4) - return this.provider4; - if (index == 5) - return this.provider5; - if (index == 6) - return this.provider6; - if (index == 7) - return this.provider7; - if (index == 8) - return this.provider8; - if (index == 9) - return this.provider9; - throw new exceptions_1.OutOfBoundsError(index); - }; - ProtoInjectorInlineStrategy.prototype.createInjectorStrategy = function(injector) { - return new InjectorInlineStrategy(injector, this); - }; - return ProtoInjectorInlineStrategy; - }()); - exports.ProtoInjectorInlineStrategy = ProtoInjectorInlineStrategy; - var ProtoInjectorDynamicStrategy = (function() { - function ProtoInjectorDynamicStrategy(protoInj, bwv) { - var len = bwv.length; - this.providers = collection_1.ListWrapper.createFixedSize(len); - this.keyIds = collection_1.ListWrapper.createFixedSize(len); - this.visibilities = collection_1.ListWrapper.createFixedSize(len); - for (var i = 0; i < len; i++) { - this.providers[i] = bwv[i].provider; - this.keyIds[i] = bwv[i].getKeyId(); - this.visibilities[i] = bwv[i].visibility; - } - } - ProtoInjectorDynamicStrategy.prototype.getProviderAtIndex = function(index) { - if (index < 0 || index >= this.providers.length) { - throw new exceptions_1.OutOfBoundsError(index); - } - return this.providers[index]; - }; - ProtoInjectorDynamicStrategy.prototype.createInjectorStrategy = function(ei) { - return new InjectorDynamicStrategy(this, ei); - }; - return ProtoInjectorDynamicStrategy; - }()); - exports.ProtoInjectorDynamicStrategy = ProtoInjectorDynamicStrategy; - var ProtoInjector = (function() { - function ProtoInjector(bwv) { - this.numberOfProviders = bwv.length; - this._strategy = bwv.length > _MAX_CONSTRUCTION_COUNTER ? new ProtoInjectorDynamicStrategy(this, bwv) : new ProtoInjectorInlineStrategy(this, bwv); - } - ProtoInjector.fromResolvedProviders = function(providers) { - var bd = providers.map(function(b) { - return new ProviderWithVisibility(b, Visibility.Public); - }); - return new ProtoInjector(bd); - }; - ProtoInjector.prototype.getProviderAtIndex = function(index) { - return this._strategy.getProviderAtIndex(index); - }; - return ProtoInjector; - }()); - exports.ProtoInjector = ProtoInjector; - var InjectorInlineStrategy = (function() { - function InjectorInlineStrategy(injector, protoStrategy) { - this.injector = injector; - this.protoStrategy = protoStrategy; - this.obj0 = exports.UNDEFINED; - this.obj1 = exports.UNDEFINED; - this.obj2 = exports.UNDEFINED; - this.obj3 = exports.UNDEFINED; - this.obj4 = exports.UNDEFINED; - this.obj5 = exports.UNDEFINED; - this.obj6 = exports.UNDEFINED; - this.obj7 = exports.UNDEFINED; - this.obj8 = exports.UNDEFINED; - this.obj9 = exports.UNDEFINED; - } - InjectorInlineStrategy.prototype.resetConstructionCounter = function() { - this.injector._constructionCounter = 0; - }; - InjectorInlineStrategy.prototype.instantiateProvider = function(provider, visibility) { - return this.injector._new(provider, visibility); - }; - InjectorInlineStrategy.prototype.getObjByKeyId = function(keyId, visibility) { - var p = this.protoStrategy; - var inj = this.injector; - if (p.keyId0 === keyId && canSee(p.visibility0, visibility)) { - if (this.obj0 === exports.UNDEFINED) { - this.obj0 = inj._new(p.provider0, p.visibility0); - } - return this.obj0; - } - if (p.keyId1 === keyId && canSee(p.visibility1, visibility)) { - if (this.obj1 === exports.UNDEFINED) { - this.obj1 = inj._new(p.provider1, p.visibility1); - } - return this.obj1; - } - if (p.keyId2 === keyId && canSee(p.visibility2, visibility)) { - if (this.obj2 === exports.UNDEFINED) { - this.obj2 = inj._new(p.provider2, p.visibility2); - } - return this.obj2; - } - if (p.keyId3 === keyId && canSee(p.visibility3, visibility)) { - if (this.obj3 === exports.UNDEFINED) { - this.obj3 = inj._new(p.provider3, p.visibility3); - } - return this.obj3; - } - if (p.keyId4 === keyId && canSee(p.visibility4, visibility)) { - if (this.obj4 === exports.UNDEFINED) { - this.obj4 = inj._new(p.provider4, p.visibility4); - } - return this.obj4; - } - if (p.keyId5 === keyId && canSee(p.visibility5, visibility)) { - if (this.obj5 === exports.UNDEFINED) { - this.obj5 = inj._new(p.provider5, p.visibility5); - } - return this.obj5; - } - if (p.keyId6 === keyId && canSee(p.visibility6, visibility)) { - if (this.obj6 === exports.UNDEFINED) { - this.obj6 = inj._new(p.provider6, p.visibility6); - } - return this.obj6; - } - if (p.keyId7 === keyId && canSee(p.visibility7, visibility)) { - if (this.obj7 === exports.UNDEFINED) { - this.obj7 = inj._new(p.provider7, p.visibility7); - } - return this.obj7; - } - if (p.keyId8 === keyId && canSee(p.visibility8, visibility)) { - if (this.obj8 === exports.UNDEFINED) { - this.obj8 = inj._new(p.provider8, p.visibility8); - } - return this.obj8; - } - if (p.keyId9 === keyId && canSee(p.visibility9, visibility)) { - if (this.obj9 === exports.UNDEFINED) { - this.obj9 = inj._new(p.provider9, p.visibility9); - } - return this.obj9; - } - return exports.UNDEFINED; - }; - InjectorInlineStrategy.prototype.getObjAtIndex = function(index) { - if (index == 0) - return this.obj0; - if (index == 1) - return this.obj1; - if (index == 2) - return this.obj2; - if (index == 3) - return this.obj3; - if (index == 4) - return this.obj4; - if (index == 5) - return this.obj5; - if (index == 6) - return this.obj6; - if (index == 7) - return this.obj7; - if (index == 8) - return this.obj8; - if (index == 9) - return this.obj9; - throw new exceptions_1.OutOfBoundsError(index); - }; - InjectorInlineStrategy.prototype.getMaxNumberOfObjects = function() { - return _MAX_CONSTRUCTION_COUNTER; - }; - return InjectorInlineStrategy; - }()); - exports.InjectorInlineStrategy = InjectorInlineStrategy; - var InjectorDynamicStrategy = (function() { - function InjectorDynamicStrategy(protoStrategy, injector) { - this.protoStrategy = protoStrategy; - this.injector = injector; - this.objs = collection_1.ListWrapper.createFixedSize(protoStrategy.providers.length); - collection_1.ListWrapper.fill(this.objs, exports.UNDEFINED); - } - InjectorDynamicStrategy.prototype.resetConstructionCounter = function() { - this.injector._constructionCounter = 0; - }; - InjectorDynamicStrategy.prototype.instantiateProvider = function(provider, visibility) { - return this.injector._new(provider, visibility); - }; - InjectorDynamicStrategy.prototype.getObjByKeyId = function(keyId, visibility) { - var p = this.protoStrategy; - for (var i = 0; i < p.keyIds.length; i++) { - if (p.keyIds[i] === keyId && canSee(p.visibilities[i], visibility)) { - if (this.objs[i] === exports.UNDEFINED) { - this.objs[i] = this.injector._new(p.providers[i], p.visibilities[i]); - } - return this.objs[i]; - } - } - return exports.UNDEFINED; - }; - InjectorDynamicStrategy.prototype.getObjAtIndex = function(index) { - if (index < 0 || index >= this.objs.length) { - throw new exceptions_1.OutOfBoundsError(index); - } - return this.objs[index]; - }; - InjectorDynamicStrategy.prototype.getMaxNumberOfObjects = function() { - return this.objs.length; - }; - return InjectorDynamicStrategy; - }()); - exports.InjectorDynamicStrategy = InjectorDynamicStrategy; - var ProviderWithVisibility = (function() { - function ProviderWithVisibility(provider, visibility) { - this.provider = provider; - this.visibility = visibility; - } - ; - ProviderWithVisibility.prototype.getKeyId = function() { - return this.provider.key.id; - }; - return ProviderWithVisibility; - }()); - exports.ProviderWithVisibility = ProviderWithVisibility; - var Injector = (function() { - function Injector(_proto, _parent, _isHostBoundary, _depProvider, _debugContext) { - if (_parent === void 0) { - _parent = null; - } - if (_isHostBoundary === void 0) { - _isHostBoundary = false; - } - if (_depProvider === void 0) { - _depProvider = null; - } - if (_debugContext === void 0) { - _debugContext = null; - } - this._isHostBoundary = _isHostBoundary; - this._depProvider = _depProvider; - this._debugContext = _debugContext; - this._constructionCounter = 0; - this._proto = _proto; - this._parent = _parent; - this._strategy = _proto._strategy.createInjectorStrategy(this); - } - Injector.resolve = function(providers) { - return provider_1.resolveProviders(providers); - }; - Injector.resolveAndCreate = function(providers) { - var resolvedProviders = Injector.resolve(providers); - return Injector.fromResolvedProviders(resolvedProviders); - }; - Injector.fromResolvedProviders = function(providers) { - return new Injector(ProtoInjector.fromResolvedProviders(providers)); - }; - Injector.fromResolvedBindings = function(providers) { - return Injector.fromResolvedProviders(providers); - }; - Object.defineProperty(Injector.prototype, "hostBoundary", { - get: function() { - return this._isHostBoundary; - }, - enumerable: true, - configurable: true - }); - Injector.prototype.debugContext = function() { - return this._debugContext(); - }; - Injector.prototype.get = function(token) { - return this._getByKey(key_1.Key.get(token), null, null, false, Visibility.PublicAndPrivate); - }; - Injector.prototype.getOptional = function(token) { - return this._getByKey(key_1.Key.get(token), null, null, true, Visibility.PublicAndPrivate); - }; - Injector.prototype.getAt = function(index) { - return this._strategy.getObjAtIndex(index); - }; - Object.defineProperty(Injector.prototype, "parent", { - get: function() { - return this._parent; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Injector.prototype, "internalStrategy", { - get: function() { - return this._strategy; - }, - enumerable: true, - configurable: true - }); - Injector.prototype.resolveAndCreateChild = function(providers) { - var resolvedProviders = Injector.resolve(providers); - return this.createChildFromResolved(resolvedProviders); - }; - Injector.prototype.createChildFromResolved = function(providers) { - var bd = providers.map(function(b) { - return new ProviderWithVisibility(b, Visibility.Public); - }); - var proto = new ProtoInjector(bd); - var inj = new Injector(proto); - inj._parent = this; - return inj; - }; - Injector.prototype.resolveAndInstantiate = function(provider) { - return this.instantiateResolved(Injector.resolve([provider])[0]); - }; - Injector.prototype.instantiateResolved = function(provider) { - return this._instantiateProvider(provider, Visibility.PublicAndPrivate); - }; - Injector.prototype._new = function(provider, visibility) { - if (this._constructionCounter++ > this._strategy.getMaxNumberOfObjects()) { - throw new exceptions_1.CyclicDependencyError(this, provider.key); - } - return this._instantiateProvider(provider, visibility); - }; - Injector.prototype._instantiateProvider = function(provider, visibility) { - if (provider.multiProvider) { - var res = collection_1.ListWrapper.createFixedSize(provider.resolvedFactories.length); - for (var i = 0; i < provider.resolvedFactories.length; ++i) { - res[i] = this._instantiate(provider, provider.resolvedFactories[i], visibility); - } - return res; - } else { - return this._instantiate(provider, provider.resolvedFactories[0], visibility); - } - }; - Injector.prototype._instantiate = function(provider, resolvedFactory, visibility) { - var factory = resolvedFactory.factory; - var deps = resolvedFactory.dependencies; - var length = deps.length; - var d0; - var d1; - var d2; - var d3; - var d4; - var d5; - var d6; - var d7; - var d8; - var d9; - var d10; - var d11; - var d12; - var d13; - var d14; - var d15; - var d16; - var d17; - var d18; - var d19; - try { - d0 = length > 0 ? this._getByDependency(provider, deps[0], visibility) : null; - d1 = length > 1 ? this._getByDependency(provider, deps[1], visibility) : null; - d2 = length > 2 ? this._getByDependency(provider, deps[2], visibility) : null; - d3 = length > 3 ? this._getByDependency(provider, deps[3], visibility) : null; - d4 = length > 4 ? this._getByDependency(provider, deps[4], visibility) : null; - d5 = length > 5 ? this._getByDependency(provider, deps[5], visibility) : null; - d6 = length > 6 ? this._getByDependency(provider, deps[6], visibility) : null; - d7 = length > 7 ? this._getByDependency(provider, deps[7], visibility) : null; - d8 = length > 8 ? this._getByDependency(provider, deps[8], visibility) : null; - d9 = length > 9 ? this._getByDependency(provider, deps[9], visibility) : null; - d10 = length > 10 ? this._getByDependency(provider, deps[10], visibility) : null; - d11 = length > 11 ? this._getByDependency(provider, deps[11], visibility) : null; - d12 = length > 12 ? this._getByDependency(provider, deps[12], visibility) : null; - d13 = length > 13 ? this._getByDependency(provider, deps[13], visibility) : null; - d14 = length > 14 ? this._getByDependency(provider, deps[14], visibility) : null; - d15 = length > 15 ? this._getByDependency(provider, deps[15], visibility) : null; - d16 = length > 16 ? this._getByDependency(provider, deps[16], visibility) : null; - d17 = length > 17 ? this._getByDependency(provider, deps[17], visibility) : null; - d18 = length > 18 ? this._getByDependency(provider, deps[18], visibility) : null; - d19 = length > 19 ? this._getByDependency(provider, deps[19], visibility) : null; - } catch (e) { - if (e instanceof exceptions_1.AbstractProviderError || e instanceof exceptions_1.InstantiationError) { - e.addKey(this, provider.key); - } - throw e; - } - var obj; - try { - switch (length) { - case 0: - obj = factory(); - break; - case 1: - obj = factory(d0); - break; - case 2: - obj = factory(d0, d1); - break; - case 3: - obj = factory(d0, d1, d2); - break; - case 4: - obj = factory(d0, d1, d2, d3); - break; - case 5: - obj = factory(d0, d1, d2, d3, d4); - break; - case 6: - obj = factory(d0, d1, d2, d3, d4, d5); - break; - case 7: - obj = factory(d0, d1, d2, d3, d4, d5, d6); - break; - case 8: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7); - break; - case 9: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8); - break; - case 10: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9); - break; - case 11: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10); - break; - case 12: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11); - break; - case 13: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12); - break; - case 14: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13); - break; - case 15: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14); - break; - case 16: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15); - break; - case 17: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16); - break; - case 18: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17); - break; - case 19: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18); - break; - case 20: - obj = factory(d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19); - break; - default: - throw new exceptions_2.BaseException("Cannot instantiate '" + provider.key.displayName + "' because it has more than 20 dependencies"); - } - } catch (e) { - throw new exceptions_1.InstantiationError(this, e, e.stack, provider.key); - } - return obj; - }; - Injector.prototype._getByDependency = function(provider, dep, providerVisibility) { - var special = lang_1.isPresent(this._depProvider) ? this._depProvider.getDependency(this, provider, dep) : exports.UNDEFINED; - if (special !== exports.UNDEFINED) { - return special; - } else { - return this._getByKey(dep.key, dep.lowerBoundVisibility, dep.upperBoundVisibility, dep.optional, providerVisibility); - } - }; - Injector.prototype._getByKey = function(key, lowerBoundVisibility, upperBoundVisibility, optional, providerVisibility) { - if (key === INJECTOR_KEY) { - return this; - } - if (upperBoundVisibility instanceof metadata_1.SelfMetadata) { - return this._getByKeySelf(key, optional, providerVisibility); - } else if (upperBoundVisibility instanceof metadata_1.HostMetadata) { - return this._getByKeyHost(key, optional, providerVisibility, lowerBoundVisibility); - } else { - return this._getByKeyDefault(key, optional, providerVisibility, lowerBoundVisibility); - } - }; - Injector.prototype._throwOrNull = function(key, optional) { - if (optional) { - return null; - } else { - throw new exceptions_1.NoProviderError(this, key); - } - }; - Injector.prototype._getByKeySelf = function(key, optional, providerVisibility) { - var obj = this._strategy.getObjByKeyId(key.id, providerVisibility); - return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); - }; - Injector.prototype._getByKeyHost = function(key, optional, providerVisibility, lowerBoundVisibility) { - var inj = this; - if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { - if (inj._isHostBoundary) { - return this._getPrivateDependency(key, optional, inj); - } else { - inj = inj._parent; - } - } - while (inj != null) { - var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); - if (obj !== exports.UNDEFINED) - return obj; - if (lang_1.isPresent(inj._parent) && inj._isHostBoundary) { - return this._getPrivateDependency(key, optional, inj); - } else { - inj = inj._parent; - } - } - return this._throwOrNull(key, optional); - }; - Injector.prototype._getPrivateDependency = function(key, optional, inj) { - var obj = inj._parent._strategy.getObjByKeyId(key.id, Visibility.Private); - return (obj !== exports.UNDEFINED) ? obj : this._throwOrNull(key, optional); - }; - Injector.prototype._getByKeyDefault = function(key, optional, providerVisibility, lowerBoundVisibility) { - var inj = this; - if (lowerBoundVisibility instanceof metadata_1.SkipSelfMetadata) { - providerVisibility = inj._isHostBoundary ? Visibility.PublicAndPrivate : Visibility.Public; - inj = inj._parent; - } - while (inj != null) { - var obj = inj._strategy.getObjByKeyId(key.id, providerVisibility); - if (obj !== exports.UNDEFINED) - return obj; - providerVisibility = inj._isHostBoundary ? Visibility.PublicAndPrivate : Visibility.Public; - inj = inj._parent; - } - return this._throwOrNull(key, optional); - }; - Object.defineProperty(Injector.prototype, "displayName", { - get: function() { - return "Injector(providers: [" + _mapProviders(this, function(b) { - return (" \"" + b.key.displayName + "\" "); - }).join(", ") + "])"; - }, - enumerable: true, - configurable: true - }); - Injector.prototype.toString = function() { - return this.displayName; - }; - return Injector; - }()); - exports.Injector = Injector; - var INJECTOR_KEY = key_1.Key.get(Injector); - function _mapProviders(injector, fn) { - var res = []; - for (var i = 0; i < injector._proto.numberOfProviders; ++i) { - res.push(fn(injector._proto.getProviderAtIndex(i))); - } - return res; - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/proto_change_detector", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/event_binding", "angular2/src/core/change_detection/coalesce", "angular2/src/core/change_detection/proto_record"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var ast_1 = require("angular2/src/core/change_detection/parser/ast"); - var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); - var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); - var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); - var event_binding_1 = require("angular2/src/core/change_detection/event_binding"); - var coalesce_1 = require("angular2/src/core/change_detection/coalesce"); - var proto_record_1 = require("angular2/src/core/change_detection/proto_record"); - var DynamicProtoChangeDetector = (function() { - function DynamicProtoChangeDetector(_definition) { - this._definition = _definition; - this._propertyBindingRecords = createPropertyRecords(_definition); - this._eventBindingRecords = createEventRecords(_definition); - this._propertyBindingTargets = this._definition.bindingRecords.map(function(b) { - return b.target; - }); - this._directiveIndices = this._definition.directiveRecords.map(function(d) { - return d.directiveIndex; - }); - } - DynamicProtoChangeDetector.prototype.instantiate = function() { - return new dynamic_change_detector_1.DynamicChangeDetector(this._definition.id, this._propertyBindingRecords.length, this._propertyBindingTargets, this._directiveIndices, this._definition.strategy, this._propertyBindingRecords, this._eventBindingRecords, this._definition.directiveRecords, this._definition.genConfig); - }; - return DynamicProtoChangeDetector; - }()); - exports.DynamicProtoChangeDetector = DynamicProtoChangeDetector; - function createPropertyRecords(definition) { - var recordBuilder = new ProtoRecordBuilder(); - collection_1.ListWrapper.forEachWithIndex(definition.bindingRecords, function(b, index) { - return recordBuilder.add(b, definition.variableNames, index); - }); - return coalesce_1.coalesce(recordBuilder.records); - } - exports.createPropertyRecords = createPropertyRecords; - function createEventRecords(definition) { - var varNames = collection_1.ListWrapper.concat(['$event'], definition.variableNames); - return definition.eventRecords.map(function(er) { - var records = _ConvertAstIntoProtoRecords.create(er, varNames); - var dirIndex = er.implicitReceiver instanceof directive_record_1.DirectiveIndex ? er.implicitReceiver : null; - return new event_binding_1.EventBinding(er.target.name, er.target.elementIndex, dirIndex, records); - }); - } - exports.createEventRecords = createEventRecords; - var ProtoRecordBuilder = (function() { - function ProtoRecordBuilder() { - this.records = []; - } - ProtoRecordBuilder.prototype.add = function(b, variableNames, bindingIndex) { - var oldLast = collection_1.ListWrapper.last(this.records); - if (lang_1.isPresent(oldLast) && oldLast.bindingRecord.directiveRecord == b.directiveRecord) { - oldLast.lastInDirective = false; - } - var numberOfRecordsBefore = this.records.length; - this._appendRecords(b, variableNames, bindingIndex); - var newLast = collection_1.ListWrapper.last(this.records); - if (lang_1.isPresent(newLast) && newLast !== oldLast) { - newLast.lastInBinding = true; - newLast.lastInDirective = true; - this._setArgumentToPureFunction(numberOfRecordsBefore); - } - }; - ProtoRecordBuilder.prototype._setArgumentToPureFunction = function(startIndex) { - var _this = this; - for (var i = startIndex; i < this.records.length; ++i) { - var rec = this.records[i]; - if (rec.isPureFunction()) { - rec.args.forEach(function(recordIndex) { - return _this.records[recordIndex - 1].argumentToPureFunction = true; - }); - } - if (rec.mode === proto_record_1.RecordType.Pipe) { - rec.args.forEach(function(recordIndex) { - return _this.records[recordIndex - 1].argumentToPureFunction = true; - }); - this.records[rec.contextIndex - 1].argumentToPureFunction = true; - } - } - }; - ProtoRecordBuilder.prototype._appendRecords = function(b, variableNames, bindingIndex) { - if (b.isDirectiveLifecycle()) { - this.records.push(new proto_record_1.ProtoRecord(proto_record_1.RecordType.DirectiveLifecycle, b.lifecycleEvent, null, [], [], -1, null, this.records.length + 1, b, false, false, false, false, null)); - } else { - _ConvertAstIntoProtoRecords.append(this.records, b, variableNames, bindingIndex); - } - }; - return ProtoRecordBuilder; - }()); - exports.ProtoRecordBuilder = ProtoRecordBuilder; - var _ConvertAstIntoProtoRecords = (function() { - function _ConvertAstIntoProtoRecords(_records, _bindingRecord, _variableNames, _bindingIndex) { - this._records = _records; - this._bindingRecord = _bindingRecord; - this._variableNames = _variableNames; - this._bindingIndex = _bindingIndex; - } - _ConvertAstIntoProtoRecords.append = function(records, b, variableNames, bindingIndex) { - var c = new _ConvertAstIntoProtoRecords(records, b, variableNames, bindingIndex); - b.ast.visit(c); - }; - _ConvertAstIntoProtoRecords.create = function(b, variableNames) { - var rec = []; - _ConvertAstIntoProtoRecords.append(rec, b, variableNames, null); - rec[rec.length - 1].lastInBinding = true; - return rec; - }; - _ConvertAstIntoProtoRecords.prototype.visitImplicitReceiver = function(ast) { - return this._bindingRecord.implicitReceiver; - }; - _ConvertAstIntoProtoRecords.prototype.visitInterpolation = function(ast) { - var args = this._visitAll(ast.expressions); - return this._addRecord(proto_record_1.RecordType.Interpolate, "interpolate", _interpolationFn(ast.strings), args, ast.strings, 0); - }; - _ConvertAstIntoProtoRecords.prototype.visitLiteralPrimitive = function(ast) { - return this._addRecord(proto_record_1.RecordType.Const, "literal", ast.value, [], null, 0); - }; - _ConvertAstIntoProtoRecords.prototype.visitPropertyRead = function(ast) { - var receiver = ast.receiver.visit(this); - if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { - return this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); - } else { - return this._addRecord(proto_record_1.RecordType.PropertyRead, ast.name, ast.getter, [], null, receiver); - } - }; - _ConvertAstIntoProtoRecords.prototype.visitPropertyWrite = function(ast) { - if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name) && ast.receiver instanceof ast_1.ImplicitReceiver) { - throw new exceptions_1.BaseException("Cannot reassign a variable binding " + ast.name); - } else { - var receiver = ast.receiver.visit(this); - var value = ast.value.visit(this); - return this._addRecord(proto_record_1.RecordType.PropertyWrite, ast.name, ast.setter, [value], null, receiver); - } - }; - _ConvertAstIntoProtoRecords.prototype.visitKeyedWrite = function(ast) { - var obj = ast.obj.visit(this); - var key = ast.key.visit(this); - var value = ast.value.visit(this); - return this._addRecord(proto_record_1.RecordType.KeyedWrite, null, null, [key, value], null, obj); - }; - _ConvertAstIntoProtoRecords.prototype.visitSafePropertyRead = function(ast) { - var receiver = ast.receiver.visit(this); - return this._addRecord(proto_record_1.RecordType.SafeProperty, ast.name, ast.getter, [], null, receiver); - }; - _ConvertAstIntoProtoRecords.prototype.visitMethodCall = function(ast) { - var receiver = ast.receiver.visit(this); - var args = this._visitAll(ast.args); - if (lang_1.isPresent(this._variableNames) && collection_1.ListWrapper.contains(this._variableNames, ast.name)) { - var target = this._addRecord(proto_record_1.RecordType.Local, ast.name, ast.name, [], null, receiver); - return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); - } else { - return this._addRecord(proto_record_1.RecordType.InvokeMethod, ast.name, ast.fn, args, null, receiver); - } - }; - _ConvertAstIntoProtoRecords.prototype.visitSafeMethodCall = function(ast) { - var receiver = ast.receiver.visit(this); - var args = this._visitAll(ast.args); - return this._addRecord(proto_record_1.RecordType.SafeMethodInvoke, ast.name, ast.fn, args, null, receiver); - }; - _ConvertAstIntoProtoRecords.prototype.visitFunctionCall = function(ast) { - var target = ast.target.visit(this); - var args = this._visitAll(ast.args); - return this._addRecord(proto_record_1.RecordType.InvokeClosure, "closure", null, args, null, target); - }; - _ConvertAstIntoProtoRecords.prototype.visitLiteralArray = function(ast) { - var primitiveName = "arrayFn" + ast.expressions.length; - return this._addRecord(proto_record_1.RecordType.CollectionLiteral, primitiveName, _arrayFn(ast.expressions.length), this._visitAll(ast.expressions), null, 0); - }; - _ConvertAstIntoProtoRecords.prototype.visitLiteralMap = function(ast) { - return this._addRecord(proto_record_1.RecordType.CollectionLiteral, _mapPrimitiveName(ast.keys), change_detection_util_1.ChangeDetectionUtil.mapFn(ast.keys), this._visitAll(ast.values), null, 0); - }; - _ConvertAstIntoProtoRecords.prototype.visitBinary = function(ast) { - var left = ast.left.visit(this); - switch (ast.operation) { - case '&&': - var branchEnd = [null]; - this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], branchEnd, left); - var right = ast.right.visit(this); - branchEnd[0] = right; - return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, right, left], null, 0); - case '||': - var branchEnd = [null]; - this._addRecord(proto_record_1.RecordType.SkipRecordsIf, "SkipRecordsIf", null, [], branchEnd, left); - var right = ast.right.visit(this); - branchEnd[0] = right; - return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [left, left, right], null, 0); - default: - var right = ast.right.visit(this); - return this._addRecord(proto_record_1.RecordType.PrimitiveOp, _operationToPrimitiveName(ast.operation), _operationToFunction(ast.operation), [left, right], null, 0); - } - }; - _ConvertAstIntoProtoRecords.prototype.visitPrefixNot = function(ast) { - var exp = ast.expression.visit(this); - return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "operation_negate", change_detection_util_1.ChangeDetectionUtil.operation_negate, [exp], null, 0); - }; - _ConvertAstIntoProtoRecords.prototype.visitConditional = function(ast) { - var condition = ast.condition.visit(this); - var startOfFalseBranch = [null]; - var endOfFalseBranch = [null]; - this._addRecord(proto_record_1.RecordType.SkipRecordsIfNot, "SkipRecordsIfNot", null, [], startOfFalseBranch, condition); - var whenTrue = ast.trueExp.visit(this); - var skip = this._addRecord(proto_record_1.RecordType.SkipRecords, "SkipRecords", null, [], endOfFalseBranch, 0); - var whenFalse = ast.falseExp.visit(this); - startOfFalseBranch[0] = skip; - endOfFalseBranch[0] = whenFalse; - return this._addRecord(proto_record_1.RecordType.PrimitiveOp, "cond", change_detection_util_1.ChangeDetectionUtil.cond, [condition, whenTrue, whenFalse], null, 0); - }; - _ConvertAstIntoProtoRecords.prototype.visitPipe = function(ast) { - var value = ast.exp.visit(this); - var args = this._visitAll(ast.args); - return this._addRecord(proto_record_1.RecordType.Pipe, ast.name, ast.name, args, null, value); - }; - _ConvertAstIntoProtoRecords.prototype.visitKeyedRead = function(ast) { - var obj = ast.obj.visit(this); - var key = ast.key.visit(this); - return this._addRecord(proto_record_1.RecordType.KeyedRead, "keyedAccess", change_detection_util_1.ChangeDetectionUtil.keyedAccess, [key], null, obj); - }; - _ConvertAstIntoProtoRecords.prototype.visitChain = function(ast) { - var _this = this; - var args = ast.expressions.map(function(e) { - return e.visit(_this); - }); - return this._addRecord(proto_record_1.RecordType.Chain, "chain", null, args, null, 0); - }; - _ConvertAstIntoProtoRecords.prototype.visitQuote = function(ast) { - throw new exceptions_1.BaseException(("Caught uninterpreted expression at " + ast.location + ": " + ast.uninterpretedExpression + ". ") + ("Expression prefix " + ast.prefix + " did not match a template transformer to interpret the expression.")); - }; - _ConvertAstIntoProtoRecords.prototype._visitAll = function(asts) { - var res = collection_1.ListWrapper.createFixedSize(asts.length); - for (var i = 0; i < asts.length; ++i) { - res[i] = asts[i].visit(this); - } - return res; - }; - _ConvertAstIntoProtoRecords.prototype._addRecord = function(type, name, funcOrValue, args, fixedArgs, context) { - var selfIndex = this._records.length + 1; - if (context instanceof directive_record_1.DirectiveIndex) { - this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, -1, context, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); - } else { - this._records.push(new proto_record_1.ProtoRecord(type, name, funcOrValue, args, fixedArgs, context, null, selfIndex, this._bindingRecord, false, false, false, false, this._bindingIndex)); - } - return selfIndex; - }; - return _ConvertAstIntoProtoRecords; - }()); - function _arrayFn(length) { - switch (length) { - case 0: - return change_detection_util_1.ChangeDetectionUtil.arrayFn0; - case 1: - return change_detection_util_1.ChangeDetectionUtil.arrayFn1; - case 2: - return change_detection_util_1.ChangeDetectionUtil.arrayFn2; - case 3: - return change_detection_util_1.ChangeDetectionUtil.arrayFn3; - case 4: - return change_detection_util_1.ChangeDetectionUtil.arrayFn4; - case 5: - return change_detection_util_1.ChangeDetectionUtil.arrayFn5; - case 6: - return change_detection_util_1.ChangeDetectionUtil.arrayFn6; - case 7: - return change_detection_util_1.ChangeDetectionUtil.arrayFn7; - case 8: - return change_detection_util_1.ChangeDetectionUtil.arrayFn8; - case 9: - return change_detection_util_1.ChangeDetectionUtil.arrayFn9; - default: - throw new exceptions_1.BaseException("Does not support literal maps with more than 9 elements"); - } - } - function _mapPrimitiveName(keys) { - var stringifiedKeys = keys.map(function(k) { - return lang_1.isString(k) ? "\"" + k + "\"" : "" + k; - }).join(', '); - return "mapFn([" + stringifiedKeys + "])"; - } - function _operationToPrimitiveName(operation) { - switch (operation) { - case '+': - return "operation_add"; - case '-': - return "operation_subtract"; - case '*': - return "operation_multiply"; - case '/': - return "operation_divide"; - case '%': - return "operation_remainder"; - case '==': - return "operation_equals"; - case '!=': - return "operation_not_equals"; - case '===': - return "operation_identical"; - case '!==': - return "operation_not_identical"; - case '<': - return "operation_less_then"; - case '>': - return "operation_greater_then"; - case '<=': - return "operation_less_or_equals_then"; - case '>=': - return "operation_greater_or_equals_then"; - default: - throw new exceptions_1.BaseException("Unsupported operation " + operation); - } - } - function _operationToFunction(operation) { - switch (operation) { - case '+': - return change_detection_util_1.ChangeDetectionUtil.operation_add; - case '-': - return change_detection_util_1.ChangeDetectionUtil.operation_subtract; - case '*': - return change_detection_util_1.ChangeDetectionUtil.operation_multiply; - case '/': - return change_detection_util_1.ChangeDetectionUtil.operation_divide; - case '%': - return change_detection_util_1.ChangeDetectionUtil.operation_remainder; - case '==': - return change_detection_util_1.ChangeDetectionUtil.operation_equals; - case '!=': - return change_detection_util_1.ChangeDetectionUtil.operation_not_equals; - case '===': - return change_detection_util_1.ChangeDetectionUtil.operation_identical; - case '!==': - return change_detection_util_1.ChangeDetectionUtil.operation_not_identical; - case '<': - return change_detection_util_1.ChangeDetectionUtil.operation_less_then; - case '>': - return change_detection_util_1.ChangeDetectionUtil.operation_greater_then; - case '<=': - return change_detection_util_1.ChangeDetectionUtil.operation_less_or_equals_then; - case '>=': - return change_detection_util_1.ChangeDetectionUtil.operation_greater_or_equals_then; - default: - throw new exceptions_1.BaseException("Unsupported operation " + operation); - } - } - function s(v) { - return lang_1.isPresent(v) ? "" + v : ''; - } - function _interpolationFn(strings) { - var length = strings.length; - var c0 = length > 0 ? strings[0] : null; - var c1 = length > 1 ? strings[1] : null; - var c2 = length > 2 ? strings[2] : null; - var c3 = length > 3 ? strings[3] : null; - var c4 = length > 4 ? strings[4] : null; - var c5 = length > 5 ? strings[5] : null; - var c6 = length > 6 ? strings[6] : null; - var c7 = length > 7 ? strings[7] : null; - var c8 = length > 8 ? strings[8] : null; - var c9 = length > 9 ? strings[9] : null; - switch (length - 1) { - case 1: - return function(a1) { - return c0 + s(a1) + c1; - }; - case 2: - return function(a1, a2) { - return c0 + s(a1) + c1 + s(a2) + c2; - }; - case 3: - return function(a1, a2, a3) { - return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3; - }; - case 4: - return function(a1, a2, a3, a4) { - return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4; - }; - case 5: - return function(a1, a2, a3, a4, a5) { - return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5; - }; - case 6: - return function(a1, a2, a3, a4, a5, a6) { - return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6; - }; - case 7: - return function(a1, a2, a3, a4, a5, a6, a7) { - return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7; - }; - case 8: - return function(a1, a2, a3, a4, a5, a6, a7, a8) { - return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8; - }; - case 9: - return function(a1, a2, a3, a4, a5, a6, a7, a8, a9) { - return c0 + s(a1) + c1 + s(a2) + c2 + s(a3) + c3 + s(a4) + c4 + s(a5) + c5 + s(a6) + c6 + s(a7) + c7 + s(a8) + c8 + s(a9) + c9; - }; - default: - throw new exceptions_1.BaseException("Does not support more than 9 expressions"); - } - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/dynamic_component_loader", ["angular2/src/core/di", "angular2/src/core/linker/compiler", "angular2/src/facade/lang", "angular2/src/core/linker/view_manager"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = require("angular2/src/core/di"); - var compiler_1 = require("angular2/src/core/linker/compiler"); - var lang_1 = require("angular2/src/facade/lang"); - var view_manager_1 = require("angular2/src/core/linker/view_manager"); - var ComponentRef = (function() { - function ComponentRef() {} - Object.defineProperty(ComponentRef.prototype, "hostView", { - get: function() { - return this.location.internalElement.parentView.ref; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(ComponentRef.prototype, "hostComponent", { - get: function() { - return this.instance; - }, - enumerable: true, - configurable: true - }); - return ComponentRef; - }()); - exports.ComponentRef = ComponentRef; - var ComponentRef_ = (function(_super) { - __extends(ComponentRef_, _super); - function ComponentRef_(location, instance, componentType, injector, _dispose) { - _super.call(this); - this._dispose = _dispose; - this.location = location; - this.instance = instance; - this.componentType = componentType; - this.injector = injector; - } - Object.defineProperty(ComponentRef_.prototype, "hostComponentType", { - get: function() { - return this.componentType; - }, - enumerable: true, - configurable: true - }); - ComponentRef_.prototype.dispose = function() { - this._dispose(); - }; - return ComponentRef_; - }(ComponentRef)); - exports.ComponentRef_ = ComponentRef_; - var DynamicComponentLoader = (function() { - function DynamicComponentLoader() {} - return DynamicComponentLoader; - }()); - exports.DynamicComponentLoader = DynamicComponentLoader; - var DynamicComponentLoader_ = (function(_super) { - __extends(DynamicComponentLoader_, _super); - function DynamicComponentLoader_(_compiler, _viewManager) { - _super.call(this); - this._compiler = _compiler; - this._viewManager = _viewManager; - } - DynamicComponentLoader_.prototype.loadAsRoot = function(type, overrideSelector, injector, onDispose, projectableNodes) { - var _this = this; - return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { - var hostViewRef = _this._viewManager.createRootHostView(hostProtoViewRef, overrideSelector, injector, projectableNodes); - var newLocation = _this._viewManager.getHostElement(hostViewRef); - var component = _this._viewManager.getComponent(newLocation); - var dispose = function() { - if (lang_1.isPresent(onDispose)) { - onDispose(); - } - _this._viewManager.destroyRootHostView(hostViewRef); - }; - return new ComponentRef_(newLocation, component, type, injector, dispose); - }); - }; - DynamicComponentLoader_.prototype.loadIntoLocation = function(type, hostLocation, anchorName, providers, projectableNodes) { - if (providers === void 0) { - providers = null; - } - if (projectableNodes === void 0) { - projectableNodes = null; - } - return this.loadNextToLocation(type, this._viewManager.getNamedElementInComponentView(hostLocation, anchorName), providers, projectableNodes); - }; - DynamicComponentLoader_.prototype.loadNextToLocation = function(type, location, providers, projectableNodes) { - var _this = this; - if (providers === void 0) { - providers = null; - } - if (projectableNodes === void 0) { - projectableNodes = null; - } - return this._compiler.compileInHost(type).then(function(hostProtoViewRef) { - var viewContainer = _this._viewManager.getViewContainer(location); - var hostViewRef = viewContainer.createHostView(hostProtoViewRef, viewContainer.length, providers, projectableNodes); - var newLocation = _this._viewManager.getHostElement(hostViewRef); - var component = _this._viewManager.getComponent(newLocation); - var dispose = function() { - var index = viewContainer.indexOf(hostViewRef); - if (!hostViewRef.destroyed && index !== -1) { - viewContainer.remove(index); - } - }; - return new ComponentRef_(newLocation, component, type, null, dispose); - }); - }; - DynamicComponentLoader_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [compiler_1.Compiler, view_manager_1.AppViewManager])], DynamicComponentLoader_); - return DynamicComponentLoader_; - }(DynamicComponentLoader)); - exports.DynamicComponentLoader_ = DynamicComponentLoader_; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/di", ["angular2/src/core/di/metadata", "angular2/src/core/di/decorators", "angular2/src/core/di/forward_ref", "angular2/src/core/di/injector", "angular2/src/core/di/provider", "angular2/src/core/di/key", "angular2/src/core/di/exceptions", "angular2/src/core/di/opaque_token"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function __export(m) { - for (var p in m) - if (!exports.hasOwnProperty(p)) - exports[p] = m[p]; - } - var metadata_1 = require("angular2/src/core/di/metadata"); - exports.InjectMetadata = metadata_1.InjectMetadata; - exports.OptionalMetadata = metadata_1.OptionalMetadata; - exports.InjectableMetadata = metadata_1.InjectableMetadata; - exports.SelfMetadata = metadata_1.SelfMetadata; - exports.HostMetadata = metadata_1.HostMetadata; - exports.SkipSelfMetadata = metadata_1.SkipSelfMetadata; - exports.DependencyMetadata = metadata_1.DependencyMetadata; - __export(require("angular2/src/core/di/decorators")); - var forward_ref_1 = require("angular2/src/core/di/forward_ref"); - exports.forwardRef = forward_ref_1.forwardRef; - exports.resolveForwardRef = forward_ref_1.resolveForwardRef; - var injector_1 = require("angular2/src/core/di/injector"); - exports.Injector = injector_1.Injector; - var provider_1 = require("angular2/src/core/di/provider"); - exports.Binding = provider_1.Binding; - exports.ProviderBuilder = provider_1.ProviderBuilder; - exports.ResolvedFactory = provider_1.ResolvedFactory; - exports.Dependency = provider_1.Dependency; - exports.bind = provider_1.bind; - exports.Provider = provider_1.Provider; - exports.provide = provider_1.provide; - var key_1 = require("angular2/src/core/di/key"); - exports.Key = key_1.Key; - var exceptions_1 = require("angular2/src/core/di/exceptions"); - exports.NoProviderError = exceptions_1.NoProviderError; - exports.AbstractProviderError = exceptions_1.AbstractProviderError; - exports.CyclicDependencyError = exceptions_1.CyclicDependencyError; - exports.InstantiationError = exceptions_1.InstantiationError; - exports.InvalidProviderError = exceptions_1.InvalidProviderError; - exports.NoAnnotationError = exceptions_1.NoAnnotationError; - exports.OutOfBoundsError = exceptions_1.OutOfBoundsError; - var opaque_token_1 = require("angular2/src/core/di/opaque_token"); - exports.OpaqueToken = opaque_token_1.OpaqueToken; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection/change_detection", ["angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/default_iterable_differ", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/differs/default_keyvalue_differ", "angular2/src/facade/lang", "angular2/src/core/change_detection/differs/default_keyvalue_differ", "angular2/src/core/change_detection/differs/default_iterable_differ", "angular2/src/core/change_detection/parser/ast", "angular2/src/core/change_detection/parser/lexer", "angular2/src/core/change_detection/parser/parser", "angular2/src/core/change_detection/parser/locals", "angular2/src/core/change_detection/exceptions", "angular2/src/core/change_detection/interfaces", "angular2/src/core/change_detection/constants", "angular2/src/core/change_detection/proto_change_detector", "angular2/src/core/change_detection/jit_proto_change_detector", "angular2/src/core/change_detection/binding_record", "angular2/src/core/change_detection/directive_record", "angular2/src/core/change_detection/dynamic_change_detector", "angular2/src/core/change_detection/change_detector_ref", "angular2/src/core/change_detection/differs/iterable_differs", "angular2/src/core/change_detection/differs/keyvalue_differs", "angular2/src/core/change_detection/change_detection_util"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var iterable_differs_1 = require("angular2/src/core/change_detection/differs/iterable_differs"); - var default_iterable_differ_1 = require("angular2/src/core/change_detection/differs/default_iterable_differ"); - var keyvalue_differs_1 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); - var default_keyvalue_differ_1 = require("angular2/src/core/change_detection/differs/default_keyvalue_differ"); - var lang_1 = require("angular2/src/facade/lang"); - var default_keyvalue_differ_2 = require("angular2/src/core/change_detection/differs/default_keyvalue_differ"); - exports.DefaultKeyValueDifferFactory = default_keyvalue_differ_2.DefaultKeyValueDifferFactory; - exports.KeyValueChangeRecord = default_keyvalue_differ_2.KeyValueChangeRecord; - var default_iterable_differ_2 = require("angular2/src/core/change_detection/differs/default_iterable_differ"); - exports.DefaultIterableDifferFactory = default_iterable_differ_2.DefaultIterableDifferFactory; - exports.CollectionChangeRecord = default_iterable_differ_2.CollectionChangeRecord; - var ast_1 = require("angular2/src/core/change_detection/parser/ast"); - exports.ASTWithSource = ast_1.ASTWithSource; - exports.AST = ast_1.AST; - exports.AstTransformer = ast_1.AstTransformer; - exports.PropertyRead = ast_1.PropertyRead; - exports.LiteralArray = ast_1.LiteralArray; - exports.ImplicitReceiver = ast_1.ImplicitReceiver; - var lexer_1 = require("angular2/src/core/change_detection/parser/lexer"); - exports.Lexer = lexer_1.Lexer; - var parser_1 = require("angular2/src/core/change_detection/parser/parser"); - exports.Parser = parser_1.Parser; - var locals_1 = require("angular2/src/core/change_detection/parser/locals"); - exports.Locals = locals_1.Locals; - var exceptions_1 = require("angular2/src/core/change_detection/exceptions"); - exports.DehydratedException = exceptions_1.DehydratedException; - exports.ExpressionChangedAfterItHasBeenCheckedException = exceptions_1.ExpressionChangedAfterItHasBeenCheckedException; - exports.ChangeDetectionError = exceptions_1.ChangeDetectionError; - var interfaces_1 = require("angular2/src/core/change_detection/interfaces"); - exports.ChangeDetectorDefinition = interfaces_1.ChangeDetectorDefinition; - exports.DebugContext = interfaces_1.DebugContext; - exports.ChangeDetectorGenConfig = interfaces_1.ChangeDetectorGenConfig; - var constants_1 = require("angular2/src/core/change_detection/constants"); - exports.ChangeDetectionStrategy = constants_1.ChangeDetectionStrategy; - exports.CHANGE_DETECTION_STRATEGY_VALUES = constants_1.CHANGE_DETECTION_STRATEGY_VALUES; - var proto_change_detector_1 = require("angular2/src/core/change_detection/proto_change_detector"); - exports.DynamicProtoChangeDetector = proto_change_detector_1.DynamicProtoChangeDetector; - var jit_proto_change_detector_1 = require("angular2/src/core/change_detection/jit_proto_change_detector"); - exports.JitProtoChangeDetector = jit_proto_change_detector_1.JitProtoChangeDetector; - var binding_record_1 = require("angular2/src/core/change_detection/binding_record"); - exports.BindingRecord = binding_record_1.BindingRecord; - exports.BindingTarget = binding_record_1.BindingTarget; - var directive_record_1 = require("angular2/src/core/change_detection/directive_record"); - exports.DirectiveIndex = directive_record_1.DirectiveIndex; - exports.DirectiveRecord = directive_record_1.DirectiveRecord; - var dynamic_change_detector_1 = require("angular2/src/core/change_detection/dynamic_change_detector"); - exports.DynamicChangeDetector = dynamic_change_detector_1.DynamicChangeDetector; - var change_detector_ref_1 = require("angular2/src/core/change_detection/change_detector_ref"); - exports.ChangeDetectorRef = change_detector_ref_1.ChangeDetectorRef; - var iterable_differs_2 = require("angular2/src/core/change_detection/differs/iterable_differs"); - exports.IterableDiffers = iterable_differs_2.IterableDiffers; - var keyvalue_differs_2 = require("angular2/src/core/change_detection/differs/keyvalue_differs"); - exports.KeyValueDiffers = keyvalue_differs_2.KeyValueDiffers; - var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); - exports.WrappedValue = change_detection_util_1.WrappedValue; - exports.SimpleChange = change_detection_util_1.SimpleChange; - exports.keyValDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_keyvalue_differ_1.DefaultKeyValueDifferFactory())]); - exports.iterableDiff = lang_1.CONST_EXPR([lang_1.CONST_EXPR(new default_iterable_differ_1.DefaultIterableDifferFactory())]); - exports.defaultIterableDiffers = lang_1.CONST_EXPR(new iterable_differs_1.IterableDiffers(exports.iterableDiff)); - exports.defaultKeyValueDiffers = lang_1.CONST_EXPR(new keyvalue_differs_1.KeyValueDiffers(exports.keyValDiff)); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/console", "angular2/src/core/profile/profile", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); - var lang_1 = require("angular2/src/facade/lang"); - var di_1 = require("angular2/src/core/di"); - var application_tokens_1 = require("angular2/src/core/application_tokens"); - var async_1 = require("angular2/src/facade/async"); - var collection_1 = require("angular2/src/facade/collection"); - var testability_1 = require("angular2/src/core/testability/testability"); - var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var console_1 = require("angular2/src/core/console"); - var profile_1 = require("angular2/src/core/profile/profile"); - var lang_2 = require("angular2/src/facade/lang"); - function _componentProviders(appComponentType) { - return [di_1.provide(application_tokens_1.APP_COMPONENT, {useValue: appComponentType}), di_1.provide(application_tokens_1.APP_COMPONENT_REF_PROMISE, { - useFactory: function(dynamicComponentLoader, appRef, injector) { - var ref; - return dynamicComponentLoader.loadAsRoot(appComponentType, null, injector, function() { - appRef._unloadComponent(ref); - }).then(function(componentRef) { - ref = componentRef; - var testability = injector.getOptional(testability_1.Testability); - if (lang_1.isPresent(testability)) { - injector.get(testability_1.TestabilityRegistry).registerApplication(componentRef.location.nativeElement, testability); - } - return componentRef; - }); - }, - deps: [dynamic_component_loader_1.DynamicComponentLoader, ApplicationRef, di_1.Injector] - }), di_1.provide(appComponentType, { - useFactory: function(p) { - return p.then(function(ref) { - return ref.instance; - }); - }, - deps: [application_tokens_1.APP_COMPONENT_REF_PROMISE] - })]; - } - function createNgZone() { - return new ng_zone_1.NgZone({enableLongStackTrace: lang_1.assertionsEnabled()}); - } - exports.createNgZone = createNgZone; - var _platform; - var _platformProviders; - function platform(providers) { - lang_2.lockMode(); - if (lang_1.isPresent(_platform)) { - if (collection_1.ListWrapper.equals(_platformProviders, providers)) { - return _platform; - } else { - throw new exceptions_1.BaseException("platform cannot be initialized with different sets of providers."); - } - } else { - return _createPlatform(providers); - } - } - exports.platform = platform; - function disposePlatform() { - if (lang_1.isPresent(_platform)) { - _platform.dispose(); - _platform = null; - } - } - exports.disposePlatform = disposePlatform; - function _createPlatform(providers) { - _platformProviders = providers; - var injector = di_1.Injector.resolveAndCreate(providers); - _platform = new PlatformRef_(injector, function() { - _platform = null; - _platformProviders = null; - }); - _runPlatformInitializers(injector); - return _platform; - } - function _runPlatformInitializers(injector) { - var inits = injector.getOptional(application_tokens_1.PLATFORM_INITIALIZER); - if (lang_1.isPresent(inits)) - inits.forEach(function(init) { - return init(); - }); - } - var PlatformRef = (function() { - function PlatformRef() {} - Object.defineProperty(PlatformRef.prototype, "injector", { - get: function() { - throw exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - ; - return PlatformRef; - }()); - exports.PlatformRef = PlatformRef; - var PlatformRef_ = (function(_super) { - __extends(PlatformRef_, _super); - function PlatformRef_(_injector, _dispose) { - _super.call(this); - this._injector = _injector; - this._dispose = _dispose; - this._applications = []; - this._disposeListeners = []; - } - PlatformRef_.prototype.registerDisposeListener = function(dispose) { - this._disposeListeners.push(dispose); - }; - Object.defineProperty(PlatformRef_.prototype, "injector", { - get: function() { - return this._injector; - }, - enumerable: true, - configurable: true - }); - PlatformRef_.prototype.application = function(providers) { - var app = this._initApp(createNgZone(), providers); - if (async_1.PromiseWrapper.isPromise(app)) { - throw new exceptions_1.BaseException("Cannot use asyncronous app initializers with application. Use asyncApplication instead."); - } - return app; - }; - PlatformRef_.prototype.asyncApplication = function(bindingFn, additionalProviders) { - var _this = this; - var zone = createNgZone(); - var completer = async_1.PromiseWrapper.completer(); - if (bindingFn === null) { - completer.resolve(this._initApp(zone, additionalProviders)); - } else { - zone.run(function() { - async_1.PromiseWrapper.then(bindingFn(zone), function(providers) { - if (lang_1.isPresent(additionalProviders)) { - providers = collection_1.ListWrapper.concat(providers, additionalProviders); - } - var promise = _this._initApp(zone, providers); - completer.resolve(promise); - }); - }); - } - return completer.promise; - }; - PlatformRef_.prototype._initApp = function(zone, providers) { - var _this = this; - var injector; - var app; - zone.run(function() { - providers = collection_1.ListWrapper.concat(providers, [di_1.provide(ng_zone_1.NgZone, {useValue: zone}), di_1.provide(ApplicationRef, { - useFactory: function() { - return app; - }, - deps: [] - })]); - var exceptionHandler; - try { - injector = _this.injector.resolveAndCreateChild(providers); - exceptionHandler = injector.get(exceptions_1.ExceptionHandler); - async_1.ObservableWrapper.subscribe(zone.onError, function(error) { - exceptionHandler.call(error.error, error.stackTrace); - }); - } catch (e) { - if (lang_1.isPresent(exceptionHandler)) { - exceptionHandler.call(e, e.stack); - } else { - lang_1.print(e.toString()); - } - } - }); - app = new ApplicationRef_(this, zone, injector); - this._applications.push(app); - var promise = _runAppInitializers(injector); - if (promise !== null) { - return async_1.PromiseWrapper.then(promise, function(_) { - return app; - }); - } else { - return app; - } - }; - PlatformRef_.prototype.dispose = function() { - collection_1.ListWrapper.clone(this._applications).forEach(function(app) { - return app.dispose(); - }); - this._disposeListeners.forEach(function(dispose) { - return dispose(); - }); - this._dispose(); - }; - PlatformRef_.prototype._applicationDisposed = function(app) { - collection_1.ListWrapper.remove(this._applications, app); - }; - return PlatformRef_; - }(PlatformRef)); - exports.PlatformRef_ = PlatformRef_; - function _runAppInitializers(injector) { - var inits = injector.getOptional(application_tokens_1.APP_INITIALIZER); - var promises = []; - if (lang_1.isPresent(inits)) { - inits.forEach(function(init) { - var retVal = init(); - if (async_1.PromiseWrapper.isPromise(retVal)) { - promises.push(retVal); - } - }); - } - if (promises.length > 0) { - return async_1.PromiseWrapper.all(promises); - } else { - return null; - } - } - var ApplicationRef = (function() { - function ApplicationRef() {} - Object.defineProperty(ApplicationRef.prototype, "injector", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - ; - Object.defineProperty(ApplicationRef.prototype, "zone", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - ; - Object.defineProperty(ApplicationRef.prototype, "componentTypes", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - ; - return ApplicationRef; - }()); - exports.ApplicationRef = ApplicationRef; - var ApplicationRef_ = (function(_super) { - __extends(ApplicationRef_, _super); - function ApplicationRef_(_platform, _zone, _injector) { - var _this = this; - _super.call(this); - this._platform = _platform; - this._zone = _zone; - this._injector = _injector; - this._bootstrapListeners = []; - this._disposeListeners = []; - this._rootComponents = []; - this._rootComponentTypes = []; - this._changeDetectorRefs = []; - this._runningTick = false; - this._enforceNoNewChanges = false; - if (lang_1.isPresent(this._zone)) { - async_1.ObservableWrapper.subscribe(this._zone.onMicrotaskEmpty, function(_) { - _this._zone.run(function() { - _this.tick(); - }); - }); - } - this._enforceNoNewChanges = lang_1.assertionsEnabled(); - } - ApplicationRef_.prototype.registerBootstrapListener = function(listener) { - this._bootstrapListeners.push(listener); - }; - ApplicationRef_.prototype.registerDisposeListener = function(dispose) { - this._disposeListeners.push(dispose); - }; - ApplicationRef_.prototype.registerChangeDetector = function(changeDetector) { - this._changeDetectorRefs.push(changeDetector); - }; - ApplicationRef_.prototype.unregisterChangeDetector = function(changeDetector) { - collection_1.ListWrapper.remove(this._changeDetectorRefs, changeDetector); - }; - ApplicationRef_.prototype.bootstrap = function(componentType, providers) { - var _this = this; - var completer = async_1.PromiseWrapper.completer(); - this._zone.run(function() { - var componentProviders = _componentProviders(componentType); - if (lang_1.isPresent(providers)) { - componentProviders.push(providers); - } - var exceptionHandler = _this._injector.get(exceptions_1.ExceptionHandler); - _this._rootComponentTypes.push(componentType); - try { - var injector = _this._injector.resolveAndCreateChild(componentProviders); - var compRefToken = injector.get(application_tokens_1.APP_COMPONENT_REF_PROMISE); - var tick = function(componentRef) { - _this._loadComponent(componentRef); - completer.resolve(componentRef); - }; - var tickResult = async_1.PromiseWrapper.then(compRefToken, tick); - async_1.PromiseWrapper.then(tickResult, null, function(err, stackTrace) { - completer.reject(err, stackTrace); - exceptionHandler.call(err, stackTrace); - }); - } catch (e) { - exceptionHandler.call(e, e.stack); - completer.reject(e, e.stack); - } - }); - return completer.promise.then(function(ref) { - var c = _this._injector.get(console_1.Console); - if (lang_1.assertionsEnabled()) { - c.log("Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode."); - } - return ref; - }); - }; - ApplicationRef_.prototype._loadComponent = function(componentRef) { - var appChangeDetector = componentRef.location.internalElement.parentView.changeDetector; - this._changeDetectorRefs.push(appChangeDetector.ref); - this.tick(); - this._rootComponents.push(componentRef); - this._bootstrapListeners.forEach(function(listener) { - return listener(componentRef); - }); - }; - ApplicationRef_.prototype._unloadComponent = function(componentRef) { - if (!collection_1.ListWrapper.contains(this._rootComponents, componentRef)) { - return ; - } - this.unregisterChangeDetector(componentRef.location.internalElement.parentView.changeDetector.ref); - collection_1.ListWrapper.remove(this._rootComponents, componentRef); - }; - Object.defineProperty(ApplicationRef_.prototype, "injector", { - get: function() { - return this._injector; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(ApplicationRef_.prototype, "zone", { - get: function() { - return this._zone; - }, - enumerable: true, - configurable: true - }); - ApplicationRef_.prototype.tick = function() { - if (this._runningTick) { - throw new exceptions_1.BaseException("ApplicationRef.tick is called recursively"); - } - var s = ApplicationRef_._tickScope(); - try { - this._runningTick = true; - this._changeDetectorRefs.forEach(function(detector) { - return detector.detectChanges(); - }); - if (this._enforceNoNewChanges) { - this._changeDetectorRefs.forEach(function(detector) { - return detector.checkNoChanges(); - }); - } - } finally { - this._runningTick = false; - profile_1.wtfLeave(s); - } - }; - ApplicationRef_.prototype.dispose = function() { - collection_1.ListWrapper.clone(this._rootComponents).forEach(function(ref) { - return ref.dispose(); - }); - this._disposeListeners.forEach(function(dispose) { - return dispose(); - }); - this._platform._applicationDisposed(this); - }; - Object.defineProperty(ApplicationRef_.prototype, "componentTypes", { - get: function() { - return this._rootComponentTypes; - }, - enumerable: true, - configurable: true - }); - ApplicationRef_._tickScope = profile_1.wtfCreateScope('ApplicationRef#tick()'); - return ApplicationRef_; - }(ApplicationRef)); - exports.ApplicationRef_ = ApplicationRef_; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/change_detection", ["angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); - exports.ChangeDetectionStrategy = change_detection_1.ChangeDetectionStrategy; - exports.ExpressionChangedAfterItHasBeenCheckedException = change_detection_1.ExpressionChangedAfterItHasBeenCheckedException; - exports.ChangeDetectionError = change_detection_1.ChangeDetectionError; - exports.ChangeDetectorRef = change_detection_1.ChangeDetectorRef; - exports.WrappedValue = change_detection_1.WrappedValue; - exports.SimpleChange = change_detection_1.SimpleChange; - exports.IterableDiffers = change_detection_1.IterableDiffers; - exports.KeyValueDiffers = change_detection_1.KeyValueDiffers; - exports.CollectionChangeRecord = change_detection_1.CollectionChangeRecord; - exports.KeyValueChangeRecord = change_detection_1.KeyValueChangeRecord; - global.define = __define; - return module.exports; -}); - -System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/prod_mode", "angular2/src/core/di", "angular2/src/facade/facade", "angular2/src/facade/lang", "angular2/src/core/application_ref", "angular2/src/core/application_tokens", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/debug/debug_node", "angular2/src/core/testability/testability", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/platform_common_providers", "angular2/src/core/application_common_providers", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function __export(m) { - for (var p in m) - if (!exports.hasOwnProperty(p)) - exports[p] = m[p]; - } - __export(require("angular2/src/core/metadata")); - __export(require("angular2/src/core/util")); - __export(require("angular2/src/core/prod_mode")); - __export(require("angular2/src/core/di")); - __export(require("angular2/src/facade/facade")); - var lang_1 = require("angular2/src/facade/lang"); - exports.enableProdMode = lang_1.enableProdMode; - var application_ref_1 = require("angular2/src/core/application_ref"); - exports.platform = application_ref_1.platform; - exports.createNgZone = application_ref_1.createNgZone; - exports.PlatformRef = application_ref_1.PlatformRef; - exports.ApplicationRef = application_ref_1.ApplicationRef; - var application_tokens_1 = require("angular2/src/core/application_tokens"); - exports.APP_ID = application_tokens_1.APP_ID; - exports.APP_COMPONENT = application_tokens_1.APP_COMPONENT; - exports.APP_INITIALIZER = application_tokens_1.APP_INITIALIZER; - exports.PACKAGE_ROOT_URL = application_tokens_1.PACKAGE_ROOT_URL; - exports.PLATFORM_INITIALIZER = application_tokens_1.PLATFORM_INITIALIZER; - __export(require("angular2/src/core/zone")); - __export(require("angular2/src/core/render")); - __export(require("angular2/src/core/linker")); - var debug_node_1 = require("angular2/src/core/debug/debug_node"); - exports.DebugElement = debug_node_1.DebugElement; - exports.DebugNode = debug_node_1.DebugNode; - exports.asNativeElements = debug_node_1.asNativeElements; - __export(require("angular2/src/core/testability/testability")); - __export(require("angular2/src/core/change_detection")); - __export(require("angular2/src/core/platform_directives_and_pipes")); - __export(require("angular2/src/core/platform_common_providers")); - __export(require("angular2/src/core/application_common_providers")); - __export(require("angular2/src/core/reflection/reflection")); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/facade/async", ["angular2/src/facade/lang", "angular2/src/facade/promise", "rxjs/Subject", "rxjs/observable/PromiseObservable", "rxjs/operator/toPromise", "rxjs/Observable", "rxjs/Subject"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var lang_1 = require("angular2/src/facade/lang"); - var promise_1 = require("angular2/src/facade/promise"); - exports.PromiseWrapper = promise_1.PromiseWrapper; - exports.PromiseCompleter = promise_1.PromiseCompleter; - var Subject_1 = require("rxjs/Subject"); - var PromiseObservable_1 = require("rxjs/observable/PromiseObservable"); - var toPromise_1 = require("rxjs/operator/toPromise"); - var Observable_1 = require("rxjs/Observable"); - exports.Observable = Observable_1.Observable; - var Subject_2 = require("rxjs/Subject"); - exports.Subject = Subject_2.Subject; - var TimerWrapper = (function() { - function TimerWrapper() {} - TimerWrapper.setTimeout = function(fn, millis) { - return lang_1.global.setTimeout(fn, millis); - }; - TimerWrapper.clearTimeout = function(id) { - lang_1.global.clearTimeout(id); - }; - TimerWrapper.setInterval = function(fn, millis) { - return lang_1.global.setInterval(fn, millis); - }; - TimerWrapper.clearInterval = function(id) { - lang_1.global.clearInterval(id); - }; - return TimerWrapper; - }()); - exports.TimerWrapper = TimerWrapper; - var ObservableWrapper = (function() { - function ObservableWrapper() {} - ObservableWrapper.subscribe = function(emitter, onNext, onError, onComplete) { - if (onComplete === void 0) { - onComplete = function() {}; - } - onError = (typeof onError === "function") && onError || lang_1.noop; - onComplete = (typeof onComplete === "function") && onComplete || lang_1.noop; - return emitter.subscribe({ - next: onNext, - error: onError, - complete: onComplete - }); - }; - ObservableWrapper.isObservable = function(obs) { - return !!obs.subscribe; - }; - ObservableWrapper.hasSubscribers = function(obs) { - return obs.observers.length > 0; - }; - ObservableWrapper.dispose = function(subscription) { - subscription.unsubscribe(); - }; - ObservableWrapper.callNext = function(emitter, value) { - emitter.next(value); - }; - ObservableWrapper.callEmit = function(emitter, value) { - emitter.emit(value); - }; - ObservableWrapper.callError = function(emitter, error) { - emitter.error(error); - }; - ObservableWrapper.callComplete = function(emitter) { - emitter.complete(); - }; - ObservableWrapper.fromPromise = function(promise) { - return PromiseObservable_1.PromiseObservable.create(promise); - }; - ObservableWrapper.toPromise = function(obj) { - return toPromise_1.toPromise.call(obj); - }; - return ObservableWrapper; - }()); - exports.ObservableWrapper = ObservableWrapper; - var EventEmitter = (function(_super) { - __extends(EventEmitter, _super); - function EventEmitter(isAsync) { - if (isAsync === void 0) { - isAsync = true; - } - _super.call(this); - this._isAsync = isAsync; - } - EventEmitter.prototype.emit = function(value) { - _super.prototype.next.call(this, value); - }; - EventEmitter.prototype.next = function(value) { - _super.prototype.next.call(this, value); - }; - EventEmitter.prototype.subscribe = function(generatorOrNext, error, complete) { - var schedulerFn; - var errorFn = function(err) { - return null; - }; - var completeFn = function() { - return null; - }; - if (generatorOrNext && typeof generatorOrNext === 'object') { - schedulerFn = this._isAsync ? function(value) { - setTimeout(function() { - return generatorOrNext.next(value); - }); - } : function(value) { - generatorOrNext.next(value); - }; - if (generatorOrNext.error) { - errorFn = this._isAsync ? function(err) { - setTimeout(function() { - return generatorOrNext.error(err); - }); - } : function(err) { - generatorOrNext.error(err); - }; - } - if (generatorOrNext.complete) { - completeFn = this._isAsync ? function() { - setTimeout(function() { - return generatorOrNext.complete(); - }); - } : function() { - generatorOrNext.complete(); - }; - } - } else { - schedulerFn = this._isAsync ? function(value) { - setTimeout(function() { - return generatorOrNext(value); - }); - } : function(value) { - generatorOrNext(value); - }; - if (error) { - errorFn = this._isAsync ? function(err) { - setTimeout(function() { - return error(err); - }); - } : function(err) { - error(err); - }; - } - if (complete) { - completeFn = this._isAsync ? function() { - setTimeout(function() { - return complete(); - }); - } : function() { - complete(); - }; - } - } - return _super.prototype.subscribe.call(this, schedulerFn, errorFn, completeFn); - }; - return EventEmitter; - }(Subject_1.Subject)); - exports.EventEmitter = EventEmitter; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/metadata/directives", ["angular2/src/facade/lang", "angular2/src/core/di/metadata", "angular2/src/core/change_detection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var metadata_1 = require("angular2/src/core/di/metadata"); - var change_detection_1 = require("angular2/src/core/change_detection"); - var DirectiveMetadata = (function(_super) { - __extends(DirectiveMetadata, _super); - function DirectiveMetadata(_a) { - var _b = _a === void 0 ? {} : _a, - selector = _b.selector, - inputs = _b.inputs, - outputs = _b.outputs, - properties = _b.properties, - events = _b.events, - host = _b.host, - bindings = _b.bindings, - providers = _b.providers, - exportAs = _b.exportAs, - queries = _b.queries; - _super.call(this); - this.selector = selector; - this._inputs = inputs; - this._properties = properties; - this._outputs = outputs; - this._events = events; - this.host = host; - this.exportAs = exportAs; - this.queries = queries; - this._providers = providers; - this._bindings = bindings; - } - Object.defineProperty(DirectiveMetadata.prototype, "inputs", { - get: function() { - return lang_1.isPresent(this._properties) && this._properties.length > 0 ? this._properties : this._inputs; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DirectiveMetadata.prototype, "properties", { - get: function() { - return this.inputs; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DirectiveMetadata.prototype, "outputs", { - get: function() { - return lang_1.isPresent(this._events) && this._events.length > 0 ? this._events : this._outputs; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DirectiveMetadata.prototype, "events", { - get: function() { - return this.outputs; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DirectiveMetadata.prototype, "providers", { - get: function() { - return lang_1.isPresent(this._bindings) && this._bindings.length > 0 ? this._bindings : this._providers; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DirectiveMetadata.prototype, "bindings", { - get: function() { - return this.providers; - }, - enumerable: true, - configurable: true - }); - DirectiveMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], DirectiveMetadata); - return DirectiveMetadata; - }(metadata_1.InjectableMetadata)); - exports.DirectiveMetadata = DirectiveMetadata; - var ComponentMetadata = (function(_super) { - __extends(ComponentMetadata, _super); - function ComponentMetadata(_a) { - var _b = _a === void 0 ? {} : _a, - selector = _b.selector, - inputs = _b.inputs, - outputs = _b.outputs, - properties = _b.properties, - events = _b.events, - host = _b.host, - exportAs = _b.exportAs, - moduleId = _b.moduleId, - bindings = _b.bindings, - providers = _b.providers, - viewBindings = _b.viewBindings, - viewProviders = _b.viewProviders, - _c = _b.changeDetection, - changeDetection = _c === void 0 ? change_detection_1.ChangeDetectionStrategy.Default : _c, - queries = _b.queries, - templateUrl = _b.templateUrl, - template = _b.template, - styleUrls = _b.styleUrls, - styles = _b.styles, - directives = _b.directives, - pipes = _b.pipes, - encapsulation = _b.encapsulation; - _super.call(this, { - selector: selector, - inputs: inputs, - outputs: outputs, - properties: properties, - events: events, - host: host, - exportAs: exportAs, - bindings: bindings, - providers: providers, - queries: queries - }); - this.changeDetection = changeDetection; - this._viewProviders = viewProviders; - this._viewBindings = viewBindings; - this.templateUrl = templateUrl; - this.template = template; - this.styleUrls = styleUrls; - this.styles = styles; - this.directives = directives; - this.pipes = pipes; - this.encapsulation = encapsulation; - this.moduleId = moduleId; - } - Object.defineProperty(ComponentMetadata.prototype, "viewProviders", { - get: function() { - return lang_1.isPresent(this._viewBindings) && this._viewBindings.length > 0 ? this._viewBindings : this._viewProviders; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(ComponentMetadata.prototype, "viewBindings", { - get: function() { - return this.viewProviders; - }, - enumerable: true, - configurable: true - }); - ComponentMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], ComponentMetadata); - return ComponentMetadata; - }(DirectiveMetadata)); - exports.ComponentMetadata = ComponentMetadata; - var PipeMetadata = (function(_super) { - __extends(PipeMetadata, _super); - function PipeMetadata(_a) { - var name = _a.name, - pure = _a.pure; - _super.call(this); - this.name = name; - this._pure = pure; - } - Object.defineProperty(PipeMetadata.prototype, "pure", { - get: function() { - return lang_1.isPresent(this._pure) ? this._pure : true; - }, - enumerable: true, - configurable: true - }); - PipeMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [Object])], PipeMetadata); - return PipeMetadata; - }(metadata_1.InjectableMetadata)); - exports.PipeMetadata = PipeMetadata; - var InputMetadata = (function() { - function InputMetadata(bindingPropertyName) { - this.bindingPropertyName = bindingPropertyName; - } - InputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], InputMetadata); - return InputMetadata; - }()); - exports.InputMetadata = InputMetadata; - var OutputMetadata = (function() { - function OutputMetadata(bindingPropertyName) { - this.bindingPropertyName = bindingPropertyName; - } - OutputMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], OutputMetadata); - return OutputMetadata; - }()); - exports.OutputMetadata = OutputMetadata; - var HostBindingMetadata = (function() { - function HostBindingMetadata(hostPropertyName) { - this.hostPropertyName = hostPropertyName; - } - HostBindingMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], HostBindingMetadata); - return HostBindingMetadata; - }()); - exports.HostBindingMetadata = HostBindingMetadata; - var HostListenerMetadata = (function() { - function HostListenerMetadata(eventName, args) { - this.eventName = eventName; - this.args = args; - } - HostListenerMetadata = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String, Array])], HostListenerMetadata); - return HostListenerMetadata; - }()); - exports.HostListenerMetadata = HostListenerMetadata; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/events/dom_events", ["angular2/src/platform/dom/dom_adapter", "angular2/core", "angular2/src/platform/dom/events/event_manager"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var core_1 = require("angular2/core"); - var event_manager_1 = require("angular2/src/platform/dom/events/event_manager"); - var DomEventsPlugin = (function(_super) { - __extends(DomEventsPlugin, _super); - function DomEventsPlugin() { - _super.apply(this, arguments); - } - DomEventsPlugin.prototype.supports = function(eventName) { - return true; - }; - DomEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { - var zone = this.manager.getZone(); - var outsideHandler = function(event) { - return zone.run(function() { - return handler(event); - }); - }; - return this.manager.getZone().runOutsideAngular(function() { - return dom_adapter_1.DOM.onAndCancel(element, eventName, outsideHandler); - }); - }; - DomEventsPlugin.prototype.addGlobalEventListener = function(target, eventName, handler) { - var element = dom_adapter_1.DOM.getGlobalEventTarget(target); - var zone = this.manager.getZone(); - var outsideHandler = function(event) { - return zone.run(function() { - return handler(event); - }); - }; - return this.manager.getZone().runOutsideAngular(function() { - return dom_adapter_1.DOM.onAndCancel(element, eventName, outsideHandler); - }); - }; - DomEventsPlugin = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [])], DomEventsPlugin); - return DomEventsPlugin; - }(event_manager_1.EventManagerPlugin)); - exports.DomEventsPlugin = DomEventsPlugin; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/zone/ng_zone", ["angular2/src/facade/async", "angular2/src/core/zone/ng_zone_impl", "angular2/src/facade/exceptions", "angular2/src/core/zone/ng_zone_impl"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var async_1 = require("angular2/src/facade/async"); - var ng_zone_impl_1 = require("angular2/src/core/zone/ng_zone_impl"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var ng_zone_impl_2 = require("angular2/src/core/zone/ng_zone_impl"); - exports.NgZoneError = ng_zone_impl_2.NgZoneError; - var NgZone = (function() { - function NgZone(_a) { - var _this = this; - var _b = _a.enableLongStackTrace, - enableLongStackTrace = _b === void 0 ? false : _b; - this._hasPendingMicrotasks = false; - this._hasPendingMacrotasks = false; - this._isStable = true; - this._nesting = 0; - this._onUnstable = new async_1.EventEmitter(false); - this._onMicrotaskEmpty = new async_1.EventEmitter(false); - this._onStable = new async_1.EventEmitter(false); - this._onErrorEvents = new async_1.EventEmitter(false); - this._zoneImpl = new ng_zone_impl_1.NgZoneImpl({ - trace: enableLongStackTrace, - onEnter: function() { - _this._nesting++; - if (_this._isStable) { - _this._isStable = false; - _this._onUnstable.emit(null); - } - }, - onLeave: function() { - _this._nesting--; - _this._checkStable(); - }, - setMicrotask: function(hasMicrotasks) { - _this._hasPendingMicrotasks = hasMicrotasks; - _this._checkStable(); - }, - setMacrotask: function(hasMacrotasks) { - _this._hasPendingMacrotasks = hasMacrotasks; - }, - onError: function(error) { - return _this._onErrorEvents.emit(error); - } - }); - } - NgZone.isInAngularZone = function() { - return ng_zone_impl_1.NgZoneImpl.isInAngularZone(); - }; - NgZone.assertInAngularZone = function() { - if (!ng_zone_impl_1.NgZoneImpl.isInAngularZone()) { - throw new exceptions_1.BaseException('Expected to be in Angular Zone, but it is not!'); - } - }; - NgZone.assertNotInAngularZone = function() { - if (ng_zone_impl_1.NgZoneImpl.isInAngularZone()) { - throw new exceptions_1.BaseException('Expected to not be in Angular Zone, but it is!'); - } - }; - NgZone.prototype._checkStable = function() { - var _this = this; - if (this._nesting == 0) { - if (!this._hasPendingMicrotasks && !this._isStable) { - try { - this._nesting++; - this._onMicrotaskEmpty.emit(null); - } finally { - this._nesting--; - if (!this._hasPendingMicrotasks) { - try { - this.runOutsideAngular(function() { - return _this._onStable.emit(null); - }); - } finally { - this._isStable = true; - } - } - } - } - } - }; - ; - Object.defineProperty(NgZone.prototype, "onUnstable", { - get: function() { - return this._onUnstable; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgZone.prototype, "onMicrotaskEmpty", { - get: function() { - return this._onMicrotaskEmpty; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgZone.prototype, "onStable", { - get: function() { - return this._onStable; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgZone.prototype, "onError", { - get: function() { - return this._onErrorEvents; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgZone.prototype, "hasPendingMicrotasks", { - get: function() { - return this._hasPendingMicrotasks; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgZone.prototype, "hasPendingMacrotasks", { - get: function() { - return this._hasPendingMacrotasks; - }, - enumerable: true, - configurable: true - }); - NgZone.prototype.run = function(fn) { - return this._zoneImpl.runInner(fn); - }; - NgZone.prototype.runOutsideAngular = function(fn) { - return this._zoneImpl.runOuter(fn); - }; - return NgZone; - }()); - exports.NgZone = NgZone; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/metadata", ["angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/metadata/di", "angular2/src/core/metadata/directives", "angular2/src/core/metadata/view", "angular2/src/core/util/decorators"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var di_1 = require("angular2/src/core/metadata/di"); - exports.QueryMetadata = di_1.QueryMetadata; - exports.ContentChildrenMetadata = di_1.ContentChildrenMetadata; - exports.ContentChildMetadata = di_1.ContentChildMetadata; - exports.ViewChildrenMetadata = di_1.ViewChildrenMetadata; - exports.ViewQueryMetadata = di_1.ViewQueryMetadata; - exports.ViewChildMetadata = di_1.ViewChildMetadata; - exports.AttributeMetadata = di_1.AttributeMetadata; - var directives_1 = require("angular2/src/core/metadata/directives"); - exports.ComponentMetadata = directives_1.ComponentMetadata; - exports.DirectiveMetadata = directives_1.DirectiveMetadata; - exports.PipeMetadata = directives_1.PipeMetadata; - exports.InputMetadata = directives_1.InputMetadata; - exports.OutputMetadata = directives_1.OutputMetadata; - exports.HostBindingMetadata = directives_1.HostBindingMetadata; - exports.HostListenerMetadata = directives_1.HostListenerMetadata; - var view_1 = require("angular2/src/core/metadata/view"); - exports.ViewMetadata = view_1.ViewMetadata; - exports.ViewEncapsulation = view_1.ViewEncapsulation; - var di_2 = require("angular2/src/core/metadata/di"); - var directives_2 = require("angular2/src/core/metadata/directives"); - var view_2 = require("angular2/src/core/metadata/view"); - var decorators_1 = require("angular2/src/core/util/decorators"); - exports.Component = decorators_1.makeDecorator(directives_2.ComponentMetadata, function(fn) { - return fn.View = View; - }); - exports.Directive = decorators_1.makeDecorator(directives_2.DirectiveMetadata); - var View = decorators_1.makeDecorator(view_2.ViewMetadata, function(fn) { - return fn.View = View; - }); - exports.Attribute = decorators_1.makeParamDecorator(di_2.AttributeMetadata); - exports.Query = decorators_1.makeParamDecorator(di_2.QueryMetadata); - exports.ContentChildren = decorators_1.makePropDecorator(di_2.ContentChildrenMetadata); - exports.ContentChild = decorators_1.makePropDecorator(di_2.ContentChildMetadata); - exports.ViewChildren = decorators_1.makePropDecorator(di_2.ViewChildrenMetadata); - exports.ViewChild = decorators_1.makePropDecorator(di_2.ViewChildMetadata); - exports.ViewQuery = decorators_1.makeParamDecorator(di_2.ViewQueryMetadata); - exports.Pipe = decorators_1.makeDecorator(directives_2.PipeMetadata); - exports.Input = decorators_1.makePropDecorator(directives_2.InputMetadata); - exports.Output = decorators_1.makePropDecorator(directives_2.OutputMetadata); - exports.HostBinding = decorators_1.makePropDecorator(directives_2.HostBindingMetadata); - exports.HostListener = decorators_1.makePropDecorator(directives_2.HostListenerMetadata); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/events/event_manager", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/di", "angular2/src/core/zone/ng_zone", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var di_1 = require("angular2/src/core/di"); - var ng_zone_1 = require("angular2/src/core/zone/ng_zone"); - var collection_1 = require("angular2/src/facade/collection"); - exports.EVENT_MANAGER_PLUGINS = lang_1.CONST_EXPR(new di_1.OpaqueToken("EventManagerPlugins")); - var EventManager = (function() { - function EventManager(plugins, _zone) { - var _this = this; - this._zone = _zone; - plugins.forEach(function(p) { - return p.manager = _this; - }); - this._plugins = collection_1.ListWrapper.reversed(plugins); - } - EventManager.prototype.addEventListener = function(element, eventName, handler) { - var plugin = this._findPluginFor(eventName); - return plugin.addEventListener(element, eventName, handler); - }; - EventManager.prototype.addGlobalEventListener = function(target, eventName, handler) { - var plugin = this._findPluginFor(eventName); - return plugin.addGlobalEventListener(target, eventName, handler); - }; - EventManager.prototype.getZone = function() { - return this._zone; - }; - EventManager.prototype._findPluginFor = function(eventName) { - var plugins = this._plugins; - for (var i = 0; i < plugins.length; i++) { - var plugin = plugins[i]; - if (plugin.supports(eventName)) { - return plugin; - } - } - throw new exceptions_1.BaseException("No event manager plugin found for event " + eventName); - }; - EventManager = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.EVENT_MANAGER_PLUGINS)), __metadata('design:paramtypes', [Array, ng_zone_1.NgZone])], EventManager); - return EventManager; - }()); - exports.EventManager = EventManager; - var EventManagerPlugin = (function() { - function EventManagerPlugin() {} - EventManagerPlugin.prototype.supports = function(eventName) { - return false; - }; - EventManagerPlugin.prototype.addEventListener = function(element, eventName, handler) { - throw "not implemented"; - }; - EventManagerPlugin.prototype.addGlobalEventListener = function(element, eventName, handler) { - throw "not implemented"; - }; - return EventManagerPlugin; - }()); - exports.EventManagerPlugin = EventManagerPlugin; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/dom_renderer", ["angular2/src/core/di", "angular2/src/animate/animation_builder", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/platform/dom/shared_styles_host", "angular2/src/platform/dom/events/event_manager", "angular2/src/platform/dom/dom_tokens", "angular2/src/core/metadata", "angular2/src/platform/dom/dom_adapter", "angular2/src/platform/dom/util"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var di_1 = require("angular2/src/core/di"); - var animation_builder_1 = require("angular2/src/animate/animation_builder"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var shared_styles_host_1 = require("angular2/src/platform/dom/shared_styles_host"); - var event_manager_1 = require("angular2/src/platform/dom/events/event_manager"); - var dom_tokens_1 = require("angular2/src/platform/dom/dom_tokens"); - var metadata_1 = require("angular2/src/core/metadata"); - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var util_1 = require("angular2/src/platform/dom/util"); - var NAMESPACE_URIS = lang_1.CONST_EXPR({ - 'xlink': 'http://www.w3.org/1999/xlink', - 'svg': 'http://www.w3.org/2000/svg' - }); - var TEMPLATE_COMMENT_TEXT = 'template bindings={}'; - var TEMPLATE_BINDINGS_EXP = /^template bindings=(.*)$/g; - var DomRootRenderer = (function() { - function DomRootRenderer(document, eventManager, sharedStylesHost, animate) { - this.document = document; - this.eventManager = eventManager; - this.sharedStylesHost = sharedStylesHost; - this.animate = animate; - this._registeredComponents = new Map(); - } - DomRootRenderer.prototype.renderComponent = function(componentProto) { - var renderer = this._registeredComponents.get(componentProto.id); - if (lang_1.isBlank(renderer)) { - renderer = new DomRenderer(this, componentProto); - this._registeredComponents.set(componentProto.id, renderer); - } - return renderer; - }; - return DomRootRenderer; - }()); - exports.DomRootRenderer = DomRootRenderer; - var DomRootRenderer_ = (function(_super) { - __extends(DomRootRenderer_, _super); - function DomRootRenderer_(_document, _eventManager, sharedStylesHost, animate) { - _super.call(this, _document, _eventManager, sharedStylesHost, animate); - } - DomRootRenderer_ = __decorate([di_1.Injectable(), __param(0, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [Object, event_manager_1.EventManager, shared_styles_host_1.DomSharedStylesHost, animation_builder_1.AnimationBuilder])], DomRootRenderer_); - return DomRootRenderer_; - }(DomRootRenderer)); - exports.DomRootRenderer_ = DomRootRenderer_; - var DomRenderer = (function() { - function DomRenderer(_rootRenderer, componentProto) { - this._rootRenderer = _rootRenderer; - this.componentProto = componentProto; - this._styles = _flattenStyles(componentProto.id, componentProto.styles, []); - if (componentProto.encapsulation !== metadata_1.ViewEncapsulation.Native) { - this._rootRenderer.sharedStylesHost.addStyles(this._styles); - } - if (this.componentProto.encapsulation === metadata_1.ViewEncapsulation.Emulated) { - this._contentAttr = _shimContentAttribute(componentProto.id); - this._hostAttr = _shimHostAttribute(componentProto.id); - } else { - this._contentAttr = null; - this._hostAttr = null; - } - } - DomRenderer.prototype.renderComponent = function(componentProto) { - return this._rootRenderer.renderComponent(componentProto); - }; - DomRenderer.prototype.selectRootElement = function(selector) { - var el = dom_adapter_1.DOM.querySelector(this._rootRenderer.document, selector); - if (lang_1.isBlank(el)) { - throw new exceptions_1.BaseException("The selector \"" + selector + "\" did not match any elements"); - } - dom_adapter_1.DOM.clearNodes(el); - return el; - }; - DomRenderer.prototype.createElement = function(parent, name) { - var nsAndName = splitNamespace(name); - var el = lang_1.isPresent(nsAndName[0]) ? dom_adapter_1.DOM.createElementNS(NAMESPACE_URIS[nsAndName[0]], nsAndName[1]) : dom_adapter_1.DOM.createElement(nsAndName[1]); - if (lang_1.isPresent(this._contentAttr)) { - dom_adapter_1.DOM.setAttribute(el, this._contentAttr, ''); - } - if (lang_1.isPresent(parent)) { - dom_adapter_1.DOM.appendChild(parent, el); - } - return el; - }; - DomRenderer.prototype.createViewRoot = function(hostElement) { - var nodesParent; - if (this.componentProto.encapsulation === metadata_1.ViewEncapsulation.Native) { - nodesParent = dom_adapter_1.DOM.createShadowRoot(hostElement); - this._rootRenderer.sharedStylesHost.addHost(nodesParent); - for (var i = 0; i < this._styles.length; i++) { - dom_adapter_1.DOM.appendChild(nodesParent, dom_adapter_1.DOM.createStyleElement(this._styles[i])); - } - } else { - if (lang_1.isPresent(this._hostAttr)) { - dom_adapter_1.DOM.setAttribute(hostElement, this._hostAttr, ''); - } - nodesParent = hostElement; - } - return nodesParent; - }; - DomRenderer.prototype.createTemplateAnchor = function(parentElement) { - var comment = dom_adapter_1.DOM.createComment(TEMPLATE_COMMENT_TEXT); - if (lang_1.isPresent(parentElement)) { - dom_adapter_1.DOM.appendChild(parentElement, comment); - } - return comment; - }; - DomRenderer.prototype.createText = function(parentElement, value) { - var node = dom_adapter_1.DOM.createTextNode(value); - if (lang_1.isPresent(parentElement)) { - dom_adapter_1.DOM.appendChild(parentElement, node); - } - return node; - }; - DomRenderer.prototype.projectNodes = function(parentElement, nodes) { - if (lang_1.isBlank(parentElement)) - return ; - appendNodes(parentElement, nodes); - }; - DomRenderer.prototype.attachViewAfter = function(node, viewRootNodes) { - moveNodesAfterSibling(node, viewRootNodes); - for (var i = 0; i < viewRootNodes.length; i++) - this.animateNodeEnter(viewRootNodes[i]); - }; - DomRenderer.prototype.detachView = function(viewRootNodes) { - for (var i = 0; i < viewRootNodes.length; i++) { - var node = viewRootNodes[i]; - dom_adapter_1.DOM.remove(node); - this.animateNodeLeave(node); - } - }; - DomRenderer.prototype.destroyView = function(hostElement, viewAllNodes) { - if (this.componentProto.encapsulation === metadata_1.ViewEncapsulation.Native && lang_1.isPresent(hostElement)) { - this._rootRenderer.sharedStylesHost.removeHost(dom_adapter_1.DOM.getShadowRoot(hostElement)); - } - }; - DomRenderer.prototype.listen = function(renderElement, name, callback) { - return this._rootRenderer.eventManager.addEventListener(renderElement, name, decoratePreventDefault(callback)); - }; - DomRenderer.prototype.listenGlobal = function(target, name, callback) { - return this._rootRenderer.eventManager.addGlobalEventListener(target, name, decoratePreventDefault(callback)); - }; - DomRenderer.prototype.setElementProperty = function(renderElement, propertyName, propertyValue) { - dom_adapter_1.DOM.setProperty(renderElement, propertyName, propertyValue); - }; - DomRenderer.prototype.setElementAttribute = function(renderElement, attributeName, attributeValue) { - var attrNs; - var nsAndName = splitNamespace(attributeName); - if (lang_1.isPresent(nsAndName[0])) { - attributeName = nsAndName[0] + ':' + nsAndName[1]; - attrNs = NAMESPACE_URIS[nsAndName[0]]; - } - if (lang_1.isPresent(attributeValue)) { - if (lang_1.isPresent(attrNs)) { - dom_adapter_1.DOM.setAttributeNS(renderElement, attrNs, attributeName, attributeValue); - } else { - dom_adapter_1.DOM.setAttribute(renderElement, attributeName, attributeValue); - } - } else { - if (lang_1.isPresent(attrNs)) { - dom_adapter_1.DOM.removeAttributeNS(renderElement, attrNs, nsAndName[1]); - } else { - dom_adapter_1.DOM.removeAttribute(renderElement, attributeName); - } - } - }; - DomRenderer.prototype.setBindingDebugInfo = function(renderElement, propertyName, propertyValue) { - var dashCasedPropertyName = util_1.camelCaseToDashCase(propertyName); - if (dom_adapter_1.DOM.isCommentNode(renderElement)) { - var existingBindings = lang_1.RegExpWrapper.firstMatch(TEMPLATE_BINDINGS_EXP, lang_1.StringWrapper.replaceAll(dom_adapter_1.DOM.getText(renderElement), /\n/g, '')); - var parsedBindings = lang_1.Json.parse(existingBindings[1]); - parsedBindings[dashCasedPropertyName] = propertyValue; - dom_adapter_1.DOM.setText(renderElement, lang_1.StringWrapper.replace(TEMPLATE_COMMENT_TEXT, '{}', lang_1.Json.stringify(parsedBindings))); - } else { - this.setElementAttribute(renderElement, propertyName, propertyValue); - } - }; - DomRenderer.prototype.setElementDebugInfo = function(renderElement, info) {}; - DomRenderer.prototype.setElementClass = function(renderElement, className, isAdd) { - if (isAdd) { - dom_adapter_1.DOM.addClass(renderElement, className); - } else { - dom_adapter_1.DOM.removeClass(renderElement, className); - } - }; - DomRenderer.prototype.setElementStyle = function(renderElement, styleName, styleValue) { - if (lang_1.isPresent(styleValue)) { - dom_adapter_1.DOM.setStyle(renderElement, styleName, lang_1.stringify(styleValue)); - } else { - dom_adapter_1.DOM.removeStyle(renderElement, styleName); - } - }; - DomRenderer.prototype.invokeElementMethod = function(renderElement, methodName, args) { - dom_adapter_1.DOM.invoke(renderElement, methodName, args); - }; - DomRenderer.prototype.setText = function(renderNode, text) { - dom_adapter_1.DOM.setText(renderNode, text); - }; - DomRenderer.prototype.animateNodeEnter = function(node) { - if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { - dom_adapter_1.DOM.addClass(node, 'ng-enter'); - this._rootRenderer.animate.css().addAnimationClass('ng-enter-active').start(node).onComplete(function() { - dom_adapter_1.DOM.removeClass(node, 'ng-enter'); - }); - } - }; - DomRenderer.prototype.animateNodeLeave = function(node) { - if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { - dom_adapter_1.DOM.addClass(node, 'ng-leave'); - this._rootRenderer.animate.css().addAnimationClass('ng-leave-active').start(node).onComplete(function() { - dom_adapter_1.DOM.removeClass(node, 'ng-leave'); - dom_adapter_1.DOM.remove(node); - }); - } else { - dom_adapter_1.DOM.remove(node); - } - }; - return DomRenderer; - }()); - exports.DomRenderer = DomRenderer; - function moveNodesAfterSibling(sibling, nodes) { - var parent = dom_adapter_1.DOM.parentElement(sibling); - if (nodes.length > 0 && lang_1.isPresent(parent)) { - var nextSibling = dom_adapter_1.DOM.nextSibling(sibling); - if (lang_1.isPresent(nextSibling)) { - for (var i = 0; i < nodes.length; i++) { - dom_adapter_1.DOM.insertBefore(nextSibling, nodes[i]); - } - } else { - for (var i = 0; i < nodes.length; i++) { - dom_adapter_1.DOM.appendChild(parent, nodes[i]); - } - } - } - } - function appendNodes(parent, nodes) { - for (var i = 0; i < nodes.length; i++) { - dom_adapter_1.DOM.appendChild(parent, nodes[i]); - } - } - function decoratePreventDefault(eventHandler) { - return function(event) { - var allowDefaultBehavior = eventHandler(event); - if (allowDefaultBehavior === false) { - dom_adapter_1.DOM.preventDefault(event); - } - }; - } - var COMPONENT_REGEX = /%COMP%/g; - exports.COMPONENT_VARIABLE = '%COMP%'; - exports.HOST_ATTR = "_nghost-" + exports.COMPONENT_VARIABLE; - exports.CONTENT_ATTR = "_ngcontent-" + exports.COMPONENT_VARIABLE; - function _shimContentAttribute(componentShortId) { - return lang_1.StringWrapper.replaceAll(exports.CONTENT_ATTR, COMPONENT_REGEX, componentShortId); - } - function _shimHostAttribute(componentShortId) { - return lang_1.StringWrapper.replaceAll(exports.HOST_ATTR, COMPONENT_REGEX, componentShortId); - } - function _flattenStyles(compId, styles, target) { - for (var i = 0; i < styles.length; i++) { - var style = styles[i]; - if (lang_1.isArray(style)) { - _flattenStyles(compId, style, target); - } else { - style = lang_1.StringWrapper.replaceAll(style, COMPONENT_REGEX, compId); - target.push(style); - } - } - return target; - } - var NS_PREFIX_RE = /^@([^:]+):(.+)/g; - function splitNamespace(name) { - if (name[0] != '@') { - return [null, name]; - } - var match = lang_1.RegExpWrapper.firstMatch(NS_PREFIX_RE, name); - return [match[1], match[2]]; - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/platform/common_dom", ["angular2/src/platform/dom/dom_adapter", "angular2/src/platform/dom/dom_renderer", "angular2/src/platform/dom/dom_tokens", "angular2/src/platform/dom/shared_styles_host", "angular2/src/platform/dom/events/dom_events", "angular2/src/platform/dom/events/event_manager", "angular2/src/platform/dom/debug/by", "angular2/src/platform/dom/debug/ng_probe"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function __export(m) { - for (var p in m) - if (!exports.hasOwnProperty(p)) - exports[p] = m[p]; - } - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - exports.DOM = dom_adapter_1.DOM; - exports.setRootDomAdapter = dom_adapter_1.setRootDomAdapter; - exports.DomAdapter = dom_adapter_1.DomAdapter; - var dom_renderer_1 = require("angular2/src/platform/dom/dom_renderer"); - exports.DomRenderer = dom_renderer_1.DomRenderer; - var dom_tokens_1 = require("angular2/src/platform/dom/dom_tokens"); - exports.DOCUMENT = dom_tokens_1.DOCUMENT; - var shared_styles_host_1 = require("angular2/src/platform/dom/shared_styles_host"); - exports.SharedStylesHost = shared_styles_host_1.SharedStylesHost; - exports.DomSharedStylesHost = shared_styles_host_1.DomSharedStylesHost; - var dom_events_1 = require("angular2/src/platform/dom/events/dom_events"); - exports.DomEventsPlugin = dom_events_1.DomEventsPlugin; - var event_manager_1 = require("angular2/src/platform/dom/events/event_manager"); - exports.EVENT_MANAGER_PLUGINS = event_manager_1.EVENT_MANAGER_PLUGINS; - exports.EventManager = event_manager_1.EventManager; - exports.EventManagerPlugin = event_manager_1.EventManagerPlugin; - __export(require("angular2/src/platform/dom/debug/by")); - __export(require("angular2/src/platform/dom/debug/ng_probe")); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/xhr", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var XHR = (function() { - function XHR() {} - XHR.prototype.get = function(url) { - return null; - }; - return XHR; - }()); - exports.XHR = XHR; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/invalid_pipe_argument_exception", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var InvalidPipeArgumentException = (function(_super) { - __extends(InvalidPipeArgumentException, _super); - function InvalidPipeArgumentException(type, value) { - _super.call(this, "Invalid argument '" + value + "' for pipe '" + lang_1.stringify(type) + "'"); - } - return InvalidPipeArgumentException; - }(exceptions_1.BaseException)); - exports.InvalidPipeArgumentException = InvalidPipeArgumentException; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/facade/intl", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - (function(NumberFormatStyle) { - NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal"; - NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent"; - NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency"; - })(exports.NumberFormatStyle || (exports.NumberFormatStyle = {})); - var NumberFormatStyle = exports.NumberFormatStyle; - var NumberFormatter = (function() { - function NumberFormatter() {} - NumberFormatter.format = function(num, locale, style, _a) { - var _b = _a === void 0 ? {} : _a, - _c = _b.minimumIntegerDigits, - minimumIntegerDigits = _c === void 0 ? 1 : _c, - _d = _b.minimumFractionDigits, - minimumFractionDigits = _d === void 0 ? 0 : _d, - _e = _b.maximumFractionDigits, - maximumFractionDigits = _e === void 0 ? 3 : _e, - currency = _b.currency, - _f = _b.currencyAsSymbol, - currencyAsSymbol = _f === void 0 ? false : _f; - var intlOptions = { - minimumIntegerDigits: minimumIntegerDigits, - minimumFractionDigits: minimumFractionDigits, - maximumFractionDigits: maximumFractionDigits - }; - intlOptions.style = NumberFormatStyle[style].toLowerCase(); - if (style == NumberFormatStyle.Currency) { - intlOptions.currency = currency; - intlOptions.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code'; - } - return new Intl.NumberFormat(locale, intlOptions).format(num); - }; - return NumberFormatter; - }()); - exports.NumberFormatter = NumberFormatter; - function digitCondition(len) { - return len == 2 ? '2-digit' : 'numeric'; - } - function nameCondition(len) { - return len < 4 ? 'short' : 'long'; - } - function extractComponents(pattern) { - var ret = {}; - var i = 0, - j; - while (i < pattern.length) { - j = i; - while (j < pattern.length && pattern[j] == pattern[i]) - j++; - var len = j - i; - switch (pattern[i]) { - case 'G': - ret.era = nameCondition(len); - break; - case 'y': - ret.year = digitCondition(len); - break; - case 'M': - if (len >= 3) - ret.month = nameCondition(len); - else - ret.month = digitCondition(len); - break; - case 'd': - ret.day = digitCondition(len); - break; - case 'E': - ret.weekday = nameCondition(len); - break; - case 'j': - ret.hour = digitCondition(len); - break; - case 'h': - ret.hour = digitCondition(len); - ret.hour12 = true; - break; - case 'H': - ret.hour = digitCondition(len); - ret.hour12 = false; - break; - case 'm': - ret.minute = digitCondition(len); - break; - case 's': - ret.second = digitCondition(len); - break; - case 'z': - ret.timeZoneName = 'long'; - break; - case 'Z': - ret.timeZoneName = 'short'; - break; - } - i = j; - } - return ret; - } - var dateFormatterCache = new Map(); - var DateFormatter = (function() { - function DateFormatter() {} - DateFormatter.format = function(date, locale, pattern) { - var key = locale + pattern; - if (dateFormatterCache.has(key)) { - return dateFormatterCache.get(key).format(date); - } - var formatter = new Intl.DateTimeFormat(locale, extractComponents(pattern)); - dateFormatterCache.set(key, formatter); - return formatter.format(date); - }; - return DateFormatter; - }()); - exports.DateFormatter = DateFormatter; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/json_pipe", ["angular2/src/facade/lang", "angular2/core"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var core_1 = require("angular2/core"); - var JsonPipe = (function() { - function JsonPipe() {} - JsonPipe.prototype.transform = function(value, args) { - if (args === void 0) { - args = null; - } - return lang_1.Json.stringify(value); - }; - JsonPipe = __decorate([lang_1.CONST(), core_1.Pipe({ - name: 'json', - pure: false - }), core_1.Injectable(), __metadata('design:paramtypes', [])], JsonPipe); - return JsonPipe; - }()); - exports.JsonPipe = JsonPipe; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/slice_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/core", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var core_1 = require("angular2/core"); - var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); - var SlicePipe = (function() { - function SlicePipe() {} - SlicePipe.prototype.transform = function(value, args) { - if (args === void 0) { - args = null; - } - if (lang_1.isBlank(args) || args.length == 0) { - throw new exceptions_1.BaseException('Slice pipe requires one argument'); - } - if (!this.supports(value)) { - throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(SlicePipe, value); - } - if (lang_1.isBlank(value)) - return value; - var start = args[0]; - var end = args.length > 1 ? args[1] : null; - if (lang_1.isString(value)) { - return lang_1.StringWrapper.slice(value, start, end); - } - return collection_1.ListWrapper.slice(value, start, end); - }; - SlicePipe.prototype.supports = function(obj) { - return lang_1.isString(obj) || lang_1.isArray(obj); - }; - SlicePipe = __decorate([core_1.Pipe({ - name: 'slice', - pure: false - }), core_1.Injectable(), __metadata('design:paramtypes', [])], SlicePipe); - return SlicePipe; - }()); - exports.SlicePipe = SlicePipe; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/lowercase_pipe", ["angular2/src/facade/lang", "angular2/core", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var core_1 = require("angular2/core"); - var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); - var LowerCasePipe = (function() { - function LowerCasePipe() {} - LowerCasePipe.prototype.transform = function(value, args) { - if (args === void 0) { - args = null; - } - if (lang_1.isBlank(value)) - return value; - if (!lang_1.isString(value)) { - throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(LowerCasePipe, value); - } - return value.toLowerCase(); - }; - LowerCasePipe = __decorate([lang_1.CONST(), core_1.Pipe({name: 'lowercase'}), core_1.Injectable(), __metadata('design:paramtypes', [])], LowerCasePipe); - return LowerCasePipe; - }()); - exports.LowerCasePipe = LowerCasePipe; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/number_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/intl", "angular2/core", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var intl_1 = require("angular2/src/facade/intl"); - var core_1 = require("angular2/core"); - var collection_1 = require("angular2/src/facade/collection"); - var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); - var defaultLocale = 'en-US'; - var _re = lang_1.RegExpWrapper.create('^(\\d+)?\\.((\\d+)(\\-(\\d+))?)?$'); - var NumberPipe = (function() { - function NumberPipe() {} - NumberPipe._format = function(value, style, digits, currency, currencyAsSymbol) { - if (currency === void 0) { - currency = null; - } - if (currencyAsSymbol === void 0) { - currencyAsSymbol = false; - } - if (lang_1.isBlank(value)) - return null; - if (!lang_1.isNumber(value)) { - throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(NumberPipe, value); - } - var minInt = 1, - minFraction = 0, - maxFraction = 3; - if (lang_1.isPresent(digits)) { - var parts = lang_1.RegExpWrapper.firstMatch(_re, digits); - if (lang_1.isBlank(parts)) { - throw new exceptions_1.BaseException(digits + " is not a valid digit info for number pipes"); - } - if (lang_1.isPresent(parts[1])) { - minInt = lang_1.NumberWrapper.parseIntAutoRadix(parts[1]); - } - if (lang_1.isPresent(parts[3])) { - minFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[3]); - } - if (lang_1.isPresent(parts[5])) { - maxFraction = lang_1.NumberWrapper.parseIntAutoRadix(parts[5]); - } - } - return intl_1.NumberFormatter.format(value, defaultLocale, style, { - minimumIntegerDigits: minInt, - minimumFractionDigits: minFraction, - maximumFractionDigits: maxFraction, - currency: currency, - currencyAsSymbol: currencyAsSymbol - }); - }; - NumberPipe = __decorate([lang_1.CONST(), core_1.Injectable(), __metadata('design:paramtypes', [])], NumberPipe); - return NumberPipe; - }()); - exports.NumberPipe = NumberPipe; - var DecimalPipe = (function(_super) { - __extends(DecimalPipe, _super); - function DecimalPipe() { - _super.apply(this, arguments); - } - DecimalPipe.prototype.transform = function(value, args) { - var digits = collection_1.ListWrapper.first(args); - return NumberPipe._format(value, intl_1.NumberFormatStyle.Decimal, digits); - }; - DecimalPipe = __decorate([lang_1.CONST(), core_1.Pipe({name: 'number'}), core_1.Injectable(), __metadata('design:paramtypes', [])], DecimalPipe); - return DecimalPipe; - }(NumberPipe)); - exports.DecimalPipe = DecimalPipe; - var PercentPipe = (function(_super) { - __extends(PercentPipe, _super); - function PercentPipe() { - _super.apply(this, arguments); - } - PercentPipe.prototype.transform = function(value, args) { - var digits = collection_1.ListWrapper.first(args); - return NumberPipe._format(value, intl_1.NumberFormatStyle.Percent, digits); - }; - PercentPipe = __decorate([lang_1.CONST(), core_1.Pipe({name: 'percent'}), core_1.Injectable(), __metadata('design:paramtypes', [])], PercentPipe); - return PercentPipe; - }(NumberPipe)); - exports.PercentPipe = PercentPipe; - var CurrencyPipe = (function(_super) { - __extends(CurrencyPipe, _super); - function CurrencyPipe() { - _super.apply(this, arguments); - } - CurrencyPipe.prototype.transform = function(value, args) { - var currencyCode = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'USD'; - var symbolDisplay = lang_1.isPresent(args) && args.length > 1 ? args[1] : false; - var digits = lang_1.isPresent(args) && args.length > 2 ? args[2] : null; - return NumberPipe._format(value, intl_1.NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay); - }; - CurrencyPipe = __decorate([lang_1.CONST(), core_1.Pipe({name: 'currency'}), core_1.Injectable(), __metadata('design:paramtypes', [])], CurrencyPipe); - return CurrencyPipe; - }(NumberPipe)); - exports.CurrencyPipe = CurrencyPipe; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/uppercase_pipe", ["angular2/src/facade/lang", "angular2/core", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var core_1 = require("angular2/core"); - var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); - var UpperCasePipe = (function() { - function UpperCasePipe() {} - UpperCasePipe.prototype.transform = function(value, args) { - if (args === void 0) { - args = null; - } - if (lang_1.isBlank(value)) - return value; - if (!lang_1.isString(value)) { - throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(UpperCasePipe, value); - } - return value.toUpperCase(); - }; - UpperCasePipe = __decorate([lang_1.CONST(), core_1.Pipe({name: 'uppercase'}), core_1.Injectable(), __metadata('design:paramtypes', [])], UpperCasePipe); - return UpperCasePipe; - }()); - exports.UpperCasePipe = UpperCasePipe; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/replace_pipe", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/core", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var core_1 = require("angular2/core"); - var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); - var ReplacePipe = (function() { - function ReplacePipe() {} - ReplacePipe.prototype.transform = function(value, args) { - if (lang_1.isBlank(args) || args.length !== 2) { - throw new exceptions_1.BaseException('ReplacePipe requires two arguments'); - } - if (lang_1.isBlank(value)) { - return value; - } - if (!this._supportedInput(value)) { - throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(ReplacePipe, value); - } - var input = value.toString(); - var pattern = args[0]; - var replacement = args[1]; - if (!this._supportedPattern(pattern)) { - throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(ReplacePipe, pattern); - } - if (!this._supportedReplacement(replacement)) { - throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(ReplacePipe, replacement); - } - if (lang_1.isFunction(replacement)) { - var rgxPattern = lang_1.isString(pattern) ? lang_1.RegExpWrapper.create(pattern) : pattern; - return lang_1.StringWrapper.replaceAllMapped(input, rgxPattern, replacement); - } - if (pattern instanceof RegExp) { - return lang_1.StringWrapper.replaceAll(input, pattern, replacement); - } - return lang_1.StringWrapper.replace(input, pattern, replacement); - }; - ReplacePipe.prototype._supportedInput = function(input) { - return lang_1.isString(input) || lang_1.isNumber(input); - }; - ReplacePipe.prototype._supportedPattern = function(pattern) { - return lang_1.isString(pattern) || pattern instanceof RegExp; - }; - ReplacePipe.prototype._supportedReplacement = function(replacement) { - return lang_1.isString(replacement) || lang_1.isFunction(replacement); - }; - ReplacePipe = __decorate([core_1.Pipe({name: 'replace'}), core_1.Injectable(), __metadata('design:paramtypes', [])], ReplacePipe); - return ReplacePipe; - }()); - exports.ReplacePipe = ReplacePipe; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/i18n_plural_pipe", ["angular2/src/facade/lang", "angular2/core", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var core_1 = require("angular2/core"); - var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); - var interpolationExp = lang_1.RegExpWrapper.create('#'); - var I18nPluralPipe = (function() { - function I18nPluralPipe() {} - I18nPluralPipe.prototype.transform = function(value, args) { - if (args === void 0) { - args = null; - } - var key; - var valueStr; - var pluralMap = (args[0]); - if (!lang_1.isStringMap(pluralMap)) { - throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(I18nPluralPipe, pluralMap); - } - key = value === 0 || value === 1 ? "=" + value : 'other'; - valueStr = lang_1.isPresent(value) ? value.toString() : ''; - return lang_1.StringWrapper.replaceAll(pluralMap[key], interpolationExp, valueStr); - }; - I18nPluralPipe = __decorate([lang_1.CONST(), core_1.Pipe({ - name: 'i18nPlural', - pure: true - }), core_1.Injectable(), __metadata('design:paramtypes', [])], I18nPluralPipe); - return I18nPluralPipe; - }()); - exports.I18nPluralPipe = I18nPluralPipe; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/i18n_select_pipe", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/core", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var core_1 = require("angular2/core"); - var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); - var I18nSelectPipe = (function() { - function I18nSelectPipe() {} - I18nSelectPipe.prototype.transform = function(value, args) { - if (args === void 0) { - args = null; - } - var mapping = (args[0]); - if (!lang_1.isStringMap(mapping)) { - throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(I18nSelectPipe, mapping); - } - return collection_1.StringMapWrapper.contains(mapping, value) ? mapping[value] : mapping['other']; - }; - I18nSelectPipe = __decorate([lang_1.CONST(), core_1.Pipe({ - name: 'i18nSelect', - pure: true - }), core_1.Injectable(), __metadata('design:paramtypes', [])], I18nSelectPipe); - return I18nSelectPipe; - }()); - exports.I18nSelectPipe = I18nSelectPipe; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/common_pipes", ["angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/uppercase_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/common/pipes/replace_pipe", "angular2/src/common/pipes/i18n_plural_pipe", "angular2/src/common/pipes/i18n_select_pipe", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var async_pipe_1 = require("angular2/src/common/pipes/async_pipe"); - var uppercase_pipe_1 = require("angular2/src/common/pipes/uppercase_pipe"); - var lowercase_pipe_1 = require("angular2/src/common/pipes/lowercase_pipe"); - var json_pipe_1 = require("angular2/src/common/pipes/json_pipe"); - var slice_pipe_1 = require("angular2/src/common/pipes/slice_pipe"); - var date_pipe_1 = require("angular2/src/common/pipes/date_pipe"); - var number_pipe_1 = require("angular2/src/common/pipes/number_pipe"); - var replace_pipe_1 = require("angular2/src/common/pipes/replace_pipe"); - var i18n_plural_pipe_1 = require("angular2/src/common/pipes/i18n_plural_pipe"); - var i18n_select_pipe_1 = require("angular2/src/common/pipes/i18n_select_pipe"); - var lang_1 = require("angular2/src/facade/lang"); - exports.COMMON_PIPES = lang_1.CONST_EXPR([async_pipe_1.AsyncPipe, uppercase_pipe_1.UpperCasePipe, lowercase_pipe_1.LowerCasePipe, json_pipe_1.JsonPipe, slice_pipe_1.SlicePipe, number_pipe_1.DecimalPipe, number_pipe_1.PercentPipe, number_pipe_1.CurrencyPipe, date_pipe_1.DatePipe, replace_pipe_1.ReplacePipe, i18n_plural_pipe_1.I18nPluralPipe, i18n_select_pipe_1.I18nSelectPipe]); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/directives/ng_class", ["angular2/src/facade/lang", "angular2/core", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var core_1 = require("angular2/core"); - var collection_1 = require("angular2/src/facade/collection"); - var NgClass = (function() { - function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) { - this._iterableDiffers = _iterableDiffers; - this._keyValueDiffers = _keyValueDiffers; - this._ngEl = _ngEl; - this._renderer = _renderer; - this._initialClasses = []; - } - Object.defineProperty(NgClass.prototype, "initialClasses", { - set: function(v) { - this._applyInitialClasses(true); - this._initialClasses = lang_1.isPresent(v) && lang_1.isString(v) ? v.split(' ') : []; - this._applyInitialClasses(false); - this._applyClasses(this._rawClass, false); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgClass.prototype, "rawClass", { - set: function(v) { - this._cleanupClasses(this._rawClass); - if (lang_1.isString(v)) { - v = v.split(' '); - } - this._rawClass = v; - this._iterableDiffer = null; - this._keyValueDiffer = null; - if (lang_1.isPresent(v)) { - if (collection_1.isListLikeIterable(v)) { - this._iterableDiffer = this._iterableDiffers.find(v).create(null); - } else { - this._keyValueDiffer = this._keyValueDiffers.find(v).create(null); - } - } - }, - enumerable: true, - configurable: true - }); - NgClass.prototype.ngDoCheck = function() { - if (lang_1.isPresent(this._iterableDiffer)) { - var changes = this._iterableDiffer.diff(this._rawClass); - if (lang_1.isPresent(changes)) { - this._applyIterableChanges(changes); - } - } - if (lang_1.isPresent(this._keyValueDiffer)) { - var changes = this._keyValueDiffer.diff(this._rawClass); - if (lang_1.isPresent(changes)) { - this._applyKeyValueChanges(changes); - } - } - }; - NgClass.prototype.ngOnDestroy = function() { - this._cleanupClasses(this._rawClass); - }; - NgClass.prototype._cleanupClasses = function(rawClassVal) { - this._applyClasses(rawClassVal, true); - this._applyInitialClasses(false); - }; - NgClass.prototype._applyKeyValueChanges = function(changes) { - var _this = this; - changes.forEachAddedItem(function(record) { - _this._toggleClass(record.key, record.currentValue); - }); - changes.forEachChangedItem(function(record) { - _this._toggleClass(record.key, record.currentValue); - }); - changes.forEachRemovedItem(function(record) { - if (record.previousValue) { - _this._toggleClass(record.key, false); - } - }); - }; - NgClass.prototype._applyIterableChanges = function(changes) { - var _this = this; - changes.forEachAddedItem(function(record) { - _this._toggleClass(record.item, true); - }); - changes.forEachRemovedItem(function(record) { - _this._toggleClass(record.item, false); - }); - }; - NgClass.prototype._applyInitialClasses = function(isCleanup) { - var _this = this; - this._initialClasses.forEach(function(className) { - return _this._toggleClass(className, !isCleanup); - }); - }; - NgClass.prototype._applyClasses = function(rawClassVal, isCleanup) { - var _this = this; - if (lang_1.isPresent(rawClassVal)) { - if (lang_1.isArray(rawClassVal)) { - rawClassVal.forEach(function(className) { - return _this._toggleClass(className, !isCleanup); - }); - } else if (rawClassVal instanceof Set) { - rawClassVal.forEach(function(className) { - return _this._toggleClass(className, !isCleanup); - }); - } else { - collection_1.StringMapWrapper.forEach(rawClassVal, function(expVal, className) { - if (lang_1.isPresent(expVal)) - _this._toggleClass(className, !isCleanup); - }); - } - } - }; - NgClass.prototype._toggleClass = function(className, enabled) { - className = className.trim(); - if (className.length > 0) { - if (className.indexOf(' ') > -1) { - var classes = className.split(/\s+/g); - for (var i = 0, - len = classes.length; i < len; i++) { - this._renderer.setElementClass(this._ngEl.nativeElement, classes[i], enabled); - } - } else { - this._renderer.setElementClass(this._ngEl.nativeElement, className, enabled); - } - } - }; - NgClass = __decorate([core_1.Directive({ - selector: '[ngClass]', - inputs: ['rawClass: ngClass', 'initialClasses: class'] - }), __metadata('design:paramtypes', [core_1.IterableDiffers, core_1.KeyValueDiffers, core_1.ElementRef, core_1.Renderer])], NgClass); - return NgClass; - }()); - exports.NgClass = NgClass; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/directives/ng_for", ["angular2/core", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var core_1 = require("angular2/core"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var NgFor = (function() { - function NgFor(_viewContainer, _templateRef, _iterableDiffers, _cdr) { - this._viewContainer = _viewContainer; - this._templateRef = _templateRef; - this._iterableDiffers = _iterableDiffers; - this._cdr = _cdr; - } - Object.defineProperty(NgFor.prototype, "ngForOf", { - set: function(value) { - this._ngForOf = value; - if (lang_1.isBlank(this._differ) && lang_1.isPresent(value)) { - try { - this._differ = this._iterableDiffers.find(value).create(this._cdr, this._ngForTrackBy); - } catch (e) { - throw new exceptions_1.BaseException("Cannot find a differ supporting object '" + value + "' of type '" + lang_1.getTypeNameForDebugging(value) + "'. NgFor only supports binding to Iterables such as Arrays."); - } - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgFor.prototype, "ngForTemplate", { - set: function(value) { - if (lang_1.isPresent(value)) { - this._templateRef = value; - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgFor.prototype, "ngForTrackBy", { - set: function(value) { - this._ngForTrackBy = value; - }, - enumerable: true, - configurable: true - }); - NgFor.prototype.ngDoCheck = function() { - if (lang_1.isPresent(this._differ)) { - var changes = this._differ.diff(this._ngForOf); - if (lang_1.isPresent(changes)) - this._applyChanges(changes); - } - }; - NgFor.prototype._applyChanges = function(changes) { - var _this = this; - var recordViewTuples = []; - changes.forEachRemovedItem(function(removedRecord) { - return recordViewTuples.push(new RecordViewTuple(removedRecord, null)); - }); - changes.forEachMovedItem(function(movedRecord) { - return recordViewTuples.push(new RecordViewTuple(movedRecord, null)); - }); - var insertTuples = this._bulkRemove(recordViewTuples); - changes.forEachAddedItem(function(addedRecord) { - return insertTuples.push(new RecordViewTuple(addedRecord, null)); - }); - this._bulkInsert(insertTuples); - for (var i = 0; i < insertTuples.length; i++) { - this._perViewChange(insertTuples[i].view, insertTuples[i].record); - } - for (var i = 0, - ilen = this._viewContainer.length; i < ilen; i++) { - var viewRef = this._viewContainer.get(i); - viewRef.setLocal('first', i === 0); - viewRef.setLocal('last', i === ilen - 1); - } - changes.forEachIdentityChange(function(record) { - var viewRef = _this._viewContainer.get(record.currentIndex); - viewRef.setLocal('\$implicit', record.item); - }); - }; - NgFor.prototype._perViewChange = function(view, record) { - view.setLocal('\$implicit', record.item); - view.setLocal('index', record.currentIndex); - view.setLocal('even', (record.currentIndex % 2 == 0)); - view.setLocal('odd', (record.currentIndex % 2 == 1)); - }; - NgFor.prototype._bulkRemove = function(tuples) { - tuples.sort(function(a, b) { - return a.record.previousIndex - b.record.previousIndex; - }); - var movedTuples = []; - for (var i = tuples.length - 1; i >= 0; i--) { - var tuple = tuples[i]; - if (lang_1.isPresent(tuple.record.currentIndex)) { - tuple.view = this._viewContainer.detach(tuple.record.previousIndex); - movedTuples.push(tuple); - } else { - this._viewContainer.remove(tuple.record.previousIndex); - } - } - return movedTuples; - }; - NgFor.prototype._bulkInsert = function(tuples) { - tuples.sort(function(a, b) { - return a.record.currentIndex - b.record.currentIndex; - }); - for (var i = 0; i < tuples.length; i++) { - var tuple = tuples[i]; - if (lang_1.isPresent(tuple.view)) { - this._viewContainer.insert(tuple.view, tuple.record.currentIndex); - } else { - tuple.view = this._viewContainer.createEmbeddedView(this._templateRef, tuple.record.currentIndex); - } - } - return tuples; - }; - NgFor = __decorate([core_1.Directive({ - selector: '[ngFor][ngForOf]', - inputs: ['ngForTrackBy', 'ngForOf', 'ngForTemplate'] - }), __metadata('design:paramtypes', [core_1.ViewContainerRef, core_1.TemplateRef, core_1.IterableDiffers, core_1.ChangeDetectorRef])], NgFor); - return NgFor; - }()); - exports.NgFor = NgFor; - var RecordViewTuple = (function() { - function RecordViewTuple(record, view) { - this.record = record; - this.view = view; - } - return RecordViewTuple; - }()); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/directives/ng_if", ["angular2/core", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var core_1 = require("angular2/core"); - var lang_1 = require("angular2/src/facade/lang"); - var NgIf = (function() { - function NgIf(_viewContainer, _templateRef) { - this._viewContainer = _viewContainer; - this._templateRef = _templateRef; - this._prevCondition = null; - } - Object.defineProperty(NgIf.prototype, "ngIf", { - set: function(newCondition) { - if (newCondition && (lang_1.isBlank(this._prevCondition) || !this._prevCondition)) { - this._prevCondition = true; - this._viewContainer.createEmbeddedView(this._templateRef); - } else if (!newCondition && (lang_1.isBlank(this._prevCondition) || this._prevCondition)) { - this._prevCondition = false; - this._viewContainer.clear(); - } - }, - enumerable: true, - configurable: true - }); - NgIf = __decorate([core_1.Directive({ - selector: '[ngIf]', - inputs: ['ngIf'] - }), __metadata('design:paramtypes', [core_1.ViewContainerRef, core_1.TemplateRef])], NgIf); - return NgIf; - }()); - exports.NgIf = NgIf; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/directives/ng_style", ["angular2/core", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var core_1 = require("angular2/core"); - var lang_1 = require("angular2/src/facade/lang"); - var NgStyle = (function() { - function NgStyle(_differs, _ngEl, _renderer) { - this._differs = _differs; - this._ngEl = _ngEl; - this._renderer = _renderer; - } - Object.defineProperty(NgStyle.prototype, "rawStyle", { - set: function(v) { - this._rawStyle = v; - if (lang_1.isBlank(this._differ) && lang_1.isPresent(v)) { - this._differ = this._differs.find(this._rawStyle).create(null); - } - }, - enumerable: true, - configurable: true - }); - NgStyle.prototype.ngDoCheck = function() { - if (lang_1.isPresent(this._differ)) { - var changes = this._differ.diff(this._rawStyle); - if (lang_1.isPresent(changes)) { - this._applyChanges(changes); - } - } - }; - NgStyle.prototype._applyChanges = function(changes) { - var _this = this; - changes.forEachAddedItem(function(record) { - _this._setStyle(record.key, record.currentValue); - }); - changes.forEachChangedItem(function(record) { - _this._setStyle(record.key, record.currentValue); - }); - changes.forEachRemovedItem(function(record) { - _this._setStyle(record.key, null); - }); - }; - NgStyle.prototype._setStyle = function(name, val) { - this._renderer.setElementStyle(this._ngEl.nativeElement, name, val); - }; - NgStyle = __decorate([core_1.Directive({ - selector: '[ngStyle]', - inputs: ['rawStyle: ngStyle'] - }), __metadata('design:paramtypes', [core_1.KeyValueDiffers, core_1.ElementRef, core_1.Renderer])], NgStyle); - return NgStyle; - }()); - exports.NgStyle = NgStyle; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/directives/ng_switch", ["angular2/core", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var core_1 = require("angular2/core"); - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var _WHEN_DEFAULT = lang_1.CONST_EXPR(new Object()); - var SwitchView = (function() { - function SwitchView(_viewContainerRef, _templateRef) { - this._viewContainerRef = _viewContainerRef; - this._templateRef = _templateRef; - } - SwitchView.prototype.create = function() { - this._viewContainerRef.createEmbeddedView(this._templateRef); - }; - SwitchView.prototype.destroy = function() { - this._viewContainerRef.clear(); - }; - return SwitchView; - }()); - exports.SwitchView = SwitchView; - var NgSwitch = (function() { - function NgSwitch() { - this._useDefault = false; - this._valueViews = new collection_1.Map(); - this._activeViews = []; - } - Object.defineProperty(NgSwitch.prototype, "ngSwitch", { - set: function(value) { - this._emptyAllActiveViews(); - this._useDefault = false; - var views = this._valueViews.get(value); - if (lang_1.isBlank(views)) { - this._useDefault = true; - views = lang_1.normalizeBlank(this._valueViews.get(_WHEN_DEFAULT)); - } - this._activateViews(views); - this._switchValue = value; - }, - enumerable: true, - configurable: true - }); - NgSwitch.prototype._onWhenValueChanged = function(oldWhen, newWhen, view) { - this._deregisterView(oldWhen, view); - this._registerView(newWhen, view); - if (oldWhen === this._switchValue) { - view.destroy(); - collection_1.ListWrapper.remove(this._activeViews, view); - } else if (newWhen === this._switchValue) { - if (this._useDefault) { - this._useDefault = false; - this._emptyAllActiveViews(); - } - view.create(); - this._activeViews.push(view); - } - if (this._activeViews.length === 0 && !this._useDefault) { - this._useDefault = true; - this._activateViews(this._valueViews.get(_WHEN_DEFAULT)); - } - }; - NgSwitch.prototype._emptyAllActiveViews = function() { - var activeContainers = this._activeViews; - for (var i = 0; i < activeContainers.length; i++) { - activeContainers[i].destroy(); - } - this._activeViews = []; - }; - NgSwitch.prototype._activateViews = function(views) { - if (lang_1.isPresent(views)) { - for (var i = 0; i < views.length; i++) { - views[i].create(); - } - this._activeViews = views; - } - }; - NgSwitch.prototype._registerView = function(value, view) { - var views = this._valueViews.get(value); - if (lang_1.isBlank(views)) { - views = []; - this._valueViews.set(value, views); - } - views.push(view); - }; - NgSwitch.prototype._deregisterView = function(value, view) { - if (value === _WHEN_DEFAULT) - return ; - var views = this._valueViews.get(value); - if (views.length == 1) { - this._valueViews.delete(value); - } else { - collection_1.ListWrapper.remove(views, view); - } - }; - NgSwitch = __decorate([core_1.Directive({ - selector: '[ngSwitch]', - inputs: ['ngSwitch'] - }), __metadata('design:paramtypes', [])], NgSwitch); - return NgSwitch; - }()); - exports.NgSwitch = NgSwitch; - var NgSwitchWhen = (function() { - function NgSwitchWhen(viewContainer, templateRef, ngSwitch) { - this._value = _WHEN_DEFAULT; - this._switch = ngSwitch; - this._view = new SwitchView(viewContainer, templateRef); - } - Object.defineProperty(NgSwitchWhen.prototype, "ngSwitchWhen", { - set: function(value) { - this._switch._onWhenValueChanged(this._value, value, this._view); - this._value = value; - }, - enumerable: true, - configurable: true - }); - NgSwitchWhen = __decorate([core_1.Directive({ - selector: '[ngSwitchWhen]', - inputs: ['ngSwitchWhen'] - }), __param(2, core_1.Host()), __metadata('design:paramtypes', [core_1.ViewContainerRef, core_1.TemplateRef, NgSwitch])], NgSwitchWhen); - return NgSwitchWhen; - }()); - exports.NgSwitchWhen = NgSwitchWhen; - var NgSwitchDefault = (function() { - function NgSwitchDefault(viewContainer, templateRef, sswitch) { - sswitch._registerView(_WHEN_DEFAULT, new SwitchView(viewContainer, templateRef)); - } - NgSwitchDefault = __decorate([core_1.Directive({selector: '[ngSwitchDefault]'}), __param(2, core_1.Host()), __metadata('design:paramtypes', [core_1.ViewContainerRef, core_1.TemplateRef, NgSwitch])], NgSwitchDefault); - return NgSwitchDefault; - }()); - exports.NgSwitchDefault = NgSwitchDefault; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/directives/ng_plural", ["angular2/core", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/common/directives/ng_switch"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var core_1 = require("angular2/core"); - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); - var _CATEGORY_DEFAULT = 'other'; - var NgLocalization = (function() { - function NgLocalization() {} - return NgLocalization; - }()); - exports.NgLocalization = NgLocalization; - var NgPluralCase = (function() { - function NgPluralCase(value, template, viewContainer) { - this.value = value; - this._view = new ng_switch_1.SwitchView(viewContainer, template); - } - NgPluralCase = __decorate([core_1.Directive({selector: '[ngPluralCase]'}), __param(0, core_1.Attribute('ngPluralCase')), __metadata('design:paramtypes', [String, core_1.TemplateRef, core_1.ViewContainerRef])], NgPluralCase); - return NgPluralCase; - }()); - exports.NgPluralCase = NgPluralCase; - var NgPlural = (function() { - function NgPlural(_localization) { - this._localization = _localization; - this._caseViews = new collection_1.Map(); - this.cases = null; - } - Object.defineProperty(NgPlural.prototype, "ngPlural", { - set: function(value) { - this._switchValue = value; - this._updateView(); - }, - enumerable: true, - configurable: true - }); - NgPlural.prototype.ngAfterContentInit = function() { - var _this = this; - this.cases.forEach(function(pluralCase) { - _this._caseViews.set(_this._formatValue(pluralCase), pluralCase._view); - }); - this._updateView(); - }; - NgPlural.prototype._updateView = function() { - this._clearViews(); - var view = this._caseViews.get(this._switchValue); - if (!lang_1.isPresent(view)) - view = this._getCategoryView(this._switchValue); - this._activateView(view); - }; - NgPlural.prototype._clearViews = function() { - if (lang_1.isPresent(this._activeView)) - this._activeView.destroy(); - }; - NgPlural.prototype._activateView = function(view) { - if (!lang_1.isPresent(view)) - return ; - this._activeView = view; - this._activeView.create(); - }; - NgPlural.prototype._getCategoryView = function(value) { - var category = this._localization.getPluralCategory(value); - var categoryView = this._caseViews.get(category); - return lang_1.isPresent(categoryView) ? categoryView : this._caseViews.get(_CATEGORY_DEFAULT); - }; - NgPlural.prototype._isValueView = function(pluralCase) { - return pluralCase.value[0] === "="; - }; - NgPlural.prototype._formatValue = function(pluralCase) { - return this._isValueView(pluralCase) ? this._stripValue(pluralCase.value) : pluralCase.value; - }; - NgPlural.prototype._stripValue = function(value) { - return lang_1.NumberWrapper.parseInt(value.substring(1), 10); - }; - __decorate([core_1.ContentChildren(NgPluralCase), __metadata('design:type', core_1.QueryList)], NgPlural.prototype, "cases", void 0); - __decorate([core_1.Input(), __metadata('design:type', Number), __metadata('design:paramtypes', [Number])], NgPlural.prototype, "ngPlural", null); - NgPlural = __decorate([core_1.Directive({selector: '[ngPlural]'}), __metadata('design:paramtypes', [NgLocalization])], NgPlural); - return NgPlural; - }()); - exports.NgPlural = NgPlural; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/directives/observable_list_diff", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/directives/core_directives", ["angular2/src/facade/lang", "angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch", "angular2/src/common/directives/ng_plural"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var ng_class_1 = require("angular2/src/common/directives/ng_class"); - var ng_for_1 = require("angular2/src/common/directives/ng_for"); - var ng_if_1 = require("angular2/src/common/directives/ng_if"); - var ng_style_1 = require("angular2/src/common/directives/ng_style"); - var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); - var ng_plural_1 = require("angular2/src/common/directives/ng_plural"); - exports.CORE_DIRECTIVES = lang_1.CONST_EXPR([ng_class_1.NgClass, ng_for_1.NgFor, ng_if_1.NgIf, ng_style_1.NgStyle, ng_switch_1.NgSwitch, ng_switch_1.NgSwitchWhen, ng_switch_1.NgSwitchDefault, ng_plural_1.NgPlural, ng_plural_1.NgPluralCase]); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/facade/promise", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var lang_1 = require("angular2/src/facade/lang"); - var async_1 = require("angular2/src/facade/async"); - var promise_1 = require("angular2/src/facade/promise"); - var collection_1 = require("angular2/src/facade/collection"); - exports.VALID = "VALID"; - exports.INVALID = "INVALID"; - exports.PENDING = "PENDING"; - function isControl(control) { - return control instanceof AbstractControl; - } - exports.isControl = isControl; - function _find(control, path) { - if (lang_1.isBlank(path)) - return null; - if (!(path instanceof Array)) { - path = path.split("/"); - } - if (path instanceof Array && collection_1.ListWrapper.isEmpty(path)) - return null; - return path.reduce(function(v, name) { - if (v instanceof ControlGroup) { - return lang_1.isPresent(v.controls[name]) ? v.controls[name] : null; - } else if (v instanceof ControlArray) { - var index = name; - return lang_1.isPresent(v.at(index)) ? v.at(index) : null; - } else { - return null; - } - }, control); - } - function toObservable(r) { - return promise_1.PromiseWrapper.isPromise(r) ? async_1.ObservableWrapper.fromPromise(r) : r; - } - var AbstractControl = (function() { - function AbstractControl(validator, asyncValidator) { - this.validator = validator; - this.asyncValidator = asyncValidator; - this._pristine = true; - this._touched = false; - } - Object.defineProperty(AbstractControl.prototype, "value", { - get: function() { - return this._value; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControl.prototype, "status", { - get: function() { - return this._status; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControl.prototype, "valid", { - get: function() { - return this._status === exports.VALID; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControl.prototype, "errors", { - get: function() { - return this._errors; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControl.prototype, "pristine", { - get: function() { - return this._pristine; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControl.prototype, "dirty", { - get: function() { - return !this.pristine; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControl.prototype, "touched", { - get: function() { - return this._touched; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControl.prototype, "untouched", { - get: function() { - return !this._touched; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControl.prototype, "valueChanges", { - get: function() { - return this._valueChanges; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControl.prototype, "statusChanges", { - get: function() { - return this._statusChanges; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControl.prototype, "pending", { - get: function() { - return this._status == exports.PENDING; - }, - enumerable: true, - configurable: true - }); - AbstractControl.prototype.markAsTouched = function() { - this._touched = true; - }; - AbstractControl.prototype.markAsDirty = function(_a) { - var onlySelf = (_a === void 0 ? {} : _a).onlySelf; - onlySelf = lang_1.normalizeBool(onlySelf); - this._pristine = false; - if (lang_1.isPresent(this._parent) && !onlySelf) { - this._parent.markAsDirty({onlySelf: onlySelf}); - } - }; - AbstractControl.prototype.markAsPending = function(_a) { - var onlySelf = (_a === void 0 ? {} : _a).onlySelf; - onlySelf = lang_1.normalizeBool(onlySelf); - this._status = exports.PENDING; - if (lang_1.isPresent(this._parent) && !onlySelf) { - this._parent.markAsPending({onlySelf: onlySelf}); - } - }; - AbstractControl.prototype.setParent = function(parent) { - this._parent = parent; - }; - AbstractControl.prototype.updateValueAndValidity = function(_a) { - var _b = _a === void 0 ? {} : _a, - onlySelf = _b.onlySelf, - emitEvent = _b.emitEvent; - onlySelf = lang_1.normalizeBool(onlySelf); - emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; - this._updateValue(); - this._errors = this._runValidator(); - this._status = this._calculateStatus(); - if (this._status == exports.VALID || this._status == exports.PENDING) { - this._runAsyncValidator(emitEvent); - } - if (emitEvent) { - async_1.ObservableWrapper.callEmit(this._valueChanges, this._value); - async_1.ObservableWrapper.callEmit(this._statusChanges, this._status); - } - if (lang_1.isPresent(this._parent) && !onlySelf) { - this._parent.updateValueAndValidity({ - onlySelf: onlySelf, - emitEvent: emitEvent - }); - } - }; - AbstractControl.prototype._runValidator = function() { - return lang_1.isPresent(this.validator) ? this.validator(this) : null; - }; - AbstractControl.prototype._runAsyncValidator = function(emitEvent) { - var _this = this; - if (lang_1.isPresent(this.asyncValidator)) { - this._status = exports.PENDING; - this._cancelExistingSubscription(); - var obs = toObservable(this.asyncValidator(this)); - this._asyncValidationSubscription = async_1.ObservableWrapper.subscribe(obs, function(res) { - return _this.setErrors(res, {emitEvent: emitEvent}); - }); - } - }; - AbstractControl.prototype._cancelExistingSubscription = function() { - if (lang_1.isPresent(this._asyncValidationSubscription)) { - async_1.ObservableWrapper.dispose(this._asyncValidationSubscription); - } - }; - AbstractControl.prototype.setErrors = function(errors, _a) { - var emitEvent = (_a === void 0 ? {} : _a).emitEvent; - emitEvent = lang_1.isPresent(emitEvent) ? emitEvent : true; - this._errors = errors; - this._status = this._calculateStatus(); - if (emitEvent) { - async_1.ObservableWrapper.callEmit(this._statusChanges, this._status); - } - if (lang_1.isPresent(this._parent)) { - this._parent._updateControlsErrors(); - } - }; - AbstractControl.prototype.find = function(path) { - return _find(this, path); - }; - AbstractControl.prototype.getError = function(errorCode, path) { - if (path === void 0) { - path = null; - } - var control = lang_1.isPresent(path) && !collection_1.ListWrapper.isEmpty(path) ? this.find(path) : this; - if (lang_1.isPresent(control) && lang_1.isPresent(control._errors)) { - return collection_1.StringMapWrapper.get(control._errors, errorCode); - } else { - return null; - } - }; - AbstractControl.prototype.hasError = function(errorCode, path) { - if (path === void 0) { - path = null; - } - return lang_1.isPresent(this.getError(errorCode, path)); - }; - Object.defineProperty(AbstractControl.prototype, "root", { - get: function() { - var x = this; - while (lang_1.isPresent(x._parent)) { - x = x._parent; - } - return x; - }, - enumerable: true, - configurable: true - }); - AbstractControl.prototype._updateControlsErrors = function() { - this._status = this._calculateStatus(); - if (lang_1.isPresent(this._parent)) { - this._parent._updateControlsErrors(); - } - }; - AbstractControl.prototype._initObservables = function() { - this._valueChanges = new async_1.EventEmitter(); - this._statusChanges = new async_1.EventEmitter(); - }; - AbstractControl.prototype._calculateStatus = function() { - if (lang_1.isPresent(this._errors)) - return exports.INVALID; - if (this._anyControlsHaveStatus(exports.PENDING)) - return exports.PENDING; - if (this._anyControlsHaveStatus(exports.INVALID)) - return exports.INVALID; - return exports.VALID; - }; - return AbstractControl; - }()); - exports.AbstractControl = AbstractControl; - var Control = (function(_super) { - __extends(Control, _super); - function Control(value, validator, asyncValidator) { - if (value === void 0) { - value = null; - } - if (validator === void 0) { - validator = null; - } - if (asyncValidator === void 0) { - asyncValidator = null; - } - _super.call(this, validator, asyncValidator); - this._value = value; - this.updateValueAndValidity({ - onlySelf: true, - emitEvent: false - }); - this._initObservables(); - } - Control.prototype.updateValue = function(value, _a) { - var _b = _a === void 0 ? {} : _a, - onlySelf = _b.onlySelf, - emitEvent = _b.emitEvent, - emitModelToViewChange = _b.emitModelToViewChange; - emitModelToViewChange = lang_1.isPresent(emitModelToViewChange) ? emitModelToViewChange : true; - this._value = value; - if (lang_1.isPresent(this._onChange) && emitModelToViewChange) - this._onChange(this._value); - this.updateValueAndValidity({ - onlySelf: onlySelf, - emitEvent: emitEvent - }); - }; - Control.prototype._updateValue = function() {}; - Control.prototype._anyControlsHaveStatus = function(status) { - return false; - }; - Control.prototype.registerOnChange = function(fn) { - this._onChange = fn; - }; - return Control; - }(AbstractControl)); - exports.Control = Control; - var ControlGroup = (function(_super) { - __extends(ControlGroup, _super); - function ControlGroup(controls, optionals, validator, asyncValidator) { - if (optionals === void 0) { - optionals = null; - } - if (validator === void 0) { - validator = null; - } - if (asyncValidator === void 0) { - asyncValidator = null; - } - _super.call(this, validator, asyncValidator); - this.controls = controls; - this._optionals = lang_1.isPresent(optionals) ? optionals : {}; - this._initObservables(); - this._setParentForControls(); - this.updateValueAndValidity({ - onlySelf: true, - emitEvent: false - }); - } - ControlGroup.prototype.addControl = function(name, control) { - this.controls[name] = control; - control.setParent(this); - }; - ControlGroup.prototype.removeControl = function(name) { - collection_1.StringMapWrapper.delete(this.controls, name); - }; - ControlGroup.prototype.include = function(controlName) { - collection_1.StringMapWrapper.set(this._optionals, controlName, true); - this.updateValueAndValidity(); - }; - ControlGroup.prototype.exclude = function(controlName) { - collection_1.StringMapWrapper.set(this._optionals, controlName, false); - this.updateValueAndValidity(); - }; - ControlGroup.prototype.contains = function(controlName) { - var c = collection_1.StringMapWrapper.contains(this.controls, controlName); - return c && this._included(controlName); - }; - ControlGroup.prototype._setParentForControls = function() { - var _this = this; - collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { - control.setParent(_this); - }); - }; - ControlGroup.prototype._updateValue = function() { - this._value = this._reduceValue(); - }; - ControlGroup.prototype._anyControlsHaveStatus = function(status) { - var _this = this; - var res = false; - collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { - res = res || (_this.contains(name) && control.status == status); - }); - return res; - }; - ControlGroup.prototype._reduceValue = function() { - return this._reduceChildren({}, function(acc, control, name) { - acc[name] = control.value; - return acc; - }); - }; - ControlGroup.prototype._reduceChildren = function(initValue, fn) { - var _this = this; - var res = initValue; - collection_1.StringMapWrapper.forEach(this.controls, function(control, name) { - if (_this._included(name)) { - res = fn(res, control, name); - } - }); - return res; - }; - ControlGroup.prototype._included = function(controlName) { - var isOptional = collection_1.StringMapWrapper.contains(this._optionals, controlName); - return !isOptional || collection_1.StringMapWrapper.get(this._optionals, controlName); - }; - return ControlGroup; - }(AbstractControl)); - exports.ControlGroup = ControlGroup; - var ControlArray = (function(_super) { - __extends(ControlArray, _super); - function ControlArray(controls, validator, asyncValidator) { - if (validator === void 0) { - validator = null; - } - if (asyncValidator === void 0) { - asyncValidator = null; - } - _super.call(this, validator, asyncValidator); - this.controls = controls; - this._initObservables(); - this._setParentForControls(); - this.updateValueAndValidity({ - onlySelf: true, - emitEvent: false - }); - } - ControlArray.prototype.at = function(index) { - return this.controls[index]; - }; - ControlArray.prototype.push = function(control) { - this.controls.push(control); - control.setParent(this); - this.updateValueAndValidity(); - }; - ControlArray.prototype.insert = function(index, control) { - collection_1.ListWrapper.insert(this.controls, index, control); - control.setParent(this); - this.updateValueAndValidity(); - }; - ControlArray.prototype.removeAt = function(index) { - collection_1.ListWrapper.removeAt(this.controls, index); - this.updateValueAndValidity(); - }; - Object.defineProperty(ControlArray.prototype, "length", { - get: function() { - return this.controls.length; - }, - enumerable: true, - configurable: true - }); - ControlArray.prototype._updateValue = function() { - this._value = this.controls.map(function(control) { - return control.value; - }); - }; - ControlArray.prototype._anyControlsHaveStatus = function(status) { - return this.controls.some(function(c) { - return c.status == status; - }); - }; - ControlArray.prototype._setParentForControls = function() { - var _this = this; - this.controls.forEach(function(control) { - control.setParent(_this); - }); - }; - return ControlArray; - }(AbstractControl)); - exports.ControlArray = ControlArray; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/abstract_control_directive", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var AbstractControlDirective = (function() { - function AbstractControlDirective() {} - Object.defineProperty(AbstractControlDirective.prototype, "control", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControlDirective.prototype, "value", { - get: function() { - return lang_1.isPresent(this.control) ? this.control.value : null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControlDirective.prototype, "valid", { - get: function() { - return lang_1.isPresent(this.control) ? this.control.valid : null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControlDirective.prototype, "errors", { - get: function() { - return lang_1.isPresent(this.control) ? this.control.errors : null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControlDirective.prototype, "pristine", { - get: function() { - return lang_1.isPresent(this.control) ? this.control.pristine : null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControlDirective.prototype, "dirty", { - get: function() { - return lang_1.isPresent(this.control) ? this.control.dirty : null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControlDirective.prototype, "touched", { - get: function() { - return lang_1.isPresent(this.control) ? this.control.touched : null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControlDirective.prototype, "untouched", { - get: function() { - return lang_1.isPresent(this.control) ? this.control.untouched : null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbstractControlDirective.prototype, "path", { - get: function() { - return null; - }, - enumerable: true, - configurable: true - }); - return AbstractControlDirective; - }()); - exports.AbstractControlDirective = AbstractControlDirective; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/control_container", ["angular2/src/common/forms/directives/abstract_control_directive"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); - var ControlContainer = (function(_super) { - __extends(ControlContainer, _super); - function ControlContainer() { - _super.apply(this, arguments); - } - Object.defineProperty(ControlContainer.prototype, "formDirective", { - get: function() { - return null; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(ControlContainer.prototype, "path", { - get: function() { - return null; - }, - enumerable: true, - configurable: true - }); - return ControlContainer; - }(abstract_control_directive_1.AbstractControlDirective)); - exports.ControlContainer = ControlContainer; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/ng_control", ["angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var NgControl = (function(_super) { - __extends(NgControl, _super); - function NgControl() { - _super.apply(this, arguments); - this.name = null; - this.valueAccessor = null; - } - Object.defineProperty(NgControl.prototype, "validator", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControl.prototype, "asyncValidator", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - return NgControl; - }(abstract_control_directive_1.AbstractControlDirective)); - exports.NgControl = NgControl; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/control_value_accessor", ["angular2/core", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var core_1 = require("angular2/core"); - var lang_1 = require("angular2/src/facade/lang"); - exports.NG_VALUE_ACCESSOR = lang_1.CONST_EXPR(new core_1.OpaqueToken("NgValueAccessor")); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/validators", ["angular2/src/facade/lang", "angular2/src/facade/promise", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/core"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var promise_1 = require("angular2/src/facade/promise"); - var async_1 = require("angular2/src/facade/async"); - var collection_1 = require("angular2/src/facade/collection"); - var core_1 = require("angular2/core"); - exports.NG_VALIDATORS = lang_1.CONST_EXPR(new core_1.OpaqueToken("NgValidators")); - exports.NG_ASYNC_VALIDATORS = lang_1.CONST_EXPR(new core_1.OpaqueToken("NgAsyncValidators")); - var Validators = (function() { - function Validators() {} - Validators.required = function(control) { - return lang_1.isBlank(control.value) || (lang_1.isString(control.value) && control.value == "") ? {"required": true} : null; - }; - Validators.minLength = function(minLength) { - return function(control) { - if (lang_1.isPresent(Validators.required(control))) - return null; - var v = control.value; - return v.length < minLength ? {"minlength": { - "requiredLength": minLength, - "actualLength": v.length - }} : null; - }; - }; - Validators.maxLength = function(maxLength) { - return function(control) { - if (lang_1.isPresent(Validators.required(control))) - return null; - var v = control.value; - return v.length > maxLength ? {"maxlength": { - "requiredLength": maxLength, - "actualLength": v.length - }} : null; - }; - }; - Validators.pattern = function(pattern) { - return function(control) { - if (lang_1.isPresent(Validators.required(control))) - return null; - var regex = new RegExp("^" + pattern + "$"); - var v = control.value; - return regex.test(v) ? null : {"pattern": { - "requiredPattern": "^" + pattern + "$", - "actualValue": v - }}; - }; - }; - Validators.nullValidator = function(c) { - return null; - }; - Validators.compose = function(validators) { - if (lang_1.isBlank(validators)) - return null; - var presentValidators = validators.filter(lang_1.isPresent); - if (presentValidators.length == 0) - return null; - return function(control) { - return _mergeErrors(_executeValidators(control, presentValidators)); - }; - }; - Validators.composeAsync = function(validators) { - if (lang_1.isBlank(validators)) - return null; - var presentValidators = validators.filter(lang_1.isPresent); - if (presentValidators.length == 0) - return null; - return function(control) { - var promises = _executeAsyncValidators(control, presentValidators).map(_convertToPromise); - return promise_1.PromiseWrapper.all(promises).then(_mergeErrors); - }; - }; - return Validators; - }()); - exports.Validators = Validators; - function _convertToPromise(obj) { - return promise_1.PromiseWrapper.isPromise(obj) ? obj : async_1.ObservableWrapper.toPromise(obj); - } - function _executeValidators(control, validators) { - return validators.map(function(v) { - return v(control); - }); - } - function _executeAsyncValidators(control, validators) { - return validators.map(function(v) { - return v(control); - }); - } - function _mergeErrors(arrayOfErrors) { - var res = arrayOfErrors.reduce(function(res, errors) { - return lang_1.isPresent(errors) ? collection_1.StringMapWrapper.merge(res, errors) : res; - }, {}); - return collection_1.StringMapWrapper.isEmpty(res) ? null : res; - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/default_value_accessor", ["angular2/core", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var core_1 = require("angular2/core"); - var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); - var lang_1 = require("angular2/src/facade/lang"); - var DEFAULT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new core_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { - useExisting: core_1.forwardRef(function() { - return DefaultValueAccessor; - }), - multi: true - })); - var DefaultValueAccessor = (function() { - function DefaultValueAccessor(_renderer, _elementRef) { - this._renderer = _renderer; - this._elementRef = _elementRef; - this.onChange = function(_) {}; - this.onTouched = function() {}; - } - DefaultValueAccessor.prototype.writeValue = function(value) { - var normalizedValue = lang_1.isBlank(value) ? '' : value; - this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', normalizedValue); - }; - DefaultValueAccessor.prototype.registerOnChange = function(fn) { - this.onChange = fn; - }; - DefaultValueAccessor.prototype.registerOnTouched = function(fn) { - this.onTouched = fn; - }; - DefaultValueAccessor = __decorate([core_1.Directive({ - selector: 'input:not([type=checkbox])[ngControl],textarea[ngControl],input:not([type=checkbox])[ngFormControl],textarea[ngFormControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]', - host: { - '(input)': 'onChange($event.target.value)', - '(blur)': 'onTouched()' - }, - bindings: [DEFAULT_VALUE_ACCESSOR] - }), __metadata('design:paramtypes', [core_1.Renderer, core_1.ElementRef])], DefaultValueAccessor); - return DefaultValueAccessor; - }()); - exports.DefaultValueAccessor = DefaultValueAccessor; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/number_value_accessor", ["angular2/core", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var core_1 = require("angular2/core"); - var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); - var lang_1 = require("angular2/src/facade/lang"); - var NUMBER_VALUE_ACCESSOR = lang_1.CONST_EXPR(new core_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { - useExisting: core_1.forwardRef(function() { - return NumberValueAccessor; - }), - multi: true - })); - var NumberValueAccessor = (function() { - function NumberValueAccessor(_renderer, _elementRef) { - this._renderer = _renderer; - this._elementRef = _elementRef; - this.onChange = function(_) {}; - this.onTouched = function() {}; - } - NumberValueAccessor.prototype.writeValue = function(value) { - this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', value); - }; - NumberValueAccessor.prototype.registerOnChange = function(fn) { - this.onChange = function(value) { - fn(lang_1.NumberWrapper.parseFloat(value)); - }; - }; - NumberValueAccessor.prototype.registerOnTouched = function(fn) { - this.onTouched = fn; - }; - NumberValueAccessor = __decorate([core_1.Directive({ - selector: 'input[type=number][ngControl],input[type=number][ngFormControl],input[type=number][ngModel]', - host: { - '(change)': 'onChange($event.target.value)', - '(input)': 'onChange($event.target.value)', - '(blur)': 'onTouched()' - }, - bindings: [NUMBER_VALUE_ACCESSOR] - }), __metadata('design:paramtypes', [core_1.Renderer, core_1.ElementRef])], NumberValueAccessor); - return NumberValueAccessor; - }()); - exports.NumberValueAccessor = NumberValueAccessor; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/checkbox_value_accessor", ["angular2/core", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var core_1 = require("angular2/core"); - var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); - var lang_1 = require("angular2/src/facade/lang"); - var CHECKBOX_VALUE_ACCESSOR = lang_1.CONST_EXPR(new core_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { - useExisting: core_1.forwardRef(function() { - return CheckboxControlValueAccessor; - }), - multi: true - })); - var CheckboxControlValueAccessor = (function() { - function CheckboxControlValueAccessor(_renderer, _elementRef) { - this._renderer = _renderer; - this._elementRef = _elementRef; - this.onChange = function(_) {}; - this.onTouched = function() {}; - } - CheckboxControlValueAccessor.prototype.writeValue = function(value) { - this._renderer.setElementProperty(this._elementRef.nativeElement, 'checked', value); - }; - CheckboxControlValueAccessor.prototype.registerOnChange = function(fn) { - this.onChange = fn; - }; - CheckboxControlValueAccessor.prototype.registerOnTouched = function(fn) { - this.onTouched = fn; - }; - CheckboxControlValueAccessor = __decorate([core_1.Directive({ - selector: 'input[type=checkbox][ngControl],input[type=checkbox][ngFormControl],input[type=checkbox][ngModel]', - host: { - '(change)': 'onChange($event.target.checked)', - '(blur)': 'onTouched()' - }, - providers: [CHECKBOX_VALUE_ACCESSOR] - }), __metadata('design:paramtypes', [core_1.Renderer, core_1.ElementRef])], CheckboxControlValueAccessor); - return CheckboxControlValueAccessor; - }()); - exports.CheckboxControlValueAccessor = CheckboxControlValueAccessor; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/select_control_value_accessor", ["angular2/core", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var core_1 = require("angular2/core"); - var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var SELECT_VALUE_ACCESSOR = lang_1.CONST_EXPR(new core_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { - useExisting: core_1.forwardRef(function() { - return SelectControlValueAccessor; - }), - multi: true - })); - function _buildValueString(id, value) { - if (lang_1.isBlank(id)) - return "" + value; - if (!lang_1.isPrimitive(value)) - value = "Object"; - return lang_1.StringWrapper.slice(id + ": " + value, 0, 50); - } - function _extractId(valueString) { - return valueString.split(":")[0]; - } - var SelectControlValueAccessor = (function() { - function SelectControlValueAccessor(_renderer, _elementRef) { - this._renderer = _renderer; - this._elementRef = _elementRef; - this._optionMap = new Map(); - this._idCounter = 0; - this.onChange = function(_) {}; - this.onTouched = function() {}; - } - SelectControlValueAccessor.prototype.writeValue = function(value) { - this.value = value; - var valueString = _buildValueString(this._getOptionId(value), value); - this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', valueString); - }; - SelectControlValueAccessor.prototype.registerOnChange = function(fn) { - var _this = this; - this.onChange = function(valueString) { - fn(_this._getOptionValue(valueString)); - }; - }; - SelectControlValueAccessor.prototype.registerOnTouched = function(fn) { - this.onTouched = fn; - }; - SelectControlValueAccessor.prototype._registerOption = function() { - return (this._idCounter++).toString(); - }; - SelectControlValueAccessor.prototype._getOptionId = function(value) { - for (var _i = 0, - _a = collection_1.MapWrapper.keys(this._optionMap); _i < _a.length; _i++) { - var id = _a[_i]; - if (lang_1.looseIdentical(this._optionMap.get(id), value)) - return id; - } - return null; - }; - SelectControlValueAccessor.prototype._getOptionValue = function(valueString) { - var value = this._optionMap.get(_extractId(valueString)); - return lang_1.isPresent(value) ? value : valueString; - }; - SelectControlValueAccessor = __decorate([core_1.Directive({ - selector: 'select[ngControl],select[ngFormControl],select[ngModel]', - host: { - '(input)': 'onChange($event.target.value)', - '(blur)': 'onTouched()' - }, - providers: [SELECT_VALUE_ACCESSOR] - }), __metadata('design:paramtypes', [core_1.Renderer, core_1.ElementRef])], SelectControlValueAccessor); - return SelectControlValueAccessor; - }()); - exports.SelectControlValueAccessor = SelectControlValueAccessor; - var NgSelectOption = (function() { - function NgSelectOption(_element, _renderer, _select) { - this._element = _element; - this._renderer = _renderer; - this._select = _select; - if (lang_1.isPresent(this._select)) - this.id = this._select._registerOption(); - } - Object.defineProperty(NgSelectOption.prototype, "ngValue", { - set: function(value) { - if (this._select == null) - return ; - this._select._optionMap.set(this.id, value); - this._setElementValue(_buildValueString(this.id, value)); - this._select.writeValue(this._select.value); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgSelectOption.prototype, "value", { - set: function(value) { - this._setElementValue(value); - if (lang_1.isPresent(this._select)) - this._select.writeValue(this._select.value); - }, - enumerable: true, - configurable: true - }); - NgSelectOption.prototype._setElementValue = function(value) { - this._renderer.setElementProperty(this._element.nativeElement, 'value', value); - }; - NgSelectOption.prototype.ngOnDestroy = function() { - if (lang_1.isPresent(this._select)) { - this._select._optionMap.delete(this.id); - this._select.writeValue(this._select.value); - } - }; - __decorate([core_1.Input('ngValue'), __metadata('design:type', Object), __metadata('design:paramtypes', [Object])], NgSelectOption.prototype, "ngValue", null); - __decorate([core_1.Input('value'), __metadata('design:type', Object), __metadata('design:paramtypes', [Object])], NgSelectOption.prototype, "value", null); - NgSelectOption = __decorate([core_1.Directive({selector: 'option'}), __param(2, core_1.Optional()), __param(2, core_1.Host()), __metadata('design:paramtypes', [core_1.ElementRef, core_1.Renderer, SelectControlValueAccessor])], NgSelectOption); - return NgSelectOption; - }()); - exports.NgSelectOption = NgSelectOption; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/radio_control_value_accessor", ["angular2/core", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/ng_control", "angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var core_1 = require("angular2/core"); - var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); - var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var RADIO_VALUE_ACCESSOR = lang_1.CONST_EXPR(new core_1.Provider(control_value_accessor_1.NG_VALUE_ACCESSOR, { - useExisting: core_1.forwardRef(function() { - return RadioControlValueAccessor; - }), - multi: true - })); - var RadioControlRegistry = (function() { - function RadioControlRegistry() { - this._accessors = []; - } - RadioControlRegistry.prototype.add = function(control, accessor) { - this._accessors.push([control, accessor]); - }; - RadioControlRegistry.prototype.remove = function(accessor) { - var indexToRemove = -1; - for (var i = 0; i < this._accessors.length; ++i) { - if (this._accessors[i][1] === accessor) { - indexToRemove = i; - } - } - collection_1.ListWrapper.removeAt(this._accessors, indexToRemove); - }; - RadioControlRegistry.prototype.select = function(accessor) { - this._accessors.forEach(function(c) { - if (c[0].control.root === accessor._control.control.root && c[1] !== accessor) { - c[1].fireUncheck(); - } - }); - }; - RadioControlRegistry = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [])], RadioControlRegistry); - return RadioControlRegistry; - }()); - exports.RadioControlRegistry = RadioControlRegistry; - var RadioButtonState = (function() { - function RadioButtonState(checked, value) { - this.checked = checked; - this.value = value; - } - return RadioButtonState; - }()); - exports.RadioButtonState = RadioButtonState; - var RadioControlValueAccessor = (function() { - function RadioControlValueAccessor(_renderer, _elementRef, _registry, _injector) { - this._renderer = _renderer; - this._elementRef = _elementRef; - this._registry = _registry; - this._injector = _injector; - this.onChange = function() {}; - this.onTouched = function() {}; - } - RadioControlValueAccessor.prototype.ngOnInit = function() { - this._control = this._injector.get(ng_control_1.NgControl); - this._registry.add(this._control, this); - }; - RadioControlValueAccessor.prototype.ngOnDestroy = function() { - this._registry.remove(this); - }; - RadioControlValueAccessor.prototype.writeValue = function(value) { - this._state = value; - if (lang_1.isPresent(value) && value.checked) { - this._renderer.setElementProperty(this._elementRef.nativeElement, 'checked', true); - } - }; - RadioControlValueAccessor.prototype.registerOnChange = function(fn) { - var _this = this; - this._fn = fn; - this.onChange = function() { - fn(new RadioButtonState(true, _this._state.value)); - _this._registry.select(_this); - }; - }; - RadioControlValueAccessor.prototype.fireUncheck = function() { - this._fn(new RadioButtonState(false, this._state.value)); - }; - RadioControlValueAccessor.prototype.registerOnTouched = function(fn) { - this.onTouched = fn; - }; - __decorate([core_1.Input(), __metadata('design:type', String)], RadioControlValueAccessor.prototype, "name", void 0); - RadioControlValueAccessor = __decorate([core_1.Directive({ - selector: 'input[type=radio][ngControl],input[type=radio][ngFormControl],input[type=radio][ngModel]', - host: { - '(change)': 'onChange()', - '(blur)': 'onTouched()' - }, - providers: [RADIO_VALUE_ACCESSOR] - }), __metadata('design:paramtypes', [core_1.Renderer, core_1.ElementRef, RadioControlRegistry, core_1.Injector])], RadioControlValueAccessor); - return RadioControlValueAccessor; - }()); - exports.RadioControlValueAccessor = RadioControlValueAccessor; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/normalize_validator", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function normalizeValidator(validator) { - if (validator.validate !== undefined) { - return function(c) { - return validator.validate(c); - }; - } else { - return validator; - } - } - exports.normalizeValidator = normalizeValidator; - function normalizeAsyncValidator(validator) { - if (validator.validate !== undefined) { - return function(c) { - return Promise.resolve(validator.validate(c)); - }; - } else { - return validator; - } - } - exports.normalizeAsyncValidator = normalizeAsyncValidator; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/ng_form_control", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/core", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var async_1 = require("angular2/src/facade/async"); - var core_1 = require("angular2/core"); - var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); - var validators_1 = require("angular2/src/common/forms/validators"); - var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); - var shared_1 = require("angular2/src/common/forms/directives/shared"); - var formControlBinding = lang_1.CONST_EXPR(new core_1.Provider(ng_control_1.NgControl, {useExisting: core_1.forwardRef(function() { - return NgFormControl; - })})); - var NgFormControl = (function(_super) { - __extends(NgFormControl, _super); - function NgFormControl(_validators, _asyncValidators, valueAccessors) { - _super.call(this); - this._validators = _validators; - this._asyncValidators = _asyncValidators; - this.update = new async_1.EventEmitter(); - this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); - } - NgFormControl.prototype.ngOnChanges = function(changes) { - if (this._isControlChanged(changes)) { - shared_1.setUpControl(this.form, this); - this.form.updateValueAndValidity({emitEvent: false}); - } - if (shared_1.isPropertyUpdated(changes, this.viewModel)) { - this.form.updateValue(this.model); - this.viewModel = this.model; - } - }; - Object.defineProperty(NgFormControl.prototype, "path", { - get: function() { - return []; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgFormControl.prototype, "validator", { - get: function() { - return shared_1.composeValidators(this._validators); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgFormControl.prototype, "asyncValidator", { - get: function() { - return shared_1.composeAsyncValidators(this._asyncValidators); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgFormControl.prototype, "control", { - get: function() { - return this.form; - }, - enumerable: true, - configurable: true - }); - NgFormControl.prototype.viewToModelUpdate = function(newValue) { - this.viewModel = newValue; - async_1.ObservableWrapper.callEmit(this.update, newValue); - }; - NgFormControl.prototype._isControlChanged = function(changes) { - return collection_1.StringMapWrapper.contains(changes, "form"); - }; - NgFormControl = __decorate([core_1.Directive({ - selector: '[ngFormControl]', - bindings: [formControlBinding], - inputs: ['form: ngFormControl', 'model: ngModel'], - outputs: ['update: ngModelChange'], - exportAs: 'ngForm' - }), __param(0, core_1.Optional()), __param(0, core_1.Self()), __param(0, core_1.Inject(validators_1.NG_VALIDATORS)), __param(1, core_1.Optional()), __param(1, core_1.Self()), __param(1, core_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, core_1.Optional()), __param(2, core_1.Self()), __param(2, core_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgFormControl); - return NgFormControl; - }(ng_control_1.NgControl)); - exports.NgFormControl = NgFormControl; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/ng_model", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/core", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/model", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/shared"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var lang_1 = require("angular2/src/facade/lang"); - var async_1 = require("angular2/src/facade/async"); - var core_1 = require("angular2/core"); - var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); - var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); - var model_1 = require("angular2/src/common/forms/model"); - var validators_1 = require("angular2/src/common/forms/validators"); - var shared_1 = require("angular2/src/common/forms/directives/shared"); - var formControlBinding = lang_1.CONST_EXPR(new core_1.Provider(ng_control_1.NgControl, {useExisting: core_1.forwardRef(function() { - return NgModel; - })})); - var NgModel = (function(_super) { - __extends(NgModel, _super); - function NgModel(_validators, _asyncValidators, valueAccessors) { - _super.call(this); - this._validators = _validators; - this._asyncValidators = _asyncValidators; - this._control = new model_1.Control(); - this._added = false; - this.update = new async_1.EventEmitter(); - this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); - } - NgModel.prototype.ngOnChanges = function(changes) { - if (!this._added) { - shared_1.setUpControl(this._control, this); - this._control.updateValueAndValidity({emitEvent: false}); - this._added = true; - } - if (shared_1.isPropertyUpdated(changes, this.viewModel)) { - this._control.updateValue(this.model); - this.viewModel = this.model; - } - }; - Object.defineProperty(NgModel.prototype, "control", { - get: function() { - return this._control; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgModel.prototype, "path", { - get: function() { - return []; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgModel.prototype, "validator", { - get: function() { - return shared_1.composeValidators(this._validators); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgModel.prototype, "asyncValidator", { - get: function() { - return shared_1.composeAsyncValidators(this._asyncValidators); - }, - enumerable: true, - configurable: true - }); - NgModel.prototype.viewToModelUpdate = function(newValue) { - this.viewModel = newValue; - async_1.ObservableWrapper.callEmit(this.update, newValue); - }; - NgModel = __decorate([core_1.Directive({ - selector: '[ngModel]:not([ngControl]):not([ngFormControl])', - bindings: [formControlBinding], - inputs: ['model: ngModel'], - outputs: ['update: ngModelChange'], - exportAs: 'ngForm' - }), __param(0, core_1.Optional()), __param(0, core_1.Self()), __param(0, core_1.Inject(validators_1.NG_VALIDATORS)), __param(1, core_1.Optional()), __param(1, core_1.Self()), __param(1, core_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(2, core_1.Optional()), __param(2, core_1.Self()), __param(2, core_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [Array, Array, Array])], NgModel); - return NgModel; - }(ng_control_1.NgControl)); - exports.NgModel = NgModel; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/ng_control_group", ["angular2/core", "angular2/src/facade/lang", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var core_1 = require("angular2/core"); - var lang_1 = require("angular2/src/facade/lang"); - var control_container_1 = require("angular2/src/common/forms/directives/control_container"); - var shared_1 = require("angular2/src/common/forms/directives/shared"); - var validators_1 = require("angular2/src/common/forms/validators"); - var controlGroupProvider = lang_1.CONST_EXPR(new core_1.Provider(control_container_1.ControlContainer, {useExisting: core_1.forwardRef(function() { - return NgControlGroup; - })})); - var NgControlGroup = (function(_super) { - __extends(NgControlGroup, _super); - function NgControlGroup(parent, _validators, _asyncValidators) { - _super.call(this); - this._validators = _validators; - this._asyncValidators = _asyncValidators; - this._parent = parent; - } - NgControlGroup.prototype.ngOnInit = function() { - this.formDirective.addControlGroup(this); - }; - NgControlGroup.prototype.ngOnDestroy = function() { - this.formDirective.removeControlGroup(this); - }; - Object.defineProperty(NgControlGroup.prototype, "control", { - get: function() { - return this.formDirective.getControlGroup(this); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlGroup.prototype, "path", { - get: function() { - return shared_1.controlPath(this.name, this._parent); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlGroup.prototype, "formDirective", { - get: function() { - return this._parent.formDirective; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlGroup.prototype, "validator", { - get: function() { - return shared_1.composeValidators(this._validators); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlGroup.prototype, "asyncValidator", { - get: function() { - return shared_1.composeAsyncValidators(this._asyncValidators); - }, - enumerable: true, - configurable: true - }); - NgControlGroup = __decorate([core_1.Directive({ - selector: '[ngControlGroup]', - providers: [controlGroupProvider], - inputs: ['name: ngControlGroup'], - exportAs: 'ngForm' - }), __param(0, core_1.Host()), __param(0, core_1.SkipSelf()), __param(1, core_1.Optional()), __param(1, core_1.Self()), __param(1, core_1.Inject(validators_1.NG_VALIDATORS)), __param(2, core_1.Optional()), __param(2, core_1.Self()), __param(2, core_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array])], NgControlGroup); - return NgControlGroup; - }(control_container_1.ControlContainer)); - exports.NgControlGroup = NgControlGroup; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/ng_form_model", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/core", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var async_1 = require("angular2/src/facade/async"); - var core_1 = require("angular2/core"); - var control_container_1 = require("angular2/src/common/forms/directives/control_container"); - var shared_1 = require("angular2/src/common/forms/directives/shared"); - var validators_1 = require("angular2/src/common/forms/validators"); - var formDirectiveProvider = lang_1.CONST_EXPR(new core_1.Provider(control_container_1.ControlContainer, {useExisting: core_1.forwardRef(function() { - return NgFormModel; - })})); - var NgFormModel = (function(_super) { - __extends(NgFormModel, _super); - function NgFormModel(_validators, _asyncValidators) { - _super.call(this); - this._validators = _validators; - this._asyncValidators = _asyncValidators; - this.form = null; - this.directives = []; - this.ngSubmit = new async_1.EventEmitter(); - } - NgFormModel.prototype.ngOnChanges = function(changes) { - if (collection_1.StringMapWrapper.contains(changes, "form")) { - var sync = shared_1.composeValidators(this._validators); - this.form.validator = validators_1.Validators.compose([this.form.validator, sync]); - var async = shared_1.composeAsyncValidators(this._asyncValidators); - this.form.asyncValidator = validators_1.Validators.composeAsync([this.form.asyncValidator, async]); - this.form.updateValueAndValidity({ - onlySelf: true, - emitEvent: false - }); - } - this._updateDomValue(); - }; - Object.defineProperty(NgFormModel.prototype, "formDirective", { - get: function() { - return this; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgFormModel.prototype, "control", { - get: function() { - return this.form; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgFormModel.prototype, "path", { - get: function() { - return []; - }, - enumerable: true, - configurable: true - }); - NgFormModel.prototype.addControl = function(dir) { - var ctrl = this.form.find(dir.path); - shared_1.setUpControl(ctrl, dir); - ctrl.updateValueAndValidity({emitEvent: false}); - this.directives.push(dir); - }; - NgFormModel.prototype.getControl = function(dir) { - return this.form.find(dir.path); - }; - NgFormModel.prototype.removeControl = function(dir) { - collection_1.ListWrapper.remove(this.directives, dir); - }; - NgFormModel.prototype.addControlGroup = function(dir) { - var ctrl = this.form.find(dir.path); - shared_1.setUpControlGroup(ctrl, dir); - ctrl.updateValueAndValidity({emitEvent: false}); - }; - NgFormModel.prototype.removeControlGroup = function(dir) {}; - NgFormModel.prototype.getControlGroup = function(dir) { - return this.form.find(dir.path); - }; - NgFormModel.prototype.updateModel = function(dir, value) { - var ctrl = this.form.find(dir.path); - ctrl.updateValue(value); - }; - NgFormModel.prototype.onSubmit = function() { - async_1.ObservableWrapper.callEmit(this.ngSubmit, null); - return false; - }; - NgFormModel.prototype._updateDomValue = function() { - var _this = this; - this.directives.forEach(function(dir) { - var ctrl = _this.form.find(dir.path); - dir.valueAccessor.writeValue(ctrl.value); - }); - }; - NgFormModel = __decorate([core_1.Directive({ - selector: '[ngFormModel]', - bindings: [formDirectiveProvider], - inputs: ['form: ngFormModel'], - host: {'(submit)': 'onSubmit()'}, - outputs: ['ngSubmit'], - exportAs: 'ngForm' - }), __param(0, core_1.Optional()), __param(0, core_1.Self()), __param(0, core_1.Inject(validators_1.NG_VALIDATORS)), __param(1, core_1.Optional()), __param(1, core_1.Self()), __param(1, core_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgFormModel); - return NgFormModel; - }(control_container_1.ControlContainer)); - exports.NgFormModel = NgFormModel; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/ng_form", ["angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/core", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/model", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var async_1 = require("angular2/src/facade/async"); - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var core_1 = require("angular2/core"); - var control_container_1 = require("angular2/src/common/forms/directives/control_container"); - var model_1 = require("angular2/src/common/forms/model"); - var shared_1 = require("angular2/src/common/forms/directives/shared"); - var validators_1 = require("angular2/src/common/forms/validators"); - var formDirectiveProvider = lang_1.CONST_EXPR(new core_1.Provider(control_container_1.ControlContainer, {useExisting: core_1.forwardRef(function() { - return NgForm; - })})); - var NgForm = (function(_super) { - __extends(NgForm, _super); - function NgForm(validators, asyncValidators) { - _super.call(this); - this.ngSubmit = new async_1.EventEmitter(); - this.form = new model_1.ControlGroup({}, null, shared_1.composeValidators(validators), shared_1.composeAsyncValidators(asyncValidators)); - } - Object.defineProperty(NgForm.prototype, "formDirective", { - get: function() { - return this; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgForm.prototype, "control", { - get: function() { - return this.form; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgForm.prototype, "path", { - get: function() { - return []; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgForm.prototype, "controls", { - get: function() { - return this.form.controls; - }, - enumerable: true, - configurable: true - }); - NgForm.prototype.addControl = function(dir) { - var _this = this; - async_1.PromiseWrapper.scheduleMicrotask(function() { - var container = _this._findContainer(dir.path); - var ctrl = new model_1.Control(); - shared_1.setUpControl(ctrl, dir); - container.addControl(dir.name, ctrl); - ctrl.updateValueAndValidity({emitEvent: false}); - }); - }; - NgForm.prototype.getControl = function(dir) { - return this.form.find(dir.path); - }; - NgForm.prototype.removeControl = function(dir) { - var _this = this; - async_1.PromiseWrapper.scheduleMicrotask(function() { - var container = _this._findContainer(dir.path); - if (lang_1.isPresent(container)) { - container.removeControl(dir.name); - container.updateValueAndValidity({emitEvent: false}); - } - }); - }; - NgForm.prototype.addControlGroup = function(dir) { - var _this = this; - async_1.PromiseWrapper.scheduleMicrotask(function() { - var container = _this._findContainer(dir.path); - var group = new model_1.ControlGroup({}); - shared_1.setUpControlGroup(group, dir); - container.addControl(dir.name, group); - group.updateValueAndValidity({emitEvent: false}); - }); - }; - NgForm.prototype.removeControlGroup = function(dir) { - var _this = this; - async_1.PromiseWrapper.scheduleMicrotask(function() { - var container = _this._findContainer(dir.path); - if (lang_1.isPresent(container)) { - container.removeControl(dir.name); - container.updateValueAndValidity({emitEvent: false}); - } - }); - }; - NgForm.prototype.getControlGroup = function(dir) { - return this.form.find(dir.path); - }; - NgForm.prototype.updateModel = function(dir, value) { - var _this = this; - async_1.PromiseWrapper.scheduleMicrotask(function() { - var ctrl = _this.form.find(dir.path); - ctrl.updateValue(value); - }); - }; - NgForm.prototype.onSubmit = function() { - async_1.ObservableWrapper.callEmit(this.ngSubmit, null); - return false; - }; - NgForm.prototype._findContainer = function(path) { - path.pop(); - return collection_1.ListWrapper.isEmpty(path) ? this.form : this.form.find(path); - }; - NgForm = __decorate([core_1.Directive({ - selector: 'form:not([ngNoForm]):not([ngFormModel]),ngForm,[ngForm]', - bindings: [formDirectiveProvider], - host: {'(submit)': 'onSubmit()'}, - outputs: ['ngSubmit'], - exportAs: 'ngForm' - }), __param(0, core_1.Optional()), __param(0, core_1.Self()), __param(0, core_1.Inject(validators_1.NG_VALIDATORS)), __param(1, core_1.Optional()), __param(1, core_1.Self()), __param(1, core_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __metadata('design:paramtypes', [Array, Array])], NgForm); - return NgForm; - }(control_container_1.ControlContainer)); - exports.NgForm = NgForm; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/ng_control_status", ["angular2/core", "angular2/src/common/forms/directives/ng_control", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var core_1 = require("angular2/core"); - var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); - var lang_1 = require("angular2/src/facade/lang"); - var NgControlStatus = (function() { - function NgControlStatus(cd) { - this._cd = cd; - } - Object.defineProperty(NgControlStatus.prototype, "ngClassUntouched", { - get: function() { - return lang_1.isPresent(this._cd.control) ? this._cd.control.untouched : false; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlStatus.prototype, "ngClassTouched", { - get: function() { - return lang_1.isPresent(this._cd.control) ? this._cd.control.touched : false; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlStatus.prototype, "ngClassPristine", { - get: function() { - return lang_1.isPresent(this._cd.control) ? this._cd.control.pristine : false; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlStatus.prototype, "ngClassDirty", { - get: function() { - return lang_1.isPresent(this._cd.control) ? this._cd.control.dirty : false; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlStatus.prototype, "ngClassValid", { - get: function() { - return lang_1.isPresent(this._cd.control) ? this._cd.control.valid : false; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlStatus.prototype, "ngClassInvalid", { - get: function() { - return lang_1.isPresent(this._cd.control) ? !this._cd.control.valid : false; - }, - enumerable: true, - configurable: true - }); - NgControlStatus = __decorate([core_1.Directive({ - selector: '[ngControl],[ngModel],[ngFormControl]', - host: { - '[class.ng-untouched]': 'ngClassUntouched', - '[class.ng-touched]': 'ngClassTouched', - '[class.ng-pristine]': 'ngClassPristine', - '[class.ng-dirty]': 'ngClassDirty', - '[class.ng-valid]': 'ngClassValid', - '[class.ng-invalid]': 'ngClassInvalid' - } - }), __param(0, core_1.Self()), __metadata('design:paramtypes', [ng_control_1.NgControl])], NgControlStatus); - return NgControlStatus; - }()); - exports.NgControlStatus = NgControlStatus; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/validators", ["angular2/core", "angular2/src/facade/lang", "angular2/src/common/forms/validators", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var core_1 = require("angular2/core"); - var lang_1 = require("angular2/src/facade/lang"); - var validators_1 = require("angular2/src/common/forms/validators"); - var lang_2 = require("angular2/src/facade/lang"); - var REQUIRED = validators_1.Validators.required; - var REQUIRED_VALIDATOR = lang_1.CONST_EXPR(new core_1.Provider(validators_1.NG_VALIDATORS, { - useValue: REQUIRED, - multi: true - })); - var RequiredValidator = (function() { - function RequiredValidator() {} - RequiredValidator = __decorate([core_1.Directive({ - selector: '[required][ngControl],[required][ngFormControl],[required][ngModel]', - providers: [REQUIRED_VALIDATOR] - }), __metadata('design:paramtypes', [])], RequiredValidator); - return RequiredValidator; - }()); - exports.RequiredValidator = RequiredValidator; - var MIN_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new core_1.Provider(validators_1.NG_VALIDATORS, { - useExisting: core_1.forwardRef(function() { - return MinLengthValidator; - }), - multi: true - })); - var MinLengthValidator = (function() { - function MinLengthValidator(minLength) { - this._validator = validators_1.Validators.minLength(lang_2.NumberWrapper.parseInt(minLength, 10)); - } - MinLengthValidator.prototype.validate = function(c) { - return this._validator(c); - }; - MinLengthValidator = __decorate([core_1.Directive({ - selector: '[minlength][ngControl],[minlength][ngFormControl],[minlength][ngModel]', - providers: [MIN_LENGTH_VALIDATOR] - }), __param(0, core_1.Attribute("minlength")), __metadata('design:paramtypes', [String])], MinLengthValidator); - return MinLengthValidator; - }()); - exports.MinLengthValidator = MinLengthValidator; - var MAX_LENGTH_VALIDATOR = lang_1.CONST_EXPR(new core_1.Provider(validators_1.NG_VALIDATORS, { - useExisting: core_1.forwardRef(function() { - return MaxLengthValidator; - }), - multi: true - })); - var MaxLengthValidator = (function() { - function MaxLengthValidator(maxLength) { - this._validator = validators_1.Validators.maxLength(lang_2.NumberWrapper.parseInt(maxLength, 10)); - } - MaxLengthValidator.prototype.validate = function(c) { - return this._validator(c); - }; - MaxLengthValidator = __decorate([core_1.Directive({ - selector: '[maxlength][ngControl],[maxlength][ngFormControl],[maxlength][ngModel]', - providers: [MAX_LENGTH_VALIDATOR] - }), __param(0, core_1.Attribute("maxlength")), __metadata('design:paramtypes', [String])], MaxLengthValidator); - return MaxLengthValidator; - }()); - exports.MaxLengthValidator = MaxLengthValidator; - var PATTERN_VALIDATOR = lang_1.CONST_EXPR(new core_1.Provider(validators_1.NG_VALIDATORS, { - useExisting: core_1.forwardRef(function() { - return PatternValidator; - }), - multi: true - })); - var PatternValidator = (function() { - function PatternValidator(pattern) { - this._validator = validators_1.Validators.pattern(pattern); - } - PatternValidator.prototype.validate = function(c) { - return this._validator(c); - }; - PatternValidator = __decorate([core_1.Directive({ - selector: '[pattern][ngControl],[pattern][ngFormControl],[pattern][ngModel]', - providers: [PATTERN_VALIDATOR] - }), __param(0, core_1.Attribute("pattern")), __metadata('design:paramtypes', [String])], PatternValidator); - return PatternValidator; - }()); - exports.PatternValidator = PatternValidator; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/form_builder", ["angular2/core", "angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/common/forms/model"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var core_1 = require("angular2/core"); - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var modelModule = require("angular2/src/common/forms/model"); - var FormBuilder = (function() { - function FormBuilder() {} - FormBuilder.prototype.group = function(controlsConfig, extra) { - if (extra === void 0) { - extra = null; - } - var controls = this._reduceControls(controlsConfig); - var optionals = (lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "optionals") : null); - var validator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "validator") : null; - var asyncValidator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "asyncValidator") : null; - return new modelModule.ControlGroup(controls, optionals, validator, asyncValidator); - }; - FormBuilder.prototype.control = function(value, validator, asyncValidator) { - if (validator === void 0) { - validator = null; - } - if (asyncValidator === void 0) { - asyncValidator = null; - } - return new modelModule.Control(value, validator, asyncValidator); - }; - FormBuilder.prototype.array = function(controlsConfig, validator, asyncValidator) { - var _this = this; - if (validator === void 0) { - validator = null; - } - if (asyncValidator === void 0) { - asyncValidator = null; - } - var controls = controlsConfig.map(function(c) { - return _this._createControl(c); - }); - return new modelModule.ControlArray(controls, validator, asyncValidator); - }; - FormBuilder.prototype._reduceControls = function(controlsConfig) { - var _this = this; - var controls = {}; - collection_1.StringMapWrapper.forEach(controlsConfig, function(controlConfig, controlName) { - controls[controlName] = _this._createControl(controlConfig); - }); - return controls; - }; - FormBuilder.prototype._createControl = function(controlConfig) { - if (controlConfig instanceof modelModule.Control || controlConfig instanceof modelModule.ControlGroup || controlConfig instanceof modelModule.ControlArray) { - return controlConfig; - } else if (lang_1.isArray(controlConfig)) { - var value = controlConfig[0]; - var validator = controlConfig.length > 1 ? controlConfig[1] : null; - var asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null; - return this.control(value, validator, asyncValidator); - } else { - return this.control(controlConfig); - } - }; - FormBuilder = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [])], FormBuilder); - return FormBuilder; - }()); - exports.FormBuilder = FormBuilder; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/common_directives", ["angular2/src/facade/lang", "angular2/src/common/forms", "angular2/src/common/directives"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var forms_1 = require("angular2/src/common/forms"); - var directives_1 = require("angular2/src/common/directives"); - exports.COMMON_DIRECTIVES = lang_1.CONST_EXPR([directives_1.CORE_DIRECTIVES, forms_1.FORM_DIRECTIVES]); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/events/key_events", ["angular2/src/platform/dom/dom_adapter", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/platform/dom/events/event_manager", "angular2/src/core/di"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var event_manager_1 = require("angular2/src/platform/dom/events/event_manager"); - var di_1 = require("angular2/src/core/di"); - var modifierKeys = ['alt', 'control', 'meta', 'shift']; - var modifierKeyGetters = { - 'alt': function(event) { - return event.altKey; - }, - 'control': function(event) { - return event.ctrlKey; - }, - 'meta': function(event) { - return event.metaKey; - }, - 'shift': function(event) { - return event.shiftKey; - } - }; - var KeyEventsPlugin = (function(_super) { - __extends(KeyEventsPlugin, _super); - function KeyEventsPlugin() { - _super.call(this); - } - KeyEventsPlugin.prototype.supports = function(eventName) { - return lang_1.isPresent(KeyEventsPlugin.parseEventName(eventName)); - }; - KeyEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { - var parsedEvent = KeyEventsPlugin.parseEventName(eventName); - var outsideHandler = KeyEventsPlugin.eventCallback(element, collection_1.StringMapWrapper.get(parsedEvent, 'fullKey'), handler, this.manager.getZone()); - return this.manager.getZone().runOutsideAngular(function() { - return dom_adapter_1.DOM.onAndCancel(element, collection_1.StringMapWrapper.get(parsedEvent, 'domEventName'), outsideHandler); - }); - }; - KeyEventsPlugin.parseEventName = function(eventName) { - var parts = eventName.toLowerCase().split('.'); - var domEventName = parts.shift(); - if ((parts.length === 0) || !(lang_1.StringWrapper.equals(domEventName, 'keydown') || lang_1.StringWrapper.equals(domEventName, 'keyup'))) { - return null; - } - var key = KeyEventsPlugin._normalizeKey(parts.pop()); - var fullKey = ''; - modifierKeys.forEach(function(modifierName) { - if (collection_1.ListWrapper.contains(parts, modifierName)) { - collection_1.ListWrapper.remove(parts, modifierName); - fullKey += modifierName + '.'; - } - }); - fullKey += key; - if (parts.length != 0 || key.length === 0) { - return null; - } - var result = collection_1.StringMapWrapper.create(); - collection_1.StringMapWrapper.set(result, 'domEventName', domEventName); - collection_1.StringMapWrapper.set(result, 'fullKey', fullKey); - return result; - }; - KeyEventsPlugin.getEventFullKey = function(event) { - var fullKey = ''; - var key = dom_adapter_1.DOM.getEventKey(event); - key = key.toLowerCase(); - if (lang_1.StringWrapper.equals(key, ' ')) { - key = 'space'; - } else if (lang_1.StringWrapper.equals(key, '.')) { - key = 'dot'; - } - modifierKeys.forEach(function(modifierName) { - if (modifierName != key) { - var modifierGetter = collection_1.StringMapWrapper.get(modifierKeyGetters, modifierName); - if (modifierGetter(event)) { - fullKey += modifierName + '.'; - } - } - }); - fullKey += key; - return fullKey; - }; - KeyEventsPlugin.eventCallback = function(element, fullKey, handler, zone) { - return function(event) { - if (lang_1.StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) { - zone.run(function() { - return handler(event); - }); - } - }; - }; - KeyEventsPlugin._normalizeKey = function(keyName) { - switch (keyName) { - case 'esc': - return 'escape'; - default: - return keyName; - } - }; - KeyEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], KeyEventsPlugin); - return KeyEventsPlugin; - }(event_manager_1.EventManagerPlugin)); - exports.KeyEventsPlugin = KeyEventsPlugin; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/events/hammer_common", ["angular2/src/platform/dom/events/event_manager", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var event_manager_1 = require("angular2/src/platform/dom/events/event_manager"); - var collection_1 = require("angular2/src/facade/collection"); - var _eventNames = { - 'pan': true, - 'panstart': true, - 'panmove': true, - 'panend': true, - 'pancancel': true, - 'panleft': true, - 'panright': true, - 'panup': true, - 'pandown': true, - 'pinch': true, - 'pinchstart': true, - 'pinchmove': true, - 'pinchend': true, - 'pinchcancel': true, - 'pinchin': true, - 'pinchout': true, - 'press': true, - 'pressup': true, - 'rotate': true, - 'rotatestart': true, - 'rotatemove': true, - 'rotateend': true, - 'rotatecancel': true, - 'swipe': true, - 'swipeleft': true, - 'swiperight': true, - 'swipeup': true, - 'swipedown': true, - 'tap': true - }; - var HammerGesturesPluginCommon = (function(_super) { - __extends(HammerGesturesPluginCommon, _super); - function HammerGesturesPluginCommon() { - _super.call(this); - } - HammerGesturesPluginCommon.prototype.supports = function(eventName) { - eventName = eventName.toLowerCase(); - return collection_1.StringMapWrapper.contains(_eventNames, eventName); - }; - return HammerGesturesPluginCommon; - }(event_manager_1.EventManagerPlugin)); - exports.HammerGesturesPluginCommon = HammerGesturesPluginCommon; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/browser/xhr_impl", ["angular2/src/facade/promise", "angular2/src/facade/lang", "angular2/src/compiler/xhr"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var promise_1 = require("angular2/src/facade/promise"); - var lang_1 = require("angular2/src/facade/lang"); - var xhr_1 = require("angular2/src/compiler/xhr"); - var XHRImpl = (function(_super) { - __extends(XHRImpl, _super); - function XHRImpl() { - _super.apply(this, arguments); - } - XHRImpl.prototype.get = function(url) { - var completer = promise_1.PromiseWrapper.completer(); - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.responseType = 'text'; - xhr.onload = function() { - var response = lang_1.isPresent(xhr.response) ? xhr.response : xhr.responseText; - var status = xhr.status === 1223 ? 204 : xhr.status; - if (status === 0) { - status = response ? 200 : 0; - } - if (200 <= status && status <= 300) { - completer.resolve(response); - } else { - completer.reject("Failed to load " + url, null); - } - }; - xhr.onerror = function() { - completer.reject("Failed to load " + url, null); - }; - xhr.send(); - return completer.promise; - }; - return XHRImpl; - }(xhr_1.XHR)); - exports.XHRImpl = XHRImpl; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/browser/testability", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/platform/dom/dom_adapter", "angular2/core"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var core_1 = require("angular2/core"); - var PublicTestability = (function() { - function PublicTestability(testability) { - this._testability = testability; - } - PublicTestability.prototype.isStable = function() { - return this._testability.isStable(); - }; - PublicTestability.prototype.whenStable = function(callback) { - this._testability.whenStable(callback); - }; - PublicTestability.prototype.findBindings = function(using, provider, exactMatch) { - return this.findProviders(using, provider, exactMatch); - }; - PublicTestability.prototype.findProviders = function(using, provider, exactMatch) { - return this._testability.findBindings(using, provider, exactMatch); - }; - return PublicTestability; - }()); - var BrowserGetTestability = (function() { - function BrowserGetTestability() {} - BrowserGetTestability.init = function() { - core_1.setTestabilityGetter(new BrowserGetTestability()); - }; - BrowserGetTestability.prototype.addToWindow = function(registry) { - lang_1.global.getAngularTestability = function(elem, findInAncestors) { - if (findInAncestors === void 0) { - findInAncestors = true; - } - var testability = registry.findTestabilityInTree(elem, findInAncestors); - if (testability == null) { - throw new Error('Could not find testability for element.'); - } - return new PublicTestability(testability); - }; - lang_1.global.getAllAngularTestabilities = function() { - var testabilities = registry.getAllTestabilities(); - return testabilities.map(function(testability) { - return new PublicTestability(testability); - }); - }; - lang_1.global.getAllAngularRootElements = function() { - return registry.getAllRootElements(); - }; - var whenAllStable = function(callback) { - var testabilities = lang_1.global.getAllAngularTestabilities(); - var count = testabilities.length; - var didWork = false; - var decrement = function(didWork_) { - didWork = didWork || didWork_; - count--; - if (count == 0) { - callback(didWork); - } - }; - testabilities.forEach(function(testability) { - testability.whenStable(decrement); - }); - }; - if (!lang_1.global.frameworkStabilizers) { - lang_1.global.frameworkStabilizers = collection_1.ListWrapper.createGrowableSize(0); - } - lang_1.global.frameworkStabilizers.push(whenAllStable); - }; - BrowserGetTestability.prototype.findTestabilityInTree = function(registry, elem, findInAncestors) { - if (elem == null) { - return null; - } - var t = registry.getTestability(elem); - if (lang_1.isPresent(t)) { - return t; - } else if (!findInAncestors) { - return null; - } - if (dom_adapter_1.DOM.isShadowRoot(elem)) { - return this.findTestabilityInTree(registry, dom_adapter_1.DOM.getHost(elem), true); - } - return this.findTestabilityInTree(registry, dom_adapter_1.DOM.parentElement(elem), true); - }; - return BrowserGetTestability; - }()); - exports.BrowserGetTestability = BrowserGetTestability; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/browser/xhr_cache", ["angular2/src/compiler/xhr", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "angular2/src/facade/promise"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var xhr_1 = require("angular2/src/compiler/xhr"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var lang_1 = require("angular2/src/facade/lang"); - var promise_1 = require("angular2/src/facade/promise"); - var CachedXHR = (function(_super) { - __extends(CachedXHR, _super); - function CachedXHR() { - _super.call(this); - this._cache = lang_1.global.$templateCache; - if (this._cache == null) { - throw new exceptions_1.BaseException('CachedXHR: Template cache was not found in $templateCache.'); - } - } - CachedXHR.prototype.get = function(url) { - if (this._cache.hasOwnProperty(url)) { - return promise_1.PromiseWrapper.resolve(this._cache[url]); - } else { - return promise_1.PromiseWrapper.reject('CachedXHR: Did not find cached template for ' + url, null); - } - }; - return CachedXHR; - }(xhr_1.XHR)); - exports.CachedXHR = CachedXHR; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/profile/wtf_init", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function wtfInit() {} - exports.wtfInit = wtfInit; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/browser/title", ["angular2/src/platform/dom/dom_adapter"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var Title = (function() { - function Title() {} - Title.prototype.getTitle = function() { - return dom_adapter_1.DOM.getTitle(); - }; - Title.prototype.setTitle = function(newTitle) { - dom_adapter_1.DOM.setTitle(newTitle); - }; - return Title; - }()); - exports.Title = Title; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/facade/browser", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var win = window; - exports.window = win; - exports.document = window.document; - exports.location = window.location; - exports.gc = window['gc'] ? function() { - return window['gc'](); - } : function() { - return null; - }; - exports.performance = window['performance'] ? window['performance'] : null; - exports.Event = window['Event']; - exports.MouseEvent = window['MouseEvent']; - exports.KeyboardEvent = window['KeyboardEvent']; - exports.EventTarget = window['EventTarget']; - exports.History = window['History']; - exports.Location = window['Location']; - exports.EventListener = window['EventListener']; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/url_resolver", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/core/application_tokens", "angular2/src/core/di"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - var application_tokens_1 = require("angular2/src/core/application_tokens"); - var di_2 = require("angular2/src/core/di"); - function createWithoutPackagePrefix() { - return new UrlResolver(); - } - exports.createWithoutPackagePrefix = createWithoutPackagePrefix; - exports.DEFAULT_PACKAGE_URL_PROVIDER = new di_2.Provider(application_tokens_1.PACKAGE_ROOT_URL, {useValue: "/"}); - var UrlResolver = (function() { - function UrlResolver(packagePrefix) { - if (packagePrefix === void 0) { - packagePrefix = null; - } - if (lang_1.isPresent(packagePrefix)) { - this._packagePrefix = lang_1.StringWrapper.stripRight(packagePrefix, "/") + "/"; - } - } - UrlResolver.prototype.resolve = function(baseUrl, url) { - var resolvedUrl = url; - if (lang_1.isPresent(baseUrl) && baseUrl.length > 0) { - resolvedUrl = _resolveUrl(baseUrl, resolvedUrl); - } - if (lang_1.isPresent(this._packagePrefix) && getUrlScheme(resolvedUrl) == "package") { - resolvedUrl = resolvedUrl.replace("package:", this._packagePrefix); - } - return resolvedUrl; - }; - UrlResolver = __decorate([di_1.Injectable(), __param(0, di_1.Inject(application_tokens_1.PACKAGE_ROOT_URL)), __metadata('design:paramtypes', [String])], UrlResolver); - return UrlResolver; - }()); - exports.UrlResolver = UrlResolver; - function getUrlScheme(url) { - var match = _split(url); - return (match && match[_ComponentIndex.Scheme]) || ""; - } - exports.getUrlScheme = getUrlScheme; - function _buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) { - var out = []; - if (lang_1.isPresent(opt_scheme)) { - out.push(opt_scheme + ':'); - } - if (lang_1.isPresent(opt_domain)) { - out.push('//'); - if (lang_1.isPresent(opt_userInfo)) { - out.push(opt_userInfo + '@'); - } - out.push(opt_domain); - if (lang_1.isPresent(opt_port)) { - out.push(':' + opt_port); - } - } - if (lang_1.isPresent(opt_path)) { - out.push(opt_path); - } - if (lang_1.isPresent(opt_queryData)) { - out.push('?' + opt_queryData); - } - if (lang_1.isPresent(opt_fragment)) { - out.push('#' + opt_fragment); - } - return out.join(''); - } - var _splitRe = lang_1.RegExpWrapper.create('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$'); - var _ComponentIndex; - (function(_ComponentIndex) { - _ComponentIndex[_ComponentIndex["Scheme"] = 1] = "Scheme"; - _ComponentIndex[_ComponentIndex["UserInfo"] = 2] = "UserInfo"; - _ComponentIndex[_ComponentIndex["Domain"] = 3] = "Domain"; - _ComponentIndex[_ComponentIndex["Port"] = 4] = "Port"; - _ComponentIndex[_ComponentIndex["Path"] = 5] = "Path"; - _ComponentIndex[_ComponentIndex["QueryData"] = 6] = "QueryData"; - _ComponentIndex[_ComponentIndex["Fragment"] = 7] = "Fragment"; - })(_ComponentIndex || (_ComponentIndex = {})); - function _split(uri) { - return lang_1.RegExpWrapper.firstMatch(_splitRe, uri); - } - function _removeDotSegments(path) { - if (path == '/') - return '/'; - var leadingSlash = path[0] == '/' ? '/' : ''; - var trailingSlash = path[path.length - 1] === '/' ? '/' : ''; - var segments = path.split('/'); - var out = []; - var up = 0; - for (var pos = 0; pos < segments.length; pos++) { - var segment = segments[pos]; - switch (segment) { - case '': - case '.': - break; - case '..': - if (out.length > 0) { - out.pop(); - } else { - up++; - } - break; - default: - out.push(segment); - } - } - if (leadingSlash == '') { - while (up-- > 0) { - out.unshift('..'); - } - if (out.length === 0) - out.push('.'); - } - return leadingSlash + out.join('/') + trailingSlash; - } - function _joinAndCanonicalizePath(parts) { - var path = parts[_ComponentIndex.Path]; - path = lang_1.isBlank(path) ? '' : _removeDotSegments(path); - parts[_ComponentIndex.Path] = path; - return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]); - } - function _resolveUrl(base, url) { - var parts = _split(encodeURI(url)); - var baseParts = _split(base); - if (lang_1.isPresent(parts[_ComponentIndex.Scheme])) { - return _joinAndCanonicalizePath(parts); - } else { - parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme]; - } - for (var i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) { - if (lang_1.isBlank(parts[i])) { - parts[i] = baseParts[i]; - } - } - if (parts[_ComponentIndex.Path][0] == '/') { - return _joinAndCanonicalizePath(parts); - } - var path = baseParts[_ComponentIndex.Path]; - if (lang_1.isBlank(path)) - path = '/'; - var index = path.lastIndexOf('/'); - path = path.substring(0, index + 1) + parts[_ComponentIndex.Path]; - parts[_ComponentIndex.Path] = path; - return _joinAndCanonicalizePath(parts); - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/selector", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var _EMPTY_ATTR_VALUE = ''; - var _SELECTOR_REGEXP = lang_1.RegExpWrapper.create('(\\:not\\()|' + '([-\\w]+)|' + '(?:\\.([-\\w]+))|' + '(?:\\[([-\\w*]+)(?:=([^\\]]*))?\\])|' + '(\\))|' + '(\\s*,\\s*)'); - var CssSelector = (function() { - function CssSelector() { - this.element = null; - this.classNames = []; - this.attrs = []; - this.notSelectors = []; - } - CssSelector.parse = function(selector) { - var results = []; - var _addResult = function(res, cssSel) { - if (cssSel.notSelectors.length > 0 && lang_1.isBlank(cssSel.element) && collection_1.ListWrapper.isEmpty(cssSel.classNames) && collection_1.ListWrapper.isEmpty(cssSel.attrs)) { - cssSel.element = "*"; - } - res.push(cssSel); - }; - var cssSelector = new CssSelector(); - var matcher = lang_1.RegExpWrapper.matcher(_SELECTOR_REGEXP, selector); - var match; - var current = cssSelector; - var inNot = false; - while (lang_1.isPresent(match = lang_1.RegExpMatcherWrapper.next(matcher))) { - if (lang_1.isPresent(match[1])) { - if (inNot) { - throw new exceptions_1.BaseException('Nesting :not is not allowed in a selector'); - } - inNot = true; - current = new CssSelector(); - cssSelector.notSelectors.push(current); - } - if (lang_1.isPresent(match[2])) { - current.setElement(match[2]); - } - if (lang_1.isPresent(match[3])) { - current.addClassName(match[3]); - } - if (lang_1.isPresent(match[4])) { - current.addAttribute(match[4], match[5]); - } - if (lang_1.isPresent(match[6])) { - inNot = false; - current = cssSelector; - } - if (lang_1.isPresent(match[7])) { - if (inNot) { - throw new exceptions_1.BaseException('Multiple selectors in :not are not supported'); - } - _addResult(results, cssSelector); - cssSelector = current = new CssSelector(); - } - } - _addResult(results, cssSelector); - return results; - }; - CssSelector.prototype.isElementSelector = function() { - return lang_1.isPresent(this.element) && collection_1.ListWrapper.isEmpty(this.classNames) && collection_1.ListWrapper.isEmpty(this.attrs) && this.notSelectors.length === 0; - }; - CssSelector.prototype.setElement = function(element) { - if (element === void 0) { - element = null; - } - this.element = element; - }; - CssSelector.prototype.getMatchingElementTemplate = function() { - var tagName = lang_1.isPresent(this.element) ? this.element : 'div'; - var classAttr = this.classNames.length > 0 ? " class=\"" + this.classNames.join(' ') + "\"" : ''; - var attrs = ''; - for (var i = 0; i < this.attrs.length; i += 2) { - var attrName = this.attrs[i]; - var attrValue = this.attrs[i + 1] !== '' ? "=\"" + this.attrs[i + 1] + "\"" : ''; - attrs += " " + attrName + attrValue; - } - return "<" + tagName + classAttr + attrs + ">"; - }; - CssSelector.prototype.addAttribute = function(name, value) { - if (value === void 0) { - value = _EMPTY_ATTR_VALUE; - } - this.attrs.push(name); - if (lang_1.isPresent(value)) { - value = value.toLowerCase(); - } else { - value = _EMPTY_ATTR_VALUE; - } - this.attrs.push(value); - }; - CssSelector.prototype.addClassName = function(name) { - this.classNames.push(name.toLowerCase()); - }; - CssSelector.prototype.toString = function() { - var res = ''; - if (lang_1.isPresent(this.element)) { - res += this.element; - } - if (lang_1.isPresent(this.classNames)) { - for (var i = 0; i < this.classNames.length; i++) { - res += '.' + this.classNames[i]; - } - } - if (lang_1.isPresent(this.attrs)) { - for (var i = 0; i < this.attrs.length; ) { - var attrName = this.attrs[i++]; - var attrValue = this.attrs[i++]; - res += '[' + attrName; - if (attrValue.length > 0) { - res += '=' + attrValue; - } - res += ']'; - } - } - this.notSelectors.forEach(function(notSelector) { - return res += ":not(" + notSelector + ")"; - }); - return res; - }; - return CssSelector; - }()); - exports.CssSelector = CssSelector; - var SelectorMatcher = (function() { - function SelectorMatcher() { - this._elementMap = new collection_1.Map(); - this._elementPartialMap = new collection_1.Map(); - this._classMap = new collection_1.Map(); - this._classPartialMap = new collection_1.Map(); - this._attrValueMap = new collection_1.Map(); - this._attrValuePartialMap = new collection_1.Map(); - this._listContexts = []; - } - SelectorMatcher.createNotMatcher = function(notSelectors) { - var notMatcher = new SelectorMatcher(); - notMatcher.addSelectables(notSelectors, null); - return notMatcher; - }; - SelectorMatcher.prototype.addSelectables = function(cssSelectors, callbackCtxt) { - var listContext = null; - if (cssSelectors.length > 1) { - listContext = new SelectorListContext(cssSelectors); - this._listContexts.push(listContext); - } - for (var i = 0; i < cssSelectors.length; i++) { - this._addSelectable(cssSelectors[i], callbackCtxt, listContext); - } - }; - SelectorMatcher.prototype._addSelectable = function(cssSelector, callbackCtxt, listContext) { - var matcher = this; - var element = cssSelector.element; - var classNames = cssSelector.classNames; - var attrs = cssSelector.attrs; - var selectable = new SelectorContext(cssSelector, callbackCtxt, listContext); - if (lang_1.isPresent(element)) { - var isTerminal = attrs.length === 0 && classNames.length === 0; - if (isTerminal) { - this._addTerminal(matcher._elementMap, element, selectable); - } else { - matcher = this._addPartial(matcher._elementPartialMap, element); - } - } - if (lang_1.isPresent(classNames)) { - for (var index = 0; index < classNames.length; index++) { - var isTerminal = attrs.length === 0 && index === classNames.length - 1; - var className = classNames[index]; - if (isTerminal) { - this._addTerminal(matcher._classMap, className, selectable); - } else { - matcher = this._addPartial(matcher._classPartialMap, className); - } - } - } - if (lang_1.isPresent(attrs)) { - for (var index = 0; index < attrs.length; ) { - var isTerminal = index === attrs.length - 2; - var attrName = attrs[index++]; - var attrValue = attrs[index++]; - if (isTerminal) { - var terminalMap = matcher._attrValueMap; - var terminalValuesMap = terminalMap.get(attrName); - if (lang_1.isBlank(terminalValuesMap)) { - terminalValuesMap = new collection_1.Map(); - terminalMap.set(attrName, terminalValuesMap); - } - this._addTerminal(terminalValuesMap, attrValue, selectable); - } else { - var parttialMap = matcher._attrValuePartialMap; - var partialValuesMap = parttialMap.get(attrName); - if (lang_1.isBlank(partialValuesMap)) { - partialValuesMap = new collection_1.Map(); - parttialMap.set(attrName, partialValuesMap); - } - matcher = this._addPartial(partialValuesMap, attrValue); - } - } - } - }; - SelectorMatcher.prototype._addTerminal = function(map, name, selectable) { - var terminalList = map.get(name); - if (lang_1.isBlank(terminalList)) { - terminalList = []; - map.set(name, terminalList); - } - terminalList.push(selectable); - }; - SelectorMatcher.prototype._addPartial = function(map, name) { - var matcher = map.get(name); - if (lang_1.isBlank(matcher)) { - matcher = new SelectorMatcher(); - map.set(name, matcher); - } - return matcher; - }; - SelectorMatcher.prototype.match = function(cssSelector, matchedCallback) { - var result = false; - var element = cssSelector.element; - var classNames = cssSelector.classNames; - var attrs = cssSelector.attrs; - for (var i = 0; i < this._listContexts.length; i++) { - this._listContexts[i].alreadyMatched = false; - } - result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result; - result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) || result; - if (lang_1.isPresent(classNames)) { - for (var index = 0; index < classNames.length; index++) { - var className = classNames[index]; - result = this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result; - result = this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) || result; - } - } - if (lang_1.isPresent(attrs)) { - for (var index = 0; index < attrs.length; ) { - var attrName = attrs[index++]; - var attrValue = attrs[index++]; - var terminalValuesMap = this._attrValueMap.get(attrName); - if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { - result = this._matchTerminal(terminalValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; - } - result = this._matchTerminal(terminalValuesMap, attrValue, cssSelector, matchedCallback) || result; - var partialValuesMap = this._attrValuePartialMap.get(attrName); - if (!lang_1.StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) { - result = this._matchPartial(partialValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) || result; - } - result = this._matchPartial(partialValuesMap, attrValue, cssSelector, matchedCallback) || result; - } - } - return result; - }; - SelectorMatcher.prototype._matchTerminal = function(map, name, cssSelector, matchedCallback) { - if (lang_1.isBlank(map) || lang_1.isBlank(name)) { - return false; - } - var selectables = map.get(name); - var starSelectables = map.get("*"); - if (lang_1.isPresent(starSelectables)) { - selectables = selectables.concat(starSelectables); - } - if (lang_1.isBlank(selectables)) { - return false; - } - var selectable; - var result = false; - for (var index = 0; index < selectables.length; index++) { - selectable = selectables[index]; - result = selectable.finalize(cssSelector, matchedCallback) || result; - } - return result; - }; - SelectorMatcher.prototype._matchPartial = function(map, name, cssSelector, matchedCallback) { - if (lang_1.isBlank(map) || lang_1.isBlank(name)) { - return false; - } - var nestedSelector = map.get(name); - if (lang_1.isBlank(nestedSelector)) { - return false; - } - return nestedSelector.match(cssSelector, matchedCallback); - }; - return SelectorMatcher; - }()); - exports.SelectorMatcher = SelectorMatcher; - var SelectorListContext = (function() { - function SelectorListContext(selectors) { - this.selectors = selectors; - this.alreadyMatched = false; - } - return SelectorListContext; - }()); - exports.SelectorListContext = SelectorListContext; - var SelectorContext = (function() { - function SelectorContext(selector, cbContext, listContext) { - this.selector = selector; - this.cbContext = cbContext; - this.listContext = listContext; - this.notSelectors = selector.notSelectors; - } - SelectorContext.prototype.finalize = function(cssSelector, callback) { - var result = true; - if (this.notSelectors.length > 0 && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { - var notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors); - result = !notMatcher.match(cssSelector, null); - } - if (result && lang_1.isPresent(callback) && (lang_1.isBlank(this.listContext) || !this.listContext.alreadyMatched)) { - if (lang_1.isPresent(this.listContext)) { - this.listContext.alreadyMatched = true; - } - callback(this.selector, this.cbContext); - } - return result; - }; - return SelectorContext; - }()); - exports.SelectorContext = SelectorContext; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/util", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var CAMEL_CASE_REGEXP = /([A-Z])/g; - var DASH_CASE_REGEXP = /-([a-z])/g; - var SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g; - var DOUBLE_QUOTE_ESCAPE_STRING_RE = /"|\\|\n|\r|\$/g; - exports.MODULE_SUFFIX = lang_1.IS_DART ? '.dart' : '.js'; - exports.CONST_VAR = lang_1.IS_DART ? 'const' : 'var'; - function camelCaseToDashCase(input) { - return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { - return '-' + m[1].toLowerCase(); - }); - } - exports.camelCaseToDashCase = camelCaseToDashCase; - function dashCaseToCamelCase(input) { - return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { - return m[1].toUpperCase(); - }); - } - exports.dashCaseToCamelCase = dashCaseToCamelCase; - function escapeSingleQuoteString(input) { - if (lang_1.isBlank(input)) { - return null; - } - return "'" + escapeString(input, SINGLE_QUOTE_ESCAPE_STRING_RE) + "'"; - } - exports.escapeSingleQuoteString = escapeSingleQuoteString; - function escapeDoubleQuoteString(input) { - if (lang_1.isBlank(input)) { - return null; - } - return "\"" + escapeString(input, DOUBLE_QUOTE_ESCAPE_STRING_RE) + "\""; - } - exports.escapeDoubleQuoteString = escapeDoubleQuoteString; - function escapeString(input, re) { - return lang_1.StringWrapper.replaceAllMapped(input, re, function(match) { - if (match[0] == '$') { - return lang_1.IS_DART ? '\\$' : '$'; - } else if (match[0] == '\n') { - return '\\n'; - } else if (match[0] == '\r') { - return '\\r'; - } else { - return "\\" + match[0]; - } - }); - } - function codeGenExportVariable(name) { - if (lang_1.IS_DART) { - return "const " + name + " = "; - } else { - return "var " + name + " = exports['" + name + "'] = "; - } - } - exports.codeGenExportVariable = codeGenExportVariable; - function codeGenConstConstructorCall(name) { - if (lang_1.IS_DART) { - return "const " + name; - } else { - return "new " + name; - } - } - exports.codeGenConstConstructorCall = codeGenConstConstructorCall; - function codeGenValueFn(params, value, fnName) { - if (fnName === void 0) { - fnName = ''; - } - if (lang_1.IS_DART) { - return codeGenFnHeader(params, fnName) + " => " + value; - } else { - return codeGenFnHeader(params, fnName) + " { return " + value + "; }"; - } - } - exports.codeGenValueFn = codeGenValueFn; - function codeGenFnHeader(params, fnName) { - if (fnName === void 0) { - fnName = ''; - } - if (lang_1.IS_DART) { - return fnName + "(" + params.join(',') + ")"; - } else { - return "function " + fnName + "(" + params.join(',') + ")"; - } - } - exports.codeGenFnHeader = codeGenFnHeader; - function codeGenToString(expr) { - if (lang_1.IS_DART) { - return "'${" + expr + "}'"; - } else { - return expr; - } - } - exports.codeGenToString = codeGenToString; - function splitAtColon(input, defaultValues) { - var parts = lang_1.StringWrapper.split(input.trim(), /\s*:\s*/g); - if (parts.length > 1) { - return parts; - } else { - return defaultValues; - } - } - exports.splitAtColon = splitAtColon; - var Statement = (function() { - function Statement(statement) { - this.statement = statement; - } - return Statement; - }()); - exports.Statement = Statement; - var Expression = (function() { - function Expression(expression, isArray) { - if (isArray === void 0) { - isArray = false; - } - this.expression = expression; - this.isArray = isArray; - } - return Expression; - }()); - exports.Expression = Expression; - function escapeValue(value) { - if (value instanceof Expression) { - return value.expression; - } else if (lang_1.isString(value)) { - return escapeSingleQuoteString(value); - } else if (lang_1.isBlank(value)) { - return 'null'; - } else { - return "" + value; - } - } - exports.escapeValue = escapeValue; - function codeGenArray(data) { - return "[" + data.map(escapeValue).join(',') + "]"; - } - exports.codeGenArray = codeGenArray; - function codeGenFlatArray(values) { - var result = '(['; - var isFirstArrayEntry = true; - var concatFn = lang_1.IS_DART ? '.addAll' : 'concat'; - for (var i = 0; i < values.length; i++) { - var value = values[i]; - if (value instanceof Expression && value.isArray) { - result += "])." + concatFn + "(" + value.expression + ")." + concatFn + "(["; - isFirstArrayEntry = true; - } else { - if (!isFirstArrayEntry) { - result += ','; - } - isFirstArrayEntry = false; - result += escapeValue(value); - } - } - result += '])'; - return result; - } - exports.codeGenFlatArray = codeGenFlatArray; - function codeGenStringMap(keyValueArray) { - return "{" + keyValueArray.map(codeGenKeyValue).join(',') + "}"; - } - exports.codeGenStringMap = codeGenStringMap; - function codeGenKeyValue(keyValue) { - return escapeValue(keyValue[0]) + ":" + escapeValue(keyValue[1]); - } - function addAll(source, target) { - for (var i = 0; i < source.length; i++) { - target.push(source[i]); - } - } - exports.addAll = addAll; - function flattenArray(source, target) { - if (lang_1.isPresent(source)) { - for (var i = 0; i < source.length; i++) { - var item = source[i]; - if (lang_1.isArray(item)) { - flattenArray(item, target); - } else { - target.push(item); - } - } - } - return target; - } - exports.flattenArray = flattenArray; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/interfaces", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - (function(LifecycleHooks) { - LifecycleHooks[LifecycleHooks["OnInit"] = 0] = "OnInit"; - LifecycleHooks[LifecycleHooks["OnDestroy"] = 1] = "OnDestroy"; - LifecycleHooks[LifecycleHooks["DoCheck"] = 2] = "DoCheck"; - LifecycleHooks[LifecycleHooks["OnChanges"] = 3] = "OnChanges"; - LifecycleHooks[LifecycleHooks["AfterContentInit"] = 4] = "AfterContentInit"; - LifecycleHooks[LifecycleHooks["AfterContentChecked"] = 5] = "AfterContentChecked"; - LifecycleHooks[LifecycleHooks["AfterViewInit"] = 6] = "AfterViewInit"; - LifecycleHooks[LifecycleHooks["AfterViewChecked"] = 7] = "AfterViewChecked"; - })(exports.LifecycleHooks || (exports.LifecycleHooks = {})); - var LifecycleHooks = exports.LifecycleHooks; - exports.LIFECYCLE_HOOKS_VALUES = [LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges, LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit, LifecycleHooks.AfterViewChecked]; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/template_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var TextAst = (function() { - function TextAst(value, ngContentIndex, sourceSpan) { - this.value = value; - this.ngContentIndex = ngContentIndex; - this.sourceSpan = sourceSpan; - } - TextAst.prototype.visit = function(visitor, context) { - return visitor.visitText(this, context); - }; - return TextAst; - }()); - exports.TextAst = TextAst; - var BoundTextAst = (function() { - function BoundTextAst(value, ngContentIndex, sourceSpan) { - this.value = value; - this.ngContentIndex = ngContentIndex; - this.sourceSpan = sourceSpan; - } - BoundTextAst.prototype.visit = function(visitor, context) { - return visitor.visitBoundText(this, context); - }; - return BoundTextAst; - }()); - exports.BoundTextAst = BoundTextAst; - var AttrAst = (function() { - function AttrAst(name, value, sourceSpan) { - this.name = name; - this.value = value; - this.sourceSpan = sourceSpan; - } - AttrAst.prototype.visit = function(visitor, context) { - return visitor.visitAttr(this, context); - }; - return AttrAst; - }()); - exports.AttrAst = AttrAst; - var BoundElementPropertyAst = (function() { - function BoundElementPropertyAst(name, type, value, unit, sourceSpan) { - this.name = name; - this.type = type; - this.value = value; - this.unit = unit; - this.sourceSpan = sourceSpan; - } - BoundElementPropertyAst.prototype.visit = function(visitor, context) { - return visitor.visitElementProperty(this, context); - }; - return BoundElementPropertyAst; - }()); - exports.BoundElementPropertyAst = BoundElementPropertyAst; - var BoundEventAst = (function() { - function BoundEventAst(name, target, handler, sourceSpan) { - this.name = name; - this.target = target; - this.handler = handler; - this.sourceSpan = sourceSpan; - } - BoundEventAst.prototype.visit = function(visitor, context) { - return visitor.visitEvent(this, context); - }; - Object.defineProperty(BoundEventAst.prototype, "fullName", { - get: function() { - if (lang_1.isPresent(this.target)) { - return this.target + ":" + this.name; - } else { - return this.name; - } - }, - enumerable: true, - configurable: true - }); - return BoundEventAst; - }()); - exports.BoundEventAst = BoundEventAst; - var VariableAst = (function() { - function VariableAst(name, value, sourceSpan) { - this.name = name; - this.value = value; - this.sourceSpan = sourceSpan; - } - VariableAst.prototype.visit = function(visitor, context) { - return visitor.visitVariable(this, context); - }; - return VariableAst; - }()); - exports.VariableAst = VariableAst; - var ElementAst = (function() { - function ElementAst(name, attrs, inputs, outputs, exportAsVars, directives, children, ngContentIndex, sourceSpan) { - this.name = name; - this.attrs = attrs; - this.inputs = inputs; - this.outputs = outputs; - this.exportAsVars = exportAsVars; - this.directives = directives; - this.children = children; - this.ngContentIndex = ngContentIndex; - this.sourceSpan = sourceSpan; - } - ElementAst.prototype.visit = function(visitor, context) { - return visitor.visitElement(this, context); - }; - ElementAst.prototype.isBound = function() { - return (this.inputs.length > 0 || this.outputs.length > 0 || this.exportAsVars.length > 0 || this.directives.length > 0); - }; - ElementAst.prototype.getComponent = function() { - return this.directives.length > 0 && this.directives[0].directive.isComponent ? this.directives[0].directive : null; - }; - return ElementAst; - }()); - exports.ElementAst = ElementAst; - var EmbeddedTemplateAst = (function() { - function EmbeddedTemplateAst(attrs, outputs, vars, directives, children, ngContentIndex, sourceSpan) { - this.attrs = attrs; - this.outputs = outputs; - this.vars = vars; - this.directives = directives; - this.children = children; - this.ngContentIndex = ngContentIndex; - this.sourceSpan = sourceSpan; - } - EmbeddedTemplateAst.prototype.visit = function(visitor, context) { - return visitor.visitEmbeddedTemplate(this, context); - }; - return EmbeddedTemplateAst; - }()); - exports.EmbeddedTemplateAst = EmbeddedTemplateAst; - var BoundDirectivePropertyAst = (function() { - function BoundDirectivePropertyAst(directiveName, templateName, value, sourceSpan) { - this.directiveName = directiveName; - this.templateName = templateName; - this.value = value; - this.sourceSpan = sourceSpan; - } - BoundDirectivePropertyAst.prototype.visit = function(visitor, context) { - return visitor.visitDirectiveProperty(this, context); - }; - return BoundDirectivePropertyAst; - }()); - exports.BoundDirectivePropertyAst = BoundDirectivePropertyAst; - var DirectiveAst = (function() { - function DirectiveAst(directive, inputs, hostProperties, hostEvents, exportAsVars, sourceSpan) { - this.directive = directive; - this.inputs = inputs; - this.hostProperties = hostProperties; - this.hostEvents = hostEvents; - this.exportAsVars = exportAsVars; - this.sourceSpan = sourceSpan; - } - DirectiveAst.prototype.visit = function(visitor, context) { - return visitor.visitDirective(this, context); - }; - return DirectiveAst; - }()); - exports.DirectiveAst = DirectiveAst; - var NgContentAst = (function() { - function NgContentAst(index, ngContentIndex, sourceSpan) { - this.index = index; - this.ngContentIndex = ngContentIndex; - this.sourceSpan = sourceSpan; - } - NgContentAst.prototype.visit = function(visitor, context) { - return visitor.visitNgContent(this, context); - }; - return NgContentAst; - }()); - exports.NgContentAst = NgContentAst; - (function(PropertyBindingType) { - PropertyBindingType[PropertyBindingType["Property"] = 0] = "Property"; - PropertyBindingType[PropertyBindingType["Attribute"] = 1] = "Attribute"; - PropertyBindingType[PropertyBindingType["Class"] = 2] = "Class"; - PropertyBindingType[PropertyBindingType["Style"] = 3] = "Style"; - })(exports.PropertyBindingType || (exports.PropertyBindingType = {})); - var PropertyBindingType = exports.PropertyBindingType; - function templateVisitAll(visitor, asts, context) { - if (context === void 0) { - context = null; - } - var result = []; - asts.forEach(function(ast) { - var astResult = ast.visit(visitor, context); - if (lang_1.isPresent(astResult)) { - result.push(astResult); - } - }); - return result; - } - exports.templateVisitAll = templateVisitAll; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/source_module", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var MODULE_REGEXP = /#MODULE\[([^\]]*)\]/g; - function moduleRef(moduleUrl) { - return "#MODULE[" + moduleUrl + "]"; - } - exports.moduleRef = moduleRef; - var SourceModule = (function() { - function SourceModule(moduleUrl, sourceWithModuleRefs) { - this.moduleUrl = moduleUrl; - this.sourceWithModuleRefs = sourceWithModuleRefs; - } - SourceModule.getSourceWithoutImports = function(sourceWithModuleRefs) { - return lang_1.StringWrapper.replaceAllMapped(sourceWithModuleRefs, MODULE_REGEXP, function(match) { - return ''; - }); - }; - SourceModule.prototype.getSourceWithImports = function() { - var _this = this; - var moduleAliases = {}; - var imports = []; - var newSource = lang_1.StringWrapper.replaceAllMapped(this.sourceWithModuleRefs, MODULE_REGEXP, function(match) { - var moduleUrl = match[1]; - var alias = moduleAliases[moduleUrl]; - if (lang_1.isBlank(alias)) { - if (moduleUrl == _this.moduleUrl) { - alias = ''; - } else { - alias = "import" + imports.length; - imports.push([moduleUrl, alias]); - } - moduleAliases[moduleUrl] = alias; - } - return alias.length > 0 ? alias + "." : ''; - }); - return new SourceWithImports(newSource, imports); - }; - return SourceModule; - }()); - exports.SourceModule = SourceModule; - var SourceExpression = (function() { - function SourceExpression(declarations, expression) { - this.declarations = declarations; - this.expression = expression; - } - return SourceExpression; - }()); - exports.SourceExpression = SourceExpression; - var SourceExpressions = (function() { - function SourceExpressions(declarations, expressions) { - this.declarations = declarations; - this.expressions = expressions; - } - return SourceExpressions; - }()); - exports.SourceExpressions = SourceExpressions; - var SourceWithImports = (function() { - function SourceWithImports(source, imports) { - this.source = source; - this.imports = imports; - } - return SourceWithImports; - }()); - exports.SourceWithImports = SourceWithImports; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/change_definition_factory", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/core/reflection/reflection", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/template_ast", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var reflection_1 = require("angular2/src/core/reflection/reflection"); - var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); - var template_ast_1 = require("angular2/src/compiler/template_ast"); - var interfaces_1 = require("angular2/src/core/linker/interfaces"); - function createChangeDetectorDefinitions(componentType, componentStrategy, genConfig, parsedTemplate) { - var pvVisitors = []; - var visitor = new ProtoViewVisitor(null, pvVisitors, componentStrategy); - template_ast_1.templateVisitAll(visitor, parsedTemplate); - return createChangeDefinitions(pvVisitors, componentType, genConfig); - } - exports.createChangeDetectorDefinitions = createChangeDetectorDefinitions; - var ProtoViewVisitor = (function() { - function ProtoViewVisitor(parent, allVisitors, strategy) { - this.parent = parent; - this.allVisitors = allVisitors; - this.strategy = strategy; - this.nodeCount = 0; - this.boundElementCount = 0; - this.variableNames = []; - this.bindingRecords = []; - this.eventRecords = []; - this.directiveRecords = []; - this.viewIndex = allVisitors.length; - allVisitors.push(this); - } - ProtoViewVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { - this.nodeCount++; - this.boundElementCount++; - template_ast_1.templateVisitAll(this, ast.outputs); - for (var i = 0; i < ast.directives.length; i++) { - ast.directives[i].visit(this, i); - } - var childVisitor = new ProtoViewVisitor(this, this.allVisitors, change_detection_1.ChangeDetectionStrategy.Default); - template_ast_1.templateVisitAll(childVisitor, ast.vars); - template_ast_1.templateVisitAll(childVisitor, ast.children); - return null; - }; - ProtoViewVisitor.prototype.visitElement = function(ast, context) { - this.nodeCount++; - if (ast.isBound()) { - this.boundElementCount++; - } - template_ast_1.templateVisitAll(this, ast.inputs, null); - template_ast_1.templateVisitAll(this, ast.outputs); - template_ast_1.templateVisitAll(this, ast.exportAsVars); - for (var i = 0; i < ast.directives.length; i++) { - ast.directives[i].visit(this, i); - } - template_ast_1.templateVisitAll(this, ast.children); - return null; - }; - ProtoViewVisitor.prototype.visitNgContent = function(ast, context) { - return null; - }; - ProtoViewVisitor.prototype.visitVariable = function(ast, context) { - this.variableNames.push(ast.name); - return null; - }; - ProtoViewVisitor.prototype.visitEvent = function(ast, directiveRecord) { - var bindingRecord = lang_1.isPresent(directiveRecord) ? change_detection_1.BindingRecord.createForHostEvent(ast.handler, ast.fullName, directiveRecord) : change_detection_1.BindingRecord.createForEvent(ast.handler, ast.fullName, this.boundElementCount - 1); - this.eventRecords.push(bindingRecord); - return null; - }; - ProtoViewVisitor.prototype.visitElementProperty = function(ast, directiveRecord) { - var boundElementIndex = this.boundElementCount - 1; - var dirIndex = lang_1.isPresent(directiveRecord) ? directiveRecord.directiveIndex : null; - var bindingRecord; - if (ast.type === template_ast_1.PropertyBindingType.Property) { - bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostProperty(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementProperty(ast.value, boundElementIndex, ast.name); - } else if (ast.type === template_ast_1.PropertyBindingType.Attribute) { - bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostAttribute(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementAttribute(ast.value, boundElementIndex, ast.name); - } else if (ast.type === template_ast_1.PropertyBindingType.Class) { - bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostClass(dirIndex, ast.value, ast.name) : change_detection_1.BindingRecord.createForElementClass(ast.value, boundElementIndex, ast.name); - } else if (ast.type === template_ast_1.PropertyBindingType.Style) { - bindingRecord = lang_1.isPresent(dirIndex) ? change_detection_1.BindingRecord.createForHostStyle(dirIndex, ast.value, ast.name, ast.unit) : change_detection_1.BindingRecord.createForElementStyle(ast.value, boundElementIndex, ast.name, ast.unit); - } - this.bindingRecords.push(bindingRecord); - return null; - }; - ProtoViewVisitor.prototype.visitAttr = function(ast, context) { - return null; - }; - ProtoViewVisitor.prototype.visitBoundText = function(ast, context) { - var nodeIndex = this.nodeCount++; - this.bindingRecords.push(change_detection_1.BindingRecord.createForTextNode(ast.value, nodeIndex)); - return null; - }; - ProtoViewVisitor.prototype.visitText = function(ast, context) { - this.nodeCount++; - return null; - }; - ProtoViewVisitor.prototype.visitDirective = function(ast, directiveIndexAsNumber) { - var directiveIndex = new change_detection_1.DirectiveIndex(this.boundElementCount - 1, directiveIndexAsNumber); - var directiveMetadata = ast.directive; - var outputsArray = []; - collection_1.StringMapWrapper.forEach(ast.directive.outputs, function(eventName, dirProperty) { - return outputsArray.push([dirProperty, eventName]); - }); - var directiveRecord = new change_detection_1.DirectiveRecord({ - directiveIndex: directiveIndex, - callAfterContentInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentInit) !== -1, - callAfterContentChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterContentChecked) !== -1, - callAfterViewInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewInit) !== -1, - callAfterViewChecked: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.AfterViewChecked) !== -1, - callOnChanges: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnChanges) !== -1, - callDoCheck: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.DoCheck) !== -1, - callOnInit: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnInit) !== -1, - callOnDestroy: directiveMetadata.lifecycleHooks.indexOf(interfaces_1.LifecycleHooks.OnDestroy) !== -1, - changeDetection: directiveMetadata.changeDetection, - outputs: outputsArray - }); - this.directiveRecords.push(directiveRecord); - template_ast_1.templateVisitAll(this, ast.inputs, directiveRecord); - var bindingRecords = this.bindingRecords; - if (directiveRecord.callOnChanges) { - bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnChanges(directiveRecord)); - } - if (directiveRecord.callOnInit) { - bindingRecords.push(change_detection_1.BindingRecord.createDirectiveOnInit(directiveRecord)); - } - if (directiveRecord.callDoCheck) { - bindingRecords.push(change_detection_1.BindingRecord.createDirectiveDoCheck(directiveRecord)); - } - template_ast_1.templateVisitAll(this, ast.hostProperties, directiveRecord); - template_ast_1.templateVisitAll(this, ast.hostEvents, directiveRecord); - template_ast_1.templateVisitAll(this, ast.exportAsVars); - return null; - }; - ProtoViewVisitor.prototype.visitDirectiveProperty = function(ast, directiveRecord) { - var setter = reflection_1.reflector.setter(ast.directiveName); - this.bindingRecords.push(change_detection_1.BindingRecord.createForDirective(ast.value, ast.directiveName, setter, directiveRecord)); - return null; - }; - return ProtoViewVisitor; - }()); - function createChangeDefinitions(pvVisitors, componentType, genConfig) { - var pvVariableNames = _collectNestedProtoViewsVariableNames(pvVisitors); - return pvVisitors.map(function(pvVisitor) { - var id = componentType.name + "_" + pvVisitor.viewIndex; - return new change_detection_1.ChangeDetectorDefinition(id, pvVisitor.strategy, pvVariableNames[pvVisitor.viewIndex], pvVisitor.bindingRecords, pvVisitor.eventRecords, pvVisitor.directiveRecords, genConfig); - }); - } - function _collectNestedProtoViewsVariableNames(pvVisitors) { - var nestedPvVariableNames = collection_1.ListWrapper.createFixedSize(pvVisitors.length); - pvVisitors.forEach(function(pv) { - var parentVariableNames = lang_1.isPresent(pv.parent) ? nestedPvVariableNames[pv.parent.viewIndex] : []; - nestedPvVariableNames[pv.viewIndex] = parentVariableNames.concat(pv.variableNames); - }); - return nestedPvVariableNames; - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/transform/template_compiler/change_detector_codegen", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var Codegen = (function() { - function Codegen(moduleAlias) {} - Codegen.prototype.generate = function(typeName, changeDetectorTypeName, def) { - throw "Not implemented in JS"; - }; - Codegen.prototype.toString = function() { - throw "Not implemented in JS"; - }; - return Codegen; - }()); - exports.Codegen = Codegen; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/shadow_css", ["angular2/src/facade/collection", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var ShadowCss = (function() { - function ShadowCss() { - this.strictStyling = true; - } - ShadowCss.prototype.shimCssText = function(cssText, selector, hostSelector) { - if (hostSelector === void 0) { - hostSelector = ''; - } - cssText = stripComments(cssText); - cssText = this._insertDirectives(cssText); - return this._scopeCssText(cssText, selector, hostSelector); - }; - ShadowCss.prototype._insertDirectives = function(cssText) { - cssText = this._insertPolyfillDirectivesInCssText(cssText); - return this._insertPolyfillRulesInCssText(cssText); - }; - ShadowCss.prototype._insertPolyfillDirectivesInCssText = function(cssText) { - return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentNextSelectorRe, function(m) { - return m[1] + '{'; - }); - }; - ShadowCss.prototype._insertPolyfillRulesInCssText = function(cssText) { - return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentRuleRe, function(m) { - var rule = m[0]; - rule = lang_1.StringWrapper.replace(rule, m[1], ''); - rule = lang_1.StringWrapper.replace(rule, m[2], ''); - return m[3] + rule; - }); - }; - ShadowCss.prototype._scopeCssText = function(cssText, scopeSelector, hostSelector) { - var unscoped = this._extractUnscopedRulesFromCssText(cssText); - cssText = this._insertPolyfillHostInCssText(cssText); - cssText = this._convertColonHost(cssText); - cssText = this._convertColonHostContext(cssText); - cssText = this._convertShadowDOMSelectors(cssText); - if (lang_1.isPresent(scopeSelector)) { - cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector); - } - cssText = cssText + '\n' + unscoped; - return cssText.trim(); - }; - ShadowCss.prototype._extractUnscopedRulesFromCssText = function(cssText) { - var r = '', - m; - var matcher = lang_1.RegExpWrapper.matcher(_cssContentUnscopedRuleRe, cssText); - while (lang_1.isPresent(m = lang_1.RegExpMatcherWrapper.next(matcher))) { - var rule = m[0]; - rule = lang_1.StringWrapper.replace(rule, m[2], ''); - rule = lang_1.StringWrapper.replace(rule, m[1], m[3]); - r += rule + '\n\n'; - } - return r; - }; - ShadowCss.prototype._convertColonHost = function(cssText) { - return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer); - }; - ShadowCss.prototype._convertColonHostContext = function(cssText) { - return this._convertColonRule(cssText, _cssColonHostContextRe, this._colonHostContextPartReplacer); - }; - ShadowCss.prototype._convertColonRule = function(cssText, regExp, partReplacer) { - return lang_1.StringWrapper.replaceAllMapped(cssText, regExp, function(m) { - if (lang_1.isPresent(m[2])) { - var parts = m[2].split(','), - r = []; - for (var i = 0; i < parts.length; i++) { - var p = parts[i]; - if (lang_1.isBlank(p)) - break; - p = p.trim(); - r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); - } - return r.join(','); - } else { - return _polyfillHostNoCombinator + m[3]; - } - }); - }; - ShadowCss.prototype._colonHostContextPartReplacer = function(host, part, suffix) { - if (lang_1.StringWrapper.contains(part, _polyfillHost)) { - return this._colonHostPartReplacer(host, part, suffix); - } else { - return host + part + suffix + ', ' + part + ' ' + host + suffix; - } - }; - ShadowCss.prototype._colonHostPartReplacer = function(host, part, suffix) { - return host + lang_1.StringWrapper.replace(part, _polyfillHost, '') + suffix; - }; - ShadowCss.prototype._convertShadowDOMSelectors = function(cssText) { - for (var i = 0; i < _shadowDOMSelectorsRe.length; i++) { - cssText = lang_1.StringWrapper.replaceAll(cssText, _shadowDOMSelectorsRe[i], ' '); - } - return cssText; - }; - ShadowCss.prototype._scopeSelectors = function(cssText, scopeSelector, hostSelector) { - var _this = this; - return processRules(cssText, function(rule) { - var selector = rule.selector; - var content = rule.content; - if (rule.selector[0] != '@' || rule.selector.startsWith('@page')) { - selector = _this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling); - } else if (rule.selector.startsWith('@media')) { - content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector); - } - return new CssRule(selector, content); - }); - }; - ShadowCss.prototype._scopeSelector = function(selector, scopeSelector, hostSelector, strict) { - var r = [], - parts = selector.split(','); - for (var i = 0; i < parts.length; i++) { - var p = parts[i].trim(); - var deepParts = lang_1.StringWrapper.split(p, _shadowDeepSelectors); - var shallowPart = deepParts[0]; - if (this._selectorNeedsScoping(shallowPart, scopeSelector)) { - deepParts[0] = strict && !lang_1.StringWrapper.contains(shallowPart, _polyfillHostNoCombinator) ? this._applyStrictSelectorScope(shallowPart, scopeSelector) : this._applySelectorScope(shallowPart, scopeSelector, hostSelector); - } - r.push(deepParts.join(' ')); - } - return r.join(', '); - }; - ShadowCss.prototype._selectorNeedsScoping = function(selector, scopeSelector) { - var re = this._makeScopeMatcher(scopeSelector); - return !lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(re, selector)); - }; - ShadowCss.prototype._makeScopeMatcher = function(scopeSelector) { - var lre = /\[/g; - var rre = /\]/g; - scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, lre, '\\['); - scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, rre, '\\]'); - return lang_1.RegExpWrapper.create('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); - }; - ShadowCss.prototype._applySelectorScope = function(selector, scopeSelector, hostSelector) { - return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector); - }; - ShadowCss.prototype._applySimpleSelectorScope = function(selector, scopeSelector, hostSelector) { - if (lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(_polyfillHostRe, selector))) { - var replaceBy = this.strictStyling ? "[" + hostSelector + "]" : scopeSelector; - selector = lang_1.StringWrapper.replace(selector, _polyfillHostNoCombinator, replaceBy); - return lang_1.StringWrapper.replaceAll(selector, _polyfillHostRe, replaceBy + ' '); - } else { - return scopeSelector + ' ' + selector; - } - }; - ShadowCss.prototype._applyStrictSelectorScope = function(selector, scopeSelector) { - var isRe = /\[is=([^\]]*)\]/g; - scopeSelector = lang_1.StringWrapper.replaceAllMapped(scopeSelector, isRe, function(m) { - return m[1]; - }); - var splits = [' ', '>', '+', '~'], - scoped = selector, - attrName = '[' + scopeSelector + ']'; - for (var i = 0; i < splits.length; i++) { - var sep = splits[i]; - var parts = scoped.split(sep); - scoped = parts.map(function(p) { - var t = lang_1.StringWrapper.replaceAll(p.trim(), _polyfillHostRe, ''); - if (t.length > 0 && !collection_1.ListWrapper.contains(splits, t) && !lang_1.StringWrapper.contains(t, attrName)) { - var re = /([^:]*)(:*)(.*)/g; - var m = lang_1.RegExpWrapper.firstMatch(re, t); - if (lang_1.isPresent(m)) { - p = m[1] + attrName + m[2] + m[3]; - } - } - return p; - }).join(sep); - } - return scoped; - }; - ShadowCss.prototype._insertPolyfillHostInCssText = function(selector) { - selector = lang_1.StringWrapper.replaceAll(selector, _colonHostContextRe, _polyfillHostContext); - selector = lang_1.StringWrapper.replaceAll(selector, _colonHostRe, _polyfillHost); - return selector; - }; - return ShadowCss; - }()); - exports.ShadowCss = ShadowCss; - var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim; - var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; - var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; - var _polyfillHost = '-shadowcsshost'; - var _polyfillHostContext = '-shadowcsscontext'; - var _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)'; - var _cssColonHostRe = lang_1.RegExpWrapper.create('(' + _polyfillHost + _parenSuffix, 'im'); - var _cssColonHostContextRe = lang_1.RegExpWrapper.create('(' + _polyfillHostContext + _parenSuffix, 'im'); - var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; - var _shadowDOMSelectorsRe = [/::shadow/g, /::content/g, /\/shadow-deep\//g, /\/shadow\//g]; - var _shadowDeepSelectors = /(?:>>>)|(?:\/deep\/)/g; - var _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$'; - var _polyfillHostRe = lang_1.RegExpWrapper.create(_polyfillHost, 'im'); - var _colonHostRe = /:host/gim; - var _colonHostContextRe = /:host-context/gim; - var _commentRe = /\/\*[\s\S]*?\*\//g; - function stripComments(input) { - return lang_1.StringWrapper.replaceAllMapped(input, _commentRe, function(_) { - return ''; - }); - } - var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; - var _curlyRe = /([{}])/g; - var OPEN_CURLY = '{'; - var CLOSE_CURLY = '}'; - var BLOCK_PLACEHOLDER = '%BLOCK%'; - var CssRule = (function() { - function CssRule(selector, content) { - this.selector = selector; - this.content = content; - } - return CssRule; - }()); - exports.CssRule = CssRule; - function processRules(input, ruleCallback) { - var inputWithEscapedBlocks = escapeBlocks(input); - var nextBlockIndex = 0; - return lang_1.StringWrapper.replaceAllMapped(inputWithEscapedBlocks.escapedString, _ruleRe, function(m) { - var selector = m[2]; - var content = ''; - var suffix = m[4]; - var contentPrefix = ''; - if (lang_1.isPresent(m[4]) && m[4].startsWith('{' + BLOCK_PLACEHOLDER)) { - content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; - suffix = m[4].substring(BLOCK_PLACEHOLDER.length + 1); - contentPrefix = '{'; - } - var rule = ruleCallback(new CssRule(selector, content)); - return "" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix; - }); - } - exports.processRules = processRules; - var StringWithEscapedBlocks = (function() { - function StringWithEscapedBlocks(escapedString, blocks) { - this.escapedString = escapedString; - this.blocks = blocks; - } - return StringWithEscapedBlocks; - }()); - function escapeBlocks(input) { - var inputParts = lang_1.StringWrapper.split(input, _curlyRe); - var resultParts = []; - var escapedBlocks = []; - var bracketCount = 0; - var currentBlockParts = []; - for (var partIndex = 0; partIndex < inputParts.length; partIndex++) { - var part = inputParts[partIndex]; - if (part == CLOSE_CURLY) { - bracketCount--; - } - if (bracketCount > 0) { - currentBlockParts.push(part); - } else { - if (currentBlockParts.length > 0) { - escapedBlocks.push(currentBlockParts.join('')); - resultParts.push(BLOCK_PLACEHOLDER); - currentBlockParts = []; - } - resultParts.push(part); - } - if (part == OPEN_CURLY) { - bracketCount++; - } - } - if (currentBlockParts.length > 0) { - escapedBlocks.push(currentBlockParts.join('')); - resultParts.push(BLOCK_PLACEHOLDER); - } - return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks); - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/style_url_resolver", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var StyleWithImports = (function() { - function StyleWithImports(style, styleUrls) { - this.style = style; - this.styleUrls = styleUrls; - } - return StyleWithImports; - }()); - exports.StyleWithImports = StyleWithImports; - function isStyleUrlResolvable(url) { - if (lang_1.isBlank(url) || url.length === 0 || url[0] == '/') - return false; - var schemeMatch = lang_1.RegExpWrapper.firstMatch(_urlWithSchemaRe, url); - return lang_1.isBlank(schemeMatch) || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset'; - } - exports.isStyleUrlResolvable = isStyleUrlResolvable; - function extractStyleUrls(resolver, baseUrl, cssText) { - var foundUrls = []; - var modifiedCssText = lang_1.StringWrapper.replaceAllMapped(cssText, _cssImportRe, function(m) { - var url = lang_1.isPresent(m[1]) ? m[1] : m[2]; - if (!isStyleUrlResolvable(url)) { - return m[0]; - } - foundUrls.push(resolver.resolve(baseUrl, url)); - return ''; - }); - return new StyleWithImports(modifiedCssText, foundUrls); - } - exports.extractStyleUrls = extractStyleUrls; - var _cssImportRe = /@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g; - var _urlWithSchemaRe = /^([a-zA-Z\-\+\.]+):/g; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/proto_view_compiler", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/compiler/template_ast", "angular2/src/compiler/source_module", "angular2/src/core/linker/view", "angular2/src/core/linker/view_type", "angular2/src/core/linker/element", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var template_ast_1 = require("angular2/src/compiler/template_ast"); - var source_module_1 = require("angular2/src/compiler/source_module"); - var view_1 = require("angular2/src/core/linker/view"); - var view_type_1 = require("angular2/src/core/linker/view_type"); - var element_1 = require("angular2/src/core/linker/element"); - var util_1 = require("angular2/src/compiler/util"); - var di_1 = require("angular2/src/core/di"); - exports.PROTO_VIEW_JIT_IMPORTS = lang_1.CONST_EXPR({ - 'AppProtoView': view_1.AppProtoView, - 'AppProtoElement': element_1.AppProtoElement, - 'ViewType': view_type_1.ViewType - }); - exports.APP_VIEW_MODULE_REF = source_module_1.moduleRef('package:angular2/src/core/linker/view' + util_1.MODULE_SUFFIX); - exports.VIEW_TYPE_MODULE_REF = source_module_1.moduleRef('package:angular2/src/core/linker/view_type' + util_1.MODULE_SUFFIX); - exports.APP_EL_MODULE_REF = source_module_1.moduleRef('package:angular2/src/core/linker/element' + util_1.MODULE_SUFFIX); - exports.METADATA_MODULE_REF = source_module_1.moduleRef('package:angular2/src/core/metadata/view' + util_1.MODULE_SUFFIX); - var IMPLICIT_TEMPLATE_VAR = '\$implicit'; - var CLASS_ATTR = 'class'; - var STYLE_ATTR = 'style'; - var ProtoViewCompiler = (function() { - function ProtoViewCompiler() {} - ProtoViewCompiler.prototype.compileProtoViewRuntime = function(metadataCache, component, template, pipes) { - var protoViewFactory = new RuntimeProtoViewFactory(metadataCache, component, pipes); - var allProtoViews = []; - protoViewFactory.createCompileProtoView(template, [], [], allProtoViews); - return new CompileProtoViews([], allProtoViews); - }; - ProtoViewCompiler.prototype.compileProtoViewCodeGen = function(resolvedMetadataCacheExpr, component, template, pipes) { - var protoViewFactory = new CodeGenProtoViewFactory(resolvedMetadataCacheExpr, component, pipes); - var allProtoViews = []; - var allStatements = []; - protoViewFactory.createCompileProtoView(template, [], allStatements, allProtoViews); - return new CompileProtoViews(allStatements.map(function(stmt) { - return stmt.statement; - }), allProtoViews); - }; - ProtoViewCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], ProtoViewCompiler); - return ProtoViewCompiler; - }()); - exports.ProtoViewCompiler = ProtoViewCompiler; - var CompileProtoViews = (function() { - function CompileProtoViews(declarations, protoViews) { - this.declarations = declarations; - this.protoViews = protoViews; - } - return CompileProtoViews; - }()); - exports.CompileProtoViews = CompileProtoViews; - var CompileProtoView = (function() { - function CompileProtoView(embeddedTemplateIndex, protoElements, protoView) { - this.embeddedTemplateIndex = embeddedTemplateIndex; - this.protoElements = protoElements; - this.protoView = protoView; - } - return CompileProtoView; - }()); - exports.CompileProtoView = CompileProtoView; - var CompileProtoElement = (function() { - function CompileProtoElement(boundElementIndex, attrNameAndValues, variableNameAndValues, renderEvents, directives, embeddedTemplateIndex, appProtoEl) { - this.boundElementIndex = boundElementIndex; - this.attrNameAndValues = attrNameAndValues; - this.variableNameAndValues = variableNameAndValues; - this.renderEvents = renderEvents; - this.directives = directives; - this.embeddedTemplateIndex = embeddedTemplateIndex; - this.appProtoEl = appProtoEl; - } - return CompileProtoElement; - }()); - exports.CompileProtoElement = CompileProtoElement; - function visitAndReturnContext(visitor, asts, context) { - template_ast_1.templateVisitAll(visitor, asts, context); - return context; - } - var ProtoViewFactory = (function() { - function ProtoViewFactory(component) { - this.component = component; - } - ProtoViewFactory.prototype.createCompileProtoView = function(template, templateVariableBindings, targetStatements, targetProtoViews) { - var embeddedTemplateIndex = targetProtoViews.length; - targetProtoViews.push(null); - var builder = new ProtoViewBuilderVisitor(this, targetStatements, targetProtoViews); - template_ast_1.templateVisitAll(builder, template); - var viewType = getViewType(this.component, embeddedTemplateIndex); - var appProtoView = this.createAppProtoView(embeddedTemplateIndex, viewType, templateVariableBindings, targetStatements); - var cpv = new CompileProtoView(embeddedTemplateIndex, builder.protoElements, appProtoView); - targetProtoViews[embeddedTemplateIndex] = cpv; - return cpv; - }; - return ProtoViewFactory; - }()); - var CodeGenProtoViewFactory = (function(_super) { - __extends(CodeGenProtoViewFactory, _super); - function CodeGenProtoViewFactory(resolvedMetadataCacheExpr, component, pipes) { - _super.call(this, component); - this.resolvedMetadataCacheExpr = resolvedMetadataCacheExpr; - this.pipes = pipes; - this._nextVarId = 0; - } - CodeGenProtoViewFactory.prototype._nextProtoViewVar = function(embeddedTemplateIndex) { - return "appProtoView" + this._nextVarId++ + "_" + this.component.type.name + embeddedTemplateIndex; - }; - CodeGenProtoViewFactory.prototype.createAppProtoView = function(embeddedTemplateIndex, viewType, templateVariableBindings, targetStatements) { - var protoViewVarName = this._nextProtoViewVar(embeddedTemplateIndex); - var viewTypeExpr = codeGenViewType(viewType); - var pipesExpr = embeddedTemplateIndex === 0 ? codeGenTypesArray(this.pipes.map(function(pipeMeta) { - return pipeMeta.type; - })) : null; - var statement = "var " + protoViewVarName + " = " + exports.APP_VIEW_MODULE_REF + "AppProtoView.create(" + this.resolvedMetadataCacheExpr.expression + ", " + viewTypeExpr + ", " + pipesExpr + ", " + util_1.codeGenStringMap(templateVariableBindings) + ");"; - targetStatements.push(new util_1.Statement(statement)); - return new util_1.Expression(protoViewVarName); - }; - CodeGenProtoViewFactory.prototype.createAppProtoElement = function(boundElementIndex, attrNameAndValues, variableNameAndValues, directives, targetStatements) { - var varName = "appProtoEl" + this._nextVarId++ + "_" + this.component.type.name; - var value = exports.APP_EL_MODULE_REF + "AppProtoElement.create(\n " + this.resolvedMetadataCacheExpr.expression + ",\n " + boundElementIndex + ",\n " + util_1.codeGenStringMap(attrNameAndValues) + ",\n " + codeGenDirectivesArray(directives) + ",\n " + util_1.codeGenStringMap(variableNameAndValues) + "\n )"; - var statement = "var " + varName + " = " + value + ";"; - targetStatements.push(new util_1.Statement(statement)); - return new util_1.Expression(varName); - }; - return CodeGenProtoViewFactory; - }(ProtoViewFactory)); - var RuntimeProtoViewFactory = (function(_super) { - __extends(RuntimeProtoViewFactory, _super); - function RuntimeProtoViewFactory(metadataCache, component, pipes) { - _super.call(this, component); - this.metadataCache = metadataCache; - this.pipes = pipes; - } - RuntimeProtoViewFactory.prototype.createAppProtoView = function(embeddedTemplateIndex, viewType, templateVariableBindings, targetStatements) { - var pipes = embeddedTemplateIndex === 0 ? this.pipes.map(function(pipeMeta) { - return pipeMeta.type.runtime; - }) : []; - var templateVars = keyValueArrayToStringMap(templateVariableBindings); - return view_1.AppProtoView.create(this.metadataCache, viewType, pipes, templateVars); - }; - RuntimeProtoViewFactory.prototype.createAppProtoElement = function(boundElementIndex, attrNameAndValues, variableNameAndValues, directives, targetStatements) { - var attrs = keyValueArrayToStringMap(attrNameAndValues); - return element_1.AppProtoElement.create(this.metadataCache, boundElementIndex, attrs, directives.map(function(dirMeta) { - return dirMeta.type.runtime; - }), keyValueArrayToStringMap(variableNameAndValues)); - }; - return RuntimeProtoViewFactory; - }(ProtoViewFactory)); - var ProtoViewBuilderVisitor = (function() { - function ProtoViewBuilderVisitor(factory, allStatements, allProtoViews) { - this.factory = factory; - this.allStatements = allStatements; - this.allProtoViews = allProtoViews; - this.protoElements = []; - this.boundElementCount = 0; - } - ProtoViewBuilderVisitor.prototype._readAttrNameAndValues = function(directives, attrAsts) { - var attrs = visitAndReturnContext(this, attrAsts, {}); - directives.forEach(function(directiveMeta) { - collection_1.StringMapWrapper.forEach(directiveMeta.hostAttributes, function(value, name) { - var prevValue = attrs[name]; - attrs[name] = lang_1.isPresent(prevValue) ? mergeAttributeValue(name, prevValue, value) : value; - }); - }); - return mapToKeyValueArray(attrs); - }; - ProtoViewBuilderVisitor.prototype.visitBoundText = function(ast, context) { - return null; - }; - ProtoViewBuilderVisitor.prototype.visitText = function(ast, context) { - return null; - }; - ProtoViewBuilderVisitor.prototype.visitNgContent = function(ast, context) { - return null; - }; - ProtoViewBuilderVisitor.prototype.visitElement = function(ast, context) { - var _this = this; - var boundElementIndex = null; - if (ast.isBound()) { - boundElementIndex = this.boundElementCount++; - } - var component = ast.getComponent(); - var variableNameAndValues = []; - if (lang_1.isBlank(component)) { - ast.exportAsVars.forEach(function(varAst) { - variableNameAndValues.push([varAst.name, null]); - }); - } - var directives = []; - var renderEvents = visitAndReturnContext(this, ast.outputs, new Map()); - collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { - directiveAst.visit(_this, new DirectiveContext(index, boundElementIndex, renderEvents, variableNameAndValues, directives)); - }); - var renderEventArray = []; - renderEvents.forEach(function(eventAst, _) { - return renderEventArray.push(eventAst); - }); - var attrNameAndValues = this._readAttrNameAndValues(directives, ast.attrs); - this._addProtoElement(ast.isBound(), boundElementIndex, attrNameAndValues, variableNameAndValues, renderEventArray, directives, null); - template_ast_1.templateVisitAll(this, ast.children); - return null; - }; - ProtoViewBuilderVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { - var _this = this; - var boundElementIndex = this.boundElementCount++; - var directives = []; - collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { - directiveAst.visit(_this, new DirectiveContext(index, boundElementIndex, new Map(), [], directives)); - }); - var attrNameAndValues = this._readAttrNameAndValues(directives, ast.attrs); - var templateVariableBindings = ast.vars.map(function(varAst) { - return [varAst.value.length > 0 ? varAst.value : IMPLICIT_TEMPLATE_VAR, varAst.name]; - }); - var nestedProtoView = this.factory.createCompileProtoView(ast.children, templateVariableBindings, this.allStatements, this.allProtoViews); - this._addProtoElement(true, boundElementIndex, attrNameAndValues, [], [], directives, nestedProtoView.embeddedTemplateIndex); - return null; - }; - ProtoViewBuilderVisitor.prototype._addProtoElement = function(isBound, boundElementIndex, attrNameAndValues, variableNameAndValues, renderEvents, directives, embeddedTemplateIndex) { - var appProtoEl = null; - if (isBound) { - appProtoEl = this.factory.createAppProtoElement(boundElementIndex, attrNameAndValues, variableNameAndValues, directives, this.allStatements); - } - var compileProtoEl = new CompileProtoElement(boundElementIndex, attrNameAndValues, variableNameAndValues, renderEvents, directives, embeddedTemplateIndex, appProtoEl); - this.protoElements.push(compileProtoEl); - }; - ProtoViewBuilderVisitor.prototype.visitVariable = function(ast, ctx) { - return null; - }; - ProtoViewBuilderVisitor.prototype.visitAttr = function(ast, attrNameAndValues) { - attrNameAndValues[ast.name] = ast.value; - return null; - }; - ProtoViewBuilderVisitor.prototype.visitDirective = function(ast, ctx) { - ctx.targetDirectives.push(ast.directive); - template_ast_1.templateVisitAll(this, ast.hostEvents, ctx.hostEventTargetAndNames); - ast.exportAsVars.forEach(function(varAst) { - ctx.targetVariableNameAndValues.push([varAst.name, ctx.index]); - }); - return null; - }; - ProtoViewBuilderVisitor.prototype.visitEvent = function(ast, eventTargetAndNames) { - eventTargetAndNames.set(ast.fullName, ast); - return null; - }; - ProtoViewBuilderVisitor.prototype.visitDirectiveProperty = function(ast, context) { - return null; - }; - ProtoViewBuilderVisitor.prototype.visitElementProperty = function(ast, context) { - return null; - }; - return ProtoViewBuilderVisitor; - }()); - function mapToKeyValueArray(data) { - var entryArray = []; - collection_1.StringMapWrapper.forEach(data, function(value, name) { - entryArray.push([name, value]); - }); - collection_1.ListWrapper.sort(entryArray, function(entry1, entry2) { - return lang_1.StringWrapper.compare(entry1[0], entry2[0]); - }); - var keyValueArray = []; - entryArray.forEach(function(entry) { - keyValueArray.push([entry[0], entry[1]]); - }); - return keyValueArray; - } - function mergeAttributeValue(attrName, attrValue1, attrValue2) { - if (attrName == CLASS_ATTR || attrName == STYLE_ATTR) { - return attrValue1 + " " + attrValue2; - } else { - return attrValue2; - } - } - var DirectiveContext = (function() { - function DirectiveContext(index, boundElementIndex, hostEventTargetAndNames, targetVariableNameAndValues, targetDirectives) { - this.index = index; - this.boundElementIndex = boundElementIndex; - this.hostEventTargetAndNames = hostEventTargetAndNames; - this.targetVariableNameAndValues = targetVariableNameAndValues; - this.targetDirectives = targetDirectives; - } - return DirectiveContext; - }()); - function keyValueArrayToStringMap(keyValueArray) { - var stringMap = {}; - for (var i = 0; i < keyValueArray.length; i++) { - var entry = keyValueArray[i]; - stringMap[entry[0]] = entry[1]; - } - return stringMap; - } - function codeGenDirectivesArray(directives) { - var expressions = directives.map(function(directiveType) { - return typeRef(directiveType.type); - }); - return "[" + expressions.join(',') + "]"; - } - function codeGenTypesArray(types) { - var expressions = types.map(typeRef); - return "[" + expressions.join(',') + "]"; - } - function codeGenViewType(value) { - if (lang_1.IS_DART) { - return "" + exports.VIEW_TYPE_MODULE_REF + value; - } else { - return "" + value; - } - } - function typeRef(type) { - return "" + source_module_1.moduleRef(type.moduleUrl) + type.name; - } - function getViewType(component, embeddedTemplateIndex) { - if (embeddedTemplateIndex > 0) { - return view_type_1.ViewType.EMBEDDED; - } else if (component.type.isHost) { - return view_type_1.ViewType.HOST; - } else { - return view_type_1.ViewType.COMPONENT; - } - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/html_ast", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var HtmlTextAst = (function() { - function HtmlTextAst(value, sourceSpan) { - this.value = value; - this.sourceSpan = sourceSpan; - } - HtmlTextAst.prototype.visit = function(visitor, context) { - return visitor.visitText(this, context); - }; - return HtmlTextAst; - }()); - exports.HtmlTextAst = HtmlTextAst; - var HtmlAttrAst = (function() { - function HtmlAttrAst(name, value, sourceSpan) { - this.name = name; - this.value = value; - this.sourceSpan = sourceSpan; - } - HtmlAttrAst.prototype.visit = function(visitor, context) { - return visitor.visitAttr(this, context); - }; - return HtmlAttrAst; - }()); - exports.HtmlAttrAst = HtmlAttrAst; - var HtmlElementAst = (function() { - function HtmlElementAst(name, attrs, children, sourceSpan, startSourceSpan, endSourceSpan) { - this.name = name; - this.attrs = attrs; - this.children = children; - this.sourceSpan = sourceSpan; - this.startSourceSpan = startSourceSpan; - this.endSourceSpan = endSourceSpan; - } - HtmlElementAst.prototype.visit = function(visitor, context) { - return visitor.visitElement(this, context); - }; - return HtmlElementAst; - }()); - exports.HtmlElementAst = HtmlElementAst; - var HtmlCommentAst = (function() { - function HtmlCommentAst(value, sourceSpan) { - this.value = value; - this.sourceSpan = sourceSpan; - } - HtmlCommentAst.prototype.visit = function(visitor, context) { - return visitor.visitComment(this, context); - }; - return HtmlCommentAst; - }()); - exports.HtmlCommentAst = HtmlCommentAst; - function htmlVisitAll(visitor, asts, context) { - if (context === void 0) { - context = null; - } - var result = []; - asts.forEach(function(ast) { - var astResult = ast.visit(visitor, context); - if (lang_1.isPresent(astResult)) { - result.push(astResult); - } - }); - return result; - } - exports.htmlVisitAll = htmlVisitAll; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/parse_util", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var ParseLocation = (function() { - function ParseLocation(file, offset, line, col) { - this.file = file; - this.offset = offset; - this.line = line; - this.col = col; - } - ParseLocation.prototype.toString = function() { - return this.file.url + "@" + this.line + ":" + this.col; - }; - return ParseLocation; - }()); - exports.ParseLocation = ParseLocation; - var ParseSourceFile = (function() { - function ParseSourceFile(content, url) { - this.content = content; - this.url = url; - } - return ParseSourceFile; - }()); - exports.ParseSourceFile = ParseSourceFile; - var ParseSourceSpan = (function() { - function ParseSourceSpan(start, end) { - this.start = start; - this.end = end; - } - ParseSourceSpan.prototype.toString = function() { - return this.start.file.content.substring(this.start.offset, this.end.offset); - }; - return ParseSourceSpan; - }()); - exports.ParseSourceSpan = ParseSourceSpan; - var ParseError = (function() { - function ParseError(span, msg) { - this.span = span; - this.msg = msg; - } - ParseError.prototype.toString = function() { - var source = this.span.start.file.content; - var ctxStart = this.span.start.offset; - if (ctxStart > source.length - 1) { - ctxStart = source.length - 1; - } - var ctxEnd = ctxStart; - var ctxLen = 0; - var ctxLines = 0; - while (ctxLen < 100 && ctxStart > 0) { - ctxStart--; - ctxLen++; - if (source[ctxStart] == "\n") { - if (++ctxLines == 3) { - break; - } - } - } - ctxLen = 0; - ctxLines = 0; - while (ctxLen < 100 && ctxEnd < source.length - 1) { - ctxEnd++; - ctxLen++; - if (source[ctxEnd] == "\n") { - if (++ctxLines == 3) { - break; - } - } - } - var context = source.substring(ctxStart, this.span.start.offset) + '[ERROR ->]' + source.substring(this.span.start.offset, ctxEnd + 1); - return this.msg + " (\"" + context + "\"): " + this.span.start; - }; - return ParseError; - }()); - exports.ParseError = ParseError; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/html_tags", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - exports.NAMED_ENTITIES = lang_1.CONST_EXPR({ - 'Aacute': '\u00C1', - 'aacute': '\u00E1', - 'Acirc': '\u00C2', - 'acirc': '\u00E2', - 'acute': '\u00B4', - 'AElig': '\u00C6', - 'aelig': '\u00E6', - 'Agrave': '\u00C0', - 'agrave': '\u00E0', - 'alefsym': '\u2135', - 'Alpha': '\u0391', - 'alpha': '\u03B1', - 'amp': '&', - 'and': '\u2227', - 'ang': '\u2220', - 'apos': '\u0027', - 'Aring': '\u00C5', - 'aring': '\u00E5', - 'asymp': '\u2248', - 'Atilde': '\u00C3', - 'atilde': '\u00E3', - 'Auml': '\u00C4', - 'auml': '\u00E4', - 'bdquo': '\u201E', - 'Beta': '\u0392', - 'beta': '\u03B2', - 'brvbar': '\u00A6', - 'bull': '\u2022', - 'cap': '\u2229', - 'Ccedil': '\u00C7', - 'ccedil': '\u00E7', - 'cedil': '\u00B8', - 'cent': '\u00A2', - 'Chi': '\u03A7', - 'chi': '\u03C7', - 'circ': '\u02C6', - 'clubs': '\u2663', - 'cong': '\u2245', - 'copy': '\u00A9', - 'crarr': '\u21B5', - 'cup': '\u222A', - 'curren': '\u00A4', - 'dagger': '\u2020', - 'Dagger': '\u2021', - 'darr': '\u2193', - 'dArr': '\u21D3', - 'deg': '\u00B0', - 'Delta': '\u0394', - 'delta': '\u03B4', - 'diams': '\u2666', - 'divide': '\u00F7', - 'Eacute': '\u00C9', - 'eacute': '\u00E9', - 'Ecirc': '\u00CA', - 'ecirc': '\u00EA', - 'Egrave': '\u00C8', - 'egrave': '\u00E8', - 'empty': '\u2205', - 'emsp': '\u2003', - 'ensp': '\u2002', - 'Epsilon': '\u0395', - 'epsilon': '\u03B5', - 'equiv': '\u2261', - 'Eta': '\u0397', - 'eta': '\u03B7', - 'ETH': '\u00D0', - 'eth': '\u00F0', - 'Euml': '\u00CB', - 'euml': '\u00EB', - 'euro': '\u20AC', - 'exist': '\u2203', - 'fnof': '\u0192', - 'forall': '\u2200', - 'frac12': '\u00BD', - 'frac14': '\u00BC', - 'frac34': '\u00BE', - 'frasl': '\u2044', - 'Gamma': '\u0393', - 'gamma': '\u03B3', - 'ge': '\u2265', - 'gt': '>', - 'harr': '\u2194', - 'hArr': '\u21D4', - 'hearts': '\u2665', - 'hellip': '\u2026', - 'Iacute': '\u00CD', - 'iacute': '\u00ED', - 'Icirc': '\u00CE', - 'icirc': '\u00EE', - 'iexcl': '\u00A1', - 'Igrave': '\u00CC', - 'igrave': '\u00EC', - 'image': '\u2111', - 'infin': '\u221E', - 'int': '\u222B', - 'Iota': '\u0399', - 'iota': '\u03B9', - 'iquest': '\u00BF', - 'isin': '\u2208', - 'Iuml': '\u00CF', - 'iuml': '\u00EF', - 'Kappa': '\u039A', - 'kappa': '\u03BA', - 'Lambda': '\u039B', - 'lambda': '\u03BB', - 'lang': '\u27E8', - 'laquo': '\u00AB', - 'larr': '\u2190', - 'lArr': '\u21D0', - 'lceil': '\u2308', - 'ldquo': '\u201C', - 'le': '\u2264', - 'lfloor': '\u230A', - 'lowast': '\u2217', - 'loz': '\u25CA', - 'lrm': '\u200E', - 'lsaquo': '\u2039', - 'lsquo': '\u2018', - 'lt': '<', - 'macr': '\u00AF', - 'mdash': '\u2014', - 'micro': '\u00B5', - 'middot': '\u00B7', - 'minus': '\u2212', - 'Mu': '\u039C', - 'mu': '\u03BC', - 'nabla': '\u2207', - 'nbsp': '\u00A0', - 'ndash': '\u2013', - 'ne': '\u2260', - 'ni': '\u220B', - 'not': '\u00AC', - 'notin': '\u2209', - 'nsub': '\u2284', - 'Ntilde': '\u00D1', - 'ntilde': '\u00F1', - 'Nu': '\u039D', - 'nu': '\u03BD', - 'Oacute': '\u00D3', - 'oacute': '\u00F3', - 'Ocirc': '\u00D4', - 'ocirc': '\u00F4', - 'OElig': '\u0152', - 'oelig': '\u0153', - 'Ograve': '\u00D2', - 'ograve': '\u00F2', - 'oline': '\u203E', - 'Omega': '\u03A9', - 'omega': '\u03C9', - 'Omicron': '\u039F', - 'omicron': '\u03BF', - 'oplus': '\u2295', - 'or': '\u2228', - 'ordf': '\u00AA', - 'ordm': '\u00BA', - 'Oslash': '\u00D8', - 'oslash': '\u00F8', - 'Otilde': '\u00D5', - 'otilde': '\u00F5', - 'otimes': '\u2297', - 'Ouml': '\u00D6', - 'ouml': '\u00F6', - 'para': '\u00B6', - 'permil': '\u2030', - 'perp': '\u22A5', - 'Phi': '\u03A6', - 'phi': '\u03C6', - 'Pi': '\u03A0', - 'pi': '\u03C0', - 'piv': '\u03D6', - 'plusmn': '\u00B1', - 'pound': '\u00A3', - 'prime': '\u2032', - 'Prime': '\u2033', - 'prod': '\u220F', - 'prop': '\u221D', - 'Psi': '\u03A8', - 'psi': '\u03C8', - 'quot': '\u0022', - 'radic': '\u221A', - 'rang': '\u27E9', - 'raquo': '\u00BB', - 'rarr': '\u2192', - 'rArr': '\u21D2', - 'rceil': '\u2309', - 'rdquo': '\u201D', - 'real': '\u211C', - 'reg': '\u00AE', - 'rfloor': '\u230B', - 'Rho': '\u03A1', - 'rho': '\u03C1', - 'rlm': '\u200F', - 'rsaquo': '\u203A', - 'rsquo': '\u2019', - 'sbquo': '\u201A', - 'Scaron': '\u0160', - 'scaron': '\u0161', - 'sdot': '\u22C5', - 'sect': '\u00A7', - 'shy': '\u00AD', - 'Sigma': '\u03A3', - 'sigma': '\u03C3', - 'sigmaf': '\u03C2', - 'sim': '\u223C', - 'spades': '\u2660', - 'sub': '\u2282', - 'sube': '\u2286', - 'sum': '\u2211', - 'sup': '\u2283', - 'sup1': '\u00B9', - 'sup2': '\u00B2', - 'sup3': '\u00B3', - 'supe': '\u2287', - 'szlig': '\u00DF', - 'Tau': '\u03A4', - 'tau': '\u03C4', - 'there4': '\u2234', - 'Theta': '\u0398', - 'theta': '\u03B8', - 'thetasym': '\u03D1', - 'thinsp': '\u2009', - 'THORN': '\u00DE', - 'thorn': '\u00FE', - 'tilde': '\u02DC', - 'times': '\u00D7', - 'trade': '\u2122', - 'Uacute': '\u00DA', - 'uacute': '\u00FA', - 'uarr': '\u2191', - 'uArr': '\u21D1', - 'Ucirc': '\u00DB', - 'ucirc': '\u00FB', - 'Ugrave': '\u00D9', - 'ugrave': '\u00F9', - 'uml': '\u00A8', - 'upsih': '\u03D2', - 'Upsilon': '\u03A5', - 'upsilon': '\u03C5', - 'Uuml': '\u00DC', - 'uuml': '\u00FC', - 'weierp': '\u2118', - 'Xi': '\u039E', - 'xi': '\u03BE', - 'Yacute': '\u00DD', - 'yacute': '\u00FD', - 'yen': '\u00A5', - 'yuml': '\u00FF', - 'Yuml': '\u0178', - 'Zeta': '\u0396', - 'zeta': '\u03B6', - 'zwj': '\u200D', - 'zwnj': '\u200C' - }); - (function(HtmlTagContentType) { - HtmlTagContentType[HtmlTagContentType["RAW_TEXT"] = 0] = "RAW_TEXT"; - HtmlTagContentType[HtmlTagContentType["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT"; - HtmlTagContentType[HtmlTagContentType["PARSABLE_DATA"] = 2] = "PARSABLE_DATA"; - })(exports.HtmlTagContentType || (exports.HtmlTagContentType = {})); - var HtmlTagContentType = exports.HtmlTagContentType; - var HtmlTagDefinition = (function() { - function HtmlTagDefinition(_a) { - var _this = this; - var _b = _a === void 0 ? {} : _a, - closedByChildren = _b.closedByChildren, - requiredParents = _b.requiredParents, - implicitNamespacePrefix = _b.implicitNamespacePrefix, - contentType = _b.contentType, - closedByParent = _b.closedByParent, - isVoid = _b.isVoid, - ignoreFirstLf = _b.ignoreFirstLf; - this.closedByChildren = {}; - this.closedByParent = false; - if (lang_1.isPresent(closedByChildren) && closedByChildren.length > 0) { - closedByChildren.forEach(function(tagName) { - return _this.closedByChildren[tagName] = true; - }); - } - this.isVoid = lang_1.normalizeBool(isVoid); - this.closedByParent = lang_1.normalizeBool(closedByParent) || this.isVoid; - if (lang_1.isPresent(requiredParents) && requiredParents.length > 0) { - this.requiredParents = {}; - this.parentToAdd = requiredParents[0]; - requiredParents.forEach(function(tagName) { - return _this.requiredParents[tagName] = true; - }); - } - this.implicitNamespacePrefix = implicitNamespacePrefix; - this.contentType = lang_1.isPresent(contentType) ? contentType : HtmlTagContentType.PARSABLE_DATA; - this.ignoreFirstLf = lang_1.normalizeBool(ignoreFirstLf); - } - HtmlTagDefinition.prototype.requireExtraParent = function(currentParent) { - if (lang_1.isBlank(this.requiredParents)) { - return false; - } - if (lang_1.isBlank(currentParent)) { - return true; - } - var lcParent = currentParent.toLowerCase(); - return this.requiredParents[lcParent] != true && lcParent != 'template'; - }; - HtmlTagDefinition.prototype.isClosedByChild = function(name) { - return this.isVoid || lang_1.normalizeBool(this.closedByChildren[name.toLowerCase()]); - }; - return HtmlTagDefinition; - }()); - exports.HtmlTagDefinition = HtmlTagDefinition; - var TAG_DEFINITIONS = { - 'base': new HtmlTagDefinition({isVoid: true}), - 'meta': new HtmlTagDefinition({isVoid: true}), - 'area': new HtmlTagDefinition({isVoid: true}), - 'embed': new HtmlTagDefinition({isVoid: true}), - 'link': new HtmlTagDefinition({isVoid: true}), - 'img': new HtmlTagDefinition({isVoid: true}), - 'input': new HtmlTagDefinition({isVoid: true}), - 'param': new HtmlTagDefinition({isVoid: true}), - 'hr': new HtmlTagDefinition({isVoid: true}), - 'br': new HtmlTagDefinition({isVoid: true}), - 'source': new HtmlTagDefinition({isVoid: true}), - 'track': new HtmlTagDefinition({isVoid: true}), - 'wbr': new HtmlTagDefinition({isVoid: true}), - 'p': new HtmlTagDefinition({ - closedByChildren: ['address', 'article', 'aside', 'blockquote', 'div', 'dl', 'fieldset', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'], - closedByParent: true - }), - 'thead': new HtmlTagDefinition({closedByChildren: ['tbody', 'tfoot']}), - 'tbody': new HtmlTagDefinition({ - closedByChildren: ['tbody', 'tfoot'], - closedByParent: true - }), - 'tfoot': new HtmlTagDefinition({ - closedByChildren: ['tbody'], - closedByParent: true - }), - 'tr': new HtmlTagDefinition({ - closedByChildren: ['tr'], - requiredParents: ['tbody', 'tfoot', 'thead'], - closedByParent: true - }), - 'td': new HtmlTagDefinition({ - closedByChildren: ['td', 'th'], - closedByParent: true - }), - 'th': new HtmlTagDefinition({ - closedByChildren: ['td', 'th'], - closedByParent: true - }), - 'col': new HtmlTagDefinition({ - requiredParents: ['colgroup'], - isVoid: true - }), - 'svg': new HtmlTagDefinition({implicitNamespacePrefix: 'svg'}), - 'math': new HtmlTagDefinition({implicitNamespacePrefix: 'math'}), - 'li': new HtmlTagDefinition({ - closedByChildren: ['li'], - closedByParent: true - }), - 'dt': new HtmlTagDefinition({closedByChildren: ['dt', 'dd']}), - 'dd': new HtmlTagDefinition({ - closedByChildren: ['dt', 'dd'], - closedByParent: true - }), - 'rb': new HtmlTagDefinition({ - closedByChildren: ['rb', 'rt', 'rtc', 'rp'], - closedByParent: true - }), - 'rt': new HtmlTagDefinition({ - closedByChildren: ['rb', 'rt', 'rtc', 'rp'], - closedByParent: true - }), - 'rtc': new HtmlTagDefinition({ - closedByChildren: ['rb', 'rtc', 'rp'], - closedByParent: true - }), - 'rp': new HtmlTagDefinition({ - closedByChildren: ['rb', 'rt', 'rtc', 'rp'], - closedByParent: true - }), - 'optgroup': new HtmlTagDefinition({ - closedByChildren: ['optgroup'], - closedByParent: true - }), - 'option': new HtmlTagDefinition({ - closedByChildren: ['option', 'optgroup'], - closedByParent: true - }), - 'pre': new HtmlTagDefinition({ignoreFirstLf: true}), - 'listing': new HtmlTagDefinition({ignoreFirstLf: true}), - 'style': new HtmlTagDefinition({contentType: HtmlTagContentType.RAW_TEXT}), - 'script': new HtmlTagDefinition({contentType: HtmlTagContentType.RAW_TEXT}), - 'title': new HtmlTagDefinition({contentType: HtmlTagContentType.ESCAPABLE_RAW_TEXT}), - 'textarea': new HtmlTagDefinition({ - contentType: HtmlTagContentType.ESCAPABLE_RAW_TEXT, - ignoreFirstLf: true - }) - }; - var DEFAULT_TAG_DEFINITION = new HtmlTagDefinition(); - function getHtmlTagDefinition(tagName) { - var result = TAG_DEFINITIONS[tagName.toLowerCase()]; - return lang_1.isPresent(result) ? result : DEFAULT_TAG_DEFINITION; - } - exports.getHtmlTagDefinition = getHtmlTagDefinition; - var NS_PREFIX_RE = /^@([^:]+):(.+)/g; - function splitNsName(elementName) { - if (elementName[0] != '@') { - return [null, elementName]; - } - var match = lang_1.RegExpWrapper.firstMatch(NS_PREFIX_RE, elementName); - return [match[1], match[2]]; - } - exports.splitNsName = splitNsName; - function getNsPrefix(elementName) { - return splitNsName(elementName)[0]; - } - exports.getNsPrefix = getNsPrefix; - function mergeNsAndName(prefix, localName) { - return lang_1.isPresent(prefix) ? "@" + prefix + ":" + localName : localName; - } - exports.mergeNsAndName = mergeNsAndName; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/schema/element_schema_registry", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var ElementSchemaRegistry = (function() { - function ElementSchemaRegistry() {} - ElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { - return true; - }; - ElementSchemaRegistry.prototype.getMappedPropName = function(propName) { - return propName; - }; - return ElementSchemaRegistry; - }()); - exports.ElementSchemaRegistry = ElementSchemaRegistry; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/template_preparser", ["angular2/src/facade/lang", "angular2/src/compiler/html_tags"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var html_tags_1 = require("angular2/src/compiler/html_tags"); - var NG_CONTENT_SELECT_ATTR = 'select'; - var NG_CONTENT_ELEMENT = 'ng-content'; - var LINK_ELEMENT = 'link'; - var LINK_STYLE_REL_ATTR = 'rel'; - var LINK_STYLE_HREF_ATTR = 'href'; - var LINK_STYLE_REL_VALUE = 'stylesheet'; - var STYLE_ELEMENT = 'style'; - var SCRIPT_ELEMENT = 'script'; - var NG_NON_BINDABLE_ATTR = 'ngNonBindable'; - var NG_PROJECT_AS = 'ngProjectAs'; - function preparseElement(ast) { - var selectAttr = null; - var hrefAttr = null; - var relAttr = null; - var nonBindable = false; - var projectAs = null; - ast.attrs.forEach(function(attr) { - var lcAttrName = attr.name.toLowerCase(); - if (lcAttrName == NG_CONTENT_SELECT_ATTR) { - selectAttr = attr.value; - } else if (lcAttrName == LINK_STYLE_HREF_ATTR) { - hrefAttr = attr.value; - } else if (lcAttrName == LINK_STYLE_REL_ATTR) { - relAttr = attr.value; - } else if (attr.name == NG_NON_BINDABLE_ATTR) { - nonBindable = true; - } else if (attr.name == NG_PROJECT_AS) { - if (attr.value.length > 0) { - projectAs = attr.value; - } - } - }); - selectAttr = normalizeNgContentSelect(selectAttr); - var nodeName = ast.name.toLowerCase(); - var type = PreparsedElementType.OTHER; - if (html_tags_1.splitNsName(nodeName)[1] == NG_CONTENT_ELEMENT) { - type = PreparsedElementType.NG_CONTENT; - } else if (nodeName == STYLE_ELEMENT) { - type = PreparsedElementType.STYLE; - } else if (nodeName == SCRIPT_ELEMENT) { - type = PreparsedElementType.SCRIPT; - } else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) { - type = PreparsedElementType.STYLESHEET; - } - return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs); - } - exports.preparseElement = preparseElement; - (function(PreparsedElementType) { - PreparsedElementType[PreparsedElementType["NG_CONTENT"] = 0] = "NG_CONTENT"; - PreparsedElementType[PreparsedElementType["STYLE"] = 1] = "STYLE"; - PreparsedElementType[PreparsedElementType["STYLESHEET"] = 2] = "STYLESHEET"; - PreparsedElementType[PreparsedElementType["SCRIPT"] = 3] = "SCRIPT"; - PreparsedElementType[PreparsedElementType["OTHER"] = 4] = "OTHER"; - })(exports.PreparsedElementType || (exports.PreparsedElementType = {})); - var PreparsedElementType = exports.PreparsedElementType; - var PreparsedElement = (function() { - function PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs) { - this.type = type; - this.selectAttr = selectAttr; - this.hrefAttr = hrefAttr; - this.nonBindable = nonBindable; - this.projectAs = projectAs; - } - return PreparsedElement; - }()); - exports.PreparsedElement = PreparsedElement; - function normalizeNgContentSelect(selectAttr) { - if (lang_1.isBlank(selectAttr) || selectAttr.length === 0) { - return '*'; - } - return selectAttr; - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/template_normalizer", ["angular2/src/compiler/directive_metadata", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/async", "angular2/src/compiler/xhr", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/core/di", "angular2/src/core/metadata/view", "angular2/src/compiler/html_ast", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_preparser"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var async_1 = require("angular2/src/facade/async"); - var xhr_1 = require("angular2/src/compiler/xhr"); - var url_resolver_1 = require("angular2/src/compiler/url_resolver"); - var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); - var di_1 = require("angular2/src/core/di"); - var view_1 = require("angular2/src/core/metadata/view"); - var html_ast_1 = require("angular2/src/compiler/html_ast"); - var html_parser_1 = require("angular2/src/compiler/html_parser"); - var template_preparser_1 = require("angular2/src/compiler/template_preparser"); - var TemplateNormalizer = (function() { - function TemplateNormalizer(_xhr, _urlResolver, _htmlParser) { - this._xhr = _xhr; - this._urlResolver = _urlResolver; - this._htmlParser = _htmlParser; - } - TemplateNormalizer.prototype.normalizeTemplate = function(directiveType, template) { - var _this = this; - if (lang_1.isPresent(template.template)) { - return async_1.PromiseWrapper.resolve(this.normalizeLoadedTemplate(directiveType, template, template.template, directiveType.moduleUrl)); - } else if (lang_1.isPresent(template.templateUrl)) { - var sourceAbsUrl = this._urlResolver.resolve(directiveType.moduleUrl, template.templateUrl); - return this._xhr.get(sourceAbsUrl).then(function(templateContent) { - return _this.normalizeLoadedTemplate(directiveType, template, templateContent, sourceAbsUrl); - }); - } else { - throw new exceptions_1.BaseException("No template specified for component " + directiveType.name); - } - }; - TemplateNormalizer.prototype.normalizeLoadedTemplate = function(directiveType, templateMeta, template, templateAbsUrl) { - var _this = this; - var rootNodesAndErrors = this._htmlParser.parse(template, directiveType.name); - if (rootNodesAndErrors.errors.length > 0) { - var errorString = rootNodesAndErrors.errors.join('\n'); - throw new exceptions_1.BaseException("Template parse errors:\n" + errorString); - } - var visitor = new TemplatePreparseVisitor(); - html_ast_1.htmlVisitAll(visitor, rootNodesAndErrors.rootNodes); - var allStyles = templateMeta.styles.concat(visitor.styles); - var allStyleAbsUrls = visitor.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { - return _this._urlResolver.resolve(templateAbsUrl, url); - }).concat(templateMeta.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url) { - return _this._urlResolver.resolve(directiveType.moduleUrl, url); - })); - var allResolvedStyles = allStyles.map(function(style) { - var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, templateAbsUrl, style); - styleWithImports.styleUrls.forEach(function(styleUrl) { - return allStyleAbsUrls.push(styleUrl); - }); - return styleWithImports.style; - }); - var encapsulation = templateMeta.encapsulation; - if (encapsulation === view_1.ViewEncapsulation.Emulated && allResolvedStyles.length === 0 && allStyleAbsUrls.length === 0) { - encapsulation = view_1.ViewEncapsulation.None; - } - return new directive_metadata_1.CompileTemplateMetadata({ - encapsulation: encapsulation, - template: template, - templateUrl: templateAbsUrl, - styles: allResolvedStyles, - styleUrls: allStyleAbsUrls, - ngContentSelectors: visitor.ngContentSelectors - }); - }; - TemplateNormalizer = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver, html_parser_1.HtmlParser])], TemplateNormalizer); - return TemplateNormalizer; - }()); - exports.TemplateNormalizer = TemplateNormalizer; - var TemplatePreparseVisitor = (function() { - function TemplatePreparseVisitor() { - this.ngContentSelectors = []; - this.styles = []; - this.styleUrls = []; - this.ngNonBindableStackCount = 0; - } - TemplatePreparseVisitor.prototype.visitElement = function(ast, context) { - var preparsedElement = template_preparser_1.preparseElement(ast); - switch (preparsedElement.type) { - case template_preparser_1.PreparsedElementType.NG_CONTENT: - if (this.ngNonBindableStackCount === 0) { - this.ngContentSelectors.push(preparsedElement.selectAttr); - } - break; - case template_preparser_1.PreparsedElementType.STYLE: - var textContent = ''; - ast.children.forEach(function(child) { - if (child instanceof html_ast_1.HtmlTextAst) { - textContent += child.value; - } - }); - this.styles.push(textContent); - break; - case template_preparser_1.PreparsedElementType.STYLESHEET: - this.styleUrls.push(preparsedElement.hrefAttr); - break; - default: - break; - } - if (preparsedElement.nonBindable) { - this.ngNonBindableStackCount++; - } - html_ast_1.htmlVisitAll(this, ast.children); - if (preparsedElement.nonBindable) { - this.ngNonBindableStackCount--; - } - return null; - }; - TemplatePreparseVisitor.prototype.visitComment = function(ast, context) { - return null; - }; - TemplatePreparseVisitor.prototype.visitAttr = function(ast, context) { - return null; - }; - TemplatePreparseVisitor.prototype.visitText = function(ast, context) { - return null; - }; - return TemplatePreparseVisitor; - }()); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/linker/directive_lifecycle_reflector", ["angular2/src/facade/lang", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var interfaces_1 = require("angular2/src/core/linker/interfaces"); - function hasLifecycleHook(lcInterface, token) { - if (!(token instanceof lang_1.Type)) - return false; - var proto = token.prototype; - switch (lcInterface) { - case interfaces_1.LifecycleHooks.AfterContentInit: - return !!proto.ngAfterContentInit; - case interfaces_1.LifecycleHooks.AfterContentChecked: - return !!proto.ngAfterContentChecked; - case interfaces_1.LifecycleHooks.AfterViewInit: - return !!proto.ngAfterViewInit; - case interfaces_1.LifecycleHooks.AfterViewChecked: - return !!proto.ngAfterViewChecked; - case interfaces_1.LifecycleHooks.OnChanges: - return !!proto.ngOnChanges; - case interfaces_1.LifecycleHooks.DoCheck: - return !!proto.ngDoCheck; - case interfaces_1.LifecycleHooks.OnDestroy: - return !!proto.ngOnDestroy; - case interfaces_1.LifecycleHooks.OnInit: - return !!proto.ngOnInit; - default: - return false; - } - } - exports.hasLifecycleHook = hasLifecycleHook; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/assertions", ["angular2/src/facade/lang", "angular2/src/facade/exceptions"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - function assertArrayOfStrings(identifier, value) { - if (!lang_1.assertionsEnabled() || lang_1.isBlank(value)) { - return ; - } - if (!lang_1.isArray(value)) { - throw new exceptions_1.BaseException("Expected '" + identifier + "' to be an array of strings."); - } - for (var i = 0; i < value.length; i += 1) { - if (!lang_1.isString(value[i])) { - throw new exceptions_1.BaseException("Expected '" + identifier + "' to be an array of strings."); - } - } - } - exports.assertArrayOfStrings = assertArrayOfStrings; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/schema/dom_element_schema_registry", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/platform/dom/dom_adapter", "angular2/src/compiler/html_tags", "angular2/src/compiler/schema/element_schema_registry"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var html_tags_1 = require("angular2/src/compiler/html_tags"); - var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); - var NAMESPACE_URIS = lang_1.CONST_EXPR({ - 'xlink': 'http://www.w3.org/1999/xlink', - 'svg': 'http://www.w3.org/2000/svg' - }); - var DomElementSchemaRegistry = (function(_super) { - __extends(DomElementSchemaRegistry, _super); - function DomElementSchemaRegistry() { - _super.apply(this, arguments); - this._protoElements = new Map(); - } - DomElementSchemaRegistry.prototype._getProtoElement = function(tagName) { - var element = this._protoElements.get(tagName); - if (lang_1.isBlank(element)) { - var nsAndName = html_tags_1.splitNsName(tagName); - element = lang_1.isPresent(nsAndName[0]) ? dom_adapter_1.DOM.createElementNS(NAMESPACE_URIS[nsAndName[0]], nsAndName[1]) : dom_adapter_1.DOM.createElement(nsAndName[1]); - this._protoElements.set(tagName, element); - } - return element; - }; - DomElementSchemaRegistry.prototype.hasProperty = function(tagName, propName) { - if (tagName.indexOf('-') !== -1) { - return true; - } else { - var elm = this._getProtoElement(tagName); - return dom_adapter_1.DOM.hasProperty(elm, propName); - } - }; - DomElementSchemaRegistry.prototype.getMappedPropName = function(propName) { - var mappedPropName = collection_1.StringMapWrapper.get(dom_adapter_1.DOM.attrToPropMap, propName); - return lang_1.isPresent(mappedPropName) ? mappedPropName : propName; - }; - DomElementSchemaRegistry = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], DomElementSchemaRegistry); - return DomElementSchemaRegistry; - }(element_schema_registry_1.ElementSchemaRegistry)); - exports.DomElementSchemaRegistry = DomElementSchemaRegistry; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/core/angular_entrypoint", ["angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var AngularEntrypoint = (function() { - function AngularEntrypoint(name) { - this.name = name; - } - AngularEntrypoint = __decorate([lang_1.CONST(), __metadata('design:paramtypes', [String])], AngularEntrypoint); - return AngularEntrypoint; - }()); - exports.AngularEntrypoint = AngularEntrypoint; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/async_pipe", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/core", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var async_1 = require("angular2/src/facade/async"); - var core_1 = require("angular2/core"); - var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); - var ObservableStrategy = (function() { - function ObservableStrategy() {} - ObservableStrategy.prototype.createSubscription = function(async, updateLatestValue) { - return async_1.ObservableWrapper.subscribe(async, updateLatestValue, function(e) { - throw e; - }); - }; - ObservableStrategy.prototype.dispose = function(subscription) { - async_1.ObservableWrapper.dispose(subscription); - }; - ObservableStrategy.prototype.onDestroy = function(subscription) { - async_1.ObservableWrapper.dispose(subscription); - }; - return ObservableStrategy; - }()); - var PromiseStrategy = (function() { - function PromiseStrategy() {} - PromiseStrategy.prototype.createSubscription = function(async, updateLatestValue) { - return async.then(updateLatestValue); - }; - PromiseStrategy.prototype.dispose = function(subscription) {}; - PromiseStrategy.prototype.onDestroy = function(subscription) {}; - return PromiseStrategy; - }()); - var _promiseStrategy = new PromiseStrategy(); - var _observableStrategy = new ObservableStrategy(); - var __unused; - var AsyncPipe = (function() { - function AsyncPipe(_ref) { - this._latestValue = null; - this._latestReturnedValue = null; - this._subscription = null; - this._obj = null; - this._strategy = null; - this._ref = _ref; - } - AsyncPipe.prototype.ngOnDestroy = function() { - if (lang_1.isPresent(this._subscription)) { - this._dispose(); - } - }; - AsyncPipe.prototype.transform = function(obj, args) { - if (lang_1.isBlank(this._obj)) { - if (lang_1.isPresent(obj)) { - this._subscribe(obj); - } - this._latestReturnedValue = this._latestValue; - return this._latestValue; - } - if (obj !== this._obj) { - this._dispose(); - return this.transform(obj); - } - if (this._latestValue === this._latestReturnedValue) { - return this._latestReturnedValue; - } else { - this._latestReturnedValue = this._latestValue; - return core_1.WrappedValue.wrap(this._latestValue); - } - }; - AsyncPipe.prototype._subscribe = function(obj) { - var _this = this; - this._obj = obj; - this._strategy = this._selectStrategy(obj); - this._subscription = this._strategy.createSubscription(obj, function(value) { - return _this._updateLatestValue(obj, value); - }); - }; - AsyncPipe.prototype._selectStrategy = function(obj) { - if (lang_1.isPromise(obj)) { - return _promiseStrategy; - } else if (async_1.ObservableWrapper.isObservable(obj)) { - return _observableStrategy; - } else { - throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(AsyncPipe, obj); - } - }; - AsyncPipe.prototype._dispose = function() { - this._strategy.dispose(this._subscription); - this._latestValue = null; - this._latestReturnedValue = null; - this._subscription = null; - this._obj = null; - }; - AsyncPipe.prototype._updateLatestValue = function(async, value) { - if (async === this._obj) { - this._latestValue = value; - this._ref.markForCheck(); - } - }; - AsyncPipe = __decorate([core_1.Pipe({ - name: 'async', - pure: false - }), core_1.Injectable(), __metadata('design:paramtypes', [core_1.ChangeDetectorRef])], AsyncPipe); - return AsyncPipe; - }()); - exports.AsyncPipe = AsyncPipe; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes/date_pipe", ["angular2/src/facade/lang", "angular2/src/facade/intl", "angular2/core", "angular2/src/facade/collection", "angular2/src/common/pipes/invalid_pipe_argument_exception"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var intl_1 = require("angular2/src/facade/intl"); - var core_1 = require("angular2/core"); - var collection_1 = require("angular2/src/facade/collection"); - var invalid_pipe_argument_exception_1 = require("angular2/src/common/pipes/invalid_pipe_argument_exception"); - var defaultLocale = 'en-US'; - var DatePipe = (function() { - function DatePipe() {} - DatePipe.prototype.transform = function(value, args) { - if (lang_1.isBlank(value)) - return null; - if (!this.supports(value)) { - throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(DatePipe, value); - } - var pattern = lang_1.isPresent(args) && args.length > 0 ? args[0] : 'mediumDate'; - if (lang_1.isNumber(value)) { - value = lang_1.DateWrapper.fromMillis(value); - } - if (collection_1.StringMapWrapper.contains(DatePipe._ALIASES, pattern)) { - pattern = collection_1.StringMapWrapper.get(DatePipe._ALIASES, pattern); - } - return intl_1.DateFormatter.format(value, defaultLocale, pattern); - }; - DatePipe.prototype.supports = function(obj) { - return lang_1.isDate(obj) || lang_1.isNumber(obj); - }; - DatePipe._ALIASES = { - 'medium': 'yMMMdjms', - 'short': 'yMdjm', - 'fullDate': 'yMMMMEEEEd', - 'longDate': 'yMMMMd', - 'mediumDate': 'yMMMd', - 'shortDate': 'yMd', - 'mediumTime': 'jms', - 'shortTime': 'jm' - }; - DatePipe = __decorate([lang_1.CONST(), core_1.Pipe({ - name: 'date', - pure: true - }), core_1.Injectable(), __metadata('design:paramtypes', [])], DatePipe); - return DatePipe; - }()); - exports.DatePipe = DatePipe; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/directives", ["angular2/src/common/directives/ng_class", "angular2/src/common/directives/ng_for", "angular2/src/common/directives/ng_if", "angular2/src/common/directives/ng_style", "angular2/src/common/directives/ng_switch", "angular2/src/common/directives/ng_plural", "angular2/src/common/directives/observable_list_diff", "angular2/src/common/directives/core_directives"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function __export(m) { - for (var p in m) - if (!exports.hasOwnProperty(p)) - exports[p] = m[p]; - } - var ng_class_1 = require("angular2/src/common/directives/ng_class"); - exports.NgClass = ng_class_1.NgClass; - var ng_for_1 = require("angular2/src/common/directives/ng_for"); - exports.NgFor = ng_for_1.NgFor; - var ng_if_1 = require("angular2/src/common/directives/ng_if"); - exports.NgIf = ng_if_1.NgIf; - var ng_style_1 = require("angular2/src/common/directives/ng_style"); - exports.NgStyle = ng_style_1.NgStyle; - var ng_switch_1 = require("angular2/src/common/directives/ng_switch"); - exports.NgSwitch = ng_switch_1.NgSwitch; - exports.NgSwitchWhen = ng_switch_1.NgSwitchWhen; - exports.NgSwitchDefault = ng_switch_1.NgSwitchDefault; - var ng_plural_1 = require("angular2/src/common/directives/ng_plural"); - exports.NgPlural = ng_plural_1.NgPlural; - exports.NgPluralCase = ng_plural_1.NgPluralCase; - exports.NgLocalization = ng_plural_1.NgLocalization; - __export(require("angular2/src/common/directives/observable_list_diff")); - var core_directives_1 = require("angular2/src/common/directives/core_directives"); - exports.CORE_DIRECTIVES = core_directives_1.CORE_DIRECTIVES; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/shared", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/radio_control_value_accessor", "angular2/src/common/forms/directives/normalize_validator"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var validators_1 = require("angular2/src/common/forms/validators"); - var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); - var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); - var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); - var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); - var radio_control_value_accessor_1 = require("angular2/src/common/forms/directives/radio_control_value_accessor"); - var normalize_validator_1 = require("angular2/src/common/forms/directives/normalize_validator"); - function controlPath(name, parent) { - var p = collection_1.ListWrapper.clone(parent.path); - p.push(name); - return p; - } - exports.controlPath = controlPath; - function setUpControl(control, dir) { - if (lang_1.isBlank(control)) - _throwError(dir, "Cannot find control"); - if (lang_1.isBlank(dir.valueAccessor)) - _throwError(dir, "No value accessor for"); - control.validator = validators_1.Validators.compose([control.validator, dir.validator]); - control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); - dir.valueAccessor.writeValue(control.value); - dir.valueAccessor.registerOnChange(function(newValue) { - dir.viewToModelUpdate(newValue); - control.updateValue(newValue, {emitModelToViewChange: false}); - control.markAsDirty(); - }); - control.registerOnChange(function(newValue) { - return dir.valueAccessor.writeValue(newValue); - }); - dir.valueAccessor.registerOnTouched(function() { - return control.markAsTouched(); - }); - } - exports.setUpControl = setUpControl; - function setUpControlGroup(control, dir) { - if (lang_1.isBlank(control)) - _throwError(dir, "Cannot find control"); - control.validator = validators_1.Validators.compose([control.validator, dir.validator]); - control.asyncValidator = validators_1.Validators.composeAsync([control.asyncValidator, dir.asyncValidator]); - } - exports.setUpControlGroup = setUpControlGroup; - function _throwError(dir, message) { - var path = dir.path.join(" -> "); - throw new exceptions_1.BaseException(message + " '" + path + "'"); - } - function composeValidators(validators) { - return lang_1.isPresent(validators) ? validators_1.Validators.compose(validators.map(normalize_validator_1.normalizeValidator)) : null; - } - exports.composeValidators = composeValidators; - function composeAsyncValidators(validators) { - return lang_1.isPresent(validators) ? validators_1.Validators.composeAsync(validators.map(normalize_validator_1.normalizeAsyncValidator)) : null; - } - exports.composeAsyncValidators = composeAsyncValidators; - function isPropertyUpdated(changes, viewModel) { - if (!collection_1.StringMapWrapper.contains(changes, "model")) - return false; - var change = changes["model"]; - if (change.isFirstChange()) - return true; - return !lang_1.looseIdentical(viewModel, change.currentValue); - } - exports.isPropertyUpdated = isPropertyUpdated; - function selectValueAccessor(dir, valueAccessors) { - if (lang_1.isBlank(valueAccessors)) - return null; - var defaultAccessor; - var builtinAccessor; - var customAccessor; - valueAccessors.forEach(function(v) { - if (lang_1.hasConstructor(v, default_value_accessor_1.DefaultValueAccessor)) { - defaultAccessor = v; - } else if (lang_1.hasConstructor(v, checkbox_value_accessor_1.CheckboxControlValueAccessor) || lang_1.hasConstructor(v, number_value_accessor_1.NumberValueAccessor) || lang_1.hasConstructor(v, select_control_value_accessor_1.SelectControlValueAccessor) || lang_1.hasConstructor(v, radio_control_value_accessor_1.RadioControlValueAccessor)) { - if (lang_1.isPresent(builtinAccessor)) - _throwError(dir, "More than one built-in value accessor matches"); - builtinAccessor = v; - } else { - if (lang_1.isPresent(customAccessor)) - _throwError(dir, "More than one custom value accessor matches"); - customAccessor = v; - } - }); - if (lang_1.isPresent(customAccessor)) - return customAccessor; - if (lang_1.isPresent(builtinAccessor)) - return builtinAccessor; - if (lang_1.isPresent(defaultAccessor)) - return defaultAccessor; - _throwError(dir, "No valid value accessor for"); - return null; - } - exports.selectValueAccessor = selectValueAccessor; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives", ["angular2/src/facade/lang", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/radio_control_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/radio_control_value_accessor", "angular2/src/common/forms/directives/number_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/directives/ng_control"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); - var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); - var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); - var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); - var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); - var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); - var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); - var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); - var number_value_accessor_1 = require("angular2/src/common/forms/directives/number_value_accessor"); - var radio_control_value_accessor_1 = require("angular2/src/common/forms/directives/radio_control_value_accessor"); - var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); - var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); - var validators_1 = require("angular2/src/common/forms/directives/validators"); - var ng_control_name_2 = require("angular2/src/common/forms/directives/ng_control_name"); - exports.NgControlName = ng_control_name_2.NgControlName; - var ng_form_control_2 = require("angular2/src/common/forms/directives/ng_form_control"); - exports.NgFormControl = ng_form_control_2.NgFormControl; - var ng_model_2 = require("angular2/src/common/forms/directives/ng_model"); - exports.NgModel = ng_model_2.NgModel; - var ng_control_group_2 = require("angular2/src/common/forms/directives/ng_control_group"); - exports.NgControlGroup = ng_control_group_2.NgControlGroup; - var ng_form_model_2 = require("angular2/src/common/forms/directives/ng_form_model"); - exports.NgFormModel = ng_form_model_2.NgFormModel; - var ng_form_2 = require("angular2/src/common/forms/directives/ng_form"); - exports.NgForm = ng_form_2.NgForm; - var default_value_accessor_2 = require("angular2/src/common/forms/directives/default_value_accessor"); - exports.DefaultValueAccessor = default_value_accessor_2.DefaultValueAccessor; - var checkbox_value_accessor_2 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); - exports.CheckboxControlValueAccessor = checkbox_value_accessor_2.CheckboxControlValueAccessor; - var radio_control_value_accessor_2 = require("angular2/src/common/forms/directives/radio_control_value_accessor"); - exports.RadioControlValueAccessor = radio_control_value_accessor_2.RadioControlValueAccessor; - exports.RadioButtonState = radio_control_value_accessor_2.RadioButtonState; - var number_value_accessor_2 = require("angular2/src/common/forms/directives/number_value_accessor"); - exports.NumberValueAccessor = number_value_accessor_2.NumberValueAccessor; - var ng_control_status_2 = require("angular2/src/common/forms/directives/ng_control_status"); - exports.NgControlStatus = ng_control_status_2.NgControlStatus; - var select_control_value_accessor_2 = require("angular2/src/common/forms/directives/select_control_value_accessor"); - exports.SelectControlValueAccessor = select_control_value_accessor_2.SelectControlValueAccessor; - exports.NgSelectOption = select_control_value_accessor_2.NgSelectOption; - var validators_2 = require("angular2/src/common/forms/directives/validators"); - exports.RequiredValidator = validators_2.RequiredValidator; - exports.MinLengthValidator = validators_2.MinLengthValidator; - exports.MaxLengthValidator = validators_2.MaxLengthValidator; - exports.PatternValidator = validators_2.PatternValidator; - var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); - exports.NgControl = ng_control_1.NgControl; - exports.FORM_DIRECTIVES = lang_1.CONST_EXPR([ng_control_name_1.NgControlName, ng_control_group_1.NgControlGroup, ng_form_control_1.NgFormControl, ng_model_1.NgModel, ng_form_model_1.NgFormModel, ng_form_1.NgForm, select_control_value_accessor_1.NgSelectOption, default_value_accessor_1.DefaultValueAccessor, number_value_accessor_1.NumberValueAccessor, checkbox_value_accessor_1.CheckboxControlValueAccessor, select_control_value_accessor_1.SelectControlValueAccessor, radio_control_value_accessor_1.RadioControlValueAccessor, ng_control_status_1.NgControlStatus, validators_1.RequiredValidator, validators_1.MinLengthValidator, validators_1.MaxLengthValidator, validators_1.PatternValidator]); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/dom/events/hammer_gestures", ["angular2/src/platform/dom/events/hammer_common", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/core"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var hammer_common_1 = require("angular2/src/platform/dom/events/hammer_common"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var core_1 = require("angular2/core"); - exports.HAMMER_GESTURE_CONFIG = lang_1.CONST_EXPR(new core_1.OpaqueToken("HammerGestureConfig")); - var HammerGestureConfig = (function() { - function HammerGestureConfig() { - this.events = []; - this.overrides = {}; - } - HammerGestureConfig.prototype.buildHammer = function(element) { - var mc = new Hammer(element); - mc.get('pinch').set({enable: true}); - mc.get('rotate').set({enable: true}); - for (var eventName in this.overrides) { - mc.get(eventName).set(this.overrides[eventName]); - } - return mc; - }; - HammerGestureConfig = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [])], HammerGestureConfig); - return HammerGestureConfig; - }()); - exports.HammerGestureConfig = HammerGestureConfig; - var HammerGesturesPlugin = (function(_super) { - __extends(HammerGesturesPlugin, _super); - function HammerGesturesPlugin(_config) { - _super.call(this); - this._config = _config; - } - HammerGesturesPlugin.prototype.supports = function(eventName) { - if (!_super.prototype.supports.call(this, eventName) && !this.isCustomEvent(eventName)) - return false; - if (!lang_1.isPresent(window['Hammer'])) { - throw new exceptions_1.BaseException("Hammer.js is not loaded, can not bind " + eventName + " event"); - } - return true; - }; - HammerGesturesPlugin.prototype.addEventListener = function(element, eventName, handler) { - var _this = this; - var zone = this.manager.getZone(); - eventName = eventName.toLowerCase(); - return zone.runOutsideAngular(function() { - var mc = _this._config.buildHammer(element); - var callback = function(eventObj) { - zone.run(function() { - handler(eventObj); - }); - }; - mc.on(eventName, callback); - return function() { - mc.off(eventName, callback); - }; - }); - }; - HammerGesturesPlugin.prototype.isCustomEvent = function(eventName) { - return this._config.events.indexOf(eventName) > -1; - }; - HammerGesturesPlugin = __decorate([core_1.Injectable(), __param(0, core_1.Inject(exports.HAMMER_GESTURE_CONFIG)), __metadata('design:paramtypes', [HammerGestureConfig])], HammerGesturesPlugin); - return HammerGesturesPlugin; - }(hammer_common_1.HammerGesturesPluginCommon)); - exports.HammerGesturesPlugin = HammerGesturesPlugin; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/browser/generic_browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/platform/dom/dom_adapter", "angular2/src/platform/browser/xhr_impl"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var xhr_impl_1 = require("angular2/src/platform/browser/xhr_impl"); - var GenericBrowserDomAdapter = (function(_super) { - __extends(GenericBrowserDomAdapter, _super); - function GenericBrowserDomAdapter() { - var _this = this; - _super.call(this); - this._animationPrefix = null; - this._transitionEnd = null; - try { - var element = this.createElement('div', this.defaultDoc()); - if (lang_1.isPresent(this.getStyle(element, 'animationName'))) { - this._animationPrefix = ''; - } else { - var domPrefixes = ['Webkit', 'Moz', 'O', 'ms']; - for (var i = 0; i < domPrefixes.length; i++) { - if (lang_1.isPresent(this.getStyle(element, domPrefixes[i] + 'AnimationName'))) { - this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-'; - break; - } - } - } - var transEndEventNames = { - WebkitTransition: 'webkitTransitionEnd', - MozTransition: 'transitionend', - OTransition: 'oTransitionEnd otransitionend', - transition: 'transitionend' - }; - collection_1.StringMapWrapper.forEach(transEndEventNames, function(value, key) { - if (lang_1.isPresent(_this.getStyle(element, key))) { - _this._transitionEnd = value; - } - }); - } catch (e) { - this._animationPrefix = null; - this._transitionEnd = null; - } - } - GenericBrowserDomAdapter.prototype.getXHR = function() { - return xhr_impl_1.XHRImpl; - }; - GenericBrowserDomAdapter.prototype.getDistributedNodes = function(el) { - return el.getDistributedNodes(); - }; - GenericBrowserDomAdapter.prototype.resolveAndSetHref = function(el, baseUrl, href) { - el.href = href == null ? baseUrl : baseUrl + '/../' + href; - }; - GenericBrowserDomAdapter.prototype.supportsDOMEvents = function() { - return true; - }; - GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = function() { - return lang_1.isFunction(this.defaultDoc().body.createShadowRoot); - }; - GenericBrowserDomAdapter.prototype.getAnimationPrefix = function() { - return lang_1.isPresent(this._animationPrefix) ? this._animationPrefix : ""; - }; - GenericBrowserDomAdapter.prototype.getTransitionEnd = function() { - return lang_1.isPresent(this._transitionEnd) ? this._transitionEnd : ""; - }; - GenericBrowserDomAdapter.prototype.supportsAnimation = function() { - return lang_1.isPresent(this._animationPrefix) && lang_1.isPresent(this._transitionEnd); - }; - return GenericBrowserDomAdapter; - }(dom_adapter_1.DomAdapter)); - exports.GenericBrowserDomAdapter = GenericBrowserDomAdapter; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/browser/tools/common_tools", ["angular2/src/core/application_ref", "angular2/src/facade/lang", "angular2/src/facade/browser", "angular2/src/platform/dom/dom_adapter"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var application_ref_1 = require("angular2/src/core/application_ref"); - var lang_1 = require("angular2/src/facade/lang"); - var browser_1 = require("angular2/src/facade/browser"); - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var AngularTools = (function() { - function AngularTools(ref) { - this.profiler = new AngularProfiler(ref); - } - return AngularTools; - }()); - exports.AngularTools = AngularTools; - var AngularProfiler = (function() { - function AngularProfiler(ref) { - this.appRef = ref.injector.get(application_ref_1.ApplicationRef); - } - AngularProfiler.prototype.timeChangeDetection = function(config) { - var record = lang_1.isPresent(config) && config['record']; - var profileName = 'Change Detection'; - var isProfilerAvailable = lang_1.isPresent(browser_1.window.console.profile); - if (record && isProfilerAvailable) { - browser_1.window.console.profile(profileName); - } - var start = dom_adapter_1.DOM.performanceNow(); - var numTicks = 0; - while (numTicks < 5 || (dom_adapter_1.DOM.performanceNow() - start) < 500) { - this.appRef.tick(); - numTicks++; - } - var end = dom_adapter_1.DOM.performanceNow(); - if (record && isProfilerAvailable) { - browser_1.window.console.profileEnd(profileName); - } - var msPerTick = (end - start) / numTicks; - browser_1.window.console.log("ran " + numTicks + " change detection cycles"); - browser_1.window.console.log(lang_1.NumberWrapper.toFixed(msPerTick, 2) + " ms per check"); - }; - return AngularProfiler; - }()); - exports.AngularProfiler = AngularProfiler; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/directive_metadata", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/core/change_detection/change_detection", "angular2/src/core/metadata/view", "angular2/src/compiler/selector", "angular2/src/compiler/util", "angular2/src/core/linker/interfaces"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); - var view_1 = require("angular2/src/core/metadata/view"); - var selector_1 = require("angular2/src/compiler/selector"); - var util_1 = require("angular2/src/compiler/util"); - var interfaces_1 = require("angular2/src/core/linker/interfaces"); - var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g; - var CompileMetadataWithIdentifier = (function() { - function CompileMetadataWithIdentifier() {} - Object.defineProperty(CompileMetadataWithIdentifier.prototype, "identifier", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - return CompileMetadataWithIdentifier; - }()); - exports.CompileMetadataWithIdentifier = CompileMetadataWithIdentifier; - var CompileMetadataWithType = (function(_super) { - __extends(CompileMetadataWithType, _super); - function CompileMetadataWithType() { - _super.apply(this, arguments); - } - Object.defineProperty(CompileMetadataWithType.prototype, "type", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CompileMetadataWithType.prototype, "identifier", { - get: function() { - return exceptions_1.unimplemented(); - }, - enumerable: true, - configurable: true - }); - return CompileMetadataWithType; - }(CompileMetadataWithIdentifier)); - exports.CompileMetadataWithType = CompileMetadataWithType; - function metadataFromJson(data) { - return _COMPILE_METADATA_FROM_JSON[data['class']](data); - } - exports.metadataFromJson = metadataFromJson; - var CompileIdentifierMetadata = (function() { - function CompileIdentifierMetadata(_a) { - var _b = _a === void 0 ? {} : _a, - runtime = _b.runtime, - name = _b.name, - moduleUrl = _b.moduleUrl, - prefix = _b.prefix, - constConstructor = _b.constConstructor, - value = _b.value; - this.runtime = runtime; - this.name = name; - this.prefix = prefix; - this.moduleUrl = moduleUrl; - this.constConstructor = constConstructor; - this.value = value; - } - CompileIdentifierMetadata.fromJson = function(data) { - var value = lang_1.isArray(data['value']) ? arrayFromJson(data['value'], metadataFromJson) : objFromJson(data['value'], metadataFromJson); - return new CompileIdentifierMetadata({ - name: data['name'], - prefix: data['prefix'], - moduleUrl: data['moduleUrl'], - constConstructor: data['constConstructor'], - value: value - }); - }; - CompileIdentifierMetadata.prototype.toJson = function() { - var value = lang_1.isArray(this.value) ? arrayToJson(this.value) : objToJson(this.value); - return { - 'class': 'Identifier', - 'name': this.name, - 'moduleUrl': this.moduleUrl, - 'prefix': this.prefix, - 'constConstructor': this.constConstructor, - 'value': value - }; - }; - Object.defineProperty(CompileIdentifierMetadata.prototype, "identifier", { - get: function() { - return this; - }, - enumerable: true, - configurable: true - }); - return CompileIdentifierMetadata; - }()); - exports.CompileIdentifierMetadata = CompileIdentifierMetadata; - var CompileDiDependencyMetadata = (function() { - function CompileDiDependencyMetadata(_a) { - var _b = _a === void 0 ? {} : _a, - isAttribute = _b.isAttribute, - isSelf = _b.isSelf, - isHost = _b.isHost, - isSkipSelf = _b.isSkipSelf, - isOptional = _b.isOptional, - query = _b.query, - viewQuery = _b.viewQuery, - token = _b.token; - this.isAttribute = lang_1.normalizeBool(isAttribute); - this.isSelf = lang_1.normalizeBool(isSelf); - this.isHost = lang_1.normalizeBool(isHost); - this.isSkipSelf = lang_1.normalizeBool(isSkipSelf); - this.isOptional = lang_1.normalizeBool(isOptional); - this.query = query; - this.viewQuery = viewQuery; - this.token = token; - } - CompileDiDependencyMetadata.fromJson = function(data) { - return new CompileDiDependencyMetadata({ - token: objFromJson(data['token'], CompileIdentifierMetadata.fromJson), - query: objFromJson(data['query'], CompileQueryMetadata.fromJson), - viewQuery: objFromJson(data['viewQuery'], CompileQueryMetadata.fromJson), - isAttribute: data['isAttribute'], - isSelf: data['isSelf'], - isHost: data['isHost'], - isSkipSelf: data['isSkipSelf'], - isOptional: data['isOptional'] - }); - }; - CompileDiDependencyMetadata.prototype.toJson = function() { - return { - 'token': objToJson(this.token), - 'query': objToJson(this.query), - 'viewQuery': objToJson(this.viewQuery), - 'isAttribute': this.isAttribute, - 'isSelf': this.isSelf, - 'isHost': this.isHost, - 'isSkipSelf': this.isSkipSelf, - 'isOptional': this.isOptional - }; - }; - return CompileDiDependencyMetadata; - }()); - exports.CompileDiDependencyMetadata = CompileDiDependencyMetadata; - var CompileProviderMetadata = (function() { - function CompileProviderMetadata(_a) { - var token = _a.token, - useClass = _a.useClass, - useValue = _a.useValue, - useExisting = _a.useExisting, - useFactory = _a.useFactory, - deps = _a.deps, - multi = _a.multi; - this.token = token; - this.useClass = useClass; - this.useValue = useValue; - this.useExisting = useExisting; - this.useFactory = useFactory; - this.deps = deps; - this.multi = multi; - } - CompileProviderMetadata.fromJson = function(data) { - return new CompileProviderMetadata({ - token: objFromJson(data['token'], CompileIdentifierMetadata.fromJson), - useClass: objFromJson(data['useClass'], CompileTypeMetadata.fromJson), - useExisting: objFromJson(data['useExisting'], CompileIdentifierMetadata.fromJson), - useValue: objFromJson(data['useValue'], CompileIdentifierMetadata.fromJson), - useFactory: objFromJson(data['useFactory'], CompileFactoryMetadata.fromJson) - }); - }; - CompileProviderMetadata.prototype.toJson = function() { - return { - 'class': 'Provider', - 'token': objToJson(this.token), - 'useClass': objToJson(this.useClass), - 'useExisting': objToJson(this.useExisting), - 'useValue': objToJson(this.useValue), - 'useFactory': objToJson(this.useFactory) - }; - }; - return CompileProviderMetadata; - }()); - exports.CompileProviderMetadata = CompileProviderMetadata; - var CompileFactoryMetadata = (function() { - function CompileFactoryMetadata(_a) { - var runtime = _a.runtime, - name = _a.name, - moduleUrl = _a.moduleUrl, - prefix = _a.prefix, - constConstructor = _a.constConstructor, - diDeps = _a.diDeps, - value = _a.value; - this.runtime = runtime; - this.name = name; - this.prefix = prefix; - this.moduleUrl = moduleUrl; - this.diDeps = diDeps; - this.constConstructor = constConstructor; - this.value = value; - } - Object.defineProperty(CompileFactoryMetadata.prototype, "identifier", { - get: function() { - return this; - }, - enumerable: true, - configurable: true - }); - CompileFactoryMetadata.fromJson = function(data) { - return new CompileFactoryMetadata({ - name: data['name'], - prefix: data['prefix'], - moduleUrl: data['moduleUrl'], - constConstructor: data['constConstructor'], - value: data['value'], - diDeps: arrayFromJson(data['diDeps'], CompileDiDependencyMetadata.fromJson) - }); - }; - CompileFactoryMetadata.prototype.toJson = function() { - return { - 'class': 'Factory', - 'name': this.name, - 'prefix': this.prefix, - 'moduleUrl': this.moduleUrl, - 'constConstructor': this.constConstructor, - 'value': this.value, - 'diDeps': arrayToJson(this.diDeps) - }; - }; - return CompileFactoryMetadata; - }()); - exports.CompileFactoryMetadata = CompileFactoryMetadata; - var CompileTypeMetadata = (function() { - function CompileTypeMetadata(_a) { - var _b = _a === void 0 ? {} : _a, - runtime = _b.runtime, - name = _b.name, - moduleUrl = _b.moduleUrl, - prefix = _b.prefix, - isHost = _b.isHost, - constConstructor = _b.constConstructor, - value = _b.value, - diDeps = _b.diDeps; - this.runtime = runtime; - this.name = name; - this.moduleUrl = moduleUrl; - this.prefix = prefix; - this.isHost = lang_1.normalizeBool(isHost); - this.constConstructor = constConstructor; - this.value = value; - this.diDeps = lang_1.normalizeBlank(diDeps); - } - CompileTypeMetadata.fromJson = function(data) { - return new CompileTypeMetadata({ - name: data['name'], - moduleUrl: data['moduleUrl'], - prefix: data['prefix'], - isHost: data['isHost'], - constConstructor: data['constConstructor'], - value: data['value'], - diDeps: arrayFromJson(data['diDeps'], CompileDiDependencyMetadata.fromJson) - }); - }; - Object.defineProperty(CompileTypeMetadata.prototype, "identifier", { - get: function() { - return this; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(CompileTypeMetadata.prototype, "type", { - get: function() { - return this; - }, - enumerable: true, - configurable: true - }); - CompileTypeMetadata.prototype.toJson = function() { - return { - 'class': 'Type', - 'name': this.name, - 'moduleUrl': this.moduleUrl, - 'prefix': this.prefix, - 'isHost': this.isHost, - 'constConstructor': this.constConstructor, - 'value': this.value, - 'diDeps': arrayToJson(this.diDeps) - }; - }; - return CompileTypeMetadata; - }()); - exports.CompileTypeMetadata = CompileTypeMetadata; - var CompileQueryMetadata = (function() { - function CompileQueryMetadata(_a) { - var _b = _a === void 0 ? {} : _a, - selectors = _b.selectors, - descendants = _b.descendants, - first = _b.first, - propertyName = _b.propertyName; - this.selectors = selectors; - this.descendants = descendants; - this.first = lang_1.normalizeBool(first); - this.propertyName = propertyName; - } - CompileQueryMetadata.fromJson = function(data) { - return new CompileQueryMetadata({ - selectors: arrayFromJson(data['selectors'], CompileIdentifierMetadata.fromJson), - descendants: data['descendants'], - first: data['first'], - propertyName: data['propertyName'] - }); - }; - CompileQueryMetadata.prototype.toJson = function() { - return { - 'selectors': arrayToJson(this.selectors), - 'descendants': this.descendants, - 'first': this.first, - 'propertyName': this.propertyName - }; - }; - return CompileQueryMetadata; - }()); - exports.CompileQueryMetadata = CompileQueryMetadata; - var CompileTemplateMetadata = (function() { - function CompileTemplateMetadata(_a) { - var _b = _a === void 0 ? {} : _a, - encapsulation = _b.encapsulation, - template = _b.template, - templateUrl = _b.templateUrl, - styles = _b.styles, - styleUrls = _b.styleUrls, - ngContentSelectors = _b.ngContentSelectors; - this.encapsulation = lang_1.isPresent(encapsulation) ? encapsulation : view_1.ViewEncapsulation.Emulated; - this.template = template; - this.templateUrl = templateUrl; - this.styles = lang_1.isPresent(styles) ? styles : []; - this.styleUrls = lang_1.isPresent(styleUrls) ? styleUrls : []; - this.ngContentSelectors = lang_1.isPresent(ngContentSelectors) ? ngContentSelectors : []; - } - CompileTemplateMetadata.fromJson = function(data) { - return new CompileTemplateMetadata({ - encapsulation: lang_1.isPresent(data['encapsulation']) ? view_1.VIEW_ENCAPSULATION_VALUES[data['encapsulation']] : data['encapsulation'], - template: data['template'], - templateUrl: data['templateUrl'], - styles: data['styles'], - styleUrls: data['styleUrls'], - ngContentSelectors: data['ngContentSelectors'] - }); - }; - CompileTemplateMetadata.prototype.toJson = function() { - return { - 'encapsulation': lang_1.isPresent(this.encapsulation) ? lang_1.serializeEnum(this.encapsulation) : this.encapsulation, - 'template': this.template, - 'templateUrl': this.templateUrl, - 'styles': this.styles, - 'styleUrls': this.styleUrls, - 'ngContentSelectors': this.ngContentSelectors - }; - }; - return CompileTemplateMetadata; - }()); - exports.CompileTemplateMetadata = CompileTemplateMetadata; - var CompileDirectiveMetadata = (function() { - function CompileDirectiveMetadata(_a) { - var _b = _a === void 0 ? {} : _a, - type = _b.type, - isComponent = _b.isComponent, - dynamicLoadable = _b.dynamicLoadable, - selector = _b.selector, - exportAs = _b.exportAs, - changeDetection = _b.changeDetection, - inputs = _b.inputs, - outputs = _b.outputs, - hostListeners = _b.hostListeners, - hostProperties = _b.hostProperties, - hostAttributes = _b.hostAttributes, - lifecycleHooks = _b.lifecycleHooks, - providers = _b.providers, - viewProviders = _b.viewProviders, - queries = _b.queries, - viewQueries = _b.viewQueries, - template = _b.template; - this.type = type; - this.isComponent = isComponent; - this.dynamicLoadable = dynamicLoadable; - this.selector = selector; - this.exportAs = exportAs; - this.changeDetection = changeDetection; - this.inputs = inputs; - this.outputs = outputs; - this.hostListeners = hostListeners; - this.hostProperties = hostProperties; - this.hostAttributes = hostAttributes; - this.lifecycleHooks = lifecycleHooks; - this.providers = lang_1.normalizeBlank(providers); - this.viewProviders = lang_1.normalizeBlank(viewProviders); - this.queries = lang_1.normalizeBlank(queries); - this.viewQueries = lang_1.normalizeBlank(viewQueries); - this.template = template; - } - CompileDirectiveMetadata.create = function(_a) { - var _b = _a === void 0 ? {} : _a, - type = _b.type, - isComponent = _b.isComponent, - dynamicLoadable = _b.dynamicLoadable, - selector = _b.selector, - exportAs = _b.exportAs, - changeDetection = _b.changeDetection, - inputs = _b.inputs, - outputs = _b.outputs, - host = _b.host, - lifecycleHooks = _b.lifecycleHooks, - providers = _b.providers, - viewProviders = _b.viewProviders, - queries = _b.queries, - viewQueries = _b.viewQueries, - template = _b.template; - var hostListeners = {}; - var hostProperties = {}; - var hostAttributes = {}; - if (lang_1.isPresent(host)) { - collection_1.StringMapWrapper.forEach(host, function(value, key) { - var matches = lang_1.RegExpWrapper.firstMatch(HOST_REG_EXP, key); - if (lang_1.isBlank(matches)) { - hostAttributes[key] = value; - } else if (lang_1.isPresent(matches[1])) { - hostProperties[matches[1]] = value; - } else if (lang_1.isPresent(matches[2])) { - hostListeners[matches[2]] = value; - } - }); - } - var inputsMap = {}; - if (lang_1.isPresent(inputs)) { - inputs.forEach(function(bindConfig) { - var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); - inputsMap[parts[0]] = parts[1]; - }); - } - var outputsMap = {}; - if (lang_1.isPresent(outputs)) { - outputs.forEach(function(bindConfig) { - var parts = util_1.splitAtColon(bindConfig, [bindConfig, bindConfig]); - outputsMap[parts[0]] = parts[1]; - }); - } - return new CompileDirectiveMetadata({ - type: type, - isComponent: lang_1.normalizeBool(isComponent), - dynamicLoadable: lang_1.normalizeBool(dynamicLoadable), - selector: selector, - exportAs: exportAs, - changeDetection: changeDetection, - inputs: inputsMap, - outputs: outputsMap, - hostListeners: hostListeners, - hostProperties: hostProperties, - hostAttributes: hostAttributes, - lifecycleHooks: lang_1.isPresent(lifecycleHooks) ? lifecycleHooks : [], - providers: providers, - viewProviders: viewProviders, - queries: queries, - viewQueries: viewQueries, - template: template - }); - }; - Object.defineProperty(CompileDirectiveMetadata.prototype, "identifier", { - get: function() { - return this.type; - }, - enumerable: true, - configurable: true - }); - CompileDirectiveMetadata.fromJson = function(data) { - return new CompileDirectiveMetadata({ - isComponent: data['isComponent'], - dynamicLoadable: data['dynamicLoadable'], - selector: data['selector'], - exportAs: data['exportAs'], - type: lang_1.isPresent(data['type']) ? CompileTypeMetadata.fromJson(data['type']) : data['type'], - changeDetection: lang_1.isPresent(data['changeDetection']) ? change_detection_1.CHANGE_DETECTION_STRATEGY_VALUES[data['changeDetection']] : data['changeDetection'], - inputs: data['inputs'], - outputs: data['outputs'], - hostListeners: data['hostListeners'], - hostProperties: data['hostProperties'], - hostAttributes: data['hostAttributes'], - lifecycleHooks: data['lifecycleHooks'].map(function(hookValue) { - return interfaces_1.LIFECYCLE_HOOKS_VALUES[hookValue]; - }), - template: lang_1.isPresent(data['template']) ? CompileTemplateMetadata.fromJson(data['template']) : data['template'], - providers: arrayFromJson(data['providers'], metadataFromJson), - viewProviders: arrayFromJson(data['viewProviders'], metadataFromJson), - queries: arrayFromJson(data['queries'], CompileQueryMetadata.fromJson), - viewQueries: arrayFromJson(data['viewQueries'], CompileQueryMetadata.fromJson) - }); - }; - CompileDirectiveMetadata.prototype.toJson = function() { - return { - 'class': 'Directive', - 'isComponent': this.isComponent, - 'dynamicLoadable': this.dynamicLoadable, - 'selector': this.selector, - 'exportAs': this.exportAs, - 'type': lang_1.isPresent(this.type) ? this.type.toJson() : this.type, - 'changeDetection': lang_1.isPresent(this.changeDetection) ? lang_1.serializeEnum(this.changeDetection) : this.changeDetection, - 'inputs': this.inputs, - 'outputs': this.outputs, - 'hostListeners': this.hostListeners, - 'hostProperties': this.hostProperties, - 'hostAttributes': this.hostAttributes, - 'lifecycleHooks': this.lifecycleHooks.map(function(hook) { - return lang_1.serializeEnum(hook); - }), - 'template': lang_1.isPresent(this.template) ? this.template.toJson() : this.template, - 'providers': arrayToJson(this.providers), - 'viewProviders': arrayToJson(this.viewProviders), - 'queries': arrayToJson(this.queries), - 'viewQueries': arrayToJson(this.viewQueries) - }; - }; - return CompileDirectiveMetadata; - }()); - exports.CompileDirectiveMetadata = CompileDirectiveMetadata; - function createHostComponentMeta(componentType, componentSelector) { - var template = selector_1.CssSelector.parse(componentSelector)[0].getMatchingElementTemplate(); - return CompileDirectiveMetadata.create({ - type: new CompileTypeMetadata({ - runtime: Object, - name: "Host" + componentType.name, - moduleUrl: componentType.moduleUrl, - isHost: true - }), - template: new CompileTemplateMetadata({ - template: template, - templateUrl: '', - styles: [], - styleUrls: [], - ngContentSelectors: [] - }), - changeDetection: change_detection_1.ChangeDetectionStrategy.Default, - inputs: [], - outputs: [], - host: {}, - lifecycleHooks: [], - isComponent: true, - dynamicLoadable: false, - selector: '*', - providers: [], - viewProviders: [], - queries: [], - viewQueries: [] - }); - } - exports.createHostComponentMeta = createHostComponentMeta; - var CompilePipeMetadata = (function() { - function CompilePipeMetadata(_a) { - var _b = _a === void 0 ? {} : _a, - type = _b.type, - name = _b.name, - pure = _b.pure; - this.type = type; - this.name = name; - this.pure = lang_1.normalizeBool(pure); - } - Object.defineProperty(CompilePipeMetadata.prototype, "identifier", { - get: function() { - return this.type; - }, - enumerable: true, - configurable: true - }); - CompilePipeMetadata.fromJson = function(data) { - return new CompilePipeMetadata({ - type: lang_1.isPresent(data['type']) ? CompileTypeMetadata.fromJson(data['type']) : data['type'], - name: data['name'], - pure: data['pure'] - }); - }; - CompilePipeMetadata.prototype.toJson = function() { - return { - 'class': 'Pipe', - 'type': lang_1.isPresent(this.type) ? this.type.toJson() : null, - 'name': this.name, - 'pure': this.pure - }; - }; - return CompilePipeMetadata; - }()); - exports.CompilePipeMetadata = CompilePipeMetadata; - var _COMPILE_METADATA_FROM_JSON = { - 'Directive': CompileDirectiveMetadata.fromJson, - 'Pipe': CompilePipeMetadata.fromJson, - 'Type': CompileTypeMetadata.fromJson, - 'Provider': CompileProviderMetadata.fromJson, - 'Identifier': CompileIdentifierMetadata.fromJson, - 'Factory': CompileFactoryMetadata.fromJson - }; - function arrayFromJson(obj, fn) { - return lang_1.isBlank(obj) ? null : obj.map(function(o) { - return objFromJson(o, fn); - }); - } - function arrayToJson(obj) { - return lang_1.isBlank(obj) ? null : obj.map(objToJson); - } - function objFromJson(obj, fn) { - if (lang_1.isArray(obj)) - return arrayFromJson(obj, fn); - if (lang_1.isString(obj) || lang_1.isBlank(obj) || lang_1.isBoolean(obj) || lang_1.isNumber(obj)) - return obj; - return fn(obj); - } - function objToJson(obj) { - if (lang_1.isArray(obj)) - return arrayToJson(obj); - if (lang_1.isString(obj) || lang_1.isBlank(obj) || lang_1.isBoolean(obj) || lang_1.isNumber(obj)) - return obj; - return obj.toJson(); - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/change_detector_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/change_detection/change_detection_jit_generator", "angular2/src/core/change_detection/abstract_change_detector", "angular2/src/core/change_detection/change_detection_util", "angular2/src/core/change_detection/constants", "angular2/src/compiler/change_definition_factory", "angular2/src/facade/lang", "angular2/src/core/change_detection/change_detection", "angular2/src/transform/template_compiler/change_detector_codegen", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var source_module_1 = require("angular2/src/compiler/source_module"); - var change_detection_jit_generator_1 = require("angular2/src/core/change_detection/change_detection_jit_generator"); - var abstract_change_detector_1 = require("angular2/src/core/change_detection/abstract_change_detector"); - var change_detection_util_1 = require("angular2/src/core/change_detection/change_detection_util"); - var constants_1 = require("angular2/src/core/change_detection/constants"); - var change_definition_factory_1 = require("angular2/src/compiler/change_definition_factory"); - var lang_1 = require("angular2/src/facade/lang"); - var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); - var change_detector_codegen_1 = require("angular2/src/transform/template_compiler/change_detector_codegen"); - var util_1 = require("angular2/src/compiler/util"); - var di_1 = require("angular2/src/core/di"); - var ABSTRACT_CHANGE_DETECTOR = "AbstractChangeDetector"; - var UTIL = "ChangeDetectionUtil"; - var CHANGE_DETECTOR_STATE = "ChangeDetectorState"; - exports.CHANGE_DETECTION_JIT_IMPORTS = lang_1.CONST_EXPR({ - 'AbstractChangeDetector': abstract_change_detector_1.AbstractChangeDetector, - 'ChangeDetectionUtil': change_detection_util_1.ChangeDetectionUtil, - 'ChangeDetectorState': constants_1.ChangeDetectorState - }); - var ABSTRACT_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/abstract_change_detector" + util_1.MODULE_SUFFIX); - var UTIL_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/change_detection_util" + util_1.MODULE_SUFFIX); - var PREGEN_PROTO_CHANGE_DETECTOR_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/pregen_proto_change_detector" + util_1.MODULE_SUFFIX); - var CONSTANTS_MODULE = source_module_1.moduleRef("package:angular2/src/core/change_detection/constants" + util_1.MODULE_SUFFIX); - var ChangeDetectionCompiler = (function() { - function ChangeDetectionCompiler(_genConfig) { - this._genConfig = _genConfig; - } - ChangeDetectionCompiler.prototype.compileComponentRuntime = function(componentType, strategy, parsedTemplate) { - var _this = this; - var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); - return changeDetectorDefinitions.map(function(definition) { - return _this._createChangeDetectorFactory(definition); - }); - }; - ChangeDetectionCompiler.prototype._createChangeDetectorFactory = function(definition) { - var proto = new change_detection_1.DynamicProtoChangeDetector(definition); - return function() { - return proto.instantiate(); - }; - }; - ChangeDetectionCompiler.prototype.compileComponentCodeGen = function(componentType, strategy, parsedTemplate) { - var changeDetectorDefinitions = change_definition_factory_1.createChangeDetectorDefinitions(componentType, strategy, this._genConfig, parsedTemplate); - var factories = []; - var index = 0; - var sourceParts = changeDetectorDefinitions.map(function(definition) { - var codegen; - var sourcePart; - if (lang_1.IS_DART) { - codegen = new change_detector_codegen_1.Codegen(PREGEN_PROTO_CHANGE_DETECTOR_MODULE); - var className = "_" + definition.id; - var typeRef = (index === 0 && componentType.isHost) ? 'dynamic' : "" + source_module_1.moduleRef(componentType.moduleUrl) + componentType.name; - codegen.generate(typeRef, className, definition); - factories.push(className + ".newChangeDetector"); - sourcePart = codegen.toString(); - } else { - codegen = new change_detection_jit_generator_1.ChangeDetectorJITGenerator(definition, "" + UTIL_MODULE + UTIL, "" + ABSTRACT_CHANGE_DETECTOR_MODULE + ABSTRACT_CHANGE_DETECTOR, "" + CONSTANTS_MODULE + CHANGE_DETECTOR_STATE); - factories.push("function() { return new " + codegen.typeName + "(); }"); - sourcePart = codegen.generateSource(); - } - index++; - return sourcePart; - }); - return new source_module_1.SourceExpressions(sourceParts, factories); - }; - ChangeDetectionCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [change_detection_1.ChangeDetectorGenConfig])], ChangeDetectionCompiler); - return ChangeDetectionCompiler; - }()); - exports.ChangeDetectionCompiler = ChangeDetectionCompiler; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/style_compiler", ["angular2/src/compiler/source_module", "angular2/src/core/metadata/view", "angular2/src/compiler/xhr", "angular2/src/facade/lang", "angular2/src/facade/async", "angular2/src/compiler/shadow_css", "angular2/src/compiler/url_resolver", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/util", "angular2/src/core/di"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var source_module_1 = require("angular2/src/compiler/source_module"); - var view_1 = require("angular2/src/core/metadata/view"); - var xhr_1 = require("angular2/src/compiler/xhr"); - var lang_1 = require("angular2/src/facade/lang"); - var async_1 = require("angular2/src/facade/async"); - var shadow_css_1 = require("angular2/src/compiler/shadow_css"); - var url_resolver_1 = require("angular2/src/compiler/url_resolver"); - var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); - var util_1 = require("angular2/src/compiler/util"); - var di_1 = require("angular2/src/core/di"); - var COMPONENT_VARIABLE = '%COMP%'; - var HOST_ATTR = "_nghost-" + COMPONENT_VARIABLE; - var CONTENT_ATTR = "_ngcontent-" + COMPONENT_VARIABLE; - var StyleCompiler = (function() { - function StyleCompiler(_xhr, _urlResolver) { - this._xhr = _xhr; - this._urlResolver = _urlResolver; - this._styleCache = new Map(); - this._shadowCss = new shadow_css_1.ShadowCss(); - } - StyleCompiler.prototype.compileComponentRuntime = function(template) { - var styles = template.styles; - var styleAbsUrls = template.styleUrls; - return this._loadStyles(styles, styleAbsUrls, template.encapsulation === view_1.ViewEncapsulation.Emulated); - }; - StyleCompiler.prototype.compileComponentCodeGen = function(template) { - var shim = template.encapsulation === view_1.ViewEncapsulation.Emulated; - return this._styleCodeGen(template.styles, template.styleUrls, shim); - }; - StyleCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { - var styleWithImports = style_url_resolver_1.extractStyleUrls(this._urlResolver, stylesheetUrl, cssText); - return [this._styleModule(stylesheetUrl, false, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, false)), this._styleModule(stylesheetUrl, true, this._styleCodeGen([styleWithImports.style], styleWithImports.styleUrls, true))]; - }; - StyleCompiler.prototype.clearCache = function() { - this._styleCache.clear(); - }; - StyleCompiler.prototype._loadStyles = function(plainStyles, absUrls, encapsulate) { - var _this = this; - var promises = absUrls.map(function(absUrl) { - var cacheKey = "" + absUrl + (encapsulate ? '.shim' : ''); - var result = _this._styleCache.get(cacheKey); - if (lang_1.isBlank(result)) { - result = _this._xhr.get(absUrl).then(function(style) { - var styleWithImports = style_url_resolver_1.extractStyleUrls(_this._urlResolver, absUrl, style); - return _this._loadStyles([styleWithImports.style], styleWithImports.styleUrls, encapsulate); - }); - _this._styleCache.set(cacheKey, result); - } - return result; - }); - return async_1.PromiseWrapper.all(promises).then(function(nestedStyles) { - var result = plainStyles.map(function(plainStyle) { - return _this._shimIfNeeded(plainStyle, encapsulate); - }); - nestedStyles.forEach(function(styles) { - return result.push(styles); - }); - return result; - }); - }; - StyleCompiler.prototype._styleCodeGen = function(plainStyles, absUrls, shim) { - var _this = this; - var arrayPrefix = lang_1.IS_DART ? "const" : ''; - var styleExpressions = plainStyles.map(function(plainStyle) { - return util_1.escapeSingleQuoteString(_this._shimIfNeeded(plainStyle, shim)); - }); - for (var i = 0; i < absUrls.length; i++) { - var moduleUrl = this._createModuleUrl(absUrls[i], shim); - styleExpressions.push(source_module_1.moduleRef(moduleUrl) + "STYLES"); - } - var expressionSource = arrayPrefix + " [" + styleExpressions.join(',') + "]"; - return new source_module_1.SourceExpression([], expressionSource); - }; - StyleCompiler.prototype._styleModule = function(stylesheetUrl, shim, expression) { - var moduleSource = "\n " + expression.declarations.join('\n') + "\n " + util_1.codeGenExportVariable('STYLES') + expression.expression + ";\n "; - return new source_module_1.SourceModule(this._createModuleUrl(stylesheetUrl, shim), moduleSource); - }; - StyleCompiler.prototype._shimIfNeeded = function(style, shim) { - return shim ? this._shadowCss.shimCssText(style, CONTENT_ATTR, HOST_ATTR) : style; - }; - StyleCompiler.prototype._createModuleUrl = function(stylesheetUrl, shim) { - return shim ? stylesheetUrl + ".shim" + util_1.MODULE_SUFFIX : "" + stylesheetUrl + util_1.MODULE_SUFFIX; - }; - StyleCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [xhr_1.XHR, url_resolver_1.UrlResolver])], StyleCompiler); - return StyleCompiler; - }()); - exports.StyleCompiler = StyleCompiler; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/view_compiler", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/compiler/template_ast", "angular2/src/compiler/source_module", "angular2/src/core/linker/view", "angular2/src/core/linker/view_type", "angular2/src/core/linker/element", "angular2/src/core/metadata/view", "angular2/src/compiler/util", "angular2/src/core/di", "angular2/src/compiler/proto_view_compiler"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var template_ast_1 = require("angular2/src/compiler/template_ast"); - var source_module_1 = require("angular2/src/compiler/source_module"); - var view_1 = require("angular2/src/core/linker/view"); - var view_type_1 = require("angular2/src/core/linker/view_type"); - var element_1 = require("angular2/src/core/linker/element"); - var view_2 = require("angular2/src/core/metadata/view"); - var util_1 = require("angular2/src/compiler/util"); - var di_1 = require("angular2/src/core/di"); - var proto_view_compiler_1 = require("angular2/src/compiler/proto_view_compiler"); - exports.VIEW_JIT_IMPORTS = lang_1.CONST_EXPR({ - 'AppView': view_1.AppView, - 'AppElement': element_1.AppElement, - 'flattenNestedViewRenderNodes': view_1.flattenNestedViewRenderNodes, - 'checkSlotCount': view_1.checkSlotCount - }); - var ViewCompiler = (function() { - function ViewCompiler() {} - ViewCompiler.prototype.compileComponentRuntime = function(component, template, styles, protoViews, changeDetectorFactories, componentViewFactory) { - var viewFactory = new RuntimeViewFactory(component, styles, protoViews, changeDetectorFactories, componentViewFactory); - return viewFactory.createViewFactory(template, 0, []); - }; - ViewCompiler.prototype.compileComponentCodeGen = function(component, template, styles, protoViews, changeDetectorFactoryExpressions, componentViewFactory) { - var viewFactory = new CodeGenViewFactory(component, styles, protoViews, changeDetectorFactoryExpressions, componentViewFactory); - var targetStatements = []; - var viewFactoryExpression = viewFactory.createViewFactory(template, 0, targetStatements); - return new source_module_1.SourceExpression(targetStatements.map(function(stmt) { - return stmt.statement; - }), viewFactoryExpression.expression); - }; - ViewCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], ViewCompiler); - return ViewCompiler; - }()); - exports.ViewCompiler = ViewCompiler; - var CodeGenViewFactory = (function() { - function CodeGenViewFactory(component, styles, protoViews, changeDetectorExpressions, componentViewFactory) { - this.component = component; - this.styles = styles; - this.protoViews = protoViews; - this.changeDetectorExpressions = changeDetectorExpressions; - this.componentViewFactory = componentViewFactory; - this._nextVarId = 0; - } - CodeGenViewFactory.prototype._nextVar = function(prefix) { - return "" + prefix + this._nextVarId++ + "_" + this.component.type.name; - }; - CodeGenViewFactory.prototype._nextRenderVar = function() { - return this._nextVar('render'); - }; - CodeGenViewFactory.prototype._nextAppVar = function() { - return this._nextVar('app'); - }; - CodeGenViewFactory.prototype._nextDisposableVar = function() { - return "disposable" + this._nextVarId++ + "_" + this.component.type.name; - }; - CodeGenViewFactory.prototype.createText = function(renderer, parent, text, targetStatements) { - var varName = this._nextRenderVar(); - var statement = "var " + varName + " = " + renderer.expression + ".createText(" + (lang_1.isPresent(parent) ? parent.expression : null) + ", " + util_1.escapeSingleQuoteString(text) + ");"; - targetStatements.push(new util_1.Statement(statement)); - return new util_1.Expression(varName); - }; - CodeGenViewFactory.prototype.createElement = function(renderer, parentRenderNode, name, rootSelector, targetStatements) { - var varName = this._nextRenderVar(); - var valueExpr; - if (lang_1.isPresent(rootSelector)) { - valueExpr = rootSelector.expression + " == null ?\n " + renderer.expression + ".createElement(" + (lang_1.isPresent(parentRenderNode) ? parentRenderNode.expression : null) + ", " + util_1.escapeSingleQuoteString(name) + ") :\n " + renderer.expression + ".selectRootElement(" + rootSelector.expression + ");"; - } else { - valueExpr = renderer.expression + ".createElement(" + (lang_1.isPresent(parentRenderNode) ? parentRenderNode.expression : null) + ", " + util_1.escapeSingleQuoteString(name) + ")"; - } - var statement = "var " + varName + " = " + valueExpr + ";"; - targetStatements.push(new util_1.Statement(statement)); - return new util_1.Expression(varName); - }; - CodeGenViewFactory.prototype.createTemplateAnchor = function(renderer, parentRenderNode, targetStatements) { - var varName = this._nextRenderVar(); - var valueExpr = renderer.expression + ".createTemplateAnchor(" + (lang_1.isPresent(parentRenderNode) ? parentRenderNode.expression : null) + ");"; - targetStatements.push(new util_1.Statement("var " + varName + " = " + valueExpr)); - return new util_1.Expression(varName); - }; - CodeGenViewFactory.prototype.createGlobalEventListener = function(renderer, appView, boundElementIndex, eventAst, targetStatements) { - var disposableVar = this._nextDisposableVar(); - var eventHandlerExpr = codeGenEventHandler(appView, boundElementIndex, eventAst.fullName); - targetStatements.push(new util_1.Statement("var " + disposableVar + " = " + renderer.expression + ".listenGlobal(" + util_1.escapeValue(eventAst.target) + ", " + util_1.escapeValue(eventAst.name) + ", " + eventHandlerExpr + ");")); - return new util_1.Expression(disposableVar); - }; - CodeGenViewFactory.prototype.createElementEventListener = function(renderer, appView, boundElementIndex, renderNode, eventAst, targetStatements) { - var disposableVar = this._nextDisposableVar(); - var eventHandlerExpr = codeGenEventHandler(appView, boundElementIndex, eventAst.fullName); - targetStatements.push(new util_1.Statement("var " + disposableVar + " = " + renderer.expression + ".listen(" + renderNode.expression + ", " + util_1.escapeValue(eventAst.name) + ", " + eventHandlerExpr + ");")); - return new util_1.Expression(disposableVar); - }; - CodeGenViewFactory.prototype.setElementAttribute = function(renderer, renderNode, attrName, attrValue, targetStatements) { - targetStatements.push(new util_1.Statement(renderer.expression + ".setElementAttribute(" + renderNode.expression + ", " + util_1.escapeSingleQuoteString(attrName) + ", " + util_1.escapeSingleQuoteString(attrValue) + ");")); - }; - CodeGenViewFactory.prototype.createAppElement = function(appProtoEl, appView, renderNode, parentAppEl, embeddedViewFactory, targetStatements) { - var appVar = this._nextAppVar(); - var varValue = "new " + proto_view_compiler_1.APP_EL_MODULE_REF + "AppElement(" + appProtoEl.expression + ", " + appView.expression + ",\n " + (lang_1.isPresent(parentAppEl) ? parentAppEl.expression : null) + ", " + renderNode.expression + ", " + (lang_1.isPresent(embeddedViewFactory) ? embeddedViewFactory.expression : null) + ")"; - targetStatements.push(new util_1.Statement("var " + appVar + " = " + varValue + ";")); - return new util_1.Expression(appVar); - }; - CodeGenViewFactory.prototype.createAndSetComponentView = function(renderer, viewManager, view, appEl, component, contentNodesByNgContentIndex, targetStatements) { - var codeGenContentNodes; - if (this.component.type.isHost) { - codeGenContentNodes = view.expression + ".projectableNodes"; - } else { - codeGenContentNodes = "[" + contentNodesByNgContentIndex.map(function(nodes) { - return util_1.codeGenFlatArray(nodes); - }).join(',') + "]"; - } - targetStatements.push(new util_1.Statement(this.componentViewFactory(component) + "(" + renderer.expression + ", " + viewManager.expression + ", " + appEl.expression + ", " + codeGenContentNodes + ", null, null, null);")); - }; - CodeGenViewFactory.prototype.getProjectedNodes = function(projectableNodes, ngContentIndex) { - return new util_1.Expression(projectableNodes.expression + "[" + ngContentIndex + "]", true); - }; - CodeGenViewFactory.prototype.appendProjectedNodes = function(renderer, parent, nodes, targetStatements) { - targetStatements.push(new util_1.Statement(renderer.expression + ".projectNodes(" + parent.expression + ", " + proto_view_compiler_1.APP_VIEW_MODULE_REF + "flattenNestedViewRenderNodes(" + nodes.expression + "));")); - }; - CodeGenViewFactory.prototype.createViewFactory = function(asts, embeddedTemplateIndex, targetStatements) { - var compileProtoView = this.protoViews[embeddedTemplateIndex]; - var isHostView = this.component.type.isHost; - var isComponentView = embeddedTemplateIndex === 0 && !isHostView; - var visitor = new ViewBuilderVisitor(new util_1.Expression('renderer'), new util_1.Expression('viewManager'), new util_1.Expression('projectableNodes'), isHostView ? new util_1.Expression('rootSelector') : null, new util_1.Expression('view'), compileProtoView, targetStatements, this); - template_ast_1.templateVisitAll(visitor, asts, new ParentElement(isComponentView ? new util_1.Expression('parentRenderNode') : null, null, null)); - var appProtoView = compileProtoView.protoView.expression; - var viewFactoryName = codeGenViewFactoryName(this.component, embeddedTemplateIndex); - var changeDetectorFactory = this.changeDetectorExpressions.expressions[embeddedTemplateIndex]; - var factoryArgs = ['parentRenderer', 'viewManager', 'containerEl', 'projectableNodes', 'rootSelector', 'dynamicallyCreatedProviders', 'rootInjector']; - var initRendererStmts = []; - var rendererExpr = "parentRenderer"; - if (embeddedTemplateIndex === 0) { - var renderCompTypeVar = this._nextVar('renderType'); - targetStatements.push(new util_1.Statement("var " + renderCompTypeVar + " = null;")); - var stylesVar = this._nextVar('styles'); - targetStatements.push(new util_1.Statement(util_1.CONST_VAR + " " + stylesVar + " = " + this.styles.expression + ";")); - var encapsulation = this.component.template.encapsulation; - initRendererStmts.push("if (" + renderCompTypeVar + " == null) {\n " + renderCompTypeVar + " = viewManager.createRenderComponentType(" + codeGenViewEncapsulation(encapsulation) + ", " + stylesVar + ");\n }"); - rendererExpr = "parentRenderer.renderComponent(" + renderCompTypeVar + ")"; - } - var statement = "\n" + util_1.codeGenFnHeader(factoryArgs, viewFactoryName) + "{\n " + initRendererStmts.join('\n') + "\n var renderer = " + rendererExpr + ";\n var view = new " + proto_view_compiler_1.APP_VIEW_MODULE_REF + "AppView(\n " + appProtoView + ", renderer, viewManager,\n projectableNodes,\n containerEl,\n dynamicallyCreatedProviders, rootInjector,\n " + changeDetectorFactory + "()\n );\n " + proto_view_compiler_1.APP_VIEW_MODULE_REF + "checkSlotCount(" + util_1.escapeValue(this.component.type.name) + ", " + this.component.template.ngContentSelectors.length + ", projectableNodes);\n " + (isComponentView ? 'var parentRenderNode = renderer.createViewRoot(view.containerAppElement.nativeElement);' : '') + "\n " + visitor.renderStmts.map(function(stmt) { - return stmt.statement; - }).join('\n') + "\n " + visitor.appStmts.map(function(stmt) { - return stmt.statement; - }).join('\n') + "\n\n view.init(" + util_1.codeGenFlatArray(visitor.rootNodesOrAppElements) + ", " + util_1.codeGenArray(visitor.renderNodes) + ", " + util_1.codeGenArray(visitor.appDisposables) + ",\n " + util_1.codeGenArray(visitor.appElements) + ");\n return view;\n}"; - targetStatements.push(new util_1.Statement(statement)); - return new util_1.Expression(viewFactoryName); - }; - return CodeGenViewFactory; - }()); - var RuntimeViewFactory = (function() { - function RuntimeViewFactory(component, styles, protoViews, changeDetectorFactories, componentViewFactory) { - this.component = component; - this.styles = styles; - this.protoViews = protoViews; - this.changeDetectorFactories = changeDetectorFactories; - this.componentViewFactory = componentViewFactory; - } - RuntimeViewFactory.prototype.createText = function(renderer, parent, text, targetStatements) { - return renderer.createText(parent, text); - }; - RuntimeViewFactory.prototype.createElement = function(renderer, parent, name, rootSelector, targetStatements) { - var el; - if (lang_1.isPresent(rootSelector)) { - el = renderer.selectRootElement(rootSelector); - } else { - el = renderer.createElement(parent, name); - } - return el; - }; - RuntimeViewFactory.prototype.createTemplateAnchor = function(renderer, parent, targetStatements) { - return renderer.createTemplateAnchor(parent); - }; - RuntimeViewFactory.prototype.createGlobalEventListener = function(renderer, appView, boundElementIndex, eventAst, targetStatements) { - return renderer.listenGlobal(eventAst.target, eventAst.name, function(event) { - return appView.triggerEventHandlers(eventAst.fullName, event, boundElementIndex); - }); - }; - RuntimeViewFactory.prototype.createElementEventListener = function(renderer, appView, boundElementIndex, renderNode, eventAst, targetStatements) { - return renderer.listen(renderNode, eventAst.name, function(event) { - return appView.triggerEventHandlers(eventAst.fullName, event, boundElementIndex); - }); - }; - RuntimeViewFactory.prototype.setElementAttribute = function(renderer, renderNode, attrName, attrValue, targetStatements) { - renderer.setElementAttribute(renderNode, attrName, attrValue); - }; - RuntimeViewFactory.prototype.createAppElement = function(appProtoEl, appView, renderNode, parentAppEl, embeddedViewFactory, targetStatements) { - return new element_1.AppElement(appProtoEl, appView, parentAppEl, renderNode, embeddedViewFactory); - }; - RuntimeViewFactory.prototype.createAndSetComponentView = function(renderer, viewManager, appView, appEl, component, contentNodesByNgContentIndex, targetStatements) { - var flattenedContentNodes; - if (this.component.type.isHost) { - flattenedContentNodes = appView.projectableNodes; - } else { - flattenedContentNodes = collection_1.ListWrapper.createFixedSize(contentNodesByNgContentIndex.length); - for (var i = 0; i < contentNodesByNgContentIndex.length; i++) { - flattenedContentNodes[i] = util_1.flattenArray(contentNodesByNgContentIndex[i], []); - } - } - this.componentViewFactory(component)(renderer, viewManager, appEl, flattenedContentNodes); - }; - RuntimeViewFactory.prototype.getProjectedNodes = function(projectableNodes, ngContentIndex) { - return projectableNodes[ngContentIndex]; - }; - RuntimeViewFactory.prototype.appendProjectedNodes = function(renderer, parent, nodes, targetStatements) { - renderer.projectNodes(parent, view_1.flattenNestedViewRenderNodes(nodes)); - }; - RuntimeViewFactory.prototype.createViewFactory = function(asts, embeddedTemplateIndex, targetStatements) { - var _this = this; - var compileProtoView = this.protoViews[embeddedTemplateIndex]; - var isComponentView = compileProtoView.protoView.type === view_type_1.ViewType.COMPONENT; - var renderComponentType = null; - return function(parentRenderer, viewManager, containerEl, projectableNodes, rootSelector, dynamicallyCreatedProviders, rootInjector) { - if (rootSelector === void 0) { - rootSelector = null; - } - if (dynamicallyCreatedProviders === void 0) { - dynamicallyCreatedProviders = null; - } - if (rootInjector === void 0) { - rootInjector = null; - } - view_1.checkSlotCount(_this.component.type.name, _this.component.template.ngContentSelectors.length, projectableNodes); - var renderer; - if (embeddedTemplateIndex === 0) { - if (lang_1.isBlank(renderComponentType)) { - renderComponentType = viewManager.createRenderComponentType(_this.component.template.encapsulation, _this.styles); - } - renderer = parentRenderer.renderComponent(renderComponentType); - } else { - renderer = parentRenderer; - } - var changeDetector = _this.changeDetectorFactories[embeddedTemplateIndex](); - var view = new view_1.AppView(compileProtoView.protoView, renderer, viewManager, projectableNodes, containerEl, dynamicallyCreatedProviders, rootInjector, changeDetector); - var visitor = new ViewBuilderVisitor(renderer, viewManager, projectableNodes, rootSelector, view, compileProtoView, [], _this); - var parentRenderNode = isComponentView ? renderer.createViewRoot(containerEl.nativeElement) : null; - template_ast_1.templateVisitAll(visitor, asts, new ParentElement(parentRenderNode, null, null)); - view.init(util_1.flattenArray(visitor.rootNodesOrAppElements, []), visitor.renderNodes, visitor.appDisposables, visitor.appElements); - return view; - }; - }; - return RuntimeViewFactory; - }()); - var ParentElement = (function() { - function ParentElement(renderNode, appEl, component) { - this.renderNode = renderNode; - this.appEl = appEl; - this.component = component; - if (lang_1.isPresent(component)) { - this.contentNodesByNgContentIndex = collection_1.ListWrapper.createFixedSize(component.template.ngContentSelectors.length); - for (var i = 0; i < this.contentNodesByNgContentIndex.length; i++) { - this.contentNodesByNgContentIndex[i] = []; - } - } else { - this.contentNodesByNgContentIndex = null; - } - } - ParentElement.prototype.addContentNode = function(ngContentIndex, nodeExpr) { - this.contentNodesByNgContentIndex[ngContentIndex].push(nodeExpr); - }; - return ParentElement; - }()); - var ViewBuilderVisitor = (function() { - function ViewBuilderVisitor(renderer, viewManager, projectableNodes, rootSelector, view, protoView, targetStatements, factory) { - this.renderer = renderer; - this.viewManager = viewManager; - this.projectableNodes = projectableNodes; - this.rootSelector = rootSelector; - this.view = view; - this.protoView = protoView; - this.targetStatements = targetStatements; - this.factory = factory; - this.renderStmts = []; - this.renderNodes = []; - this.appStmts = []; - this.appElements = []; - this.appDisposables = []; - this.rootNodesOrAppElements = []; - this.elementCount = 0; - } - ViewBuilderVisitor.prototype._addRenderNode = function(renderNode, appEl, ngContentIndex, parent) { - this.renderNodes.push(renderNode); - if (lang_1.isPresent(parent.component)) { - if (lang_1.isPresent(ngContentIndex)) { - parent.addContentNode(ngContentIndex, lang_1.isPresent(appEl) ? appEl : renderNode); - } - } else if (lang_1.isBlank(parent.renderNode)) { - this.rootNodesOrAppElements.push(lang_1.isPresent(appEl) ? appEl : renderNode); - } - }; - ViewBuilderVisitor.prototype._getParentRenderNode = function(ngContentIndex, parent) { - return lang_1.isPresent(parent.component) && parent.component.template.encapsulation !== view_2.ViewEncapsulation.Native ? null : parent.renderNode; - }; - ViewBuilderVisitor.prototype.visitBoundText = function(ast, parent) { - return this._visitText('', ast.ngContentIndex, parent); - }; - ViewBuilderVisitor.prototype.visitText = function(ast, parent) { - return this._visitText(ast.value, ast.ngContentIndex, parent); - }; - ViewBuilderVisitor.prototype._visitText = function(value, ngContentIndex, parent) { - var renderNode = this.factory.createText(this.renderer, this._getParentRenderNode(ngContentIndex, parent), value, this.renderStmts); - this._addRenderNode(renderNode, null, ngContentIndex, parent); - return null; - }; - ViewBuilderVisitor.prototype.visitNgContent = function(ast, parent) { - var nodesExpression = this.factory.getProjectedNodes(this.projectableNodes, ast.index); - if (lang_1.isPresent(parent.component)) { - if (lang_1.isPresent(ast.ngContentIndex)) { - parent.addContentNode(ast.ngContentIndex, nodesExpression); - } - } else { - if (lang_1.isPresent(parent.renderNode)) { - this.factory.appendProjectedNodes(this.renderer, parent.renderNode, nodesExpression, this.renderStmts); - } else { - this.rootNodesOrAppElements.push(nodesExpression); - } - } - return null; - }; - ViewBuilderVisitor.prototype.visitElement = function(ast, parent) { - var _this = this; - var renderNode = this.factory.createElement(this.renderer, this._getParentRenderNode(ast.ngContentIndex, parent), ast.name, this.rootSelector, this.renderStmts); - var component = ast.getComponent(); - var elementIndex = this.elementCount++; - var protoEl = this.protoView.protoElements[elementIndex]; - protoEl.renderEvents.forEach(function(eventAst) { - var disposable; - if (lang_1.isPresent(eventAst.target)) { - disposable = _this.factory.createGlobalEventListener(_this.renderer, _this.view, protoEl.boundElementIndex, eventAst, _this.renderStmts); - } else { - disposable = _this.factory.createElementEventListener(_this.renderer, _this.view, protoEl.boundElementIndex, renderNode, eventAst, _this.renderStmts); - } - _this.appDisposables.push(disposable); - }); - for (var i = 0; i < protoEl.attrNameAndValues.length; i++) { - var attrName = protoEl.attrNameAndValues[i][0]; - var attrValue = protoEl.attrNameAndValues[i][1]; - this.factory.setElementAttribute(this.renderer, renderNode, attrName, attrValue, this.renderStmts); - } - var appEl = null; - if (lang_1.isPresent(protoEl.appProtoEl)) { - appEl = this.factory.createAppElement(protoEl.appProtoEl, this.view, renderNode, parent.appEl, null, this.appStmts); - this.appElements.push(appEl); - } - this._addRenderNode(renderNode, appEl, ast.ngContentIndex, parent); - var newParent = new ParentElement(renderNode, lang_1.isPresent(appEl) ? appEl : parent.appEl, component); - template_ast_1.templateVisitAll(this, ast.children, newParent); - if (lang_1.isPresent(appEl) && lang_1.isPresent(component)) { - this.factory.createAndSetComponentView(this.renderer, this.viewManager, this.view, appEl, component, newParent.contentNodesByNgContentIndex, this.appStmts); - } - return null; - }; - ViewBuilderVisitor.prototype.visitEmbeddedTemplate = function(ast, parent) { - var renderNode = this.factory.createTemplateAnchor(this.renderer, this._getParentRenderNode(ast.ngContentIndex, parent), this.renderStmts); - var elementIndex = this.elementCount++; - var protoEl = this.protoView.protoElements[elementIndex]; - var embeddedViewFactory = this.factory.createViewFactory(ast.children, protoEl.embeddedTemplateIndex, this.targetStatements); - var appEl = this.factory.createAppElement(protoEl.appProtoEl, this.view, renderNode, parent.appEl, embeddedViewFactory, this.appStmts); - this._addRenderNode(renderNode, appEl, ast.ngContentIndex, parent); - this.appElements.push(appEl); - return null; - }; - ViewBuilderVisitor.prototype.visitVariable = function(ast, ctx) { - return null; - }; - ViewBuilderVisitor.prototype.visitAttr = function(ast, ctx) { - return null; - }; - ViewBuilderVisitor.prototype.visitDirective = function(ast, ctx) { - return null; - }; - ViewBuilderVisitor.prototype.visitEvent = function(ast, ctx) { - return null; - }; - ViewBuilderVisitor.prototype.visitDirectiveProperty = function(ast, context) { - return null; - }; - ViewBuilderVisitor.prototype.visitElementProperty = function(ast, context) { - return null; - }; - return ViewBuilderVisitor; - }()); - function codeGenEventHandler(view, boundElementIndex, eventName) { - return util_1.codeGenValueFn(['event'], view.expression + ".triggerEventHandlers(" + util_1.escapeValue(eventName) + ", event, " + boundElementIndex + ")"); - } - function codeGenViewFactoryName(component, embeddedTemplateIndex) { - return "viewFactory_" + component.type.name + embeddedTemplateIndex; - } - function codeGenViewEncapsulation(value) { - if (lang_1.IS_DART) { - return "" + proto_view_compiler_1.METADATA_MODULE_REF + value; - } else { - return "" + value; - } - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/html_lexer", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/compiler/parse_util", "angular2/src/compiler/html_tags"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var parse_util_1 = require("angular2/src/compiler/parse_util"); - var html_tags_1 = require("angular2/src/compiler/html_tags"); - (function(HtmlTokenType) { - HtmlTokenType[HtmlTokenType["TAG_OPEN_START"] = 0] = "TAG_OPEN_START"; - HtmlTokenType[HtmlTokenType["TAG_OPEN_END"] = 1] = "TAG_OPEN_END"; - HtmlTokenType[HtmlTokenType["TAG_OPEN_END_VOID"] = 2] = "TAG_OPEN_END_VOID"; - HtmlTokenType[HtmlTokenType["TAG_CLOSE"] = 3] = "TAG_CLOSE"; - HtmlTokenType[HtmlTokenType["TEXT"] = 4] = "TEXT"; - HtmlTokenType[HtmlTokenType["ESCAPABLE_RAW_TEXT"] = 5] = "ESCAPABLE_RAW_TEXT"; - HtmlTokenType[HtmlTokenType["RAW_TEXT"] = 6] = "RAW_TEXT"; - HtmlTokenType[HtmlTokenType["COMMENT_START"] = 7] = "COMMENT_START"; - HtmlTokenType[HtmlTokenType["COMMENT_END"] = 8] = "COMMENT_END"; - HtmlTokenType[HtmlTokenType["CDATA_START"] = 9] = "CDATA_START"; - HtmlTokenType[HtmlTokenType["CDATA_END"] = 10] = "CDATA_END"; - HtmlTokenType[HtmlTokenType["ATTR_NAME"] = 11] = "ATTR_NAME"; - HtmlTokenType[HtmlTokenType["ATTR_VALUE"] = 12] = "ATTR_VALUE"; - HtmlTokenType[HtmlTokenType["DOC_TYPE"] = 13] = "DOC_TYPE"; - HtmlTokenType[HtmlTokenType["EOF"] = 14] = "EOF"; - })(exports.HtmlTokenType || (exports.HtmlTokenType = {})); - var HtmlTokenType = exports.HtmlTokenType; - var HtmlToken = (function() { - function HtmlToken(type, parts, sourceSpan) { - this.type = type; - this.parts = parts; - this.sourceSpan = sourceSpan; - } - return HtmlToken; - }()); - exports.HtmlToken = HtmlToken; - var HtmlTokenError = (function(_super) { - __extends(HtmlTokenError, _super); - function HtmlTokenError(errorMsg, tokenType, span) { - _super.call(this, span, errorMsg); - this.tokenType = tokenType; - } - return HtmlTokenError; - }(parse_util_1.ParseError)); - exports.HtmlTokenError = HtmlTokenError; - var HtmlTokenizeResult = (function() { - function HtmlTokenizeResult(tokens, errors) { - this.tokens = tokens; - this.errors = errors; - } - return HtmlTokenizeResult; - }()); - exports.HtmlTokenizeResult = HtmlTokenizeResult; - function tokenizeHtml(sourceContent, sourceUrl) { - return new _HtmlTokenizer(new parse_util_1.ParseSourceFile(sourceContent, sourceUrl)).tokenize(); - } - exports.tokenizeHtml = tokenizeHtml; - var $EOF = 0; - var $TAB = 9; - var $LF = 10; - var $FF = 12; - var $CR = 13; - var $SPACE = 32; - var $BANG = 33; - var $DQ = 34; - var $HASH = 35; - var $$ = 36; - var $AMPERSAND = 38; - var $SQ = 39; - var $MINUS = 45; - var $SLASH = 47; - var $0 = 48; - var $SEMICOLON = 59; - var $9 = 57; - var $COLON = 58; - var $LT = 60; - var $EQ = 61; - var $GT = 62; - var $QUESTION = 63; - var $LBRACKET = 91; - var $RBRACKET = 93; - var $A = 65; - var $F = 70; - var $X = 88; - var $Z = 90; - var $a = 97; - var $f = 102; - var $z = 122; - var $x = 120; - var $NBSP = 160; - var CR_OR_CRLF_REGEXP = /\r\n?/g; - function unexpectedCharacterErrorMsg(charCode) { - var char = charCode === $EOF ? 'EOF' : lang_1.StringWrapper.fromCharCode(charCode); - return "Unexpected character \"" + char + "\""; - } - function unknownEntityErrorMsg(entitySrc) { - return "Unknown entity \"" + entitySrc + "\" - use the \"&#;\" or \"&#x;\" syntax"; - } - var ControlFlowError = (function() { - function ControlFlowError(error) { - this.error = error; - } - return ControlFlowError; - }()); - var _HtmlTokenizer = (function() { - function _HtmlTokenizer(file) { - this.file = file; - this.peek = -1; - this.index = -1; - this.line = 0; - this.column = -1; - this.tokens = []; - this.errors = []; - this.input = file.content; - this.length = file.content.length; - this._advance(); - } - _HtmlTokenizer.prototype._processCarriageReturns = function(content) { - return lang_1.StringWrapper.replaceAll(content, CR_OR_CRLF_REGEXP, '\n'); - }; - _HtmlTokenizer.prototype.tokenize = function() { - while (this.peek !== $EOF) { - var start = this._getLocation(); - try { - if (this._attemptCharCode($LT)) { - if (this._attemptCharCode($BANG)) { - if (this._attemptCharCode($LBRACKET)) { - this._consumeCdata(start); - } else if (this._attemptCharCode($MINUS)) { - this._consumeComment(start); - } else { - this._consumeDocType(start); - } - } else if (this._attemptCharCode($SLASH)) { - this._consumeTagClose(start); - } else { - this._consumeTagOpen(start); - } - } else { - this._consumeText(); - } - } catch (e) { - if (e instanceof ControlFlowError) { - this.errors.push(e.error); - } else { - throw e; - } - } - } - this._beginToken(HtmlTokenType.EOF); - this._endToken([]); - return new HtmlTokenizeResult(mergeTextTokens(this.tokens), this.errors); - }; - _HtmlTokenizer.prototype._getLocation = function() { - return new parse_util_1.ParseLocation(this.file, this.index, this.line, this.column); - }; - _HtmlTokenizer.prototype._getSpan = function(start, end) { - if (lang_1.isBlank(start)) { - start = this._getLocation(); - } - if (lang_1.isBlank(end)) { - end = this._getLocation(); - } - return new parse_util_1.ParseSourceSpan(start, end); - }; - _HtmlTokenizer.prototype._beginToken = function(type, start) { - if (start === void 0) { - start = null; - } - if (lang_1.isBlank(start)) { - start = this._getLocation(); - } - this.currentTokenStart = start; - this.currentTokenType = type; - }; - _HtmlTokenizer.prototype._endToken = function(parts, end) { - if (end === void 0) { - end = null; - } - if (lang_1.isBlank(end)) { - end = this._getLocation(); - } - var token = new HtmlToken(this.currentTokenType, parts, new parse_util_1.ParseSourceSpan(this.currentTokenStart, end)); - this.tokens.push(token); - this.currentTokenStart = null; - this.currentTokenType = null; - return token; - }; - _HtmlTokenizer.prototype._createError = function(msg, span) { - var error = new HtmlTokenError(msg, this.currentTokenType, span); - this.currentTokenStart = null; - this.currentTokenType = null; - return new ControlFlowError(error); - }; - _HtmlTokenizer.prototype._advance = function() { - if (this.index >= this.length) { - throw this._createError(unexpectedCharacterErrorMsg($EOF), this._getSpan()); - } - if (this.peek === $LF) { - this.line++; - this.column = 0; - } else if (this.peek !== $LF && this.peek !== $CR) { - this.column++; - } - this.index++; - this.peek = this.index >= this.length ? $EOF : lang_1.StringWrapper.charCodeAt(this.input, this.index); - }; - _HtmlTokenizer.prototype._attemptCharCode = function(charCode) { - if (this.peek === charCode) { - this._advance(); - return true; - } - return false; - }; - _HtmlTokenizer.prototype._attemptCharCodeCaseInsensitive = function(charCode) { - if (compareCharCodeCaseInsensitive(this.peek, charCode)) { - this._advance(); - return true; - } - return false; - }; - _HtmlTokenizer.prototype._requireCharCode = function(charCode) { - var location = this._getLocation(); - if (!this._attemptCharCode(charCode)) { - throw this._createError(unexpectedCharacterErrorMsg(this.peek), this._getSpan(location, location)); - } - }; - _HtmlTokenizer.prototype._attemptStr = function(chars) { - for (var i = 0; i < chars.length; i++) { - if (!this._attemptCharCode(lang_1.StringWrapper.charCodeAt(chars, i))) { - return false; - } - } - return true; - }; - _HtmlTokenizer.prototype._attemptStrCaseInsensitive = function(chars) { - for (var i = 0; i < chars.length; i++) { - if (!this._attemptCharCodeCaseInsensitive(lang_1.StringWrapper.charCodeAt(chars, i))) { - return false; - } - } - return true; - }; - _HtmlTokenizer.prototype._requireStr = function(chars) { - var location = this._getLocation(); - if (!this._attemptStr(chars)) { - throw this._createError(unexpectedCharacterErrorMsg(this.peek), this._getSpan(location)); - } - }; - _HtmlTokenizer.prototype._attemptCharCodeUntilFn = function(predicate) { - while (!predicate(this.peek)) { - this._advance(); - } - }; - _HtmlTokenizer.prototype._requireCharCodeUntilFn = function(predicate, len) { - var start = this._getLocation(); - this._attemptCharCodeUntilFn(predicate); - if (this.index - start.offset < len) { - throw this._createError(unexpectedCharacterErrorMsg(this.peek), this._getSpan(start, start)); - } - }; - _HtmlTokenizer.prototype._attemptUntilChar = function(char) { - while (this.peek !== char) { - this._advance(); - } - }; - _HtmlTokenizer.prototype._readChar = function(decodeEntities) { - if (decodeEntities && this.peek === $AMPERSAND) { - return this._decodeEntity(); - } else { - var index = this.index; - this._advance(); - return this.input[index]; - } - }; - _HtmlTokenizer.prototype._decodeEntity = function() { - var start = this._getLocation(); - this._advance(); - if (this._attemptCharCode($HASH)) { - var isHex = this._attemptCharCode($x) || this._attemptCharCode($X); - var numberStart = this._getLocation().offset; - this._attemptCharCodeUntilFn(isDigitEntityEnd); - if (this.peek != $SEMICOLON) { - throw this._createError(unexpectedCharacterErrorMsg(this.peek), this._getSpan()); - } - this._advance(); - var strNum = this.input.substring(numberStart, this.index - 1); - try { - var charCode = lang_1.NumberWrapper.parseInt(strNum, isHex ? 16 : 10); - return lang_1.StringWrapper.fromCharCode(charCode); - } catch (e) { - var entity = this.input.substring(start.offset + 1, this.index - 1); - throw this._createError(unknownEntityErrorMsg(entity), this._getSpan(start)); - } - } else { - var startPosition = this._savePosition(); - this._attemptCharCodeUntilFn(isNamedEntityEnd); - if (this.peek != $SEMICOLON) { - this._restorePosition(startPosition); - return '&'; - } - this._advance(); - var name_1 = this.input.substring(start.offset + 1, this.index - 1); - var char = html_tags_1.NAMED_ENTITIES[name_1]; - if (lang_1.isBlank(char)) { - throw this._createError(unknownEntityErrorMsg(name_1), this._getSpan(start)); - } - return char; - } - }; - _HtmlTokenizer.prototype._consumeRawText = function(decodeEntities, firstCharOfEnd, attemptEndRest) { - var tagCloseStart; - var textStart = this._getLocation(); - this._beginToken(decodeEntities ? HtmlTokenType.ESCAPABLE_RAW_TEXT : HtmlTokenType.RAW_TEXT, textStart); - var parts = []; - while (true) { - tagCloseStart = this._getLocation(); - if (this._attemptCharCode(firstCharOfEnd) && attemptEndRest()) { - break; - } - if (this.index > tagCloseStart.offset) { - parts.push(this.input.substring(tagCloseStart.offset, this.index)); - } - while (this.peek !== firstCharOfEnd) { - parts.push(this._readChar(decodeEntities)); - } - } - return this._endToken([this._processCarriageReturns(parts.join(''))], tagCloseStart); - }; - _HtmlTokenizer.prototype._consumeComment = function(start) { - var _this = this; - this._beginToken(HtmlTokenType.COMMENT_START, start); - this._requireCharCode($MINUS); - this._endToken([]); - var textToken = this._consumeRawText(false, $MINUS, function() { - return _this._attemptStr('->'); - }); - this._beginToken(HtmlTokenType.COMMENT_END, textToken.sourceSpan.end); - this._endToken([]); - }; - _HtmlTokenizer.prototype._consumeCdata = function(start) { - var _this = this; - this._beginToken(HtmlTokenType.CDATA_START, start); - this._requireStr('CDATA['); - this._endToken([]); - var textToken = this._consumeRawText(false, $RBRACKET, function() { - return _this._attemptStr(']>'); - }); - this._beginToken(HtmlTokenType.CDATA_END, textToken.sourceSpan.end); - this._endToken([]); - }; - _HtmlTokenizer.prototype._consumeDocType = function(start) { - this._beginToken(HtmlTokenType.DOC_TYPE, start); - this._attemptUntilChar($GT); - this._advance(); - this._endToken([this.input.substring(start.offset + 2, this.index - 1)]); - }; - _HtmlTokenizer.prototype._consumePrefixAndName = function() { - var nameOrPrefixStart = this.index; - var prefix = null; - while (this.peek !== $COLON && !isPrefixEnd(this.peek)) { - this._advance(); - } - var nameStart; - if (this.peek === $COLON) { - this._advance(); - prefix = this.input.substring(nameOrPrefixStart, this.index - 1); - nameStart = this.index; - } else { - nameStart = nameOrPrefixStart; - } - this._requireCharCodeUntilFn(isNameEnd, this.index === nameStart ? 1 : 0); - var name = this.input.substring(nameStart, this.index); - return [prefix, name]; - }; - _HtmlTokenizer.prototype._consumeTagOpen = function(start) { - var savedPos = this._savePosition(); - var lowercaseTagName; - try { - if (!isAsciiLetter(this.peek)) { - throw this._createError(unexpectedCharacterErrorMsg(this.peek), this._getSpan()); - } - var nameStart = this.index; - this._consumeTagOpenStart(start); - lowercaseTagName = this.input.substring(nameStart, this.index).toLowerCase(); - this._attemptCharCodeUntilFn(isNotWhitespace); - while (this.peek !== $SLASH && this.peek !== $GT) { - this._consumeAttributeName(); - this._attemptCharCodeUntilFn(isNotWhitespace); - if (this._attemptCharCode($EQ)) { - this._attemptCharCodeUntilFn(isNotWhitespace); - this._consumeAttributeValue(); - } - this._attemptCharCodeUntilFn(isNotWhitespace); - } - this._consumeTagOpenEnd(); - } catch (e) { - if (e instanceof ControlFlowError) { - this._restorePosition(savedPos); - this._beginToken(HtmlTokenType.TEXT, start); - this._endToken(['<']); - return ; - } - throw e; - } - var contentTokenType = html_tags_1.getHtmlTagDefinition(lowercaseTagName).contentType; - if (contentTokenType === html_tags_1.HtmlTagContentType.RAW_TEXT) { - this._consumeRawTextWithTagClose(lowercaseTagName, false); - } else if (contentTokenType === html_tags_1.HtmlTagContentType.ESCAPABLE_RAW_TEXT) { - this._consumeRawTextWithTagClose(lowercaseTagName, true); - } - }; - _HtmlTokenizer.prototype._consumeRawTextWithTagClose = function(lowercaseTagName, decodeEntities) { - var _this = this; - var textToken = this._consumeRawText(decodeEntities, $LT, function() { - if (!_this._attemptCharCode($SLASH)) - return false; - _this._attemptCharCodeUntilFn(isNotWhitespace); - if (!_this._attemptStrCaseInsensitive(lowercaseTagName)) - return false; - _this._attemptCharCodeUntilFn(isNotWhitespace); - if (!_this._attemptCharCode($GT)) - return false; - return true; - }); - this._beginToken(HtmlTokenType.TAG_CLOSE, textToken.sourceSpan.end); - this._endToken([null, lowercaseTagName]); - }; - _HtmlTokenizer.prototype._consumeTagOpenStart = function(start) { - this._beginToken(HtmlTokenType.TAG_OPEN_START, start); - var parts = this._consumePrefixAndName(); - this._endToken(parts); - }; - _HtmlTokenizer.prototype._consumeAttributeName = function() { - this._beginToken(HtmlTokenType.ATTR_NAME); - var prefixAndName = this._consumePrefixAndName(); - this._endToken(prefixAndName); - }; - _HtmlTokenizer.prototype._consumeAttributeValue = function() { - this._beginToken(HtmlTokenType.ATTR_VALUE); - var value; - if (this.peek === $SQ || this.peek === $DQ) { - var quoteChar = this.peek; - this._advance(); - var parts = []; - while (this.peek !== quoteChar) { - parts.push(this._readChar(true)); - } - value = parts.join(''); - this._advance(); - } else { - var valueStart = this.index; - this._requireCharCodeUntilFn(isNameEnd, 1); - value = this.input.substring(valueStart, this.index); - } - this._endToken([this._processCarriageReturns(value)]); - }; - _HtmlTokenizer.prototype._consumeTagOpenEnd = function() { - var tokenType = this._attemptCharCode($SLASH) ? HtmlTokenType.TAG_OPEN_END_VOID : HtmlTokenType.TAG_OPEN_END; - this._beginToken(tokenType); - this._requireCharCode($GT); - this._endToken([]); - }; - _HtmlTokenizer.prototype._consumeTagClose = function(start) { - this._beginToken(HtmlTokenType.TAG_CLOSE, start); - this._attemptCharCodeUntilFn(isNotWhitespace); - var prefixAndName; - prefixAndName = this._consumePrefixAndName(); - this._attemptCharCodeUntilFn(isNotWhitespace); - this._requireCharCode($GT); - this._endToken(prefixAndName); - }; - _HtmlTokenizer.prototype._consumeText = function() { - var start = this._getLocation(); - this._beginToken(HtmlTokenType.TEXT, start); - var parts = [this._readChar(true)]; - while (!isTextEnd(this.peek)) { - parts.push(this._readChar(true)); - } - this._endToken([this._processCarriageReturns(parts.join(''))]); - }; - _HtmlTokenizer.prototype._savePosition = function() { - return [this.peek, this.index, this.column, this.line, this.tokens.length]; - }; - _HtmlTokenizer.prototype._restorePosition = function(position) { - this.peek = position[0]; - this.index = position[1]; - this.column = position[2]; - this.line = position[3]; - var nbTokens = position[4]; - if (nbTokens < this.tokens.length) { - this.tokens = collection_1.ListWrapper.slice(this.tokens, 0, nbTokens); - } - }; - return _HtmlTokenizer; - }()); - function isNotWhitespace(code) { - return !isWhitespace(code) || code === $EOF; - } - function isWhitespace(code) { - return (code >= $TAB && code <= $SPACE) || (code === $NBSP); - } - function isNameEnd(code) { - return isWhitespace(code) || code === $GT || code === $SLASH || code === $SQ || code === $DQ || code === $EQ; - } - function isPrefixEnd(code) { - return (code < $a || $z < code) && (code < $A || $Z < code) && (code < $0 || code > $9); - } - function isDigitEntityEnd(code) { - return code == $SEMICOLON || code == $EOF || !isAsciiHexDigit(code); - } - function isNamedEntityEnd(code) { - return code == $SEMICOLON || code == $EOF || !isAsciiLetter(code); - } - function isTextEnd(code) { - return code === $LT || code === $EOF; - } - function isAsciiLetter(code) { - return code >= $a && code <= $z || code >= $A && code <= $Z; - } - function isAsciiHexDigit(code) { - return code >= $a && code <= $f || code >= $A && code <= $F || code >= $0 && code <= $9; - } - function compareCharCodeCaseInsensitive(code1, code2) { - return toUpperCaseCharCode(code1) == toUpperCaseCharCode(code2); - } - function toUpperCaseCharCode(code) { - return code >= $a && code <= $z ? code - $a + $A : code; - } - function mergeTextTokens(srcTokens) { - var dstTokens = []; - var lastDstToken; - for (var i = 0; i < srcTokens.length; i++) { - var token = srcTokens[i]; - if (lang_1.isPresent(lastDstToken) && lastDstToken.type == HtmlTokenType.TEXT && token.type == HtmlTokenType.TEXT) { - lastDstToken.parts[0] += token.parts[0]; - lastDstToken.sourceSpan.end = token.sourceSpan.end; - } else { - lastDstToken = token; - dstTokens.push(lastDstToken); - } - } - return dstTokens; - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/runtime_metadata", ["angular2/src/core/di", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/compiler/directive_metadata", "angular2/src/core/metadata/directives", "angular2/src/core/linker/directive_resolver", "angular2/src/core/linker/pipe_resolver", "angular2/src/core/linker/view_resolver", "angular2/src/core/linker/directive_lifecycle_reflector", "angular2/src/core/linker/interfaces", "angular2/src/core/reflection/reflection", "angular2/src/core/di", "angular2/src/core/platform_directives_and_pipes", "angular2/src/compiler/util", "angular2/src/compiler/assertions", "angular2/src/compiler/url_resolver"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var di_1 = require("angular2/src/core/di"); - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var cpl = require("angular2/src/compiler/directive_metadata"); - var md = require("angular2/src/core/metadata/directives"); - var directive_resolver_1 = require("angular2/src/core/linker/directive_resolver"); - var pipe_resolver_1 = require("angular2/src/core/linker/pipe_resolver"); - var view_resolver_1 = require("angular2/src/core/linker/view_resolver"); - var directive_lifecycle_reflector_1 = require("angular2/src/core/linker/directive_lifecycle_reflector"); - var interfaces_1 = require("angular2/src/core/linker/interfaces"); - var reflection_1 = require("angular2/src/core/reflection/reflection"); - var di_2 = require("angular2/src/core/di"); - var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); - var util_1 = require("angular2/src/compiler/util"); - var assertions_1 = require("angular2/src/compiler/assertions"); - var url_resolver_1 = require("angular2/src/compiler/url_resolver"); - var RuntimeMetadataResolver = (function() { - function RuntimeMetadataResolver(_directiveResolver, _pipeResolver, _viewResolver, _platformDirectives, _platformPipes) { - this._directiveResolver = _directiveResolver; - this._pipeResolver = _pipeResolver; - this._viewResolver = _viewResolver; - this._platformDirectives = _platformDirectives; - this._platformPipes = _platformPipes; - this._directiveCache = new Map(); - this._pipeCache = new Map(); - this._anonymousTypes = new Map(); - this._anonymousTypeIndex = 0; - } - RuntimeMetadataResolver.prototype.sanitizeName = function(obj) { - var result = lang_1.stringify(obj); - if (result.indexOf('(') < 0) { - return result; - } - var found = this._anonymousTypes.get(obj); - if (!found) { - this._anonymousTypes.set(obj, this._anonymousTypeIndex++); - found = this._anonymousTypes.get(obj); - } - return "anonymous_type_" + found + "_"; - }; - RuntimeMetadataResolver.prototype.getDirectiveMetadata = function(directiveType) { - var meta = this._directiveCache.get(directiveType); - if (lang_1.isBlank(meta)) { - var dirMeta = this._directiveResolver.resolve(directiveType); - var moduleUrl = null; - var templateMeta = null; - var changeDetectionStrategy = null; - if (dirMeta instanceof md.ComponentMetadata) { - assertions_1.assertArrayOfStrings('styles', dirMeta.styles); - var cmpMeta = dirMeta; - moduleUrl = calcModuleUrl(directiveType, cmpMeta); - var viewMeta = this._viewResolver.resolve(directiveType); - assertions_1.assertArrayOfStrings('styles', viewMeta.styles); - templateMeta = new cpl.CompileTemplateMetadata({ - encapsulation: viewMeta.encapsulation, - template: viewMeta.template, - templateUrl: viewMeta.templateUrl, - styles: viewMeta.styles, - styleUrls: viewMeta.styleUrls - }); - changeDetectionStrategy = cmpMeta.changeDetection; - } - meta = cpl.CompileDirectiveMetadata.create({ - selector: dirMeta.selector, - exportAs: dirMeta.exportAs, - isComponent: lang_1.isPresent(templateMeta), - dynamicLoadable: true, - type: new cpl.CompileTypeMetadata({ - name: this.sanitizeName(directiveType), - moduleUrl: moduleUrl, - runtime: directiveType - }), - template: templateMeta, - changeDetection: changeDetectionStrategy, - inputs: dirMeta.inputs, - outputs: dirMeta.outputs, - host: dirMeta.host, - lifecycleHooks: interfaces_1.LIFECYCLE_HOOKS_VALUES.filter(function(hook) { - return directive_lifecycle_reflector_1.hasLifecycleHook(hook, directiveType); - }) - }); - this._directiveCache.set(directiveType, meta); - } - return meta; - }; - RuntimeMetadataResolver.prototype.getPipeMetadata = function(pipeType) { - var meta = this._pipeCache.get(pipeType); - if (lang_1.isBlank(meta)) { - var pipeMeta = this._pipeResolver.resolve(pipeType); - var moduleUrl = reflection_1.reflector.importUri(pipeType); - meta = new cpl.CompilePipeMetadata({ - type: new cpl.CompileTypeMetadata({ - name: this.sanitizeName(pipeType), - moduleUrl: moduleUrl, - runtime: pipeType - }), - name: pipeMeta.name, - pure: pipeMeta.pure - }); - this._pipeCache.set(pipeType, meta); - } - return meta; - }; - RuntimeMetadataResolver.prototype.getViewDirectivesMetadata = function(component) { - var _this = this; - var view = this._viewResolver.resolve(component); - var directives = flattenDirectives(view, this._platformDirectives); - for (var i = 0; i < directives.length; i++) { - if (!isValidType(directives[i])) { - throw new exceptions_1.BaseException("Unexpected directive value '" + lang_1.stringify(directives[i]) + "' on the View of component '" + lang_1.stringify(component) + "'"); - } - } - return directives.map(function(type) { - return _this.getDirectiveMetadata(type); - }); - }; - RuntimeMetadataResolver.prototype.getViewPipesMetadata = function(component) { - var _this = this; - var view = this._viewResolver.resolve(component); - var pipes = flattenPipes(view, this._platformPipes); - for (var i = 0; i < pipes.length; i++) { - if (!isValidType(pipes[i])) { - throw new exceptions_1.BaseException("Unexpected piped value '" + lang_1.stringify(pipes[i]) + "' on the View of component '" + lang_1.stringify(component) + "'"); - } - } - return pipes.map(function(type) { - return _this.getPipeMetadata(type); - }); - }; - RuntimeMetadataResolver = __decorate([di_2.Injectable(), __param(3, di_2.Optional()), __param(3, di_2.Inject(platform_directives_and_pipes_1.PLATFORM_DIRECTIVES)), __param(4, di_2.Optional()), __param(4, di_2.Inject(platform_directives_and_pipes_1.PLATFORM_PIPES)), __metadata('design:paramtypes', [directive_resolver_1.DirectiveResolver, pipe_resolver_1.PipeResolver, view_resolver_1.ViewResolver, Array, Array])], RuntimeMetadataResolver); - return RuntimeMetadataResolver; - }()); - exports.RuntimeMetadataResolver = RuntimeMetadataResolver; - function flattenDirectives(view, platformDirectives) { - var directives = []; - if (lang_1.isPresent(platformDirectives)) { - flattenArray(platformDirectives, directives); - } - if (lang_1.isPresent(view.directives)) { - flattenArray(view.directives, directives); - } - return directives; - } - function flattenPipes(view, platformPipes) { - var pipes = []; - if (lang_1.isPresent(platformPipes)) { - flattenArray(platformPipes, pipes); - } - if (lang_1.isPresent(view.pipes)) { - flattenArray(view.pipes, pipes); - } - return pipes; - } - function flattenArray(tree, out) { - for (var i = 0; i < tree.length; i++) { - var item = di_1.resolveForwardRef(tree[i]); - if (lang_1.isArray(item)) { - flattenArray(item, out); - } else { - out.push(item); - } - } - } - function isValidType(value) { - return lang_1.isPresent(value) && (value instanceof lang_1.Type); - } - function calcModuleUrl(type, cmpMetadata) { - var moduleId = cmpMetadata.moduleId; - if (lang_1.isPresent(moduleId)) { - var scheme = url_resolver_1.getUrlScheme(moduleId); - return lang_1.isPresent(scheme) && scheme.length > 0 ? moduleId : "package:" + moduleId + util_1.MODULE_SUFFIX; - } else { - return reflection_1.reflector.importUri(type); - } - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/pipes", ["angular2/src/common/pipes/async_pipe", "angular2/src/common/pipes/date_pipe", "angular2/src/common/pipes/json_pipe", "angular2/src/common/pipes/slice_pipe", "angular2/src/common/pipes/lowercase_pipe", "angular2/src/common/pipes/number_pipe", "angular2/src/common/pipes/uppercase_pipe", "angular2/src/common/pipes/replace_pipe", "angular2/src/common/pipes/i18n_plural_pipe", "angular2/src/common/pipes/i18n_select_pipe", "angular2/src/common/pipes/common_pipes"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var async_pipe_1 = require("angular2/src/common/pipes/async_pipe"); - exports.AsyncPipe = async_pipe_1.AsyncPipe; - var date_pipe_1 = require("angular2/src/common/pipes/date_pipe"); - exports.DatePipe = date_pipe_1.DatePipe; - var json_pipe_1 = require("angular2/src/common/pipes/json_pipe"); - exports.JsonPipe = json_pipe_1.JsonPipe; - var slice_pipe_1 = require("angular2/src/common/pipes/slice_pipe"); - exports.SlicePipe = slice_pipe_1.SlicePipe; - var lowercase_pipe_1 = require("angular2/src/common/pipes/lowercase_pipe"); - exports.LowerCasePipe = lowercase_pipe_1.LowerCasePipe; - var number_pipe_1 = require("angular2/src/common/pipes/number_pipe"); - exports.NumberPipe = number_pipe_1.NumberPipe; - exports.DecimalPipe = number_pipe_1.DecimalPipe; - exports.PercentPipe = number_pipe_1.PercentPipe; - exports.CurrencyPipe = number_pipe_1.CurrencyPipe; - var uppercase_pipe_1 = require("angular2/src/common/pipes/uppercase_pipe"); - exports.UpperCasePipe = uppercase_pipe_1.UpperCasePipe; - var replace_pipe_1 = require("angular2/src/common/pipes/replace_pipe"); - exports.ReplacePipe = replace_pipe_1.ReplacePipe; - var i18n_plural_pipe_1 = require("angular2/src/common/pipes/i18n_plural_pipe"); - exports.I18nPluralPipe = i18n_plural_pipe_1.I18nPluralPipe; - var i18n_select_pipe_1 = require("angular2/src/common/pipes/i18n_select_pipe"); - exports.I18nSelectPipe = i18n_select_pipe_1.I18nSelectPipe; - var common_pipes_1 = require("angular2/src/common/pipes/common_pipes"); - exports.COMMON_PIPES = common_pipes_1.COMMON_PIPES; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms/directives/ng_control_name", ["angular2/src/facade/lang", "angular2/src/facade/async", "angular2/core", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/shared", "angular2/src/common/forms/validators"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var lang_1 = require("angular2/src/facade/lang"); - var async_1 = require("angular2/src/facade/async"); - var core_1 = require("angular2/core"); - var control_container_1 = require("angular2/src/common/forms/directives/control_container"); - var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); - var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); - var shared_1 = require("angular2/src/common/forms/directives/shared"); - var validators_1 = require("angular2/src/common/forms/validators"); - var controlNameBinding = lang_1.CONST_EXPR(new core_1.Provider(ng_control_1.NgControl, {useExisting: core_1.forwardRef(function() { - return NgControlName; - })})); - var NgControlName = (function(_super) { - __extends(NgControlName, _super); - function NgControlName(_parent, _validators, _asyncValidators, valueAccessors) { - _super.call(this); - this._parent = _parent; - this._validators = _validators; - this._asyncValidators = _asyncValidators; - this.update = new async_1.EventEmitter(); - this._added = false; - this.valueAccessor = shared_1.selectValueAccessor(this, valueAccessors); - } - NgControlName.prototype.ngOnChanges = function(changes) { - if (!this._added) { - this.formDirective.addControl(this); - this._added = true; - } - if (shared_1.isPropertyUpdated(changes, this.viewModel)) { - this.viewModel = this.model; - this.formDirective.updateModel(this, this.model); - } - }; - NgControlName.prototype.ngOnDestroy = function() { - this.formDirective.removeControl(this); - }; - NgControlName.prototype.viewToModelUpdate = function(newValue) { - this.viewModel = newValue; - async_1.ObservableWrapper.callEmit(this.update, newValue); - }; - Object.defineProperty(NgControlName.prototype, "path", { - get: function() { - return shared_1.controlPath(this.name, this._parent); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlName.prototype, "formDirective", { - get: function() { - return this._parent.formDirective; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlName.prototype, "validator", { - get: function() { - return shared_1.composeValidators(this._validators); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlName.prototype, "asyncValidator", { - get: function() { - return shared_1.composeAsyncValidators(this._asyncValidators); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NgControlName.prototype, "control", { - get: function() { - return this.formDirective.getControl(this); - }, - enumerable: true, - configurable: true - }); - NgControlName = __decorate([core_1.Directive({ - selector: '[ngControl]', - bindings: [controlNameBinding], - inputs: ['name: ngControl', 'model: ngModel'], - outputs: ['update: ngModelChange'], - exportAs: 'ngForm' - }), __param(0, core_1.Host()), __param(0, core_1.SkipSelf()), __param(1, core_1.Optional()), __param(1, core_1.Self()), __param(1, core_1.Inject(validators_1.NG_VALIDATORS)), __param(2, core_1.Optional()), __param(2, core_1.Self()), __param(2, core_1.Inject(validators_1.NG_ASYNC_VALIDATORS)), __param(3, core_1.Optional()), __param(3, core_1.Self()), __param(3, core_1.Inject(control_value_accessor_1.NG_VALUE_ACCESSOR)), __metadata('design:paramtypes', [control_container_1.ControlContainer, Array, Array, Array])], NgControlName); - return NgControlName; - }(ng_control_1.NgControl)); - exports.NgControlName = NgControlName; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/browser/browser_adapter", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/src/platform/dom/dom_adapter", "angular2/src/platform/browser/generic_browser_adapter"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var generic_browser_adapter_1 = require("angular2/src/platform/browser/generic_browser_adapter"); - var _attrToPropMap = { - 'class': 'className', - 'innerHtml': 'innerHTML', - 'readonly': 'readOnly', - 'tabindex': 'tabIndex' - }; - var DOM_KEY_LOCATION_NUMPAD = 3; - var _keyMap = { - '\b': 'Backspace', - '\t': 'Tab', - '\x7F': 'Delete', - '\x1B': 'Escape', - 'Del': 'Delete', - 'Esc': 'Escape', - 'Left': 'ArrowLeft', - 'Right': 'ArrowRight', - 'Up': 'ArrowUp', - 'Down': 'ArrowDown', - 'Menu': 'ContextMenu', - 'Scroll': 'ScrollLock', - 'Win': 'OS' - }; - var _chromeNumKeyPadMap = { - 'A': '1', - 'B': '2', - 'C': '3', - 'D': '4', - 'E': '5', - 'F': '6', - 'G': '7', - 'H': '8', - 'I': '9', - 'J': '*', - 'K': '+', - 'M': '-', - 'N': '.', - 'O': '/', - '\x60': '0', - '\x90': 'NumLock' - }; - var BrowserDomAdapter = (function(_super) { - __extends(BrowserDomAdapter, _super); - function BrowserDomAdapter() { - _super.apply(this, arguments); - } - BrowserDomAdapter.prototype.parse = function(templateHtml) { - throw new Error("parse not implemented"); - }; - BrowserDomAdapter.makeCurrent = function() { - dom_adapter_1.setRootDomAdapter(new BrowserDomAdapter()); - }; - BrowserDomAdapter.prototype.hasProperty = function(element, name) { - return name in element; - }; - BrowserDomAdapter.prototype.setProperty = function(el, name, value) { - el[name] = value; - }; - BrowserDomAdapter.prototype.getProperty = function(el, name) { - return el[name]; - }; - BrowserDomAdapter.prototype.invoke = function(el, methodName, args) { - el[methodName].apply(el, args); - }; - BrowserDomAdapter.prototype.logError = function(error) { - if (window.console.error) { - window.console.error(error); - } else { - window.console.log(error); - } - }; - BrowserDomAdapter.prototype.log = function(error) { - window.console.log(error); - }; - BrowserDomAdapter.prototype.logGroup = function(error) { - if (window.console.group) { - window.console.group(error); - this.logError(error); - } else { - window.console.log(error); - } - }; - BrowserDomAdapter.prototype.logGroupEnd = function() { - if (window.console.groupEnd) { - window.console.groupEnd(); - } - }; - Object.defineProperty(BrowserDomAdapter.prototype, "attrToPropMap", { - get: function() { - return _attrToPropMap; - }, - enumerable: true, - configurable: true - }); - BrowserDomAdapter.prototype.query = function(selector) { - return document.querySelector(selector); - }; - BrowserDomAdapter.prototype.querySelector = function(el, selector) { - return el.querySelector(selector); - }; - BrowserDomAdapter.prototype.querySelectorAll = function(el, selector) { - return el.querySelectorAll(selector); - }; - BrowserDomAdapter.prototype.on = function(el, evt, listener) { - el.addEventListener(evt, listener, false); - }; - BrowserDomAdapter.prototype.onAndCancel = function(el, evt, listener) { - el.addEventListener(evt, listener, false); - return function() { - el.removeEventListener(evt, listener, false); - }; - }; - BrowserDomAdapter.prototype.dispatchEvent = function(el, evt) { - el.dispatchEvent(evt); - }; - BrowserDomAdapter.prototype.createMouseEvent = function(eventType) { - var evt = document.createEvent('MouseEvent'); - evt.initEvent(eventType, true, true); - return evt; - }; - BrowserDomAdapter.prototype.createEvent = function(eventType) { - var evt = document.createEvent('Event'); - evt.initEvent(eventType, true, true); - return evt; - }; - BrowserDomAdapter.prototype.preventDefault = function(evt) { - evt.preventDefault(); - evt.returnValue = false; - }; - BrowserDomAdapter.prototype.isPrevented = function(evt) { - return evt.defaultPrevented || lang_1.isPresent(evt.returnValue) && !evt.returnValue; - }; - BrowserDomAdapter.prototype.getInnerHTML = function(el) { - return el.innerHTML; - }; - BrowserDomAdapter.prototype.getOuterHTML = function(el) { - return el.outerHTML; - }; - BrowserDomAdapter.prototype.nodeName = function(node) { - return node.nodeName; - }; - BrowserDomAdapter.prototype.nodeValue = function(node) { - return node.nodeValue; - }; - BrowserDomAdapter.prototype.type = function(node) { - return node.type; - }; - BrowserDomAdapter.prototype.content = function(node) { - if (this.hasProperty(node, "content")) { - return node.content; - } else { - return node; - } - }; - BrowserDomAdapter.prototype.firstChild = function(el) { - return el.firstChild; - }; - BrowserDomAdapter.prototype.nextSibling = function(el) { - return el.nextSibling; - }; - BrowserDomAdapter.prototype.parentElement = function(el) { - return el.parentNode; - }; - BrowserDomAdapter.prototype.childNodes = function(el) { - return el.childNodes; - }; - BrowserDomAdapter.prototype.childNodesAsList = function(el) { - var childNodes = el.childNodes; - var res = collection_1.ListWrapper.createFixedSize(childNodes.length); - for (var i = 0; i < childNodes.length; i++) { - res[i] = childNodes[i]; - } - return res; - }; - BrowserDomAdapter.prototype.clearNodes = function(el) { - while (el.firstChild) { - el.removeChild(el.firstChild); - } - }; - BrowserDomAdapter.prototype.appendChild = function(el, node) { - el.appendChild(node); - }; - BrowserDomAdapter.prototype.removeChild = function(el, node) { - el.removeChild(node); - }; - BrowserDomAdapter.prototype.replaceChild = function(el, newChild, oldChild) { - el.replaceChild(newChild, oldChild); - }; - BrowserDomAdapter.prototype.remove = function(node) { - if (node.parentNode) { - node.parentNode.removeChild(node); - } - return node; - }; - BrowserDomAdapter.prototype.insertBefore = function(el, node) { - el.parentNode.insertBefore(node, el); - }; - BrowserDomAdapter.prototype.insertAllBefore = function(el, nodes) { - nodes.forEach(function(n) { - return el.parentNode.insertBefore(n, el); - }); - }; - BrowserDomAdapter.prototype.insertAfter = function(el, node) { - el.parentNode.insertBefore(node, el.nextSibling); - }; - BrowserDomAdapter.prototype.setInnerHTML = function(el, value) { - el.innerHTML = value; - }; - BrowserDomAdapter.prototype.getText = function(el) { - return el.textContent; - }; - BrowserDomAdapter.prototype.setText = function(el, value) { - el.textContent = value; - }; - BrowserDomAdapter.prototype.getValue = function(el) { - return el.value; - }; - BrowserDomAdapter.prototype.setValue = function(el, value) { - el.value = value; - }; - BrowserDomAdapter.prototype.getChecked = function(el) { - return el.checked; - }; - BrowserDomAdapter.prototype.setChecked = function(el, value) { - el.checked = value; - }; - BrowserDomAdapter.prototype.createComment = function(text) { - return document.createComment(text); - }; - BrowserDomAdapter.prototype.createTemplate = function(html) { - var t = document.createElement('template'); - t.innerHTML = html; - return t; - }; - BrowserDomAdapter.prototype.createElement = function(tagName, doc) { - if (doc === void 0) { - doc = document; - } - return doc.createElement(tagName); - }; - BrowserDomAdapter.prototype.createElementNS = function(ns, tagName, doc) { - if (doc === void 0) { - doc = document; - } - return doc.createElementNS(ns, tagName); - }; - BrowserDomAdapter.prototype.createTextNode = function(text, doc) { - if (doc === void 0) { - doc = document; - } - return doc.createTextNode(text); - }; - BrowserDomAdapter.prototype.createScriptTag = function(attrName, attrValue, doc) { - if (doc === void 0) { - doc = document; - } - var el = doc.createElement('SCRIPT'); - el.setAttribute(attrName, attrValue); - return el; - }; - BrowserDomAdapter.prototype.createStyleElement = function(css, doc) { - if (doc === void 0) { - doc = document; - } - var style = doc.createElement('style'); - this.appendChild(style, this.createTextNode(css)); - return style; - }; - BrowserDomAdapter.prototype.createShadowRoot = function(el) { - return el.createShadowRoot(); - }; - BrowserDomAdapter.prototype.getShadowRoot = function(el) { - return el.shadowRoot; - }; - BrowserDomAdapter.prototype.getHost = function(el) { - return el.host; - }; - BrowserDomAdapter.prototype.clone = function(node) { - return node.cloneNode(true); - }; - BrowserDomAdapter.prototype.getElementsByClassName = function(element, name) { - return element.getElementsByClassName(name); - }; - BrowserDomAdapter.prototype.getElementsByTagName = function(element, name) { - return element.getElementsByTagName(name); - }; - BrowserDomAdapter.prototype.classList = function(element) { - return Array.prototype.slice.call(element.classList, 0); - }; - BrowserDomAdapter.prototype.addClass = function(element, className) { - element.classList.add(className); - }; - BrowserDomAdapter.prototype.removeClass = function(element, className) { - element.classList.remove(className); - }; - BrowserDomAdapter.prototype.hasClass = function(element, className) { - return element.classList.contains(className); - }; - BrowserDomAdapter.prototype.setStyle = function(element, styleName, styleValue) { - element.style[styleName] = styleValue; - }; - BrowserDomAdapter.prototype.removeStyle = function(element, stylename) { - element.style[stylename] = null; - }; - BrowserDomAdapter.prototype.getStyle = function(element, stylename) { - return element.style[stylename]; - }; - BrowserDomAdapter.prototype.hasStyle = function(element, styleName, styleValue) { - if (styleValue === void 0) { - styleValue = null; - } - var value = this.getStyle(element, styleName) || ''; - return styleValue ? value == styleValue : value.length > 0; - }; - BrowserDomAdapter.prototype.tagName = function(element) { - return element.tagName; - }; - BrowserDomAdapter.prototype.attributeMap = function(element) { - var res = new Map(); - var elAttrs = element.attributes; - for (var i = 0; i < elAttrs.length; i++) { - var attrib = elAttrs[i]; - res.set(attrib.name, attrib.value); - } - return res; - }; - BrowserDomAdapter.prototype.hasAttribute = function(element, attribute) { - return element.hasAttribute(attribute); - }; - BrowserDomAdapter.prototype.hasAttributeNS = function(element, ns, attribute) { - return element.hasAttributeNS(ns, attribute); - }; - BrowserDomAdapter.prototype.getAttribute = function(element, attribute) { - return element.getAttribute(attribute); - }; - BrowserDomAdapter.prototype.getAttributeNS = function(element, ns, name) { - return element.getAttributeNS(ns, name); - }; - BrowserDomAdapter.prototype.setAttribute = function(element, name, value) { - element.setAttribute(name, value); - }; - BrowserDomAdapter.prototype.setAttributeNS = function(element, ns, name, value) { - element.setAttributeNS(ns, name, value); - }; - BrowserDomAdapter.prototype.removeAttribute = function(element, attribute) { - element.removeAttribute(attribute); - }; - BrowserDomAdapter.prototype.removeAttributeNS = function(element, ns, name) { - element.removeAttributeNS(ns, name); - }; - BrowserDomAdapter.prototype.templateAwareRoot = function(el) { - return this.isTemplateElement(el) ? this.content(el) : el; - }; - BrowserDomAdapter.prototype.createHtmlDocument = function() { - return document.implementation.createHTMLDocument('fakeTitle'); - }; - BrowserDomAdapter.prototype.defaultDoc = function() { - return document; - }; - BrowserDomAdapter.prototype.getBoundingClientRect = function(el) { - try { - return el.getBoundingClientRect(); - } catch (e) { - return { - top: 0, - bottom: 0, - left: 0, - right: 0, - width: 0, - height: 0 - }; - } - }; - BrowserDomAdapter.prototype.getTitle = function() { - return document.title; - }; - BrowserDomAdapter.prototype.setTitle = function(newTitle) { - document.title = newTitle || ''; - }; - BrowserDomAdapter.prototype.elementMatches = function(n, selector) { - var matches = false; - if (n instanceof HTMLElement) { - if (n.matches) { - matches = n.matches(selector); - } else if (n.msMatchesSelector) { - matches = n.msMatchesSelector(selector); - } else if (n.webkitMatchesSelector) { - matches = n.webkitMatchesSelector(selector); - } - } - return matches; - }; - BrowserDomAdapter.prototype.isTemplateElement = function(el) { - return el instanceof HTMLElement && el.nodeName == "TEMPLATE"; - }; - BrowserDomAdapter.prototype.isTextNode = function(node) { - return node.nodeType === Node.TEXT_NODE; - }; - BrowserDomAdapter.prototype.isCommentNode = function(node) { - return node.nodeType === Node.COMMENT_NODE; - }; - BrowserDomAdapter.prototype.isElementNode = function(node) { - return node.nodeType === Node.ELEMENT_NODE; - }; - BrowserDomAdapter.prototype.hasShadowRoot = function(node) { - return node instanceof HTMLElement && lang_1.isPresent(node.shadowRoot); - }; - BrowserDomAdapter.prototype.isShadowRoot = function(node) { - return node instanceof DocumentFragment; - }; - BrowserDomAdapter.prototype.importIntoDoc = function(node) { - var toImport = node; - if (this.isTemplateElement(node)) { - toImport = this.content(node); - } - return document.importNode(toImport, true); - }; - BrowserDomAdapter.prototype.adoptNode = function(node) { - return document.adoptNode(node); - }; - BrowserDomAdapter.prototype.getHref = function(el) { - return el.href; - }; - BrowserDomAdapter.prototype.getEventKey = function(event) { - var key = event.key; - if (lang_1.isBlank(key)) { - key = event.keyIdentifier; - if (lang_1.isBlank(key)) { - return 'Unidentified'; - } - if (key.startsWith('U+')) { - key = String.fromCharCode(parseInt(key.substring(2), 16)); - if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) { - key = _chromeNumKeyPadMap[key]; - } - } - } - if (_keyMap.hasOwnProperty(key)) { - key = _keyMap[key]; - } - return key; - }; - BrowserDomAdapter.prototype.getGlobalEventTarget = function(target) { - if (target == "window") { - return window; - } else if (target == "document") { - return document; - } else if (target == "body") { - return document.body; - } - }; - BrowserDomAdapter.prototype.getHistory = function() { - return window.history; - }; - BrowserDomAdapter.prototype.getLocation = function() { - return window.location; - }; - BrowserDomAdapter.prototype.getBaseHref = function() { - var href = getBaseElementHref(); - if (lang_1.isBlank(href)) { - return null; - } - return relativePath(href); - }; - BrowserDomAdapter.prototype.resetBaseElement = function() { - baseElement = null; - }; - BrowserDomAdapter.prototype.getUserAgent = function() { - return window.navigator.userAgent; - }; - BrowserDomAdapter.prototype.setData = function(element, name, value) { - this.setAttribute(element, 'data-' + name, value); - }; - BrowserDomAdapter.prototype.getData = function(element, name) { - return this.getAttribute(element, 'data-' + name); - }; - BrowserDomAdapter.prototype.getComputedStyle = function(element) { - return getComputedStyle(element); - }; - BrowserDomAdapter.prototype.setGlobalVar = function(path, value) { - lang_1.setValueOnPath(lang_1.global, path, value); - }; - BrowserDomAdapter.prototype.requestAnimationFrame = function(callback) { - return window.requestAnimationFrame(callback); - }; - BrowserDomAdapter.prototype.cancelAnimationFrame = function(id) { - window.cancelAnimationFrame(id); - }; - BrowserDomAdapter.prototype.performanceNow = function() { - if (lang_1.isPresent(window.performance) && lang_1.isPresent(window.performance.now)) { - return window.performance.now(); - } else { - return lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); - } - }; - return BrowserDomAdapter; - }(generic_browser_adapter_1.GenericBrowserDomAdapter)); - exports.BrowserDomAdapter = BrowserDomAdapter; - var baseElement = null; - function getBaseElementHref() { - if (lang_1.isBlank(baseElement)) { - baseElement = document.querySelector('base'); - if (lang_1.isBlank(baseElement)) { - return null; - } - } - return baseElement.getAttribute('href'); - } - var urlParsingNode = null; - function relativePath(url) { - if (lang_1.isBlank(urlParsingNode)) { - urlParsingNode = document.createElement("a"); - } - urlParsingNode.setAttribute('href', url); - return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname; - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/browser/tools/tools", ["angular2/src/facade/lang", "angular2/src/platform/browser/tools/common_tools"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var common_tools_1 = require("angular2/src/platform/browser/tools/common_tools"); - var context = lang_1.global; - function enableDebugTools(ref) { - context.ng = new common_tools_1.AngularTools(ref); - } - exports.enableDebugTools = enableDebugTools; - function disableDebugTools() { - delete context.ng; - } - exports.disableDebugTools = disableDebugTools; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/html_parser", ["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/compiler/html_ast", "angular2/src/core/di", "angular2/src/compiler/html_lexer", "angular2/src/compiler/parse_util", "angular2/src/compiler/html_tags"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - var html_ast_1 = require("angular2/src/compiler/html_ast"); - var di_1 = require("angular2/src/core/di"); - var html_lexer_1 = require("angular2/src/compiler/html_lexer"); - var parse_util_1 = require("angular2/src/compiler/parse_util"); - var html_tags_1 = require("angular2/src/compiler/html_tags"); - var HtmlTreeError = (function(_super) { - __extends(HtmlTreeError, _super); - function HtmlTreeError(elementName, span, msg) { - _super.call(this, span, msg); - this.elementName = elementName; - } - HtmlTreeError.create = function(elementName, span, msg) { - return new HtmlTreeError(elementName, span, msg); - }; - return HtmlTreeError; - }(parse_util_1.ParseError)); - exports.HtmlTreeError = HtmlTreeError; - var HtmlParseTreeResult = (function() { - function HtmlParseTreeResult(rootNodes, errors) { - this.rootNodes = rootNodes; - this.errors = errors; - } - return HtmlParseTreeResult; - }()); - exports.HtmlParseTreeResult = HtmlParseTreeResult; - var HtmlParser = (function() { - function HtmlParser() {} - HtmlParser.prototype.parse = function(sourceContent, sourceUrl) { - var tokensAndErrors = html_lexer_1.tokenizeHtml(sourceContent, sourceUrl); - var treeAndErrors = new TreeBuilder(tokensAndErrors.tokens).build(); - return new HtmlParseTreeResult(treeAndErrors.rootNodes, tokensAndErrors.errors.concat(treeAndErrors.errors)); - }; - HtmlParser = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], HtmlParser); - return HtmlParser; - }()); - exports.HtmlParser = HtmlParser; - var TreeBuilder = (function() { - function TreeBuilder(tokens) { - this.tokens = tokens; - this.index = -1; - this.rootNodes = []; - this.errors = []; - this.elementStack = []; - this._advance(); - } - TreeBuilder.prototype.build = function() { - while (this.peek.type !== html_lexer_1.HtmlTokenType.EOF) { - if (this.peek.type === html_lexer_1.HtmlTokenType.TAG_OPEN_START) { - this._consumeStartTag(this._advance()); - } else if (this.peek.type === html_lexer_1.HtmlTokenType.TAG_CLOSE) { - this._consumeEndTag(this._advance()); - } else if (this.peek.type === html_lexer_1.HtmlTokenType.CDATA_START) { - this._closeVoidElement(); - this._consumeCdata(this._advance()); - } else if (this.peek.type === html_lexer_1.HtmlTokenType.COMMENT_START) { - this._closeVoidElement(); - this._consumeComment(this._advance()); - } else if (this.peek.type === html_lexer_1.HtmlTokenType.TEXT || this.peek.type === html_lexer_1.HtmlTokenType.RAW_TEXT || this.peek.type === html_lexer_1.HtmlTokenType.ESCAPABLE_RAW_TEXT) { - this._closeVoidElement(); - this._consumeText(this._advance()); - } else { - this._advance(); - } - } - return new HtmlParseTreeResult(this.rootNodes, this.errors); - }; - TreeBuilder.prototype._advance = function() { - var prev = this.peek; - if (this.index < this.tokens.length - 1) { - this.index++; - } - this.peek = this.tokens[this.index]; - return prev; - }; - TreeBuilder.prototype._advanceIf = function(type) { - if (this.peek.type === type) { - return this._advance(); - } - return null; - }; - TreeBuilder.prototype._consumeCdata = function(startToken) { - this._consumeText(this._advance()); - this._advanceIf(html_lexer_1.HtmlTokenType.CDATA_END); - }; - TreeBuilder.prototype._consumeComment = function(token) { - var text = this._advanceIf(html_lexer_1.HtmlTokenType.RAW_TEXT); - this._advanceIf(html_lexer_1.HtmlTokenType.COMMENT_END); - var value = lang_1.isPresent(text) ? text.parts[0].trim() : null; - this._addToParent(new html_ast_1.HtmlCommentAst(value, token.sourceSpan)); - }; - TreeBuilder.prototype._consumeText = function(token) { - var text = token.parts[0]; - if (text.length > 0 && text[0] == '\n') { - var parent_1 = this._getParentElement(); - if (lang_1.isPresent(parent_1) && parent_1.children.length == 0 && html_tags_1.getHtmlTagDefinition(parent_1.name).ignoreFirstLf) { - text = text.substring(1); - } - } - if (text.length > 0) { - this._addToParent(new html_ast_1.HtmlTextAst(text, token.sourceSpan)); - } - }; - TreeBuilder.prototype._closeVoidElement = function() { - if (this.elementStack.length > 0) { - var el = collection_1.ListWrapper.last(this.elementStack); - if (html_tags_1.getHtmlTagDefinition(el.name).isVoid) { - this.elementStack.pop(); - } - } - }; - TreeBuilder.prototype._consumeStartTag = function(startTagToken) { - var prefix = startTagToken.parts[0]; - var name = startTagToken.parts[1]; - var attrs = []; - while (this.peek.type === html_lexer_1.HtmlTokenType.ATTR_NAME) { - attrs.push(this._consumeAttr(this._advance())); - } - var fullName = getElementFullName(prefix, name, this._getParentElement()); - var selfClosing = false; - if (this.peek.type === html_lexer_1.HtmlTokenType.TAG_OPEN_END_VOID) { - this._advance(); - selfClosing = true; - if (html_tags_1.getNsPrefix(fullName) == null && !html_tags_1.getHtmlTagDefinition(fullName).isVoid) { - this.errors.push(HtmlTreeError.create(fullName, startTagToken.sourceSpan, "Only void and foreign elements can be self closed \"" + startTagToken.parts[1] + "\"")); - } - } else if (this.peek.type === html_lexer_1.HtmlTokenType.TAG_OPEN_END) { - this._advance(); - selfClosing = false; - } - var end = this.peek.sourceSpan.start; - var span = new parse_util_1.ParseSourceSpan(startTagToken.sourceSpan.start, end); - var el = new html_ast_1.HtmlElementAst(fullName, attrs, [], span, span, null); - this._pushElement(el); - if (selfClosing) { - this._popElement(fullName); - el.endSourceSpan = span; - } - }; - TreeBuilder.prototype._pushElement = function(el) { - if (this.elementStack.length > 0) { - var parentEl = collection_1.ListWrapper.last(this.elementStack); - if (html_tags_1.getHtmlTagDefinition(parentEl.name).isClosedByChild(el.name)) { - this.elementStack.pop(); - } - } - var tagDef = html_tags_1.getHtmlTagDefinition(el.name); - var parentEl = this._getParentElement(); - if (tagDef.requireExtraParent(lang_1.isPresent(parentEl) ? parentEl.name : null)) { - var newParent = new html_ast_1.HtmlElementAst(tagDef.parentToAdd, [], [el], el.sourceSpan, el.startSourceSpan, el.endSourceSpan); - this._addToParent(newParent); - this.elementStack.push(newParent); - this.elementStack.push(el); - } else { - this._addToParent(el); - this.elementStack.push(el); - } - }; - TreeBuilder.prototype._consumeEndTag = function(endTagToken) { - var fullName = getElementFullName(endTagToken.parts[0], endTagToken.parts[1], this._getParentElement()); - this._getParentElement().endSourceSpan = endTagToken.sourceSpan; - if (html_tags_1.getHtmlTagDefinition(fullName).isVoid) { - this.errors.push(HtmlTreeError.create(fullName, endTagToken.sourceSpan, "Void elements do not have end tags \"" + endTagToken.parts[1] + "\"")); - } else if (!this._popElement(fullName)) { - this.errors.push(HtmlTreeError.create(fullName, endTagToken.sourceSpan, "Unexpected closing tag \"" + endTagToken.parts[1] + "\"")); - } - }; - TreeBuilder.prototype._popElement = function(fullName) { - for (var stackIndex = this.elementStack.length - 1; stackIndex >= 0; stackIndex--) { - var el = this.elementStack[stackIndex]; - if (el.name == fullName) { - collection_1.ListWrapper.splice(this.elementStack, stackIndex, this.elementStack.length - stackIndex); - return true; - } - if (!html_tags_1.getHtmlTagDefinition(el.name).closedByParent) { - return false; - } - } - return false; - }; - TreeBuilder.prototype._consumeAttr = function(attrName) { - var fullName = html_tags_1.mergeNsAndName(attrName.parts[0], attrName.parts[1]); - var end = attrName.sourceSpan.end; - var value = ''; - if (this.peek.type === html_lexer_1.HtmlTokenType.ATTR_VALUE) { - var valueToken = this._advance(); - value = valueToken.parts[0]; - end = valueToken.sourceSpan.end; - } - return new html_ast_1.HtmlAttrAst(fullName, value, new parse_util_1.ParseSourceSpan(attrName.sourceSpan.start, end)); - }; - TreeBuilder.prototype._getParentElement = function() { - return this.elementStack.length > 0 ? collection_1.ListWrapper.last(this.elementStack) : null; - }; - TreeBuilder.prototype._addToParent = function(node) { - var parent = this._getParentElement(); - if (lang_1.isPresent(parent)) { - parent.children.push(node); - } else { - this.rootNodes.push(node); - } - }; - return TreeBuilder; - }()); - function getElementFullName(prefix, localName, parentElement) { - if (lang_1.isBlank(prefix)) { - prefix = html_tags_1.getHtmlTagDefinition(localName).implicitNamespacePrefix; - if (lang_1.isBlank(prefix) && lang_1.isPresent(parentElement)) { - prefix = html_tags_1.getNsPrefix(parentElement.name); - } - } - return html_tags_1.mergeNsAndName(prefix, localName); - } - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/common/forms", ["angular2/src/common/forms/model", "angular2/src/common/forms/directives/abstract_control_directive", "angular2/src/common/forms/directives/control_container", "angular2/src/common/forms/directives/ng_control_name", "angular2/src/common/forms/directives/ng_form_control", "angular2/src/common/forms/directives/ng_model", "angular2/src/common/forms/directives/ng_control", "angular2/src/common/forms/directives/ng_control_group", "angular2/src/common/forms/directives/ng_form_model", "angular2/src/common/forms/directives/ng_form", "angular2/src/common/forms/directives/control_value_accessor", "angular2/src/common/forms/directives/default_value_accessor", "angular2/src/common/forms/directives/ng_control_status", "angular2/src/common/forms/directives/checkbox_value_accessor", "angular2/src/common/forms/directives/select_control_value_accessor", "angular2/src/common/forms/directives", "angular2/src/common/forms/validators", "angular2/src/common/forms/directives/validators", "angular2/src/common/forms/form_builder", "angular2/src/common/forms/form_builder", "angular2/src/common/forms/directives/radio_control_value_accessor", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var model_1 = require("angular2/src/common/forms/model"); - exports.AbstractControl = model_1.AbstractControl; - exports.Control = model_1.Control; - exports.ControlGroup = model_1.ControlGroup; - exports.ControlArray = model_1.ControlArray; - var abstract_control_directive_1 = require("angular2/src/common/forms/directives/abstract_control_directive"); - exports.AbstractControlDirective = abstract_control_directive_1.AbstractControlDirective; - var control_container_1 = require("angular2/src/common/forms/directives/control_container"); - exports.ControlContainer = control_container_1.ControlContainer; - var ng_control_name_1 = require("angular2/src/common/forms/directives/ng_control_name"); - exports.NgControlName = ng_control_name_1.NgControlName; - var ng_form_control_1 = require("angular2/src/common/forms/directives/ng_form_control"); - exports.NgFormControl = ng_form_control_1.NgFormControl; - var ng_model_1 = require("angular2/src/common/forms/directives/ng_model"); - exports.NgModel = ng_model_1.NgModel; - var ng_control_1 = require("angular2/src/common/forms/directives/ng_control"); - exports.NgControl = ng_control_1.NgControl; - var ng_control_group_1 = require("angular2/src/common/forms/directives/ng_control_group"); - exports.NgControlGroup = ng_control_group_1.NgControlGroup; - var ng_form_model_1 = require("angular2/src/common/forms/directives/ng_form_model"); - exports.NgFormModel = ng_form_model_1.NgFormModel; - var ng_form_1 = require("angular2/src/common/forms/directives/ng_form"); - exports.NgForm = ng_form_1.NgForm; - var control_value_accessor_1 = require("angular2/src/common/forms/directives/control_value_accessor"); - exports.NG_VALUE_ACCESSOR = control_value_accessor_1.NG_VALUE_ACCESSOR; - var default_value_accessor_1 = require("angular2/src/common/forms/directives/default_value_accessor"); - exports.DefaultValueAccessor = default_value_accessor_1.DefaultValueAccessor; - var ng_control_status_1 = require("angular2/src/common/forms/directives/ng_control_status"); - exports.NgControlStatus = ng_control_status_1.NgControlStatus; - var checkbox_value_accessor_1 = require("angular2/src/common/forms/directives/checkbox_value_accessor"); - exports.CheckboxControlValueAccessor = checkbox_value_accessor_1.CheckboxControlValueAccessor; - var select_control_value_accessor_1 = require("angular2/src/common/forms/directives/select_control_value_accessor"); - exports.NgSelectOption = select_control_value_accessor_1.NgSelectOption; - exports.SelectControlValueAccessor = select_control_value_accessor_1.SelectControlValueAccessor; - var directives_1 = require("angular2/src/common/forms/directives"); - exports.FORM_DIRECTIVES = directives_1.FORM_DIRECTIVES; - exports.RadioButtonState = directives_1.RadioButtonState; - var validators_1 = require("angular2/src/common/forms/validators"); - exports.NG_VALIDATORS = validators_1.NG_VALIDATORS; - exports.NG_ASYNC_VALIDATORS = validators_1.NG_ASYNC_VALIDATORS; - exports.Validators = validators_1.Validators; - var validators_2 = require("angular2/src/common/forms/directives/validators"); - exports.RequiredValidator = validators_2.RequiredValidator; - exports.MinLengthValidator = validators_2.MinLengthValidator; - exports.MaxLengthValidator = validators_2.MaxLengthValidator; - exports.PatternValidator = validators_2.PatternValidator; - var form_builder_1 = require("angular2/src/common/forms/form_builder"); - exports.FormBuilder = form_builder_1.FormBuilder; - var form_builder_2 = require("angular2/src/common/forms/form_builder"); - var radio_control_value_accessor_1 = require("angular2/src/common/forms/directives/radio_control_value_accessor"); - var lang_1 = require("angular2/src/facade/lang"); - exports.FORM_PROVIDERS = lang_1.CONST_EXPR([form_builder_2.FormBuilder, radio_control_value_accessor_1.RadioControlRegistry]); - exports.FORM_BINDINGS = exports.FORM_PROVIDERS; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/template_parser", ["angular2/src/facade/collection", "angular2/src/facade/lang", "angular2/core", "angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/core/change_detection/change_detection", "angular2/src/compiler/html_parser", "angular2/src/compiler/html_tags", "angular2/src/compiler/parse_util", "angular2/src/core/change_detection/parser/ast", "angular2/src/compiler/template_ast", "angular2/src/compiler/selector", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/template_preparser", "angular2/src/compiler/style_url_resolver", "angular2/src/compiler/html_ast", "angular2/src/compiler/util"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var collection_1 = require("angular2/src/facade/collection"); - var lang_1 = require("angular2/src/facade/lang"); - var core_1 = require("angular2/core"); - var lang_2 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); - var html_parser_1 = require("angular2/src/compiler/html_parser"); - var html_tags_1 = require("angular2/src/compiler/html_tags"); - var parse_util_1 = require("angular2/src/compiler/parse_util"); - var ast_1 = require("angular2/src/core/change_detection/parser/ast"); - var template_ast_1 = require("angular2/src/compiler/template_ast"); - var selector_1 = require("angular2/src/compiler/selector"); - var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); - var template_preparser_1 = require("angular2/src/compiler/template_preparser"); - var style_url_resolver_1 = require("angular2/src/compiler/style_url_resolver"); - var html_ast_1 = require("angular2/src/compiler/html_ast"); - var util_1 = require("angular2/src/compiler/util"); - var BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(var-|#)|(on-)|(bindon-))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g; - var TEMPLATE_ELEMENT = 'template'; - var TEMPLATE_ATTR = 'template'; - var TEMPLATE_ATTR_PREFIX = '*'; - var CLASS_ATTR = 'class'; - var PROPERTY_PARTS_SEPARATOR = '.'; - var ATTRIBUTE_PREFIX = 'attr'; - var CLASS_PREFIX = 'class'; - var STYLE_PREFIX = 'style'; - var TEXT_CSS_SELECTOR = selector_1.CssSelector.parse('*')[0]; - exports.TEMPLATE_TRANSFORMS = lang_2.CONST_EXPR(new core_1.OpaqueToken('TemplateTransforms')); - var TemplateParseError = (function(_super) { - __extends(TemplateParseError, _super); - function TemplateParseError(message, span) { - _super.call(this, span, message); - } - return TemplateParseError; - }(parse_util_1.ParseError)); - exports.TemplateParseError = TemplateParseError; - var TemplateParseResult = (function() { - function TemplateParseResult(templateAst, errors) { - this.templateAst = templateAst; - this.errors = errors; - } - return TemplateParseResult; - }()); - exports.TemplateParseResult = TemplateParseResult; - var TemplateParser = (function() { - function TemplateParser(_exprParser, _schemaRegistry, _htmlParser, transforms) { - this._exprParser = _exprParser; - this._schemaRegistry = _schemaRegistry; - this._htmlParser = _htmlParser; - this.transforms = transforms; - } - TemplateParser.prototype.parse = function(template, directives, pipes, templateUrl) { - var result = this.tryParse(template, directives, pipes, templateUrl); - if (lang_1.isPresent(result.errors)) { - var errorString = result.errors.join('\n'); - throw new exceptions_1.BaseException("Template parse errors:\n" + errorString); - } - return result.templateAst; - }; - TemplateParser.prototype.tryParse = function(template, directives, pipes, templateUrl) { - var parseVisitor = new TemplateParseVisitor(directives, pipes, this._exprParser, this._schemaRegistry); - var htmlAstWithErrors = this._htmlParser.parse(template, templateUrl); - var result = html_ast_1.htmlVisitAll(parseVisitor, htmlAstWithErrors.rootNodes, EMPTY_COMPONENT); - var errors = htmlAstWithErrors.errors.concat(parseVisitor.errors); - if (errors.length > 0) { - return new TemplateParseResult(result, errors); - } - if (lang_1.isPresent(this.transforms)) { - this.transforms.forEach(function(transform) { - result = template_ast_1.templateVisitAll(transform, result); - }); - } - return new TemplateParseResult(result); - }; - TemplateParser = __decorate([core_1.Injectable(), __param(3, core_1.Optional()), __param(3, core_1.Inject(exports.TEMPLATE_TRANSFORMS)), __metadata('design:paramtypes', [change_detection_1.Parser, element_schema_registry_1.ElementSchemaRegistry, html_parser_1.HtmlParser, Array])], TemplateParser); - return TemplateParser; - }()); - exports.TemplateParser = TemplateParser; - var TemplateParseVisitor = (function() { - function TemplateParseVisitor(directives, pipes, _exprParser, _schemaRegistry) { - var _this = this; - this._exprParser = _exprParser; - this._schemaRegistry = _schemaRegistry; - this.errors = []; - this.directivesIndex = new Map(); - this.ngContentCount = 0; - this.selectorMatcher = new selector_1.SelectorMatcher(); - collection_1.ListWrapper.forEachWithIndex(directives, function(directive, index) { - var selector = selector_1.CssSelector.parse(directive.selector); - _this.selectorMatcher.addSelectables(selector, directive); - _this.directivesIndex.set(directive, index); - }); - this.pipesByName = new Map(); - pipes.forEach(function(pipe) { - return _this.pipesByName.set(pipe.name, pipe); - }); - } - TemplateParseVisitor.prototype._reportError = function(message, sourceSpan) { - this.errors.push(new TemplateParseError(message, sourceSpan)); - }; - TemplateParseVisitor.prototype._parseInterpolation = function(value, sourceSpan) { - var sourceInfo = sourceSpan.start.toString(); - try { - var ast = this._exprParser.parseInterpolation(value, sourceInfo); - this._checkPipes(ast, sourceSpan); - return ast; - } catch (e) { - this._reportError("" + e, sourceSpan); - return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); - } - }; - TemplateParseVisitor.prototype._parseAction = function(value, sourceSpan) { - var sourceInfo = sourceSpan.start.toString(); - try { - var ast = this._exprParser.parseAction(value, sourceInfo); - this._checkPipes(ast, sourceSpan); - return ast; - } catch (e) { - this._reportError("" + e, sourceSpan); - return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); - } - }; - TemplateParseVisitor.prototype._parseBinding = function(value, sourceSpan) { - var sourceInfo = sourceSpan.start.toString(); - try { - var ast = this._exprParser.parseBinding(value, sourceInfo); - this._checkPipes(ast, sourceSpan); - return ast; - } catch (e) { - this._reportError("" + e, sourceSpan); - return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); - } - }; - TemplateParseVisitor.prototype._parseTemplateBindings = function(value, sourceSpan) { - var _this = this; - var sourceInfo = sourceSpan.start.toString(); - try { - var bindings = this._exprParser.parseTemplateBindings(value, sourceInfo); - bindings.forEach(function(binding) { - if (lang_1.isPresent(binding.expression)) { - _this._checkPipes(binding.expression, sourceSpan); - } - }); - return bindings; - } catch (e) { - this._reportError("" + e, sourceSpan); - return []; - } - }; - TemplateParseVisitor.prototype._checkPipes = function(ast, sourceSpan) { - var _this = this; - if (lang_1.isPresent(ast)) { - var collector = new PipeCollector(); - ast.visit(collector); - collector.pipes.forEach(function(pipeName) { - if (!_this.pipesByName.has(pipeName)) { - _this._reportError("The pipe '" + pipeName + "' could not be found", sourceSpan); - } - }); - } - }; - TemplateParseVisitor.prototype.visitText = function(ast, component) { - var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); - var expr = this._parseInterpolation(ast.value, ast.sourceSpan); - if (lang_1.isPresent(expr)) { - return new template_ast_1.BoundTextAst(expr, ngContentIndex, ast.sourceSpan); - } else { - return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceSpan); - } - }; - TemplateParseVisitor.prototype.visitAttr = function(ast, contex) { - return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceSpan); - }; - TemplateParseVisitor.prototype.visitComment = function(ast, context) { - return null; - }; - TemplateParseVisitor.prototype.visitElement = function(element, component) { - var _this = this; - var nodeName = element.name; - var preparsedElement = template_preparser_1.preparseElement(element); - if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE) { - return null; - } - if (preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET && style_url_resolver_1.isStyleUrlResolvable(preparsedElement.hrefAttr)) { - return null; - } - var matchableAttrs = []; - var elementOrDirectiveProps = []; - var vars = []; - var events = []; - var templateElementOrDirectiveProps = []; - var templateVars = []; - var templateMatchableAttrs = []; - var hasInlineTemplates = false; - var attrs = []; - element.attrs.forEach(function(attr) { - var hasBinding = _this._parseAttr(attr, matchableAttrs, elementOrDirectiveProps, events, vars); - var hasTemplateBinding = _this._parseInlineTemplateBinding(attr, templateMatchableAttrs, templateElementOrDirectiveProps, templateVars); - if (!hasBinding && !hasTemplateBinding) { - attrs.push(_this.visitAttr(attr, null)); - matchableAttrs.push([attr.name, attr.value]); - } - if (hasTemplateBinding) { - hasInlineTemplates = true; - } - }); - var lcElName = html_tags_1.splitNsName(nodeName.toLowerCase())[1]; - var isTemplateElement = lcElName == TEMPLATE_ELEMENT; - var elementCssSelector = createElementCssSelector(nodeName, matchableAttrs); - var directives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, elementCssSelector), elementOrDirectiveProps, isTemplateElement ? [] : vars, element.sourceSpan); - var elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, directives); - var children = html_ast_1.htmlVisitAll(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, Component.create(directives)); - var projectionSelector = lang_1.isPresent(preparsedElement.projectAs) ? selector_1.CssSelector.parse(preparsedElement.projectAs)[0] : elementCssSelector; - var ngContentIndex = component.findNgContentIndex(projectionSelector); - var parsedElement; - if (preparsedElement.type === template_preparser_1.PreparsedElementType.NG_CONTENT) { - if (lang_1.isPresent(element.children) && element.children.length > 0) { - this._reportError(" element cannot have content. must be immediately followed by ", element.sourceSpan); - } - parsedElement = new template_ast_1.NgContentAst(this.ngContentCount++, hasInlineTemplates ? null : ngContentIndex, element.sourceSpan); - } else if (isTemplateElement) { - this._assertAllEventsPublishedByDirectives(directives, events); - this._assertNoComponentsNorElementBindingsOnTemplate(directives, elementProps, element.sourceSpan); - parsedElement = new template_ast_1.EmbeddedTemplateAst(attrs, events, vars, directives, children, hasInlineTemplates ? null : ngContentIndex, element.sourceSpan); - } else { - this._assertOnlyOneComponent(directives, element.sourceSpan); - var elementExportAsVars = vars.filter(function(varAst) { - return varAst.value.length === 0; - }); - var ngContentIndex_1 = hasInlineTemplates ? null : component.findNgContentIndex(projectionSelector); - parsedElement = new template_ast_1.ElementAst(nodeName, attrs, elementProps, events, elementExportAsVars, directives, children, hasInlineTemplates ? null : ngContentIndex_1, element.sourceSpan); - } - if (hasInlineTemplates) { - var templateCssSelector = createElementCssSelector(TEMPLATE_ELEMENT, templateMatchableAttrs); - var templateDirectives = this._createDirectiveAsts(element.name, this._parseDirectives(this.selectorMatcher, templateCssSelector), templateElementOrDirectiveProps, [], element.sourceSpan); - var templateElementProps = this._createElementPropertyAsts(element.name, templateElementOrDirectiveProps, templateDirectives); - this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectives, templateElementProps, element.sourceSpan); - parsedElement = new template_ast_1.EmbeddedTemplateAst([], [], templateVars, templateDirectives, [parsedElement], ngContentIndex, element.sourceSpan); - } - return parsedElement; - }; - TemplateParseVisitor.prototype._parseInlineTemplateBinding = function(attr, targetMatchableAttrs, targetProps, targetVars) { - var templateBindingsSource = null; - if (attr.name == TEMPLATE_ATTR) { - templateBindingsSource = attr.value; - } else if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) { - var key = attr.name.substring(TEMPLATE_ATTR_PREFIX.length); - templateBindingsSource = (attr.value.length == 0) ? key : key + ' ' + attr.value; - } - if (lang_1.isPresent(templateBindingsSource)) { - var bindings = this._parseTemplateBindings(templateBindingsSource, attr.sourceSpan); - for (var i = 0; i < bindings.length; i++) { - var binding = bindings[i]; - if (binding.keyIsVar) { - targetVars.push(new template_ast_1.VariableAst(binding.key, binding.name, attr.sourceSpan)); - targetMatchableAttrs.push([binding.key, binding.name]); - } else if (lang_1.isPresent(binding.expression)) { - this._parsePropertyAst(binding.key, binding.expression, attr.sourceSpan, targetMatchableAttrs, targetProps); - } else { - targetMatchableAttrs.push([binding.key, '']); - this._parseLiteralAttr(binding.key, null, attr.sourceSpan, targetProps); - } - } - return true; - } - return false; - }; - TemplateParseVisitor.prototype._parseAttr = function(attr, targetMatchableAttrs, targetProps, targetEvents, targetVars) { - var attrName = this._normalizeAttributeName(attr.name); - var attrValue = attr.value; - var bindParts = lang_1.RegExpWrapper.firstMatch(BIND_NAME_REGEXP, attrName); - var hasBinding = false; - if (lang_1.isPresent(bindParts)) { - hasBinding = true; - if (lang_1.isPresent(bindParts[1])) { - this._parseProperty(bindParts[5], attrValue, attr.sourceSpan, targetMatchableAttrs, targetProps); - } else if (lang_1.isPresent(bindParts[2])) { - var identifier = bindParts[5]; - this._parseVariable(identifier, attrValue, attr.sourceSpan, targetVars); - } else if (lang_1.isPresent(bindParts[3])) { - this._parseEvent(bindParts[5], attrValue, attr.sourceSpan, targetMatchableAttrs, targetEvents); - } else if (lang_1.isPresent(bindParts[4])) { - this._parseProperty(bindParts[5], attrValue, attr.sourceSpan, targetMatchableAttrs, targetProps); - this._parseAssignmentEvent(bindParts[5], attrValue, attr.sourceSpan, targetMatchableAttrs, targetEvents); - } else if (lang_1.isPresent(bindParts[6])) { - this._parseProperty(bindParts[6], attrValue, attr.sourceSpan, targetMatchableAttrs, targetProps); - this._parseAssignmentEvent(bindParts[6], attrValue, attr.sourceSpan, targetMatchableAttrs, targetEvents); - } else if (lang_1.isPresent(bindParts[7])) { - this._parseProperty(bindParts[7], attrValue, attr.sourceSpan, targetMatchableAttrs, targetProps); - } else if (lang_1.isPresent(bindParts[8])) { - this._parseEvent(bindParts[8], attrValue, attr.sourceSpan, targetMatchableAttrs, targetEvents); - } - } else { - hasBinding = this._parsePropertyInterpolation(attrName, attrValue, attr.sourceSpan, targetMatchableAttrs, targetProps); - } - if (!hasBinding) { - this._parseLiteralAttr(attrName, attrValue, attr.sourceSpan, targetProps); - } - return hasBinding; - }; - TemplateParseVisitor.prototype._normalizeAttributeName = function(attrName) { - return attrName.toLowerCase().startsWith('data-') ? attrName.substring(5) : attrName; - }; - TemplateParseVisitor.prototype._parseVariable = function(identifier, value, sourceSpan, targetVars) { - if (identifier.indexOf('-') > -1) { - this._reportError("\"-\" is not allowed in variable names", sourceSpan); - } - targetVars.push(new template_ast_1.VariableAst(identifier, value, sourceSpan)); - }; - TemplateParseVisitor.prototype._parseProperty = function(name, expression, sourceSpan, targetMatchableAttrs, targetProps) { - this._parsePropertyAst(name, this._parseBinding(expression, sourceSpan), sourceSpan, targetMatchableAttrs, targetProps); - }; - TemplateParseVisitor.prototype._parsePropertyInterpolation = function(name, value, sourceSpan, targetMatchableAttrs, targetProps) { - var expr = this._parseInterpolation(value, sourceSpan); - if (lang_1.isPresent(expr)) { - this._parsePropertyAst(name, expr, sourceSpan, targetMatchableAttrs, targetProps); - return true; - } - return false; - }; - TemplateParseVisitor.prototype._parsePropertyAst = function(name, ast, sourceSpan, targetMatchableAttrs, targetProps) { - targetMatchableAttrs.push([name, ast.source]); - targetProps.push(new BoundElementOrDirectiveProperty(name, ast, false, sourceSpan)); - }; - TemplateParseVisitor.prototype._parseAssignmentEvent = function(name, expression, sourceSpan, targetMatchableAttrs, targetEvents) { - this._parseEvent(name + "Change", expression + "=$event", sourceSpan, targetMatchableAttrs, targetEvents); - }; - TemplateParseVisitor.prototype._parseEvent = function(name, expression, sourceSpan, targetMatchableAttrs, targetEvents) { - var parts = util_1.splitAtColon(name, [null, name]); - var target = parts[0]; - var eventName = parts[1]; - var ast = this._parseAction(expression, sourceSpan); - targetMatchableAttrs.push([name, ast.source]); - targetEvents.push(new template_ast_1.BoundEventAst(eventName, target, ast, sourceSpan)); - }; - TemplateParseVisitor.prototype._parseLiteralAttr = function(name, value, sourceSpan, targetProps) { - targetProps.push(new BoundElementOrDirectiveProperty(name, this._exprParser.wrapLiteralPrimitive(value, ''), true, sourceSpan)); - }; - TemplateParseVisitor.prototype._parseDirectives = function(selectorMatcher, elementCssSelector) { - var _this = this; - var directives = []; - selectorMatcher.match(elementCssSelector, function(selector, directive) { - directives.push(directive); - }); - collection_1.ListWrapper.sort(directives, function(dir1, dir2) { - var dir1Comp = dir1.isComponent; - var dir2Comp = dir2.isComponent; - if (dir1Comp && !dir2Comp) { - return -1; - } else if (!dir1Comp && dir2Comp) { - return 1; - } else { - return _this.directivesIndex.get(dir1) - _this.directivesIndex.get(dir2); - } - }); - return directives; - }; - TemplateParseVisitor.prototype._createDirectiveAsts = function(elementName, directives, props, possibleExportAsVars, sourceSpan) { - var _this = this; - var matchedVariables = new Set(); - var directiveAsts = directives.map(function(directive) { - var hostProperties = []; - var hostEvents = []; - var directiveProperties = []; - _this._createDirectiveHostPropertyAsts(elementName, directive.hostProperties, sourceSpan, hostProperties); - _this._createDirectiveHostEventAsts(directive.hostListeners, sourceSpan, hostEvents); - _this._createDirectivePropertyAsts(directive.inputs, props, directiveProperties); - var exportAsVars = []; - possibleExportAsVars.forEach(function(varAst) { - if ((varAst.value.length === 0 && directive.isComponent) || (directive.exportAs == varAst.value)) { - exportAsVars.push(varAst); - matchedVariables.add(varAst.name); - } - }); - return new template_ast_1.DirectiveAst(directive, directiveProperties, hostProperties, hostEvents, exportAsVars, sourceSpan); - }); - possibleExportAsVars.forEach(function(varAst) { - if (varAst.value.length > 0 && !collection_1.SetWrapper.has(matchedVariables, varAst.name)) { - _this._reportError("There is no directive with \"exportAs\" set to \"" + varAst.value + "\"", varAst.sourceSpan); - } - }); - return directiveAsts; - }; - TemplateParseVisitor.prototype._createDirectiveHostPropertyAsts = function(elementName, hostProps, sourceSpan, targetPropertyAsts) { - var _this = this; - if (lang_1.isPresent(hostProps)) { - collection_1.StringMapWrapper.forEach(hostProps, function(expression, propName) { - var exprAst = _this._parseBinding(expression, sourceSpan); - targetPropertyAsts.push(_this._createElementPropertyAst(elementName, propName, exprAst, sourceSpan)); - }); - } - }; - TemplateParseVisitor.prototype._createDirectiveHostEventAsts = function(hostListeners, sourceSpan, targetEventAsts) { - var _this = this; - if (lang_1.isPresent(hostListeners)) { - collection_1.StringMapWrapper.forEach(hostListeners, function(expression, propName) { - _this._parseEvent(propName, expression, sourceSpan, [], targetEventAsts); - }); - } - }; - TemplateParseVisitor.prototype._createDirectivePropertyAsts = function(directiveProperties, boundProps, targetBoundDirectiveProps) { - if (lang_1.isPresent(directiveProperties)) { - var boundPropsByName = new Map(); - boundProps.forEach(function(boundProp) { - var prevValue = boundPropsByName.get(boundProp.name); - if (lang_1.isBlank(prevValue) || prevValue.isLiteral) { - boundPropsByName.set(boundProp.name, boundProp); - } - }); - collection_1.StringMapWrapper.forEach(directiveProperties, function(elProp, dirProp) { - var boundProp = boundPropsByName.get(elProp); - if (lang_1.isPresent(boundProp)) { - targetBoundDirectiveProps.push(new template_ast_1.BoundDirectivePropertyAst(dirProp, boundProp.name, boundProp.expression, boundProp.sourceSpan)); - } - }); - } - }; - TemplateParseVisitor.prototype._createElementPropertyAsts = function(elementName, props, directives) { - var _this = this; - var boundElementProps = []; - var boundDirectivePropsIndex = new Map(); - directives.forEach(function(directive) { - directive.inputs.forEach(function(prop) { - boundDirectivePropsIndex.set(prop.templateName, prop); - }); - }); - props.forEach(function(prop) { - if (!prop.isLiteral && lang_1.isBlank(boundDirectivePropsIndex.get(prop.name))) { - boundElementProps.push(_this._createElementPropertyAst(elementName, prop.name, prop.expression, prop.sourceSpan)); - } - }); - return boundElementProps; - }; - TemplateParseVisitor.prototype._createElementPropertyAst = function(elementName, name, ast, sourceSpan) { - var unit = null; - var bindingType; - var boundPropertyName; - var parts = name.split(PROPERTY_PARTS_SEPARATOR); - if (parts.length === 1) { - boundPropertyName = this._schemaRegistry.getMappedPropName(parts[0]); - bindingType = template_ast_1.PropertyBindingType.Property; - if (!this._schemaRegistry.hasProperty(elementName, boundPropertyName)) { - this._reportError("Can't bind to '" + boundPropertyName + "' since it isn't a known native property", sourceSpan); - } - } else { - if (parts[0] == ATTRIBUTE_PREFIX) { - boundPropertyName = parts[1]; - var nsSeparatorIdx = boundPropertyName.indexOf(':'); - if (nsSeparatorIdx > -1) { - var ns = boundPropertyName.substring(0, nsSeparatorIdx); - var name_1 = boundPropertyName.substring(nsSeparatorIdx + 1); - boundPropertyName = html_tags_1.mergeNsAndName(ns, name_1); - } - bindingType = template_ast_1.PropertyBindingType.Attribute; - } else if (parts[0] == CLASS_PREFIX) { - boundPropertyName = parts[1]; - bindingType = template_ast_1.PropertyBindingType.Class; - } else if (parts[0] == STYLE_PREFIX) { - unit = parts.length > 2 ? parts[2] : null; - boundPropertyName = parts[1]; - bindingType = template_ast_1.PropertyBindingType.Style; - } else { - this._reportError("Invalid property name '" + name + "'", sourceSpan); - bindingType = null; - } - } - return new template_ast_1.BoundElementPropertyAst(boundPropertyName, bindingType, ast, unit, sourceSpan); - }; - TemplateParseVisitor.prototype._findComponentDirectiveNames = function(directives) { - var componentTypeNames = []; - directives.forEach(function(directive) { - var typeName = directive.directive.type.name; - if (directive.directive.isComponent) { - componentTypeNames.push(typeName); - } - }); - return componentTypeNames; - }; - TemplateParseVisitor.prototype._assertOnlyOneComponent = function(directives, sourceSpan) { - var componentTypeNames = this._findComponentDirectiveNames(directives); - if (componentTypeNames.length > 1) { - this._reportError("More than one component: " + componentTypeNames.join(','), sourceSpan); - } - }; - TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate = function(directives, elementProps, sourceSpan) { - var _this = this; - var componentTypeNames = this._findComponentDirectiveNames(directives); - if (componentTypeNames.length > 0) { - this._reportError("Components on an embedded template: " + componentTypeNames.join(','), sourceSpan); - } - elementProps.forEach(function(prop) { - _this._reportError("Property binding " + prop.name + " not used by any directive on an embedded template", sourceSpan); - }); - }; - TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives = function(directives, events) { - var _this = this; - var allDirectiveEvents = new Set(); - directives.forEach(function(directive) { - collection_1.StringMapWrapper.forEach(directive.directive.outputs, function(eventName, _) { - allDirectiveEvents.add(eventName); - }); - }); - events.forEach(function(event) { - if (lang_1.isPresent(event.target) || !collection_1.SetWrapper.has(allDirectiveEvents, event.name)) { - _this._reportError("Event binding " + event.fullName + " not emitted by any directive on an embedded template", event.sourceSpan); - } - }); - }; - return TemplateParseVisitor; - }()); - var NonBindableVisitor = (function() { - function NonBindableVisitor() {} - NonBindableVisitor.prototype.visitElement = function(ast, component) { - var preparsedElement = template_preparser_1.preparseElement(ast); - if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET) { - return null; - } - var attrNameAndValues = ast.attrs.map(function(attrAst) { - return [attrAst.name, attrAst.value]; - }); - var selector = createElementCssSelector(ast.name, attrNameAndValues); - var ngContentIndex = component.findNgContentIndex(selector); - var children = html_ast_1.htmlVisitAll(this, ast.children, EMPTY_COMPONENT); - return new template_ast_1.ElementAst(ast.name, html_ast_1.htmlVisitAll(this, ast.attrs), [], [], [], [], children, ngContentIndex, ast.sourceSpan); - }; - NonBindableVisitor.prototype.visitComment = function(ast, context) { - return null; - }; - NonBindableVisitor.prototype.visitAttr = function(ast, context) { - return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceSpan); - }; - NonBindableVisitor.prototype.visitText = function(ast, component) { - var ngContentIndex = component.findNgContentIndex(TEXT_CSS_SELECTOR); - return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceSpan); - }; - return NonBindableVisitor; - }()); - var BoundElementOrDirectiveProperty = (function() { - function BoundElementOrDirectiveProperty(name, expression, isLiteral, sourceSpan) { - this.name = name; - this.expression = expression; - this.isLiteral = isLiteral; - this.sourceSpan = sourceSpan; - } - return BoundElementOrDirectiveProperty; - }()); - function splitClasses(classAttrValue) { - return lang_1.StringWrapper.split(classAttrValue.trim(), /\s+/g); - } - exports.splitClasses = splitClasses; - var Component = (function() { - function Component(ngContentIndexMatcher, wildcardNgContentIndex) { - this.ngContentIndexMatcher = ngContentIndexMatcher; - this.wildcardNgContentIndex = wildcardNgContentIndex; - } - Component.create = function(directives) { - if (directives.length === 0 || !directives[0].directive.isComponent) { - return EMPTY_COMPONENT; - } - var matcher = new selector_1.SelectorMatcher(); - var ngContentSelectors = directives[0].directive.template.ngContentSelectors; - var wildcardNgContentIndex = null; - for (var i = 0; i < ngContentSelectors.length; i++) { - var selector = ngContentSelectors[i]; - if (lang_1.StringWrapper.equals(selector, '*')) { - wildcardNgContentIndex = i; - } else { - matcher.addSelectables(selector_1.CssSelector.parse(ngContentSelectors[i]), i); - } - } - return new Component(matcher, wildcardNgContentIndex); - }; - Component.prototype.findNgContentIndex = function(selector) { - var ngContentIndices = []; - this.ngContentIndexMatcher.match(selector, function(selector, ngContentIndex) { - ngContentIndices.push(ngContentIndex); - }); - collection_1.ListWrapper.sort(ngContentIndices); - if (lang_1.isPresent(this.wildcardNgContentIndex)) { - ngContentIndices.push(this.wildcardNgContentIndex); - } - return ngContentIndices.length > 0 ? ngContentIndices[0] : null; - }; - return Component; - }()); - function createElementCssSelector(elementName, matchableAttrs) { - var cssSelector = new selector_1.CssSelector(); - var elNameNoNs = html_tags_1.splitNsName(elementName)[1]; - cssSelector.setElement(elNameNoNs); - for (var i = 0; i < matchableAttrs.length; i++) { - var attrName = matchableAttrs[i][0]; - var attrNameNoNs = html_tags_1.splitNsName(attrName)[1]; - var attrValue = matchableAttrs[i][1]; - cssSelector.addAttribute(attrNameNoNs, attrValue); - if (attrName.toLowerCase() == CLASS_ATTR) { - var classes = splitClasses(attrValue); - classes.forEach(function(className) { - return cssSelector.addClassName(className); - }); - } - } - return cssSelector; - } - var EMPTY_COMPONENT = new Component(new selector_1.SelectorMatcher(), null); - var NON_BINDABLE_VISITOR = new NonBindableVisitor(); - var PipeCollector = (function(_super) { - __extends(PipeCollector, _super); - function PipeCollector() { - _super.apply(this, arguments); - this.pipes = new Set(); - } - PipeCollector.prototype.visitPipe = function(ast) { - this.pipes.add(ast.name); - ast.exp.visit(this); - this.visitAll(ast.args); - return null; - }; - return PipeCollector; - }(ast_1.RecursiveAstVisitor)); - exports.PipeCollector = PipeCollector; - global.define = __define; - return module.exports; -}); - -System.register("angular2/common", ["angular2/src/common/pipes", "angular2/src/common/directives", "angular2/src/common/forms", "angular2/src/common/common_directives"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function __export(m) { - for (var p in m) - if (!exports.hasOwnProperty(p)) - exports[p] = m[p]; - } - __export(require("angular2/src/common/pipes")); - __export(require("angular2/src/common/directives")); - __export(require("angular2/src/common/forms")); - __export(require("angular2/src/common/common_directives")); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/template_compiler", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection", "angular2/src/facade/async", "angular2/src/compiler/directive_metadata", "angular2/src/compiler/template_ast", "angular2/src/core/di", "angular2/src/compiler/source_module", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/view_compiler", "angular2/src/compiler/proto_view_compiler", "angular2/src/compiler/template_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/core/linker/view", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/resolved_metadata_cache", "angular2/src/compiler/util"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var async_1 = require("angular2/src/facade/async"); - var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); - var template_ast_1 = require("angular2/src/compiler/template_ast"); - var di_1 = require("angular2/src/core/di"); - var source_module_1 = require("angular2/src/compiler/source_module"); - var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); - var style_compiler_1 = require("angular2/src/compiler/style_compiler"); - var view_compiler_1 = require("angular2/src/compiler/view_compiler"); - var proto_view_compiler_1 = require("angular2/src/compiler/proto_view_compiler"); - var template_parser_1 = require("angular2/src/compiler/template_parser"); - var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); - var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); - var view_1 = require("angular2/src/core/linker/view"); - var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); - var resolved_metadata_cache_1 = require("angular2/src/core/linker/resolved_metadata_cache"); - var util_1 = require("angular2/src/compiler/util"); - exports.METADATA_CACHE_MODULE_REF = source_module_1.moduleRef('package:angular2/src/core/linker/resolved_metadata_cache' + util_1.MODULE_SUFFIX); - var TemplateCompiler = (function() { - function TemplateCompiler(_runtimeMetadataResolver, _templateNormalizer, _templateParser, _styleCompiler, _cdCompiler, _protoViewCompiler, _viewCompiler, _resolvedMetadataCache, _genConfig) { - this._runtimeMetadataResolver = _runtimeMetadataResolver; - this._templateNormalizer = _templateNormalizer; - this._templateParser = _templateParser; - this._styleCompiler = _styleCompiler; - this._cdCompiler = _cdCompiler; - this._protoViewCompiler = _protoViewCompiler; - this._viewCompiler = _viewCompiler; - this._resolvedMetadataCache = _resolvedMetadataCache; - this._genConfig = _genConfig; - this._hostCacheKeys = new Map(); - this._compiledTemplateCache = new Map(); - this._compiledTemplateDone = new Map(); - } - TemplateCompiler.prototype.normalizeDirectiveMetadata = function(directive) { - if (!directive.isComponent) { - return async_1.PromiseWrapper.resolve(directive); - } - return this._templateNormalizer.normalizeTemplate(directive.type, directive.template).then(function(normalizedTemplate) { - return new directive_metadata_1.CompileDirectiveMetadata({ - type: directive.type, - isComponent: directive.isComponent, - dynamicLoadable: directive.dynamicLoadable, - selector: directive.selector, - exportAs: directive.exportAs, - changeDetection: directive.changeDetection, - inputs: directive.inputs, - outputs: directive.outputs, - hostListeners: directive.hostListeners, - hostProperties: directive.hostProperties, - hostAttributes: directive.hostAttributes, - lifecycleHooks: directive.lifecycleHooks, - providers: directive.providers, - viewProviders: directive.viewProviders, - queries: directive.queries, - viewQueries: directive.viewQueries, - template: normalizedTemplate - }); - }); - }; - TemplateCompiler.prototype.compileHostComponentRuntime = function(type) { - var compMeta = this._runtimeMetadataResolver.getDirectiveMetadata(type); - var hostCacheKey = this._hostCacheKeys.get(type); - if (lang_1.isBlank(hostCacheKey)) { - hostCacheKey = new Object(); - this._hostCacheKeys.set(type, hostCacheKey); - assertComponent(compMeta); - var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); - this._compileComponentRuntime(hostCacheKey, hostMeta, [compMeta], [], []); - } - return this._compiledTemplateDone.get(hostCacheKey).then(function(compiledTemplate) { - return new view_1.HostViewFactory(compMeta.selector, compiledTemplate.viewFactory); - }); - }; - TemplateCompiler.prototype.clearCache = function() { - this._styleCompiler.clearCache(); - this._compiledTemplateCache.clear(); - this._compiledTemplateDone.clear(); - this._hostCacheKeys.clear(); - }; - TemplateCompiler.prototype.compileTemplatesCodeGen = function(components) { - var _this = this; - if (components.length === 0) { - throw new exceptions_1.BaseException('No components given'); - } - var declarations = []; - components.forEach(function(componentWithDirs) { - var compMeta = componentWithDirs.component; - assertComponent(compMeta); - _this._compileComponentCodeGen(compMeta, componentWithDirs.directives, componentWithDirs.pipes, declarations); - if (compMeta.dynamicLoadable) { - var hostMeta = directive_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); - var viewFactoryExpression = _this._compileComponentCodeGen(hostMeta, [compMeta], [], declarations); - var constructionKeyword = lang_1.IS_DART ? 'const' : 'new'; - var compiledTemplateExpr = constructionKeyword + " " + proto_view_compiler_1.APP_VIEW_MODULE_REF + "HostViewFactory('" + compMeta.selector + "'," + viewFactoryExpression + ")"; - var varName = codeGenHostViewFactoryName(compMeta.type); - declarations.push("" + util_1.codeGenExportVariable(varName) + compiledTemplateExpr + ";"); - } - }); - var moduleUrl = components[0].component.type.moduleUrl; - return new source_module_1.SourceModule("" + templateModuleUrl(moduleUrl), declarations.join('\n')); - }; - TemplateCompiler.prototype.compileStylesheetCodeGen = function(stylesheetUrl, cssText) { - return this._styleCompiler.compileStylesheetCodeGen(stylesheetUrl, cssText); - }; - TemplateCompiler.prototype._compileComponentRuntime = function(cacheKey, compMeta, viewDirectives, pipes, compilingComponentsPath) { - var _this = this; - var uniqViewDirectives = removeDuplicates(viewDirectives); - var uniqViewPipes = removeDuplicates(pipes); - var compiledTemplate = this._compiledTemplateCache.get(cacheKey); - var done = this._compiledTemplateDone.get(cacheKey); - if (lang_1.isBlank(compiledTemplate)) { - compiledTemplate = new CompiledTemplate(); - this._compiledTemplateCache.set(cacheKey, compiledTemplate); - done = async_1.PromiseWrapper.all([this._styleCompiler.compileComponentRuntime(compMeta.template)].concat(uniqViewDirectives.map(function(dirMeta) { - return _this.normalizeDirectiveMetadata(dirMeta); - }))).then(function(stylesAndNormalizedViewDirMetas) { - var normalizedViewDirMetas = stylesAndNormalizedViewDirMetas.slice(1); - var styles = stylesAndNormalizedViewDirMetas[0]; - var parsedTemplate = _this._templateParser.parse(compMeta.template.template, normalizedViewDirMetas, uniqViewPipes, compMeta.type.name); - var childPromises = []; - var usedDirectives = DirectiveCollector.findUsedDirectives(parsedTemplate); - usedDirectives.components.forEach(function(component) { - return _this._compileNestedComponentRuntime(component, compilingComponentsPath, childPromises); - }); - return async_1.PromiseWrapper.all(childPromises).then(function(_) { - var filteredPipes = filterPipes(parsedTemplate, uniqViewPipes); - compiledTemplate.init(_this._createViewFactoryRuntime(compMeta, parsedTemplate, usedDirectives.directives, styles, filteredPipes)); - return compiledTemplate; - }); - }); - this._compiledTemplateDone.set(cacheKey, done); - } - return compiledTemplate; - }; - TemplateCompiler.prototype._compileNestedComponentRuntime = function(childComponentDir, parentCompilingComponentsPath, childPromises) { - var compilingComponentsPath = collection_1.ListWrapper.clone(parentCompilingComponentsPath); - var childCacheKey = childComponentDir.type.runtime; - var childViewDirectives = this._runtimeMetadataResolver.getViewDirectivesMetadata(childComponentDir.type.runtime); - var childViewPipes = this._runtimeMetadataResolver.getViewPipesMetadata(childComponentDir.type.runtime); - var childIsRecursive = collection_1.ListWrapper.contains(compilingComponentsPath, childCacheKey); - compilingComponentsPath.push(childCacheKey); - this._compileComponentRuntime(childCacheKey, childComponentDir, childViewDirectives, childViewPipes, compilingComponentsPath); - if (!childIsRecursive) { - childPromises.push(this._compiledTemplateDone.get(childCacheKey)); - } - }; - TemplateCompiler.prototype._createViewFactoryRuntime = function(compMeta, parsedTemplate, directives, styles, pipes) { - var _this = this; - if (lang_1.IS_DART || !this._genConfig.useJit) { - var changeDetectorFactories = this._cdCompiler.compileComponentRuntime(compMeta.type, compMeta.changeDetection, parsedTemplate); - var protoViews = this._protoViewCompiler.compileProtoViewRuntime(this._resolvedMetadataCache, compMeta, parsedTemplate, pipes); - return this._viewCompiler.compileComponentRuntime(compMeta, parsedTemplate, styles, protoViews.protoViews, changeDetectorFactories, function(compMeta) { - return _this._getNestedComponentViewFactory(compMeta); - }); - } else { - var declarations = []; - var viewFactoryExpr = this._createViewFactoryCodeGen('resolvedMetadataCache', compMeta, new source_module_1.SourceExpression([], 'styles'), parsedTemplate, pipes, declarations); - var vars = { - 'exports': {}, - 'styles': styles, - 'resolvedMetadataCache': this._resolvedMetadataCache - }; - directives.forEach(function(dirMeta) { - vars[dirMeta.type.name] = dirMeta.type.runtime; - if (dirMeta.isComponent && dirMeta.type.runtime !== compMeta.type.runtime) { - vars[("viewFactory_" + dirMeta.type.name + "0")] = _this._getNestedComponentViewFactory(dirMeta); - } - }); - pipes.forEach(function(pipeMeta) { - return vars[pipeMeta.type.name] = pipeMeta.type.runtime; - }); - var declarationsWithoutImports = source_module_1.SourceModule.getSourceWithoutImports(declarations.join('\n')); - return lang_1.evalExpression("viewFactory_" + compMeta.type.name, viewFactoryExpr, declarationsWithoutImports, mergeStringMaps([vars, change_detector_compiler_1.CHANGE_DETECTION_JIT_IMPORTS, proto_view_compiler_1.PROTO_VIEW_JIT_IMPORTS, view_compiler_1.VIEW_JIT_IMPORTS])); - } - }; - TemplateCompiler.prototype._getNestedComponentViewFactory = function(compMeta) { - return this._compiledTemplateCache.get(compMeta.type.runtime).viewFactory; - }; - TemplateCompiler.prototype._compileComponentCodeGen = function(compMeta, directives, pipes, targetDeclarations) { - var uniqueDirectives = removeDuplicates(directives); - var uniqPipes = removeDuplicates(pipes); - var styleExpr = this._styleCompiler.compileComponentCodeGen(compMeta.template); - var parsedTemplate = this._templateParser.parse(compMeta.template.template, uniqueDirectives, uniqPipes, compMeta.type.name); - var filteredPipes = filterPipes(parsedTemplate, uniqPipes); - return this._createViewFactoryCodeGen(exports.METADATA_CACHE_MODULE_REF + "CODEGEN_RESOLVED_METADATA_CACHE", compMeta, styleExpr, parsedTemplate, filteredPipes, targetDeclarations); - }; - TemplateCompiler.prototype._createViewFactoryCodeGen = function(resolvedMetadataCacheExpr, compMeta, styleExpr, parsedTemplate, pipes, targetDeclarations) { - var changeDetectorsExprs = this._cdCompiler.compileComponentCodeGen(compMeta.type, compMeta.changeDetection, parsedTemplate); - var protoViewExprs = this._protoViewCompiler.compileProtoViewCodeGen(new util_1.Expression(resolvedMetadataCacheExpr), compMeta, parsedTemplate, pipes); - var viewFactoryExpr = this._viewCompiler.compileComponentCodeGen(compMeta, parsedTemplate, styleExpr, protoViewExprs.protoViews, changeDetectorsExprs, codeGenComponentViewFactoryName); - util_1.addAll(changeDetectorsExprs.declarations, targetDeclarations); - util_1.addAll(protoViewExprs.declarations, targetDeclarations); - util_1.addAll(viewFactoryExpr.declarations, targetDeclarations); - return viewFactoryExpr.expression; - }; - TemplateCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [runtime_metadata_1.RuntimeMetadataResolver, template_normalizer_1.TemplateNormalizer, template_parser_1.TemplateParser, style_compiler_1.StyleCompiler, change_detector_compiler_1.ChangeDetectionCompiler, proto_view_compiler_1.ProtoViewCompiler, view_compiler_1.ViewCompiler, resolved_metadata_cache_1.ResolvedMetadataCache, change_detection_1.ChangeDetectorGenConfig])], TemplateCompiler); - return TemplateCompiler; - }()); - exports.TemplateCompiler = TemplateCompiler; - var NormalizedComponentWithViewDirectives = (function() { - function NormalizedComponentWithViewDirectives(component, directives, pipes) { - this.component = component; - this.directives = directives; - this.pipes = pipes; - } - return NormalizedComponentWithViewDirectives; - }()); - exports.NormalizedComponentWithViewDirectives = NormalizedComponentWithViewDirectives; - var CompiledTemplate = (function() { - function CompiledTemplate() { - this.viewFactory = null; - } - CompiledTemplate.prototype.init = function(viewFactory) { - this.viewFactory = viewFactory; - }; - return CompiledTemplate; - }()); - function assertComponent(meta) { - if (!meta.isComponent) { - throw new exceptions_1.BaseException("Could not compile '" + meta.type.name + "' because it is not a component."); - } - } - function templateModuleUrl(moduleUrl) { - var urlWithoutSuffix = moduleUrl.substring(0, moduleUrl.length - util_1.MODULE_SUFFIX.length); - return urlWithoutSuffix + ".template" + util_1.MODULE_SUFFIX; - } - function codeGenHostViewFactoryName(type) { - return "hostViewFactory_" + type.name; - } - function codeGenComponentViewFactoryName(nestedCompType) { - return source_module_1.moduleRef(templateModuleUrl(nestedCompType.type.moduleUrl)) + "viewFactory_" + nestedCompType.type.name + "0"; - } - function mergeStringMaps(maps) { - var result = {}; - maps.forEach(function(map) { - collection_1.StringMapWrapper.forEach(map, function(value, key) { - result[key] = value; - }); - }); - return result; - } - function removeDuplicates(items) { - var res = []; - items.forEach(function(item) { - var hasMatch = res.filter(function(r) { - return r.type.name == item.type.name && r.type.moduleUrl == item.type.moduleUrl && r.type.runtime == item.type.runtime; - }).length > 0; - if (!hasMatch) { - res.push(item); - } - }); - return res; - } - var DirectiveCollector = (function() { - function DirectiveCollector() { - this.directives = []; - this.components = []; - } - DirectiveCollector.findUsedDirectives = function(parsedTemplate) { - var collector = new DirectiveCollector(); - template_ast_1.templateVisitAll(collector, parsedTemplate); - return collector; - }; - DirectiveCollector.prototype.visitBoundText = function(ast, context) { - return null; - }; - DirectiveCollector.prototype.visitText = function(ast, context) { - return null; - }; - DirectiveCollector.prototype.visitNgContent = function(ast, context) { - return null; - }; - DirectiveCollector.prototype.visitElement = function(ast, context) { - template_ast_1.templateVisitAll(this, ast.directives); - template_ast_1.templateVisitAll(this, ast.children); - return null; - }; - DirectiveCollector.prototype.visitEmbeddedTemplate = function(ast, context) { - template_ast_1.templateVisitAll(this, ast.directives); - template_ast_1.templateVisitAll(this, ast.children); - return null; - }; - DirectiveCollector.prototype.visitVariable = function(ast, ctx) { - return null; - }; - DirectiveCollector.prototype.visitAttr = function(ast, attrNameAndValues) { - return null; - }; - DirectiveCollector.prototype.visitDirective = function(ast, ctx) { - if (ast.directive.isComponent) { - this.components.push(ast.directive); - } - this.directives.push(ast.directive); - return null; - }; - DirectiveCollector.prototype.visitEvent = function(ast, eventTargetAndNames) { - return null; - }; - DirectiveCollector.prototype.visitDirectiveProperty = function(ast, context) { - return null; - }; - DirectiveCollector.prototype.visitElementProperty = function(ast, context) { - return null; - }; - return DirectiveCollector; - }()); - function filterPipes(template, allPipes) { - var visitor = new PipeVisitor(); - template_ast_1.templateVisitAll(visitor, template); - return allPipes.filter(function(pipeMeta) { - return collection_1.SetWrapper.has(visitor.collector.pipes, pipeMeta.name); - }); - } - var PipeVisitor = (function() { - function PipeVisitor() { - this.collector = new template_parser_1.PipeCollector(); - } - PipeVisitor.prototype.visitBoundText = function(ast, context) { - ast.value.visit(this.collector); - return null; - }; - PipeVisitor.prototype.visitText = function(ast, context) { - return null; - }; - PipeVisitor.prototype.visitNgContent = function(ast, context) { - return null; - }; - PipeVisitor.prototype.visitElement = function(ast, context) { - template_ast_1.templateVisitAll(this, ast.inputs); - template_ast_1.templateVisitAll(this, ast.outputs); - template_ast_1.templateVisitAll(this, ast.directives); - template_ast_1.templateVisitAll(this, ast.children); - return null; - }; - PipeVisitor.prototype.visitEmbeddedTemplate = function(ast, context) { - template_ast_1.templateVisitAll(this, ast.outputs); - template_ast_1.templateVisitAll(this, ast.directives); - template_ast_1.templateVisitAll(this, ast.children); - return null; - }; - PipeVisitor.prototype.visitVariable = function(ast, ctx) { - return null; - }; - PipeVisitor.prototype.visitAttr = function(ast, attrNameAndValues) { - return null; - }; - PipeVisitor.prototype.visitDirective = function(ast, ctx) { - template_ast_1.templateVisitAll(this, ast.inputs); - template_ast_1.templateVisitAll(this, ast.hostEvents); - template_ast_1.templateVisitAll(this, ast.hostProperties); - return null; - }; - PipeVisitor.prototype.visitEvent = function(ast, eventTargetAndNames) { - ast.handler.visit(this.collector); - return null; - }; - PipeVisitor.prototype.visitDirectiveProperty = function(ast, context) { - ast.value.visit(this.collector); - return null; - }; - PipeVisitor.prototype.visitElementProperty = function(ast, context) { - ast.value.visit(this.collector); - return null; - }; - return PipeVisitor; - }()); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/runtime_compiler", ["angular2/src/core/linker/compiler", "angular2/src/core/linker/view_ref", "angular2/src/compiler/template_compiler", "angular2/src/core/di"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var compiler_1 = require("angular2/src/core/linker/compiler"); - var view_ref_1 = require("angular2/src/core/linker/view_ref"); - var template_compiler_1 = require("angular2/src/compiler/template_compiler"); - var di_1 = require("angular2/src/core/di"); - var RuntimeCompiler = (function(_super) { - __extends(RuntimeCompiler, _super); - function RuntimeCompiler() { - _super.apply(this, arguments); - } - return RuntimeCompiler; - }(compiler_1.Compiler)); - exports.RuntimeCompiler = RuntimeCompiler; - var RuntimeCompiler_ = (function(_super) { - __extends(RuntimeCompiler_, _super); - function RuntimeCompiler_(_templateCompiler) { - _super.call(this); - this._templateCompiler = _templateCompiler; - } - RuntimeCompiler_.prototype.compileInHost = function(componentType) { - return this._templateCompiler.compileHostComponentRuntime(componentType).then(function(hostViewFactory) { - return new view_ref_1.HostViewFactoryRef_(hostViewFactory); - }); - }; - RuntimeCompiler_.prototype.clearCache = function() { - _super.prototype.clearCache.call(this); - this._templateCompiler.clearCache(); - }; - RuntimeCompiler_ = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [template_compiler_1.TemplateCompiler])], RuntimeCompiler_); - return RuntimeCompiler_; - }(compiler_1.Compiler_)); - exports.RuntimeCompiler_ = RuntimeCompiler_; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/compiler/compiler", ["angular2/src/compiler/runtime_compiler", "angular2/src/compiler/template_compiler", "angular2/src/compiler/directive_metadata", "angular2/src/compiler/source_module", "angular2/src/core/platform_directives_and_pipes", "angular2/src/compiler/template_ast", "angular2/src/compiler/template_parser", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/compiler/template_parser", "angular2/src/compiler/html_parser", "angular2/src/compiler/template_normalizer", "angular2/src/compiler/runtime_metadata", "angular2/src/compiler/change_detector_compiler", "angular2/src/compiler/style_compiler", "angular2/src/compiler/view_compiler", "angular2/src/compiler/proto_view_compiler", "angular2/src/compiler/template_compiler", "angular2/src/core/change_detection/change_detection", "angular2/src/core/linker/compiler", "angular2/src/compiler/runtime_compiler", "angular2/src/compiler/schema/element_schema_registry", "angular2/src/compiler/schema/dom_element_schema_registry", "angular2/src/compiler/url_resolver", "angular2/src/core/change_detection/change_detection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function __export(m) { - for (var p in m) - if (!exports.hasOwnProperty(p)) - exports[p] = m[p]; - } - var runtime_compiler_1 = require("angular2/src/compiler/runtime_compiler"); - var template_compiler_1 = require("angular2/src/compiler/template_compiler"); - exports.TemplateCompiler = template_compiler_1.TemplateCompiler; - var directive_metadata_1 = require("angular2/src/compiler/directive_metadata"); - exports.CompileDirectiveMetadata = directive_metadata_1.CompileDirectiveMetadata; - exports.CompileTypeMetadata = directive_metadata_1.CompileTypeMetadata; - exports.CompileTemplateMetadata = directive_metadata_1.CompileTemplateMetadata; - var source_module_1 = require("angular2/src/compiler/source_module"); - exports.SourceModule = source_module_1.SourceModule; - exports.SourceWithImports = source_module_1.SourceWithImports; - var platform_directives_and_pipes_1 = require("angular2/src/core/platform_directives_and_pipes"); - exports.PLATFORM_DIRECTIVES = platform_directives_and_pipes_1.PLATFORM_DIRECTIVES; - exports.PLATFORM_PIPES = platform_directives_and_pipes_1.PLATFORM_PIPES; - __export(require("angular2/src/compiler/template_ast")); - var template_parser_1 = require("angular2/src/compiler/template_parser"); - exports.TEMPLATE_TRANSFORMS = template_parser_1.TEMPLATE_TRANSFORMS; - var lang_1 = require("angular2/src/facade/lang"); - var di_1 = require("angular2/src/core/di"); - var template_parser_2 = require("angular2/src/compiler/template_parser"); - var html_parser_1 = require("angular2/src/compiler/html_parser"); - var template_normalizer_1 = require("angular2/src/compiler/template_normalizer"); - var runtime_metadata_1 = require("angular2/src/compiler/runtime_metadata"); - var change_detector_compiler_1 = require("angular2/src/compiler/change_detector_compiler"); - var style_compiler_1 = require("angular2/src/compiler/style_compiler"); - var view_compiler_1 = require("angular2/src/compiler/view_compiler"); - var proto_view_compiler_1 = require("angular2/src/compiler/proto_view_compiler"); - var template_compiler_2 = require("angular2/src/compiler/template_compiler"); - var change_detection_1 = require("angular2/src/core/change_detection/change_detection"); - var compiler_1 = require("angular2/src/core/linker/compiler"); - var runtime_compiler_2 = require("angular2/src/compiler/runtime_compiler"); - var element_schema_registry_1 = require("angular2/src/compiler/schema/element_schema_registry"); - var dom_element_schema_registry_1 = require("angular2/src/compiler/schema/dom_element_schema_registry"); - var url_resolver_1 = require("angular2/src/compiler/url_resolver"); - var change_detection_2 = require("angular2/src/core/change_detection/change_detection"); - function _createChangeDetectorGenConfig() { - return new change_detection_1.ChangeDetectorGenConfig(lang_1.assertionsEnabled(), false, true); - } - exports.COMPILER_PROVIDERS = lang_1.CONST_EXPR([change_detection_2.Lexer, change_detection_2.Parser, html_parser_1.HtmlParser, template_parser_2.TemplateParser, template_normalizer_1.TemplateNormalizer, runtime_metadata_1.RuntimeMetadataResolver, url_resolver_1.DEFAULT_PACKAGE_URL_PROVIDER, style_compiler_1.StyleCompiler, proto_view_compiler_1.ProtoViewCompiler, view_compiler_1.ViewCompiler, change_detector_compiler_1.ChangeDetectionCompiler, new di_1.Provider(change_detection_1.ChangeDetectorGenConfig, { - useFactory: _createChangeDetectorGenConfig, - deps: [] - }), template_compiler_2.TemplateCompiler, new di_1.Provider(runtime_compiler_2.RuntimeCompiler, {useClass: runtime_compiler_1.RuntimeCompiler_}), new di_1.Provider(compiler_1.Compiler, {useExisting: runtime_compiler_2.RuntimeCompiler}), dom_element_schema_registry_1.DomElementSchemaRegistry, new di_1.Provider(element_schema_registry_1.ElementSchemaRegistry, {useExisting: dom_element_schema_registry_1.DomElementSchemaRegistry}), url_resolver_1.UrlResolver]); - global.define = __define; - return module.exports; -}); - -System.register("angular2/compiler", ["angular2/src/compiler/url_resolver", "angular2/src/compiler/xhr", "angular2/src/compiler/compiler"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - function __export(m) { - for (var p in m) - if (!exports.hasOwnProperty(p)) - exports[p] = m[p]; - } - __export(require("angular2/src/compiler/url_resolver")); - __export(require("angular2/src/compiler/xhr")); - __export(require("angular2/src/compiler/compiler")); - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/platform/browser_common", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/compiler/xhr", "angular2/core", "angular2/common", "angular2/src/core/testability/testability", "angular2/src/platform/dom/dom_adapter", "angular2/src/platform/dom/events/dom_events", "angular2/src/platform/dom/events/key_events", "angular2/src/platform/dom/events/hammer_gestures", "angular2/src/platform/dom/dom_tokens", "angular2/src/platform/dom/dom_renderer", "angular2/src/platform/dom/shared_styles_host", "angular2/src/platform/dom/shared_styles_host", "angular2/src/animate/browser_details", "angular2/src/animate/animation_builder", "angular2/src/platform/browser/browser_adapter", "angular2/src/platform/browser/testability", "angular2/src/platform/browser/xhr_cache", "angular2/src/core/profile/wtf_init", "angular2/src/platform/dom/events/event_manager", "angular2/src/platform/dom/events/hammer_gestures", "angular2/platform/common_dom", "angular2/src/platform/dom/dom_tokens", "angular2/src/platform/browser/title", "angular2/platform/common_dom", "angular2/src/platform/browser/browser_adapter", "angular2/src/platform/browser/tools/tools", "angular2/src/platform/dom/events/hammer_gestures"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var di_1 = require("angular2/src/core/di"); - var xhr_1 = require("angular2/src/compiler/xhr"); - var core_1 = require("angular2/core"); - var common_1 = require("angular2/common"); - var testability_1 = require("angular2/src/core/testability/testability"); - var dom_adapter_1 = require("angular2/src/platform/dom/dom_adapter"); - var dom_events_1 = require("angular2/src/platform/dom/events/dom_events"); - var key_events_1 = require("angular2/src/platform/dom/events/key_events"); - var hammer_gestures_1 = require("angular2/src/platform/dom/events/hammer_gestures"); - var dom_tokens_1 = require("angular2/src/platform/dom/dom_tokens"); - var dom_renderer_1 = require("angular2/src/platform/dom/dom_renderer"); - var shared_styles_host_1 = require("angular2/src/platform/dom/shared_styles_host"); - var shared_styles_host_2 = require("angular2/src/platform/dom/shared_styles_host"); - var browser_details_1 = require("angular2/src/animate/browser_details"); - var animation_builder_1 = require("angular2/src/animate/animation_builder"); - var browser_adapter_1 = require("angular2/src/platform/browser/browser_adapter"); - var testability_2 = require("angular2/src/platform/browser/testability"); - var xhr_cache_1 = require("angular2/src/platform/browser/xhr_cache"); - var wtf_init_1 = require("angular2/src/core/profile/wtf_init"); - var event_manager_1 = require("angular2/src/platform/dom/events/event_manager"); - var hammer_gestures_2 = require("angular2/src/platform/dom/events/hammer_gestures"); - var common_dom_1 = require("angular2/platform/common_dom"); - var dom_tokens_2 = require("angular2/src/platform/dom/dom_tokens"); - exports.DOCUMENT = dom_tokens_2.DOCUMENT; - var title_1 = require("angular2/src/platform/browser/title"); - exports.Title = title_1.Title; - var common_dom_2 = require("angular2/platform/common_dom"); - exports.ELEMENT_PROBE_PROVIDERS = common_dom_2.ELEMENT_PROBE_PROVIDERS; - exports.ELEMENT_PROBE_PROVIDERS_PROD_MODE = common_dom_2.ELEMENT_PROBE_PROVIDERS_PROD_MODE; - exports.inspectNativeElement = common_dom_2.inspectNativeElement; - exports.By = common_dom_2.By; - var browser_adapter_2 = require("angular2/src/platform/browser/browser_adapter"); - exports.BrowserDomAdapter = browser_adapter_2.BrowserDomAdapter; - var tools_1 = require("angular2/src/platform/browser/tools/tools"); - exports.enableDebugTools = tools_1.enableDebugTools; - exports.disableDebugTools = tools_1.disableDebugTools; - var hammer_gestures_3 = require("angular2/src/platform/dom/events/hammer_gestures"); - exports.HAMMER_GESTURE_CONFIG = hammer_gestures_3.HAMMER_GESTURE_CONFIG; - exports.HammerGestureConfig = hammer_gestures_3.HammerGestureConfig; - exports.BROWSER_PROVIDERS = lang_1.CONST_EXPR([core_1.PLATFORM_COMMON_PROVIDERS, new di_1.Provider(core_1.PLATFORM_INITIALIZER, { - useValue: initDomAdapter, - multi: true - })]); - function _exceptionHandler() { - return new core_1.ExceptionHandler(dom_adapter_1.DOM, !lang_1.IS_DART); - } - function _document() { - return dom_adapter_1.DOM.defaultDoc(); - } - exports.BROWSER_APP_COMMON_PROVIDERS = lang_1.CONST_EXPR([core_1.APPLICATION_COMMON_PROVIDERS, common_1.FORM_PROVIDERS, new di_1.Provider(core_1.PLATFORM_PIPES, { - useValue: common_1.COMMON_PIPES, - multi: true - }), new di_1.Provider(core_1.PLATFORM_DIRECTIVES, { - useValue: common_1.COMMON_DIRECTIVES, - multi: true - }), new di_1.Provider(core_1.ExceptionHandler, { - useFactory: _exceptionHandler, - deps: [] - }), new di_1.Provider(dom_tokens_1.DOCUMENT, { - useFactory: _document, - deps: [] - }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { - useClass: dom_events_1.DomEventsPlugin, - multi: true - }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { - useClass: key_events_1.KeyEventsPlugin, - multi: true - }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { - useClass: hammer_gestures_1.HammerGesturesPlugin, - multi: true - }), new di_1.Provider(hammer_gestures_2.HAMMER_GESTURE_CONFIG, {useClass: hammer_gestures_2.HammerGestureConfig}), new di_1.Provider(dom_renderer_1.DomRootRenderer, {useClass: dom_renderer_1.DomRootRenderer_}), new di_1.Provider(core_1.RootRenderer, {useExisting: dom_renderer_1.DomRootRenderer}), new di_1.Provider(shared_styles_host_2.SharedStylesHost, {useExisting: shared_styles_host_1.DomSharedStylesHost}), shared_styles_host_1.DomSharedStylesHost, testability_1.Testability, browser_details_1.BrowserDetails, animation_builder_1.AnimationBuilder, event_manager_1.EventManager, common_dom_1.ELEMENT_PROBE_PROVIDERS]); - exports.CACHED_TEMPLATE_PROVIDER = lang_1.CONST_EXPR([new di_1.Provider(xhr_1.XHR, {useClass: xhr_cache_1.CachedXHR})]); - function initDomAdapter() { - browser_adapter_1.BrowserDomAdapter.makeCurrent(); - wtf_init_1.wtfInit(); - testability_2.BrowserGetTestability.init(); - } - exports.initDomAdapter = initDomAdapter; - global.define = __define; - return module.exports; -}); - -System.register("angular2/platform/browser", ["angular2/src/core/angular_entrypoint", "angular2/src/platform/browser_common", "angular2/src/facade/lang", "angular2/src/platform/browser_common", "angular2/compiler", "angular2/core", "angular2/src/core/reflection/reflection_capabilities", "angular2/src/platform/browser/xhr_impl", "angular2/compiler", "angular2/src/core/di"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var angular_entrypoint_1 = require("angular2/src/core/angular_entrypoint"); - exports.AngularEntrypoint = angular_entrypoint_1.AngularEntrypoint; - var browser_common_1 = require("angular2/src/platform/browser_common"); - exports.BROWSER_PROVIDERS = browser_common_1.BROWSER_PROVIDERS; - exports.CACHED_TEMPLATE_PROVIDER = browser_common_1.CACHED_TEMPLATE_PROVIDER; - exports.ELEMENT_PROBE_PROVIDERS = browser_common_1.ELEMENT_PROBE_PROVIDERS; - exports.ELEMENT_PROBE_PROVIDERS_PROD_MODE = browser_common_1.ELEMENT_PROBE_PROVIDERS_PROD_MODE; - exports.inspectNativeElement = browser_common_1.inspectNativeElement; - exports.BrowserDomAdapter = browser_common_1.BrowserDomAdapter; - exports.By = browser_common_1.By; - exports.Title = browser_common_1.Title; - exports.DOCUMENT = browser_common_1.DOCUMENT; - exports.enableDebugTools = browser_common_1.enableDebugTools; - exports.disableDebugTools = browser_common_1.disableDebugTools; - var lang_1 = require("angular2/src/facade/lang"); - var browser_common_2 = require("angular2/src/platform/browser_common"); - var compiler_1 = require("angular2/compiler"); - var core_1 = require("angular2/core"); - var reflection_capabilities_1 = require("angular2/src/core/reflection/reflection_capabilities"); - var xhr_impl_1 = require("angular2/src/platform/browser/xhr_impl"); - var compiler_2 = require("angular2/compiler"); - var di_1 = require("angular2/src/core/di"); - exports.BROWSER_APP_PROVIDERS = lang_1.CONST_EXPR([browser_common_2.BROWSER_APP_COMMON_PROVIDERS, compiler_1.COMPILER_PROVIDERS, new di_1.Provider(compiler_2.XHR, {useClass: xhr_impl_1.XHRImpl})]); - function bootstrap(appComponentType, customProviders) { - core_1.reflector.reflectionCapabilities = new reflection_capabilities_1.ReflectionCapabilities(); - var appProviders = lang_1.isPresent(customProviders) ? [exports.BROWSER_APP_PROVIDERS, customProviders] : exports.BROWSER_APP_PROVIDERS; - return core_1.platform(browser_common_2.BROWSER_PROVIDERS).application(appProviders).bootstrap(appComponentType); - } - exports.bootstrap = bootstrap; - global.define = __define; - return module.exports; -}); - -System.register("angular2/instrumentation", ["angular2/src/core/profile/profile"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var profile_1 = require("angular2/src/core/profile/profile"); - exports.wtfCreateScope = profile_1.wtfCreateScope; - exports.wtfLeave = profile_1.wtfLeave; - exports.wtfStartTimeRange = profile_1.wtfStartTimeRange; - exports.wtfEndTimeRange = profile_1.wtfEndTimeRange; - global.define = __define; - return module.exports; -}); - -//# sourceMappingURLDisabled=angular2.dev.js.map \ No newline at end of file diff --git a/demo-shell-ng2/dist/lib/bootstrap.min.css b/demo-shell-ng2/dist/lib/bootstrap.min.css deleted file mode 100644 index 4cf729e434..0000000000 --- a/demo-shell-ng2/dist/lib/bootstrap.min.css +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Bootstrap v3.3.6 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} -/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/demo-shell-ng2/dist/lib/bootstrap.min.js b/demo-shell-ng2/dist/lib/bootstrap.min.js deleted file mode 100644 index e79c065134..0000000000 --- a/demo-shell-ng2/dist/lib/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v3.3.6 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under the MIT license - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/demo-shell-ng2/dist/lib/es6-shim.min.js b/demo-shell-ng2/dist/lib/es6-shim.min.js deleted file mode 100644 index 6f0d3de237..0000000000 --- a/demo-shell-ng2/dist/lib/es6-shim.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * https://github.com/paulmillr/es6-shim - * @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com) - * and contributors, MIT License - * es6-shim: v0.35.0 - * see https://github.com/paulmillr/es6-shim/blob/0.35.0/LICENSE - * Details and documentation: - * https://github.com/paulmillr/es6-shim/ - */ -(function(e,t){if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{e.returnExports=t()}})(this,function(){"use strict";var e=Function.call.bind(Function.apply);var t=Function.call.bind(Function.call);var r=Array.isArray;var n=Object.keys;var o=function notThunker(t){return function notThunk(){return!e(t,this,arguments)}};var i=function(e){try{e();return false}catch(t){return true}};var a=function valueOrFalseIfThrows(e){try{return e()}catch(t){return false}};var u=o(i);var f=function(){return!i(function(){Object.defineProperty({},"x",{get:function(){}})})};var s=!!Object.defineProperty&&f();var c=function foo(){}.name==="foo";var l=Function.call.bind(Array.prototype.forEach);var p=Function.call.bind(Array.prototype.reduce);var v=Function.call.bind(Array.prototype.filter);var y=Function.call.bind(Array.prototype.some);var h=function(e,t,r,n){if(!n&&t in e){return}if(s){Object.defineProperty(e,t,{configurable:true,enumerable:false,writable:true,value:r})}else{e[t]=r}};var b=function(e,t,r){l(n(t),function(n){var o=t[n];h(e,n,o,!!r)})};var g=Function.call.bind(Object.prototype.toString);var d=typeof/abc/==="function"?function IsCallableSlow(e){return typeof e==="function"&&g(e)==="[object Function]"}:function IsCallableFast(e){return typeof e==="function"};var O={getter:function(e,t,r){if(!s){throw new TypeError("getters require true ES5 support")}Object.defineProperty(e,t,{configurable:true,enumerable:false,get:r})},proxy:function(e,t,r){if(!s){throw new TypeError("getters require true ES5 support")}var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,{configurable:n.configurable,enumerable:n.enumerable,get:function getKey(){return e[t]},set:function setKey(r){e[t]=r}})},redefine:function(e,t,r){if(s){var n=Object.getOwnPropertyDescriptor(e,t);n.value=r;Object.defineProperty(e,t,n)}else{e[t]=r}},defineByDescriptor:function(e,t,r){if(s){Object.defineProperty(e,t,r)}else if("value"in r){e[t]=r.value}},preserveToString:function(e,t){if(t&&d(t.toString)){h(e,"toString",t.toString.bind(t),true)}}};var m=Object.create||function(e,t){var r=function Prototype(){};r.prototype=e;var o=new r;if(typeof t!=="undefined"){n(t).forEach(function(e){O.defineByDescriptor(o,e,t[e])})}return o};var w=function(e,t){if(!Object.setPrototypeOf){return false}return a(function(){var r=function Subclass(t){var r=new e(t);Object.setPrototypeOf(r,Subclass.prototype);return r};Object.setPrototypeOf(r,e);r.prototype=m(e.prototype,{constructor:{value:r}});return t(r)})};var j=function(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")};var S=j();var T=S.isFinite;var I=Function.call.bind(String.prototype.indexOf);var E=Function.apply.bind(Array.prototype.indexOf);var P=Function.call.bind(Array.prototype.concat);var M=Function.call.bind(Array.prototype.sort);var C=Function.call.bind(String.prototype.slice);var x=Function.call.bind(Array.prototype.push);var N=Function.apply.bind(Array.prototype.push);var A=Function.call.bind(Array.prototype.shift);var R=Math.max;var _=Math.min;var k=Math.floor;var F=Math.abs;var L=Math.log;var D=Math.sqrt;var z=Function.call.bind(Object.prototype.hasOwnProperty);var q;var G=function(){};var W=S.Symbol||{};var H=W.species||"@@species";var V=Number.isNaN||function isNaN(e){return e!==e};var B=Number.isFinite||function isFinite(e){return typeof e==="number"&&T(e)};var $=function isArguments(e){return g(e)==="[object Arguments]"};var U=function isArguments(e){return e!==null&&typeof e==="object"&&typeof e.length==="number"&&e.length>=0&&g(e)!=="[object Array]"&&g(e.callee)==="[object Function]"};var J=$(arguments)?$:U;var K={primitive:function(e){return e===null||typeof e!=="function"&&typeof e!=="object"},object:function(e){return e!==null&&typeof e==="object"},string:function(e){return g(e)==="[object String]"},regex:function(e){return g(e)==="[object RegExp]"},symbol:function(e){return typeof S.Symbol==="function"&&typeof e==="symbol"}};var X=function overrideNative(e,t,r){var n=e[t];h(e,t,r,true);O.preserveToString(e[t],n)};var Z=typeof W==="function"&&typeof W["for"]==="function"&&K.symbol(W());var Y=K.symbol(W.iterator)?W.iterator:"_es6-shim iterator_";if(S.Set&&typeof(new S.Set)["@@iterator"]==="function"){Y="@@iterator"}if(!S.Reflect){h(S,"Reflect",{},true)}var Q=S.Reflect;var ee=String;var te={Call:function Call(t,r){var n=arguments.length>2?arguments[2]:[];if(!te.IsCallable(t)){throw new TypeError(t+" is not a function")}return e(t,r,n)},RequireObjectCoercible:function(e,t){if(e==null){throw new TypeError(t||"Cannot call method on "+e)}return e},TypeIsObject:function(e){if(e===void 0||e===null||e===true||e===false){return false}return typeof e==="function"||typeof e==="object"},ToObject:function(e,t){return Object(te.RequireObjectCoercible(e,t))},IsCallable:d,IsConstructor:function(e){return te.IsCallable(e)},ToInt32:function(e){return te.ToNumber(e)>>0},ToUint32:function(e){return te.ToNumber(e)>>>0},ToNumber:function(e){if(g(e)==="[object Symbol]"){throw new TypeError("Cannot convert a Symbol value to a number")}return+e},ToInteger:function(e){var t=te.ToNumber(e);if(V(t)){return 0}if(t===0||!B(t)){return t}return(t>0?1:-1)*k(F(t))},ToLength:function(e){var t=te.ToInteger(e);if(t<=0){return 0}if(t>Number.MAX_SAFE_INTEGER){return Number.MAX_SAFE_INTEGER}return t},SameValue:function(e,t){if(e===t){if(e===0){return 1/e===1/t}return true}return V(e)&&V(t)},SameValueZero:function(e,t){return e===t||V(e)&&V(t)},IsIterable:function(e){return te.TypeIsObject(e)&&(typeof e[Y]!=="undefined"||J(e))},GetIterator:function(e){if(J(e)){return new q(e,"value")}var t=te.GetMethod(e,Y);if(!te.IsCallable(t)){throw new TypeError("value is not an iterable")}var r=te.Call(t,e);if(!te.TypeIsObject(r)){throw new TypeError("bad iterator")}return r},GetMethod:function(e,t){var r=te.ToObject(e)[t];if(r===void 0||r===null){return void 0}if(!te.IsCallable(r)){throw new TypeError("Method not callable: "+t)}return r},IteratorComplete:function(e){return!!e.done},IteratorClose:function(e,t){var r=te.GetMethod(e,"return");if(r===void 0){return}var n,o;try{n=te.Call(r,e)}catch(i){o=i}if(t){return}if(o){throw o}if(!te.TypeIsObject(n)){throw new TypeError("Iterator's return method returned a non-object.")}},IteratorNext:function(e){var t=arguments.length>1?e.next(arguments[1]):e.next();if(!te.TypeIsObject(t)){throw new TypeError("bad iterator")}return t},IteratorStep:function(e){var t=te.IteratorNext(e);var r=te.IteratorComplete(t);return r?false:t},Construct:function(e,t,r,n){var o=typeof r==="undefined"?e:r;if(!n&&Q.construct){return Q.construct(e,t,o)}var i=o.prototype;if(!te.TypeIsObject(i)){i=Object.prototype}var a=m(i);var u=te.Call(e,a,t);return te.TypeIsObject(u)?u:a},SpeciesConstructor:function(e,t){var r=e.constructor;if(r===void 0){return t}if(!te.TypeIsObject(r)){throw new TypeError("Bad constructor")}var n=r[H];if(n===void 0||n===null){return t}if(!te.IsConstructor(n)){throw new TypeError("Bad @@species")}return n},CreateHTML:function(e,t,r,n){var o=te.ToString(e);var i="<"+t;if(r!==""){var a=te.ToString(n);var u=a.replace(/"/g,""");i+=" "+r+'="'+u+'"'}var f=i+">";var s=f+o;return s+""},IsRegExp:function IsRegExp(e){if(!te.TypeIsObject(e)){return false}var t=e[W.match];if(typeof t!=="undefined"){return!!t}return K.regex(e)},ToString:function ToString(e){return ee(e)}};if(s&&Z){var re=function defineWellKnownSymbol(e){if(K.symbol(W[e])){return W[e]}var t=W["for"]("Symbol."+e);Object.defineProperty(W,e,{configurable:false,enumerable:false,writable:false,value:t});return t};if(!K.symbol(W.search)){var ne=re("search");var oe=String.prototype.search;h(RegExp.prototype,ne,function search(e){return te.Call(oe,e,[this])});var ie=function search(e){var t=te.RequireObjectCoercible(this);if(e!==null&&typeof e!=="undefined"){var r=te.GetMethod(e,ne);if(typeof r!=="undefined"){return te.Call(r,e,[t])}}return te.Call(oe,t,[te.ToString(e)])};X(String.prototype,"search",ie)}if(!K.symbol(W.replace)){var ae=re("replace");var ue=String.prototype.replace;h(RegExp.prototype,ae,function replace(e,t){return te.Call(ue,e,[this,t])});var fe=function replace(e,t){var r=te.RequireObjectCoercible(this);if(e!==null&&typeof e!=="undefined"){var n=te.GetMethod(e,ae);if(typeof n!=="undefined"){return te.Call(n,e,[r,t])}}return te.Call(ue,r,[te.ToString(e),t])};X(String.prototype,"replace",fe)}if(!K.symbol(W.split)){var se=re("split");var ce=String.prototype.split;h(RegExp.prototype,se,function split(e,t){return te.Call(ce,e,[this,t])});var le=function split(e,t){var r=te.RequireObjectCoercible(this);if(e!==null&&typeof e!=="undefined"){var n=te.GetMethod(e,se);if(typeof n!=="undefined"){return te.Call(n,e,[r,t])}}return te.Call(ce,r,[te.ToString(e),t])};X(String.prototype,"split",le)}var pe=K.symbol(W.match);var ve=pe&&function(){var e={};e[W.match]=function(){return 42};return"a".match(e)!==42}();if(!pe||ve){var ye=re("match");var he=String.prototype.match;h(RegExp.prototype,ye,function match(e){return te.Call(he,e,[this])});var be=function match(e){var t=te.RequireObjectCoercible(this);if(e!==null&&typeof e!=="undefined"){var r=te.GetMethod(e,ye);if(typeof r!=="undefined"){return te.Call(r,e,[t])}}return te.Call(he,t,[te.ToString(e)])};X(String.prototype,"match",be)}}var ge=function wrapConstructor(e,t,r){O.preserveToString(t,e);if(Object.setPrototypeOf){Object.setPrototypeOf(e,t)}if(s){l(Object.getOwnPropertyNames(e),function(n){if(n in G||r[n]){return}O.proxy(e,n,t)})}else{l(Object.keys(e),function(n){if(n in G||r[n]){return}t[n]=e[n]})}t.prototype=e.prototype;O.redefine(e.prototype,"constructor",t)};var de=function(){return this};var Oe=function(e){if(s&&!z(e,H)){O.getter(e,H,de)}};var me=function(e,t){var r=t||function iterator(){return this};h(e,Y,r);if(!e[Y]&&K.symbol(Y)){e[Y]=r}};var we=function createDataProperty(e,t,r){if(s){Object.defineProperty(e,t,{configurable:true,enumerable:true,writable:true,value:r})}else{e[t]=r}};var je=function createDataPropertyOrThrow(e,t,r){we(e,t,r);if(!te.SameValue(e[t],r)){throw new TypeError("property is nonconfigurable")}};var Se=function(e,t,r,n){if(!te.TypeIsObject(e)){throw new TypeError("Constructor requires `new`: "+t.name)}var o=t.prototype;if(!te.TypeIsObject(o)){o=r}var i=m(o);for(var a in n){if(z(n,a)){var u=n[a];h(i,a,u,true)}}return i};if(String.fromCodePoint&&String.fromCodePoint.length!==1){var Te=String.fromCodePoint;X(String,"fromCodePoint",function fromCodePoint(e){return te.Call(Te,this,arguments)})}var Ie={fromCodePoint:function fromCodePoint(e){var t=[];var r;for(var n=0,o=arguments.length;n1114111){throw new RangeError("Invalid code point "+r)}if(r<65536){x(t,String.fromCharCode(r))}else{r-=65536;x(t,String.fromCharCode((r>>10)+55296));x(t,String.fromCharCode(r%1024+56320))}}return t.join("")},raw:function raw(e){var t=te.ToObject(e,"bad callSite");var r=te.ToObject(t.raw,"bad raw value");var n=r.length;var o=te.ToLength(n);if(o<=0){return""}var i=[];var a=0;var u,f,s,c;while(a=o){break}f=a+1=Pe){throw new RangeError("repeat count must be less than infinity and not overflow maximum string size")}return Ee(t,r)},startsWith:function startsWith(e){var t=te.ToString(te.RequireObjectCoercible(this));if(te.IsRegExp(e)){throw new TypeError('Cannot call method "startsWith" with a regex')}var r=te.ToString(e);var n;if(arguments.length>1){n=arguments[1]}var o=R(te.ToInteger(n),0);return C(t,o,o+r.length)===r},endsWith:function endsWith(e){var t=te.ToString(te.RequireObjectCoercible(this));if(te.IsRegExp(e)){throw new TypeError('Cannot call method "endsWith" with a regex')}var r=te.ToString(e);var n=t.length;var o;if(arguments.length>1){o=arguments[1]}var i=typeof o==="undefined"?n:te.ToInteger(o);var a=_(R(i,0),n);return C(t,a-r.length,a)===r},includes:function includes(e){if(te.IsRegExp(e)){throw new TypeError('"includes" does not accept a RegExp')}var t=te.ToString(e);var r;if(arguments.length>1){r=arguments[1]}return I(this,t,r)!==-1},codePointAt:function codePointAt(e){var t=te.ToString(te.RequireObjectCoercible(this));var r=te.ToInteger(e);var n=t.length;if(r>=0&&r56319||i){return o}var a=t.charCodeAt(r+1);if(a<56320||a>57343){return o}return(o-55296)*1024+(a-56320)+65536}}};if(String.prototype.includes&&"a".includes("a",Infinity)!==false){X(String.prototype,"includes",Me.includes)}if(String.prototype.startsWith&&String.prototype.endsWith){var Ce=i(function(){"/a/".startsWith(/a/)});var xe=a(function(){return"abc".startsWith("a",Infinity)===false});if(!Ce||!xe){X(String.prototype,"startsWith",Me.startsWith);X(String.prototype,"endsWith",Me.endsWith)}}if(Z){var Ne=a(function(){var e=/a/;e[W.match]=false;return"/a/".startsWith(e)});if(!Ne){X(String.prototype,"startsWith",Me.startsWith)}var Ae=a(function(){var e=/a/;e[W.match]=false;return"/a/".endsWith(e)});if(!Ae){X(String.prototype,"endsWith",Me.endsWith)}var Re=a(function(){var e=/a/;e[W.match]=false;return"/a/".includes(e)});if(!Re){X(String.prototype,"includes",Me.includes)}}b(String.prototype,Me);var _e=[" \n\x0B\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003","\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028","\u2029\ufeff"].join("");var ke=new RegExp("(^["+_e+"]+)|(["+_e+"]+$)","g");var Fe=function trim(){return te.ToString(te.RequireObjectCoercible(this)).replace(ke,"")};var Le=["\x85","\u200b","\ufffe"].join("");var De=new RegExp("["+Le+"]","g");var ze=/^[\-+]0x[0-9a-f]+$/i;var qe=Le.trim().length!==Le.length;h(String.prototype,"trim",Fe,qe);var Ge=function(e){te.RequireObjectCoercible(e);this._s=te.ToString(e);this._i=0};Ge.prototype.next=function(){var e=this._s,t=this._i;if(typeof e==="undefined"||t>=e.length){this._s=void 0;return{value:void 0,done:true}}var r=e.charCodeAt(t),n,o;if(r<55296||r>56319||t+1===e.length){o=1}else{n=e.charCodeAt(t+1);o=n<56320||n>57343?1:2}this._i=t+o;return{value:e.substr(t,o),done:false}};me(Ge.prototype);me(String.prototype,function(){return new Ge(this)});var We={from:function from(e){var r=this;var n;if(arguments.length>1){n=arguments[1]}var o,i;if(typeof n==="undefined"){o=false}else{if(!te.IsCallable(n)){throw new TypeError("Array.from: when provided, the second argument must be a function")}if(arguments.length>2){i=arguments[2]}o=true}var a=typeof(J(e)||te.GetMethod(e,Y))!=="undefined";var u,f,s;if(a){f=te.IsConstructor(r)?Object(new r):[];var c=te.GetIterator(e);var l,p;s=0;while(true){l=te.IteratorStep(c);if(l===false){break}p=l.value;try{if(o){p=typeof i==="undefined"?n(p,s):t(n,i,p,s)}f[s]=p}catch(v){te.IteratorClose(c,true);throw v}s+=1}u=s}else{var y=te.ToObject(e);u=te.ToLength(y.length);f=te.IsConstructor(r)?Object(new r(u)):new Array(u);var h;for(s=0;s2){f=arguments[2]}var s=typeof f==="undefined"?n:te.ToInteger(f);var c=s<0?R(n+s,0):_(s,n);var l=_(c-u,n-a);var p=1;if(u0){if(u in r){r[a]=r[u]}else{delete r[a]}u+=p;a+=p;l-=1}return r},fill:function fill(e){var t;if(arguments.length>1){t=arguments[1]}var r;if(arguments.length>2){r=arguments[2]}var n=te.ToObject(this);var o=te.ToLength(n.length);t=te.ToInteger(typeof t==="undefined"?0:t);r=te.ToInteger(typeof r==="undefined"?o:r);var i=t<0?R(o+t,0):_(t,o);var a=r<0?o+r:r;for(var u=i;u1?arguments[1]:null;for(var i=0,a;i1?arguments[1]:null;for(var i=0;i1&&typeof arguments[1]!=="undefined"){return te.Call(Ye,this,arguments)}else{return t(Ye,this,e)}})}var Qe=-(Math.pow(2,32)-1);var et=function(e,r){var n={length:Qe};n[r?(n.length>>>0)-1:0]=true;return a(function(){t(e,n,function(){throw new RangeError("should not reach here")},[]);return true})};if(!et(Array.prototype.forEach)){var tt=Array.prototype.forEach;X(Array.prototype,"forEach",function forEach(e){return te.Call(tt,this.length>=0?this:[],arguments)},true)}if(!et(Array.prototype.map)){var rt=Array.prototype.map;X(Array.prototype,"map",function map(e){return te.Call(rt,this.length>=0?this:[],arguments)},true)}if(!et(Array.prototype.filter)){var nt=Array.prototype.filter;X(Array.prototype,"filter",function filter(e){return te.Call(nt,this.length>=0?this:[],arguments)},true)}if(!et(Array.prototype.some)){var ot=Array.prototype.some;X(Array.prototype,"some",function some(e){return te.Call(ot,this.length>=0?this:[],arguments)},true)}if(!et(Array.prototype.every)){var it=Array.prototype.every;X(Array.prototype,"every",function every(e){return te.Call(it,this.length>=0?this:[],arguments)},true)}if(!et(Array.prototype.reduce)){var at=Array.prototype.reduce;X(Array.prototype,"reduce",function reduce(e){return te.Call(at,this.length>=0?this:[],arguments)},true)}if(!et(Array.prototype.reduceRight,true)){var ut=Array.prototype.reduceRight;X(Array.prototype,"reduceRight",function reduceRight(e){return te.Call(ut,this.length>=0?this:[],arguments)},true)}var ft=Number("0o10")!==8;var st=Number("0b10")!==2;var ct=y(Le,function(e){return Number(e+0+e)===0});if(ft||st||ct){var lt=Number;var pt=/^0b[01]+$/i;var vt=/^0o[0-7]+$/i;var yt=pt.test.bind(pt);var ht=vt.test.bind(vt);var bt=function(e){var t;if(typeof e.valueOf==="function"){t=e.valueOf();if(K.primitive(t)){return t}}if(typeof e.toString==="function"){t=e.toString();if(K.primitive(t)){return t}}throw new TypeError("No default value")};var gt=De.test.bind(De);var dt=ze.test.bind(ze);var Ot=function(){var e=function Number(t){var r;if(arguments.length>0){r=K.primitive(t)?t:bt(t,"number")}else{r=0}if(typeof r==="string"){r=te.Call(Fe,r);if(yt(r)){r=parseInt(C(r,2),2)}else if(ht(r)){r=parseInt(C(r,2),8)}else if(gt(r)||dt(r)){r=NaN}}var n=this;var o=a(function(){lt.prototype.valueOf.call(n);return true});if(n instanceof e&&!o){return new lt(r)}return lt(r)};return e}();ge(lt,Ot,{});b(Ot,{NaN:lt.NaN,MAX_VALUE:lt.MAX_VALUE,MIN_VALUE:lt.MIN_VALUE,NEGATIVE_INFINITY:lt.NEGATIVE_INFINITY,POSITIVE_INFINITY:lt.POSITIVE_INFINITY});Number=Ot;O.redefine(S,"Number",Ot)}var mt=Math.pow(2,53)-1;b(Number,{MAX_SAFE_INTEGER:mt,MIN_SAFE_INTEGER:-mt,EPSILON:2.220446049250313e-16,parseInt:S.parseInt,parseFloat:S.parseFloat,isFinite:B,isInteger:function isInteger(e){return B(e)&&te.ToInteger(e)===e},isSafeInteger:function isSafeInteger(e){return Number.isInteger(e)&&F(e)<=Number.MAX_SAFE_INTEGER},isNaN:V});h(Number,"parseInt",S.parseInt,Number.parseInt!==S.parseInt);if(![,1].find(function(e,t){return t===0})){X(Array.prototype,"find",Ue.find)}if([,1].findIndex(function(e,t){return t===0})!==0){X(Array.prototype,"findIndex",Ue.findIndex)}var wt=Function.bind.call(Function.bind,Object.prototype.propertyIsEnumerable);var jt=function ensureEnumerable(e,t){if(s&&wt(e,t)){Object.defineProperty(e,t,{enumerable:false})}};var St=function sliceArgs(){var e=Number(this);var t=arguments.length;var r=t-e;var n=new Array(r<0?0:r);for(var o=e;o1){return NaN}if(t===-1){return-Infinity}if(t===1){return Infinity}if(t===0){return t}return.5*L((1+t)/(1-t))},cbrt:function cbrt(e){var t=Number(e);if(t===0){return t}var r=t<0,n;if(r){t=-t}if(t===Infinity){n=Infinity}else{n=Math.exp(L(t)/3);n=(t/(n*n)+2*n)/3}return r?-n:n},clz32:function clz32(e){var t=Number(e);var r=te.ToUint32(t);if(r===0){return 32}return gr?te.Call(gr,r):31-k(L(r+.5)*Math.LOG2E)},cosh:function cosh(e){var t=Number(e);if(t===0){return 1}if(Number.isNaN(t)){return NaN}if(!T(t)){return Infinity}if(t<0){t=-t}if(t>21){return Math.exp(t)/2}return(Math.exp(t)+Math.exp(-t))/2},expm1:function expm1(e){var t=Number(e);if(t===-Infinity){return-1}if(!T(t)||t===0){return t}if(F(t)>.5){return Math.exp(t)-1}var r=t;var n=0;var o=1;while(n+r!==n){n+=r;o+=1;r*=t/o}return n},hypot:function hypot(e,t){var r=0;var n=0;for(var o=0;o0?i/n*(i/n):i}}return n===Infinity?Infinity:n*D(r)},log2:function log2(e){return L(e)*Math.LOG2E},log10:function log10(e){return L(e)*Math.LOG10E},log1p:function log1p(e){var t=Number(e);if(t<-1||Number.isNaN(t)){return NaN}if(t===0||t===Infinity){return t}if(t===-1){return-Infinity}return 1+t-1===0?t:t*(L(1+t)/(1+t-1))},sign:function sign(e){var t=Number(e);if(t===0){return t}if(Number.isNaN(t)){return t}return t<0?-1:1},sinh:function sinh(e){var t=Number(e);if(!T(t)||t===0){return t}if(F(t)<1){return(Math.expm1(t)-Math.expm1(-t))/2}return(Math.exp(t-1)-Math.exp(-t-1))*Math.E/2},tanh:function tanh(e){var t=Number(e);if(Number.isNaN(t)||t===0){return t}if(t>=20){return 1}if(t<=-20){return-1}var r=Math.expm1(t);var n=Math.expm1(-t);if(r===Infinity){return 1}if(n===Infinity){return-1}return(r-n)/(Math.exp(t)+Math.exp(-t))},trunc:function trunc(e){var t=Number(e);return t<0?-k(-t):k(t)},imul:function imul(e,t){var r=te.ToUint32(e);var n=te.ToUint32(t);var o=r>>>16&65535;var i=r&65535;var a=n>>>16&65535;var u=n&65535;return i*u+(o*u+i*a<<16>>>0)|0},fround:function fround(e){var t=Number(e);if(t===0||t===Infinity||t===-Infinity||V(t)){return t}var r=Math.sign(t);var n=F(t);if(nhr||V(i)){return r*Infinity}return r*i}};b(Math,dr);h(Math,"log1p",dr.log1p,Math.log1p(-1e-17)!==-1e-17);h(Math,"asinh",dr.asinh,Math.asinh(-1e7)!==-Math.asinh(1e7));h(Math,"tanh",dr.tanh,Math.tanh(-2e-17)!==-2e-17);h(Math,"acosh",dr.acosh,Math.acosh(Number.MAX_VALUE)===Infinity);h(Math,"cbrt",dr.cbrt,Math.abs(1-Math.cbrt(1e-300)/1e-100)/Number.EPSILON>8);h(Math,"sinh",dr.sinh,Math.sinh(-2e-17)!==-2e-17);var Or=Math.expm1(10);h(Math,"expm1",dr.expm1,Or>22025.465794806718||Or<22025.465794806718); -var mr=Math.round;var wr=Math.round(.5-Number.EPSILON/4)===0&&Math.round(-.5+Number.EPSILON/3.99)===1;var jr=pr+1;var Sr=2*pr-1;var Tr=[jr,Sr].every(function(e){return Math.round(e)===e});h(Math,"round",function round(e){var t=k(e);var r=t===-1?-0:t+1;return e-t<.5?t:r},!wr||!Tr);O.preserveToString(Math.round,mr);var Ir=Math.imul;if(Math.imul(4294967295,5)!==-5){Math.imul=dr.imul;O.preserveToString(Math.imul,Ir)}if(Math.imul.length!==2){X(Math,"imul",function imul(e,t){return te.Call(Ir,Math,arguments)})}var Er=function(){var e=S.setTimeout;if(typeof e!=="function"&&typeof e!=="object"){return}te.IsPromise=function(e){if(!te.TypeIsObject(e)){return false}if(typeof e._promise==="undefined"){return false}return true};var r=function(e){if(!te.IsConstructor(e)){throw new TypeError("Bad promise constructor")}var t=this;var r=function(e,r){if(t.resolve!==void 0||t.reject!==void 0){throw new TypeError("Bad Promise implementation!")}t.resolve=e;t.reject=r};t.resolve=void 0;t.reject=void 0;t.promise=new e(r);if(!(te.IsCallable(t.resolve)&&te.IsCallable(t.reject))){throw new TypeError("Bad promise constructor")}};var n;if(typeof window!=="undefined"&&te.IsCallable(window.postMessage)){n=function(){var e=[];var t="zero-timeout-message";var r=function(r){x(e,r);window.postMessage(t,"*")};var n=function(r){if(r.source===window&&r.data===t){r.stopPropagation();if(e.length===0){return}var n=A(e);n()}};window.addEventListener("message",n,true);return r}}var o=function(){var e=S.Promise;var t=e&&e.resolve&&e.resolve();return t&&function(e){return t.then(e)}};var i=te.IsCallable(S.setImmediate)?S.setImmediate:typeof process==="object"&&process.nextTick?process.nextTick:o()||(te.IsCallable(n)?n():function(t){e(t,0)});var a=function(e){return e};var u=function(e){throw e};var f=0;var s=1;var c=2;var l=0;var p=1;var v=2;var y={};var h=function(e,t,r){i(function(){g(e,t,r)})};var g=function(e,t,r){var n,o;if(t===y){return e(r)}try{n=e(r);o=t.resolve}catch(i){n=i;o=t.reject}o(n)};var d=function(e,t){var r=e._promise;var n=r.reactionLength;if(n>0){h(r.fulfillReactionHandler0,r.reactionCapability0,t);r.fulfillReactionHandler0=void 0;r.rejectReactions0=void 0;r.reactionCapability0=void 0;if(n>1){for(var o=1,i=0;o0){h(r.rejectReactionHandler0,r.reactionCapability0,t);r.fulfillReactionHandler0=void 0;r.rejectReactions0=void 0;r.reactionCapability0=void 0;if(n>1){for(var o=1,i=0;o2&&arguments[2]===y;if(b&&o===E){i=y}else{i=new r(o)}var g=te.IsCallable(e)?e:a;var d=te.IsCallable(t)?t:u;var O=n._promise;var m;if(O.state===f){if(O.reactionLength===0){O.fulfillReactionHandler0=g;O.rejectReactionHandler0=d;O.reactionCapability0=i}else{var w=3*(O.reactionLength-1);O[w+l]=g;O[w+p]=d;O[w+v]=i}O.reactionLength+=1}else if(O.state===s){m=O.result;h(g,i,m)}else if(O.state===c){m=O.result;h(d,i,m)}else{throw new TypeError("unexpected Promise state")}return i.promise}});y=new r(E);I=T.then;return E}();if(S.Promise){delete S.Promise.accept;delete S.Promise.defer;delete S.Promise.prototype.chain}if(typeof Er==="function"){b(S,{Promise:Er});var Pr=w(S.Promise,function(e){return e.resolve(42).then(function(){})instanceof e});var Mr=!i(function(){S.Promise.reject(42).then(null,5).then(null,G)});var Cr=i(function(){S.Promise.call(3,G)});var xr=function(e){var t=e.resolve(5);t.constructor={};var r=e.resolve(t);try{r.then(null,G).then(null,G)}catch(n){return true}return t===r}(S.Promise);var Nr=s&&function(){var e=0;var t=Object.defineProperty({},"then",{get:function(){e+=1}});Promise.resolve(t);return e===1}();var Ar=function BadResolverPromise(e){var t=new Promise(e);e(3,function(){});this.then=t.then;this.constructor=BadResolverPromise};Ar.prototype=Promise.prototype;Ar.all=Promise.all;var Rr=a(function(){return!!Ar.all([1,2])});if(!Pr||!Mr||!Cr||xr||!Nr||Rr){Promise=Er;X(S,"Promise",Er)}if(Promise.all.length!==1){var _r=Promise.all;X(Promise,"all",function all(e){return te.Call(_r,this,arguments)})}if(Promise.race.length!==1){var kr=Promise.race;X(Promise,"race",function race(e){return te.Call(kr,this,arguments)})}if(Promise.resolve.length!==1){var Fr=Promise.resolve;X(Promise,"resolve",function resolve(e){return te.Call(Fr,this,arguments)})}if(Promise.reject.length!==1){var Lr=Promise.reject;X(Promise,"reject",function reject(e){return te.Call(Lr,this,arguments)})}jt(Promise,"all");jt(Promise,"race");jt(Promise,"resolve");jt(Promise,"reject");Oe(Promise)}var Dr=function(e){var t=n(p(e,function(e,t){e[t]=true;return e},{}));return e.join(":")===t.join(":")};var zr=Dr(["z","a","bb"]);var qr=Dr(["z",1,"a","3",2]);if(s){var Gr=function fastkey(e){if(!zr){return null}if(typeof e==="undefined"||e===null){return"^"+te.ToString(e)}else if(typeof e==="string"){return"$"+e}else if(typeof e==="number"){if(!qr){return"n"+e}return e}else if(typeof e==="boolean"){return"b"+e}return null};var Wr=function emptyObject(){return Object.create?Object.create(null):{}};var Hr=function addIterableToMap(e,n,o){if(r(o)||K.string(o)){l(o,function(e){if(!te.TypeIsObject(e)){throw new TypeError("Iterator value "+e+" is not an entry object")}n.set(e[0],e[1])})}else if(o instanceof e){t(e.prototype.forEach,o,function(e,t){n.set(t,e)})}else{var i,a;if(o!==null&&typeof o!=="undefined"){a=n.set;if(!te.IsCallable(a)){throw new TypeError("bad map")}i=te.GetIterator(o)}if(typeof i!=="undefined"){while(true){var u=te.IteratorStep(i);if(u===false){break}var f=u.value;try{if(!te.TypeIsObject(f)){throw new TypeError("Iterator value "+f+" is not an entry object")}t(a,n,f[0],f[1])}catch(s){te.IteratorClose(i,true);throw s}}}}};var Vr=function addIterableToSet(e,n,o){if(r(o)||K.string(o)){l(o,function(e){n.add(e)})}else if(o instanceof e){t(e.prototype.forEach,o,function(e){n.add(e)})}else{var i,a;if(o!==null&&typeof o!=="undefined"){a=n.add;if(!te.IsCallable(a)){throw new TypeError("bad set")}i=te.GetIterator(o)}if(typeof i!=="undefined"){while(true){var u=te.IteratorStep(i);if(u===false){break}var f=u.value;try{t(a,n,f)}catch(s){te.IteratorClose(i,true);throw s}}}}};var Br={Map:function(){var e={};var r=function MapEntry(e,t){this.key=e;this.value=t;this.next=null;this.prev=null};r.prototype.isRemoved=function isRemoved(){return this.key===e};var n=function isMap(e){return!!e._es6map};var o=function requireMapSlot(e,t){if(!te.TypeIsObject(e)||!n(e)){throw new TypeError("Method Map.prototype."+t+" called on incompatible receiver "+te.ToString(e))}};var i=function MapIterator(e,t){o(e,"[[MapIterator]]");this.head=e._head;this.i=this.head;this.kind=t};i.prototype={next:function next(){var e=this.i,t=this.kind,r=this.head,n;if(typeof this.i==="undefined"){return{value:void 0,done:true}}while(e.isRemoved()&&e!==r){e=e.prev}while(e.next!==r){e=e.next;if(!e.isRemoved()){if(t==="key"){n=e.key}else if(t==="value"){n=e.value}else{n=[e.key,e.value]}this.i=e;return{value:n,done:false}}}this.i=void 0;return{value:void 0,done:true}}};me(i.prototype);var a;var u=function Map(){if(!(this instanceof Map)){throw new TypeError('Constructor Map requires "new"')}if(this&&this._es6map){throw new TypeError("Bad construction")}var e=Se(this,Map,a,{_es6map:true,_head:null,_storage:Wr(),_size:0});var t=new r(null,null);t.next=t.prev=t;e._head=t;if(arguments.length>0){Hr(Map,e,arguments[0])}return e};a=u.prototype;O.getter(a,"size",function(){if(typeof this._size==="undefined"){throw new TypeError("size method called on incompatible Map")}return this._size});b(a,{get:function get(e){o(this,"get");var t=Gr(e);if(t!==null){var r=this._storage[t];if(r){return r.value}else{return}}var n=this._head,i=n;while((i=i.next)!==n){if(te.SameValueZero(i.key,e)){return i.value}}},has:function has(e){o(this,"has");var t=Gr(e);if(t!==null){return typeof this._storage[t]!=="undefined"}var r=this._head,n=r;while((n=n.next)!==r){if(te.SameValueZero(n.key,e)){return true}}return false},set:function set(e,t){o(this,"set");var n=this._head,i=n,a;var u=Gr(e);if(u!==null){if(typeof this._storage[u]!=="undefined"){this._storage[u].value=t;return this}else{a=this._storage[u]=new r(e,t);i=n.prev}}while((i=i.next)!==n){if(te.SameValueZero(i.key,e)){i.value=t;return this}}a=a||new r(e,t);if(te.SameValue(-0,e)){a.key=+0}a.next=this._head;a.prev=this._head.prev;a.prev.next=a;a.next.prev=a;this._size+=1;return this},"delete":function(t){o(this,"delete");var r=this._head,n=r;var i=Gr(t);if(i!==null){if(typeof this._storage[i]==="undefined"){return false}n=this._storage[i].prev;delete this._storage[i]}while((n=n.next)!==r){if(te.SameValueZero(n.key,t)){n.key=n.value=e;n.prev.next=n.next;n.next.prev=n.prev;this._size-=1;return true}}return false},clear:function clear(){o(this,"clear");this._size=0;this._storage=Wr();var t=this._head,r=t,n=r.next;while((r=n)!==t){r.key=r.value=e;n=r.next;r.next=r.prev=t}t.next=t.prev=t},keys:function keys(){o(this,"keys");return new i(this,"key")},values:function values(){o(this,"values");return new i(this,"value")},entries:function entries(){o(this,"entries");return new i(this,"key+value")},forEach:function forEach(e){o(this,"forEach");var r=arguments.length>1?arguments[1]:null;var n=this.entries();for(var i=n.next();!i.done;i=n.next()){if(r){t(e,r,i.value[1],i.value[0],this)}else{e(i.value[1],i.value[0],this)}}}});me(a,a.entries);return u}(),Set:function(){var e=function isSet(e){return e._es6set&&typeof e._storage!=="undefined"};var r=function requireSetSlot(t,r){if(!te.TypeIsObject(t)||!e(t)){throw new TypeError("Set.prototype."+r+" called on incompatible receiver "+te.ToString(t))}};var o;var i=function Set(){if(!(this instanceof Set)){throw new TypeError('Constructor Set requires "new"')}if(this&&this._es6set){throw new TypeError("Bad construction")}var e=Se(this,Set,o,{_es6set:true,"[[SetData]]":null,_storage:Wr()});if(!e._es6set){throw new TypeError("bad set")}if(arguments.length>0){Vr(Set,e,arguments[0])}return e};o=i.prototype;var a=function(e){var t=e;if(t==="^null"){return null}else if(t==="^undefined"){return void 0}else{var r=t.charAt(0);if(r==="$"){return C(t,1)}else if(r==="n"){return+C(t,1)}else if(r==="b"){return t==="btrue"}}return+t};var u=function ensureMap(e){if(!e["[[SetData]]"]){var t=e["[[SetData]]"]=new Br.Map;l(n(e._storage),function(e){var r=a(e);t.set(r,r)});e["[[SetData]]"]=t}e._storage=null};O.getter(i.prototype,"size",function(){r(this,"size");if(this._storage){return n(this._storage).length}u(this);return this["[[SetData]]"].size});b(i.prototype,{has:function has(e){r(this,"has");var t;if(this._storage&&(t=Gr(e))!==null){return!!this._storage[t]}u(this);return this["[[SetData]]"].has(e)},add:function add(e){r(this,"add");var t;if(this._storage&&(t=Gr(e))!==null){this._storage[t]=true;return this}u(this);this["[[SetData]]"].set(e,e);return this},"delete":function(e){r(this,"delete");var t;if(this._storage&&(t=Gr(e))!==null){var n=z(this._storage,t);return delete this._storage[t]&&n}u(this);return this["[[SetData]]"]["delete"](e)},clear:function clear(){r(this,"clear");if(this._storage){this._storage=Wr()}if(this["[[SetData]]"]){this["[[SetData]]"].clear()}},values:function values(){r(this,"values");u(this);return this["[[SetData]]"].values()},entries:function entries(){r(this,"entries");u(this);return this["[[SetData]]"].entries()},forEach:function forEach(e){r(this,"forEach");var n=arguments.length>1?arguments[1]:null;var o=this;u(o);this["[[SetData]]"].forEach(function(r,i){if(n){t(e,n,i,i,o)}else{e(i,i,o)}})}});h(i.prototype,"keys",i.prototype.values,true);me(i.prototype,i.prototype.values);return i}()};if(S.Map||S.Set){var $r=a(function(){return new Map([[1,2]]).get(1)===2});if(!$r){var Ur=S.Map;S.Map=function Map(){if(!(this instanceof Map)){throw new TypeError('Constructor Map requires "new"')}var e=new Ur;if(arguments.length>0){Hr(Map,e,arguments[0])}delete e.constructor;Object.setPrototypeOf(e,S.Map.prototype);return e};S.Map.prototype=m(Ur.prototype);h(S.Map.prototype,"constructor",S.Map,true);O.preserveToString(S.Map,Ur)}var Jr=new Map;var Kr=function(){var e=new Map([[1,0],[2,0],[3,0],[4,0]]);e.set(-0,e);return e.get(0)===e&&e.get(-0)===e&&e.has(0)&&e.has(-0)}();var Xr=Jr.set(1,2)===Jr;if(!Kr||!Xr){var Zr=Map.prototype.set;X(Map.prototype,"set",function set(e,r){t(Zr,this,e===0?0:e,r);return this})}if(!Kr){var Yr=Map.prototype.get;var Qr=Map.prototype.has;b(Map.prototype,{get:function get(e){return t(Yr,this,e===0?0:e)},has:function has(e){return t(Qr,this,e===0?0:e)}},true);O.preserveToString(Map.prototype.get,Yr);O.preserveToString(Map.prototype.has,Qr)}var en=new Set;var tn=function(e){e["delete"](0);e.add(-0);return!e.has(0)}(en);var rn=en.add(1)===en;if(!tn||!rn){var nn=Set.prototype.add;Set.prototype.add=function add(e){t(nn,this,e===0?0:e);return this};O.preserveToString(Set.prototype.add,nn)}if(!tn){var on=Set.prototype.has;Set.prototype.has=function has(e){return t(on,this,e===0?0:e)};O.preserveToString(Set.prototype.has,on);var an=Set.prototype["delete"];Set.prototype["delete"]=function SetDelete(e){return t(an,this,e===0?0:e)};O.preserveToString(Set.prototype["delete"],an)}var un=w(S.Map,function(e){var t=new e([]);t.set(42,42);return t instanceof e});var fn=Object.setPrototypeOf&&!un;var sn=function(){try{return!(S.Map()instanceof S.Map)}catch(e){return e instanceof TypeError}}();if(S.Map.length!==0||fn||!sn){var cn=S.Map;S.Map=function Map(){if(!(this instanceof Map)){throw new TypeError('Constructor Map requires "new"')}var e=new cn;if(arguments.length>0){Hr(Map,e,arguments[0])}delete e.constructor;Object.setPrototypeOf(e,Map.prototype);return e};S.Map.prototype=cn.prototype;h(S.Map.prototype,"constructor",S.Map,true);O.preserveToString(S.Map,cn)}var ln=w(S.Set,function(e){var t=new e([]);t.add(42,42);return t instanceof e});var pn=Object.setPrototypeOf&&!ln;var vn=function(){try{return!(S.Set()instanceof S.Set)}catch(e){return e instanceof TypeError}}();if(S.Set.length!==0||pn||!vn){var yn=S.Set;S.Set=function Set(){if(!(this instanceof Set)){throw new TypeError('Constructor Set requires "new"')}var e=new yn;if(arguments.length>0){Vr(Set,e,arguments[0])}delete e.constructor;Object.setPrototypeOf(e,Set.prototype);return e};S.Set.prototype=yn.prototype;h(S.Set.prototype,"constructor",S.Set,true);O.preserveToString(S.Set,yn)}var hn=!a(function(){return(new Map).keys().next().done});if(typeof S.Map.prototype.clear!=="function"||(new S.Set).size!==0||(new S.Map).size!==0||typeof S.Map.prototype.keys!=="function"||typeof S.Set.prototype.keys!=="function"||typeof S.Map.prototype.forEach!=="function"||typeof S.Set.prototype.forEach!=="function"||u(S.Map)||u(S.Set)||typeof(new S.Map).keys().next!=="function"||hn||!un){b(S,{Map:Br.Map,Set:Br.Set},true)}if(S.Set.prototype.keys!==S.Set.prototype.values){h(S.Set.prototype,"keys",S.Set.prototype.values,true)}me(Object.getPrototypeOf((new S.Map).keys()));me(Object.getPrototypeOf((new S.Set).keys()));if(c&&S.Set.prototype.has.name!=="has"){var bn=S.Set.prototype.has;X(S.Set.prototype,"has",function has(e){return t(bn,this,e)})}}b(S,Br);Oe(S.Map);Oe(S.Set)}var gn=function throwUnlessTargetIsObject(e){if(!te.TypeIsObject(e)){throw new TypeError("target must be an object")}};var dn={apply:function apply(){return te.Call(te.Call,null,arguments)},construct:function construct(e,t){if(!te.IsConstructor(e)){throw new TypeError("First argument must be a constructor.")}var r=arguments.length>2?arguments[2]:e;if(!te.IsConstructor(r)){throw new TypeError("new.target must be a constructor.")}return te.Construct(e,t,r,"internal")},deleteProperty:function deleteProperty(e,t){gn(e);if(s){var r=Object.getOwnPropertyDescriptor(e,t);if(r&&!r.configurable){return false}}return delete e[t]},has:function has(e,t){gn(e);return t in e}};if(Object.getOwnPropertyNames){Object.assign(dn,{ownKeys:function ownKeys(e){gn(e);var t=Object.getOwnPropertyNames(e);if(te.IsCallable(Object.getOwnPropertySymbols)){N(t,Object.getOwnPropertySymbols(e))}return t}})}var On=function ConvertExceptionToBoolean(e){return!i(e)};if(Object.preventExtensions){Object.assign(dn,{isExtensible:function isExtensible(e){gn(e);return Object.isExtensible(e)},preventExtensions:function preventExtensions(e){gn(e);return On(function(){Object.preventExtensions(e)})}})}if(s){var mn=function get(e,t,r){var n=Object.getOwnPropertyDescriptor(e,t);if(!n){var o=Object.getPrototypeOf(e);if(o===null){return void 0}return mn(o,t,r)}if("value"in n){return n.value}if(n.get){return te.Call(n.get,r)}return void 0};var wn=function set(e,r,n,o){var i=Object.getOwnPropertyDescriptor(e,r);if(!i){var a=Object.getPrototypeOf(e);if(a!==null){return wn(a,r,n,o)}i={value:void 0,writable:true,enumerable:true,configurable:true}}if("value"in i){if(!i.writable){return false}if(!te.TypeIsObject(o)){return false}var u=Object.getOwnPropertyDescriptor(o,r);if(u){return Q.defineProperty(o,r,{value:n})}else{return Q.defineProperty(o,r,{value:n,writable:true,enumerable:true,configurable:true})}}if(i.set){t(i.set,o,n);return true}return false};Object.assign(dn,{defineProperty:function defineProperty(e,t,r){gn(e);return On(function(){Object.defineProperty(e,t,r)})},getOwnPropertyDescriptor:function getOwnPropertyDescriptor(e,t){gn(e);return Object.getOwnPropertyDescriptor(e,t)},get:function get(e,t){gn(e);var r=arguments.length>2?arguments[2]:e;return mn(e,t,r)},set:function set(e,t,r){gn(e);var n=arguments.length>3?arguments[3]:e;return wn(e,t,r,n)}})}if(Object.getPrototypeOf){var jn=Object.getPrototypeOf;dn.getPrototypeOf=function getPrototypeOf(e){gn(e);return jn(e)}}if(Object.setPrototypeOf&&dn.getPrototypeOf){var Sn=function(e,t){var r=t;while(r){if(e===r){return true}r=dn.getPrototypeOf(r)}return false};Object.assign(dn,{setPrototypeOf:function setPrototypeOf(e,t){gn(e);if(t!==null&&!te.TypeIsObject(t)){throw new TypeError("proto must be an object or null")}if(t===Q.getPrototypeOf(e)){return true}if(Q.isExtensible&&!Q.isExtensible(e)){return false}if(Sn(e,t)){return false}Object.setPrototypeOf(e,t);return true}})}var Tn=function(e,t){if(!te.IsCallable(S.Reflect[e])){h(S.Reflect,e,t)}else{var r=a(function(){S.Reflect[e](1);S.Reflect[e](NaN);S.Reflect[e](true);return true});if(r){X(S.Reflect,e,t)}}};Object.keys(dn).forEach(function(e){Tn(e,dn[e])});var In=S.Reflect.getPrototypeOf;if(c&&In&&In.name!=="getPrototypeOf"){X(S.Reflect,"getPrototypeOf",function getPrototypeOf(e){return t(In,S.Reflect,e)})}if(S.Reflect.setPrototypeOf){if(a(function(){S.Reflect.setPrototypeOf(1,{});return true})){X(S.Reflect,"setPrototypeOf",dn.setPrototypeOf)}}if(S.Reflect.defineProperty){if(!a(function(){var e=!S.Reflect.defineProperty(1,"test",{value:1});var t=typeof Object.preventExtensions!=="function"||!S.Reflect.defineProperty(Object.preventExtensions({}),"test",{});return e&&t})){X(S.Reflect,"defineProperty",dn.defineProperty)}}if(S.Reflect.construct){if(!a(function(){var e=function F(){};return S.Reflect.construct(function(){},[],e)instanceof e})){X(S.Reflect,"construct",dn.construct)}}if(String(new Date(NaN))!=="Invalid Date"){var En=Date.prototype.toString;var Pn=function toString(){var e=+this;if(e!==e){return"Invalid Date"}return te.Call(En,this)};X(Date.prototype,"toString",Pn)}var Mn={anchor:function anchor(e){return te.CreateHTML(this,"a","name",e)},big:function big(){return te.CreateHTML(this,"big","","")},blink:function blink(){return te.CreateHTML(this,"blink","","")},bold:function bold(){return te.CreateHTML(this,"b","","")},fixed:function fixed(){return te.CreateHTML(this,"tt","","")},fontcolor:function fontcolor(e){return te.CreateHTML(this,"font","color",e)},fontsize:function fontsize(e){return te.CreateHTML(this,"font","size",e)},italics:function italics(){return te.CreateHTML(this,"i","","")},link:function link(e){return te.CreateHTML(this,"a","href",e)},small:function small(){return te.CreateHTML(this,"small","","")},strike:function strike(){return te.CreateHTML(this,"strike","","")},sub:function sub(){return te.CreateHTML(this,"sub","","")},sup:function sub(){return te.CreateHTML(this,"sup","","")}};l(Object.keys(Mn),function(e){var r=String.prototype[e];var n=false;if(te.IsCallable(r)){var o=t(r,"",' " ');var i=P([],o.match(/"/g)).length;n=o!==o.toLowerCase()||i>2}else{n=true}if(n){X(String.prototype,e,Mn[e])}});var Cn=function(){if(!Z){return false}var e=typeof JSON==="object"&&typeof JSON.stringify==="function"?JSON.stringify:null;if(!e){return false}if(typeof e(W())!=="undefined"){return true}if(e([W()])!=="[null]"){return true}var t={a:W()};t[W()]=true;if(e(t)!=="{}"){return true}return false}();var xn=a(function(){if(!Z){return true}return JSON.stringify(Object(W()))==="{}"&&JSON.stringify([Object(W())])==="[{}]"});if(Cn||!xn){var Nn=JSON.stringify;X(JSON,"stringify",function stringify(e){if(typeof e==="symbol"){return}var n;if(arguments.length>1){n=arguments[1]}var o=[e];if(!r(n)){var i=te.IsCallable(n)?n:null;var a=function(e,r){var n=i?t(i,this,e,r):r;if(typeof n!=="symbol"){if(K.symbol(n)){return Tt({})(n)}else{return n}}};o.push(a)}else{o.push(n)}if(arguments.length>2){o.push(arguments[2])}return Nn.apply(this,o)})}return S}); -//# sourceMappingURL=es6-shim.map diff --git a/demo-shell-ng2/dist/lib/font-awesome.min.css b/demo-shell-ng2/dist/lib/font-awesome.min.css deleted file mode 100644 index 885b38403e..0000000000 --- a/demo-shell-ng2/dist/lib/font-awesome.min.css +++ /dev/null @@ -1,4 +0,0 @@ -/*! - * Font Awesome 4.6.1 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.6.1');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.1') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.6.1') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.6.1') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.6.1') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.6.1#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} diff --git a/demo-shell-ng2/dist/lib/http.dev.js b/demo-shell-ng2/dist/lib/http.dev.js deleted file mode 100644 index 9db4f1d2ee..0000000000 --- a/demo-shell-ng2/dist/lib/http.dev.js +++ /dev/null @@ -1,1106 +0,0 @@ -"format register"; -System.register("angular2/src/http/interfaces", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var ConnectionBackend = (function() { - function ConnectionBackend() {} - return ConnectionBackend; - }()); - exports.ConnectionBackend = ConnectionBackend; - var Connection = (function() { - function Connection() {} - return Connection; - }()); - exports.Connection = Connection; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/headers", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var collection_1 = require("angular2/src/facade/collection"); - var Headers = (function() { - function Headers(headers) { - var _this = this; - if (headers instanceof Headers) { - this._headersMap = headers._headersMap; - return ; - } - this._headersMap = new collection_1.Map(); - if (lang_1.isBlank(headers)) { - return ; - } - collection_1.StringMapWrapper.forEach(headers, function(v, k) { - _this._headersMap.set(k, collection_1.isListLikeIterable(v) ? v : [v]); - }); - } - Headers.fromResponseHeaderString = function(headersString) { - return headersString.trim().split('\n').map(function(val) { - return val.split(':'); - }).map(function(_a) { - var key = _a[0], - parts = _a.slice(1); - return ([key.trim(), parts.join(':').trim()]); - }).reduce(function(headers, _a) { - var key = _a[0], - value = _a[1]; - return !headers.set(key, value) && headers; - }, new Headers()); - }; - Headers.prototype.append = function(name, value) { - var mapName = this._headersMap.get(name); - var list = collection_1.isListLikeIterable(mapName) ? mapName : []; - list.push(value); - this._headersMap.set(name, list); - }; - Headers.prototype.delete = function(name) { - this._headersMap.delete(name); - }; - Headers.prototype.forEach = function(fn) { - this._headersMap.forEach(fn); - }; - Headers.prototype.get = function(header) { - return collection_1.ListWrapper.first(this._headersMap.get(header)); - }; - Headers.prototype.has = function(header) { - return this._headersMap.has(header); - }; - Headers.prototype.keys = function() { - return collection_1.MapWrapper.keys(this._headersMap); - }; - Headers.prototype.set = function(header, value) { - var list = []; - if (collection_1.isListLikeIterable(value)) { - var pushValue = value.join(','); - list.push(pushValue); - } else { - list.push(value); - } - this._headersMap.set(header, list); - }; - Headers.prototype.values = function() { - return collection_1.MapWrapper.values(this._headersMap); - }; - Headers.prototype.toJSON = function() { - var serializableHeaders = {}; - this._headersMap.forEach(function(values, name) { - var list = []; - collection_1.iterateListLike(values, function(val) { - return list = collection_1.ListWrapper.concat(list, val.split(',')); - }); - serializableHeaders[name] = list; - }); - return serializableHeaders; - }; - Headers.prototype.getAll = function(header) { - var headers = this._headersMap.get(header); - return collection_1.isListLikeIterable(headers) ? headers : []; - }; - Headers.prototype.entries = function() { - throw new exceptions_1.BaseException('"entries" method is not implemented on Headers class'); - }; - return Headers; - }()); - exports.Headers = Headers; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/enums", [], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - (function(RequestMethod) { - RequestMethod[RequestMethod["Get"] = 0] = "Get"; - RequestMethod[RequestMethod["Post"] = 1] = "Post"; - RequestMethod[RequestMethod["Put"] = 2] = "Put"; - RequestMethod[RequestMethod["Delete"] = 3] = "Delete"; - RequestMethod[RequestMethod["Options"] = 4] = "Options"; - RequestMethod[RequestMethod["Head"] = 5] = "Head"; - RequestMethod[RequestMethod["Patch"] = 6] = "Patch"; - })(exports.RequestMethod || (exports.RequestMethod = {})); - var RequestMethod = exports.RequestMethod; - (function(ReadyState) { - ReadyState[ReadyState["Unsent"] = 0] = "Unsent"; - ReadyState[ReadyState["Open"] = 1] = "Open"; - ReadyState[ReadyState["HeadersReceived"] = 2] = "HeadersReceived"; - ReadyState[ReadyState["Loading"] = 3] = "Loading"; - ReadyState[ReadyState["Done"] = 4] = "Done"; - ReadyState[ReadyState["Cancelled"] = 5] = "Cancelled"; - })(exports.ReadyState || (exports.ReadyState = {})); - var ReadyState = exports.ReadyState; - (function(ResponseType) { - ResponseType[ResponseType["Basic"] = 0] = "Basic"; - ResponseType[ResponseType["Cors"] = 1] = "Cors"; - ResponseType[ResponseType["Default"] = 2] = "Default"; - ResponseType[ResponseType["Error"] = 3] = "Error"; - ResponseType[ResponseType["Opaque"] = 4] = "Opaque"; - })(exports.ResponseType || (exports.ResponseType = {})); - var ResponseType = exports.ResponseType; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/url_search_params", ["angular2/src/facade/lang", "angular2/src/facade/collection"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var collection_1 = require("angular2/src/facade/collection"); - function paramParser(rawParams) { - if (rawParams === void 0) { - rawParams = ''; - } - var map = new collection_1.Map(); - if (rawParams.length > 0) { - var params = rawParams.split('&'); - params.forEach(function(param) { - var split = param.split('='); - var key = split[0]; - var val = split[1]; - var list = lang_1.isPresent(map.get(key)) ? map.get(key) : []; - list.push(val); - map.set(key, list); - }); - } - return map; - } - var URLSearchParams = (function() { - function URLSearchParams(rawParams) { - if (rawParams === void 0) { - rawParams = ''; - } - this.rawParams = rawParams; - this.paramsMap = paramParser(rawParams); - } - URLSearchParams.prototype.clone = function() { - var clone = new URLSearchParams(); - clone.appendAll(this); - return clone; - }; - URLSearchParams.prototype.has = function(param) { - return this.paramsMap.has(param); - }; - URLSearchParams.prototype.get = function(param) { - var storedParam = this.paramsMap.get(param); - if (collection_1.isListLikeIterable(storedParam)) { - return collection_1.ListWrapper.first(storedParam); - } else { - return null; - } - }; - URLSearchParams.prototype.getAll = function(param) { - var mapParam = this.paramsMap.get(param); - return lang_1.isPresent(mapParam) ? mapParam : []; - }; - URLSearchParams.prototype.set = function(param, val) { - var mapParam = this.paramsMap.get(param); - var list = lang_1.isPresent(mapParam) ? mapParam : []; - collection_1.ListWrapper.clear(list); - list.push(val); - this.paramsMap.set(param, list); - }; - URLSearchParams.prototype.setAll = function(searchParams) { - var _this = this; - searchParams.paramsMap.forEach(function(value, param) { - var mapParam = _this.paramsMap.get(param); - var list = lang_1.isPresent(mapParam) ? mapParam : []; - collection_1.ListWrapper.clear(list); - list.push(value[0]); - _this.paramsMap.set(param, list); - }); - }; - URLSearchParams.prototype.append = function(param, val) { - var mapParam = this.paramsMap.get(param); - var list = lang_1.isPresent(mapParam) ? mapParam : []; - list.push(val); - this.paramsMap.set(param, list); - }; - URLSearchParams.prototype.appendAll = function(searchParams) { - var _this = this; - searchParams.paramsMap.forEach(function(value, param) { - var mapParam = _this.paramsMap.get(param); - var list = lang_1.isPresent(mapParam) ? mapParam : []; - for (var i = 0; i < value.length; ++i) { - list.push(value[i]); - } - _this.paramsMap.set(param, list); - }); - }; - URLSearchParams.prototype.replaceAll = function(searchParams) { - var _this = this; - searchParams.paramsMap.forEach(function(value, param) { - var mapParam = _this.paramsMap.get(param); - var list = lang_1.isPresent(mapParam) ? mapParam : []; - collection_1.ListWrapper.clear(list); - for (var i = 0; i < value.length; ++i) { - list.push(value[i]); - } - _this.paramsMap.set(param, list); - }); - }; - URLSearchParams.prototype.toString = function() { - var paramsList = []; - this.paramsMap.forEach(function(values, k) { - values.forEach(function(v) { - return paramsList.push(k + '=' + v); - }); - }); - return paramsList.join('&'); - }; - URLSearchParams.prototype.delete = function(param) { - this.paramsMap.delete(param); - }; - return URLSearchParams; - }()); - exports.URLSearchParams = URLSearchParams; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/static_response", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/src/http/http_utils"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var http_utils_1 = require("angular2/src/http/http_utils"); - var Response = (function() { - function Response(responseOptions) { - this._body = responseOptions.body; - this.status = responseOptions.status; - this.statusText = responseOptions.statusText; - this.headers = responseOptions.headers; - this.type = responseOptions.type; - this.url = responseOptions.url; - } - Response.prototype.blob = function() { - throw new exceptions_1.BaseException('"blob()" method not implemented on Response superclass'); - }; - Response.prototype.json = function() { - var jsonResponse; - if (http_utils_1.isJsObject(this._body)) { - jsonResponse = this._body; - } else if (lang_1.isString(this._body)) { - jsonResponse = lang_1.Json.parse(this._body); - } - return jsonResponse; - }; - Response.prototype.text = function() { - return this._body.toString(); - }; - Response.prototype.arrayBuffer = function() { - throw new exceptions_1.BaseException('"arrayBuffer()" method not implemented on Response superclass'); - }; - return Response; - }()); - exports.Response = Response; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/base_response_options", ["angular2/core", "angular2/src/facade/lang", "angular2/src/http/headers", "angular2/src/http/enums"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var core_1 = require("angular2/core"); - var lang_1 = require("angular2/src/facade/lang"); - var headers_1 = require("angular2/src/http/headers"); - var enums_1 = require("angular2/src/http/enums"); - var ResponseOptions = (function() { - function ResponseOptions(_a) { - var _b = _a === void 0 ? {} : _a, - body = _b.body, - status = _b.status, - headers = _b.headers, - statusText = _b.statusText, - type = _b.type, - url = _b.url; - this.body = lang_1.isPresent(body) ? body : null; - this.status = lang_1.isPresent(status) ? status : null; - this.headers = lang_1.isPresent(headers) ? headers : null; - this.statusText = lang_1.isPresent(statusText) ? statusText : null; - this.type = lang_1.isPresent(type) ? type : null; - this.url = lang_1.isPresent(url) ? url : null; - } - ResponseOptions.prototype.merge = function(options) { - return new ResponseOptions({ - body: lang_1.isPresent(options) && lang_1.isPresent(options.body) ? options.body : this.body, - status: lang_1.isPresent(options) && lang_1.isPresent(options.status) ? options.status : this.status, - headers: lang_1.isPresent(options) && lang_1.isPresent(options.headers) ? options.headers : this.headers, - statusText: lang_1.isPresent(options) && lang_1.isPresent(options.statusText) ? options.statusText : this.statusText, - type: lang_1.isPresent(options) && lang_1.isPresent(options.type) ? options.type : this.type, - url: lang_1.isPresent(options) && lang_1.isPresent(options.url) ? options.url : this.url - }); - }; - return ResponseOptions; - }()); - exports.ResponseOptions = ResponseOptions; - var BaseResponseOptions = (function(_super) { - __extends(BaseResponseOptions, _super); - function BaseResponseOptions() { - _super.call(this, { - status: 200, - statusText: 'Ok', - type: enums_1.ResponseType.Default, - headers: new headers_1.Headers() - }); - } - BaseResponseOptions = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [])], BaseResponseOptions); - return BaseResponseOptions; - }(ResponseOptions)); - exports.BaseResponseOptions = BaseResponseOptions; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/backends/browser_xhr", ["angular2/core"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var core_1 = require("angular2/core"); - var BrowserXhr = (function() { - function BrowserXhr() {} - BrowserXhr.prototype.build = function() { - return (new XMLHttpRequest()); - }; - BrowserXhr = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [])], BrowserXhr); - return BrowserXhr; - }()); - exports.BrowserXhr = BrowserXhr; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/backends/browser_jsonp", ["angular2/core", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var core_1 = require("angular2/core"); - var lang_1 = require("angular2/src/facade/lang"); - var _nextRequestId = 0; - exports.JSONP_HOME = '__ng_jsonp__'; - var _jsonpConnections = null; - function _getJsonpConnections() { - if (_jsonpConnections === null) { - _jsonpConnections = lang_1.global[exports.JSONP_HOME] = {}; - } - return _jsonpConnections; - } - var BrowserJsonp = (function() { - function BrowserJsonp() {} - BrowserJsonp.prototype.build = function(url) { - var node = document.createElement('script'); - node.src = url; - return node; - }; - BrowserJsonp.prototype.nextRequestID = function() { - return "__req" + _nextRequestId++; - }; - BrowserJsonp.prototype.requestCallback = function(id) { - return exports.JSONP_HOME + "." + id + ".finished"; - }; - BrowserJsonp.prototype.exposeConnection = function(id, connection) { - var connections = _getJsonpConnections(); - connections[id] = connection; - }; - BrowserJsonp.prototype.removeConnection = function(id) { - var connections = _getJsonpConnections(); - connections[id] = null; - }; - BrowserJsonp.prototype.send = function(node) { - document.body.appendChild((node)); - }; - BrowserJsonp.prototype.cleanup = function(node) { - if (node.parentNode) { - node.parentNode.removeChild((node)); - } - }; - BrowserJsonp = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [])], BrowserJsonp); - return BrowserJsonp; - }()); - exports.BrowserJsonp = BrowserJsonp; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/http_utils", ["angular2/src/facade/lang", "angular2/src/http/enums", "angular2/src/facade/exceptions", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var lang_1 = require("angular2/src/facade/lang"); - var enums_1 = require("angular2/src/http/enums"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - function normalizeMethodName(method) { - if (lang_1.isString(method)) { - var originalMethod = method; - method = method.replace(/(\w)(\w*)/g, function(g0, g1, g2) { - return g1.toUpperCase() + g2.toLowerCase(); - }); - method = enums_1.RequestMethod[method]; - if (typeof method !== 'number') - throw exceptions_1.makeTypeError("Invalid request method. The method \"" + originalMethod + "\" is not supported."); - } - return method; - } - exports.normalizeMethodName = normalizeMethodName; - exports.isSuccess = function(status) { - return (status >= 200 && status < 300); - }; - function getResponseURL(xhr) { - if ('responseURL' in xhr) { - return xhr.responseURL; - } - if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) { - return xhr.getResponseHeader('X-Request-URL'); - } - return ; - } - exports.getResponseURL = getResponseURL; - var lang_2 = require("angular2/src/facade/lang"); - exports.isJsObject = lang_2.isJsObject; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/base_request_options", ["angular2/src/facade/lang", "angular2/src/http/headers", "angular2/src/http/enums", "angular2/core", "angular2/src/http/url_search_params", "angular2/src/http/http_utils"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var headers_1 = require("angular2/src/http/headers"); - var enums_1 = require("angular2/src/http/enums"); - var core_1 = require("angular2/core"); - var url_search_params_1 = require("angular2/src/http/url_search_params"); - var http_utils_1 = require("angular2/src/http/http_utils"); - var RequestOptions = (function() { - function RequestOptions(_a) { - var _b = _a === void 0 ? {} : _a, - method = _b.method, - headers = _b.headers, - body = _b.body, - url = _b.url, - search = _b.search; - this.method = lang_1.isPresent(method) ? http_utils_1.normalizeMethodName(method) : null; - this.headers = lang_1.isPresent(headers) ? headers : null; - this.body = lang_1.isPresent(body) ? body : null; - this.url = lang_1.isPresent(url) ? url : null; - this.search = lang_1.isPresent(search) ? (lang_1.isString(search) ? new url_search_params_1.URLSearchParams((search)) : (search)) : null; - } - RequestOptions.prototype.merge = function(options) { - return new RequestOptions({ - method: lang_1.isPresent(options) && lang_1.isPresent(options.method) ? options.method : this.method, - headers: lang_1.isPresent(options) && lang_1.isPresent(options.headers) ? options.headers : this.headers, - body: lang_1.isPresent(options) && lang_1.isPresent(options.body) ? options.body : this.body, - url: lang_1.isPresent(options) && lang_1.isPresent(options.url) ? options.url : this.url, - search: lang_1.isPresent(options) && lang_1.isPresent(options.search) ? (lang_1.isString(options.search) ? new url_search_params_1.URLSearchParams((options.search)) : (options.search).clone()) : this.search - }); - }; - return RequestOptions; - }()); - exports.RequestOptions = RequestOptions; - var BaseRequestOptions = (function(_super) { - __extends(BaseRequestOptions, _super); - function BaseRequestOptions() { - _super.call(this, { - method: enums_1.RequestMethod.Get, - headers: new headers_1.Headers() - }); - } - BaseRequestOptions = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [])], BaseRequestOptions); - return BaseRequestOptions; - }(RequestOptions)); - exports.BaseRequestOptions = BaseRequestOptions; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/backends/xhr_backend", ["angular2/src/http/enums", "angular2/src/http/static_response", "angular2/src/http/headers", "angular2/src/http/base_response_options", "angular2/core", "angular2/src/http/backends/browser_xhr", "angular2/src/facade/lang", "rxjs/Observable", "angular2/src/http/http_utils"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var enums_1 = require("angular2/src/http/enums"); - var static_response_1 = require("angular2/src/http/static_response"); - var headers_1 = require("angular2/src/http/headers"); - var base_response_options_1 = require("angular2/src/http/base_response_options"); - var core_1 = require("angular2/core"); - var browser_xhr_1 = require("angular2/src/http/backends/browser_xhr"); - var lang_1 = require("angular2/src/facade/lang"); - var Observable_1 = require("rxjs/Observable"); - var http_utils_1 = require("angular2/src/http/http_utils"); - var XHRConnection = (function() { - function XHRConnection(req, browserXHR, baseResponseOptions) { - var _this = this; - this.request = req; - this.response = new Observable_1.Observable(function(responseObserver) { - var _xhr = browserXHR.build(); - _xhr.open(enums_1.RequestMethod[req.method].toUpperCase(), req.url); - var onLoad = function() { - var body = lang_1.isPresent(_xhr.response) ? _xhr.response : _xhr.responseText; - var headers = headers_1.Headers.fromResponseHeaderString(_xhr.getAllResponseHeaders()); - var url = http_utils_1.getResponseURL(_xhr); - var status = _xhr.status === 1223 ? 204 : _xhr.status; - if (status === 0) { - status = body ? 200 : 0; - } - var responseOptions = new base_response_options_1.ResponseOptions({ - body: body, - status: status, - headers: headers, - url: url - }); - if (lang_1.isPresent(baseResponseOptions)) { - responseOptions = baseResponseOptions.merge(responseOptions); - } - var response = new static_response_1.Response(responseOptions); - if (http_utils_1.isSuccess(status)) { - responseObserver.next(response); - responseObserver.complete(); - return ; - } - responseObserver.error(response); - }; - var onError = function(err) { - var responseOptions = new base_response_options_1.ResponseOptions({ - body: err, - type: enums_1.ResponseType.Error - }); - if (lang_1.isPresent(baseResponseOptions)) { - responseOptions = baseResponseOptions.merge(responseOptions); - } - responseObserver.error(new static_response_1.Response(responseOptions)); - }; - if (lang_1.isPresent(req.headers)) { - req.headers.forEach(function(values, name) { - return _xhr.setRequestHeader(name, values.join(',')); - }); - } - _xhr.addEventListener('load', onLoad); - _xhr.addEventListener('error', onError); - _xhr.send(_this.request.text()); - return function() { - _xhr.removeEventListener('load', onLoad); - _xhr.removeEventListener('error', onError); - _xhr.abort(); - }; - }); - } - return XHRConnection; - }()); - exports.XHRConnection = XHRConnection; - var XHRBackend = (function() { - function XHRBackend(_browserXHR, _baseResponseOptions) { - this._browserXHR = _browserXHR; - this._baseResponseOptions = _baseResponseOptions; - } - XHRBackend.prototype.createConnection = function(request) { - return new XHRConnection(request, this._browserXHR, this._baseResponseOptions); - }; - XHRBackend = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [browser_xhr_1.BrowserXhr, base_response_options_1.ResponseOptions])], XHRBackend); - return XHRBackend; - }()); - exports.XHRBackend = XHRBackend; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/backends/jsonp_backend", ["angular2/src/http/interfaces", "angular2/src/http/enums", "angular2/src/http/static_response", "angular2/src/http/base_response_options", "angular2/core", "angular2/src/http/backends/browser_jsonp", "angular2/src/facade/exceptions", "angular2/src/facade/lang", "rxjs/Observable"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var interfaces_1 = require("angular2/src/http/interfaces"); - var enums_1 = require("angular2/src/http/enums"); - var static_response_1 = require("angular2/src/http/static_response"); - var base_response_options_1 = require("angular2/src/http/base_response_options"); - var core_1 = require("angular2/core"); - var browser_jsonp_1 = require("angular2/src/http/backends/browser_jsonp"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var lang_1 = require("angular2/src/facade/lang"); - var Observable_1 = require("rxjs/Observable"); - var JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.'; - var JSONP_ERR_WRONG_METHOD = 'JSONP requests must use GET request method.'; - var JSONPConnection = (function() { - function JSONPConnection() {} - return JSONPConnection; - }()); - exports.JSONPConnection = JSONPConnection; - var JSONPConnection_ = (function(_super) { - __extends(JSONPConnection_, _super); - function JSONPConnection_(req, _dom, baseResponseOptions) { - var _this = this; - _super.call(this); - this._dom = _dom; - this.baseResponseOptions = baseResponseOptions; - this._finished = false; - if (req.method !== enums_1.RequestMethod.Get) { - throw exceptions_1.makeTypeError(JSONP_ERR_WRONG_METHOD); - } - this.request = req; - this.response = new Observable_1.Observable(function(responseObserver) { - _this.readyState = enums_1.ReadyState.Loading; - var id = _this._id = _dom.nextRequestID(); - _dom.exposeConnection(id, _this); - var callback = _dom.requestCallback(_this._id); - var url = req.url; - if (url.indexOf('=JSONP_CALLBACK&') > -1) { - url = lang_1.StringWrapper.replace(url, '=JSONP_CALLBACK&', "=" + callback + "&"); - } else if (url.lastIndexOf('=JSONP_CALLBACK') === url.length - '=JSONP_CALLBACK'.length) { - url = url.substring(0, url.length - '=JSONP_CALLBACK'.length) + ("=" + callback); - } - var script = _this._script = _dom.build(url); - var onLoad = function(event) { - if (_this.readyState === enums_1.ReadyState.Cancelled) - return ; - _this.readyState = enums_1.ReadyState.Done; - _dom.cleanup(script); - if (!_this._finished) { - var responseOptions_1 = new base_response_options_1.ResponseOptions({ - body: JSONP_ERR_NO_CALLBACK, - type: enums_1.ResponseType.Error, - url: url - }); - if (lang_1.isPresent(baseResponseOptions)) { - responseOptions_1 = baseResponseOptions.merge(responseOptions_1); - } - responseObserver.error(new static_response_1.Response(responseOptions_1)); - return ; - } - var responseOptions = new base_response_options_1.ResponseOptions({ - body: _this._responseData, - url: url - }); - if (lang_1.isPresent(_this.baseResponseOptions)) { - responseOptions = _this.baseResponseOptions.merge(responseOptions); - } - responseObserver.next(new static_response_1.Response(responseOptions)); - responseObserver.complete(); - }; - var onError = function(error) { - if (_this.readyState === enums_1.ReadyState.Cancelled) - return ; - _this.readyState = enums_1.ReadyState.Done; - _dom.cleanup(script); - var responseOptions = new base_response_options_1.ResponseOptions({ - body: error.message, - type: enums_1.ResponseType.Error - }); - if (lang_1.isPresent(baseResponseOptions)) { - responseOptions = baseResponseOptions.merge(responseOptions); - } - responseObserver.error(new static_response_1.Response(responseOptions)); - }; - script.addEventListener('load', onLoad); - script.addEventListener('error', onError); - _dom.send(script); - return function() { - _this.readyState = enums_1.ReadyState.Cancelled; - script.removeEventListener('load', onLoad); - script.removeEventListener('error', onError); - if (lang_1.isPresent(script)) { - _this._dom.cleanup(script); - } - }; - }); - } - JSONPConnection_.prototype.finished = function(data) { - this._finished = true; - this._dom.removeConnection(this._id); - if (this.readyState === enums_1.ReadyState.Cancelled) - return ; - this._responseData = data; - }; - return JSONPConnection_; - }(JSONPConnection)); - exports.JSONPConnection_ = JSONPConnection_; - var JSONPBackend = (function(_super) { - __extends(JSONPBackend, _super); - function JSONPBackend() { - _super.apply(this, arguments); - } - return JSONPBackend; - }(interfaces_1.ConnectionBackend)); - exports.JSONPBackend = JSONPBackend; - var JSONPBackend_ = (function(_super) { - __extends(JSONPBackend_, _super); - function JSONPBackend_(_browserJSONP, _baseResponseOptions) { - _super.call(this); - this._browserJSONP = _browserJSONP; - this._baseResponseOptions = _baseResponseOptions; - } - JSONPBackend_.prototype.createConnection = function(request) { - return new JSONPConnection_(request, this._browserJSONP, this._baseResponseOptions); - }; - JSONPBackend_ = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [browser_jsonp_1.BrowserJsonp, base_response_options_1.ResponseOptions])], JSONPBackend_); - return JSONPBackend_; - }(JSONPBackend)); - exports.JSONPBackend_ = JSONPBackend_; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/static_request", ["angular2/src/http/headers", "angular2/src/http/http_utils", "angular2/src/facade/lang"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var headers_1 = require("angular2/src/http/headers"); - var http_utils_1 = require("angular2/src/http/http_utils"); - var lang_1 = require("angular2/src/facade/lang"); - var Request = (function() { - function Request(requestOptions) { - var url = requestOptions.url; - this.url = requestOptions.url; - if (lang_1.isPresent(requestOptions.search)) { - var search = requestOptions.search.toString(); - if (search.length > 0) { - var prefix = '?'; - if (lang_1.StringWrapper.contains(this.url, '?')) { - prefix = (this.url[this.url.length - 1] == '&') ? '' : '&'; - } - this.url = url + prefix + search; - } - } - this._body = requestOptions.body; - this.method = http_utils_1.normalizeMethodName(requestOptions.method); - this.headers = new headers_1.Headers(requestOptions.headers); - } - Request.prototype.text = function() { - return lang_1.isPresent(this._body) ? this._body.toString() : ''; - }; - return Request; - }()); - exports.Request = Request; - global.define = __define; - return module.exports; -}); - -System.register("angular2/src/http/http", ["angular2/src/facade/lang", "angular2/src/facade/exceptions", "angular2/core", "angular2/src/http/interfaces", "angular2/src/http/static_request", "angular2/src/http/base_request_options", "angular2/src/http/enums"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var lang_1 = require("angular2/src/facade/lang"); - var exceptions_1 = require("angular2/src/facade/exceptions"); - var core_1 = require("angular2/core"); - var interfaces_1 = require("angular2/src/http/interfaces"); - var static_request_1 = require("angular2/src/http/static_request"); - var base_request_options_1 = require("angular2/src/http/base_request_options"); - var enums_1 = require("angular2/src/http/enums"); - function httpRequest(backend, request) { - return backend.createConnection(request).response; - } - function mergeOptions(defaultOpts, providedOpts, method, url) { - var newOptions = defaultOpts; - if (lang_1.isPresent(providedOpts)) { - return newOptions.merge(new base_request_options_1.RequestOptions({ - method: providedOpts.method || method, - url: providedOpts.url || url, - search: providedOpts.search, - headers: providedOpts.headers, - body: providedOpts.body - })); - } - if (lang_1.isPresent(method)) { - return newOptions.merge(new base_request_options_1.RequestOptions({ - method: method, - url: url - })); - } else { - return newOptions.merge(new base_request_options_1.RequestOptions({url: url})); - } - } - var Http = (function() { - function Http(_backend, _defaultOptions) { - this._backend = _backend; - this._defaultOptions = _defaultOptions; - } - Http.prototype.request = function(url, options) { - var responseObservable; - if (lang_1.isString(url)) { - responseObservable = httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethod.Get, url))); - } else if (url instanceof static_request_1.Request) { - responseObservable = httpRequest(this._backend, url); - } else { - throw exceptions_1.makeTypeError('First argument must be a url string or Request instance.'); - } - return responseObservable; - }; - Http.prototype.get = function(url, options) { - return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethod.Get, url))); - }; - Http.prototype.post = function(url, body, options) { - return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethod.Post, url))); - }; - Http.prototype.put = function(url, body, options) { - return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethod.Put, url))); - }; - Http.prototype.delete = function(url, options) { - return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethod.Delete, url))); - }; - Http.prototype.patch = function(url, body, options) { - return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions.merge(new base_request_options_1.RequestOptions({body: body})), options, enums_1.RequestMethod.Patch, url))); - }; - Http.prototype.head = function(url, options) { - return httpRequest(this._backend, new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethod.Head, url))); - }; - Http = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [interfaces_1.ConnectionBackend, base_request_options_1.RequestOptions])], Http); - return Http; - }()); - exports.Http = Http; - var Jsonp = (function(_super) { - __extends(Jsonp, _super); - function Jsonp(backend, defaultOptions) { - _super.call(this, backend, defaultOptions); - } - Jsonp.prototype.request = function(url, options) { - var responseObservable; - if (lang_1.isString(url)) { - url = new static_request_1.Request(mergeOptions(this._defaultOptions, options, enums_1.RequestMethod.Get, url)); - } - if (url instanceof static_request_1.Request) { - if (url.method !== enums_1.RequestMethod.Get) { - exceptions_1.makeTypeError('JSONP requests must use GET request method.'); - } - responseObservable = httpRequest(this._backend, url); - } else { - throw exceptions_1.makeTypeError('First argument must be a url string or Request instance.'); - } - return responseObservable; - }; - Jsonp = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [interfaces_1.ConnectionBackend, base_request_options_1.RequestOptions])], Jsonp); - return Jsonp; - }(Http)); - exports.Jsonp = Jsonp; - global.define = __define; - return module.exports; -}); - -System.register("angular2/http", ["angular2/core", "angular2/src/http/http", "angular2/src/http/backends/xhr_backend", "angular2/src/http/backends/jsonp_backend", "angular2/src/http/backends/browser_xhr", "angular2/src/http/backends/browser_jsonp", "angular2/src/http/base_request_options", "angular2/src/http/base_response_options", "angular2/src/http/static_request", "angular2/src/http/static_response", "angular2/src/http/interfaces", "angular2/src/http/backends/browser_xhr", "angular2/src/http/base_request_options", "angular2/src/http/base_response_options", "angular2/src/http/backends/xhr_backend", "angular2/src/http/backends/jsonp_backend", "angular2/src/http/http", "angular2/src/http/headers", "angular2/src/http/enums", "angular2/src/http/url_search_params"], true, function(require, exports, module) { - var global = System.global, - __define = global.define; - global.define = undefined; - "use strict"; - var core_1 = require("angular2/core"); - var http_1 = require("angular2/src/http/http"); - var xhr_backend_1 = require("angular2/src/http/backends/xhr_backend"); - var jsonp_backend_1 = require("angular2/src/http/backends/jsonp_backend"); - var browser_xhr_1 = require("angular2/src/http/backends/browser_xhr"); - var browser_jsonp_1 = require("angular2/src/http/backends/browser_jsonp"); - var base_request_options_1 = require("angular2/src/http/base_request_options"); - var base_response_options_1 = require("angular2/src/http/base_response_options"); - var static_request_1 = require("angular2/src/http/static_request"); - exports.Request = static_request_1.Request; - var static_response_1 = require("angular2/src/http/static_response"); - exports.Response = static_response_1.Response; - var interfaces_1 = require("angular2/src/http/interfaces"); - exports.Connection = interfaces_1.Connection; - exports.ConnectionBackend = interfaces_1.ConnectionBackend; - var browser_xhr_2 = require("angular2/src/http/backends/browser_xhr"); - exports.BrowserXhr = browser_xhr_2.BrowserXhr; - var base_request_options_2 = require("angular2/src/http/base_request_options"); - exports.BaseRequestOptions = base_request_options_2.BaseRequestOptions; - exports.RequestOptions = base_request_options_2.RequestOptions; - var base_response_options_2 = require("angular2/src/http/base_response_options"); - exports.BaseResponseOptions = base_response_options_2.BaseResponseOptions; - exports.ResponseOptions = base_response_options_2.ResponseOptions; - var xhr_backend_2 = require("angular2/src/http/backends/xhr_backend"); - exports.XHRBackend = xhr_backend_2.XHRBackend; - exports.XHRConnection = xhr_backend_2.XHRConnection; - var jsonp_backend_2 = require("angular2/src/http/backends/jsonp_backend"); - exports.JSONPBackend = jsonp_backend_2.JSONPBackend; - exports.JSONPConnection = jsonp_backend_2.JSONPConnection; - var http_2 = require("angular2/src/http/http"); - exports.Http = http_2.Http; - exports.Jsonp = http_2.Jsonp; - var headers_1 = require("angular2/src/http/headers"); - exports.Headers = headers_1.Headers; - var enums_1 = require("angular2/src/http/enums"); - exports.ResponseType = enums_1.ResponseType; - exports.ReadyState = enums_1.ReadyState; - exports.RequestMethod = enums_1.RequestMethod; - var url_search_params_1 = require("angular2/src/http/url_search_params"); - exports.URLSearchParams = url_search_params_1.URLSearchParams; - exports.HTTP_PROVIDERS = [core_1.provide(http_1.Http, { - useFactory: function(xhrBackend, requestOptions) { - return new http_1.Http(xhrBackend, requestOptions); - }, - deps: [xhr_backend_1.XHRBackend, base_request_options_1.RequestOptions] - }), browser_xhr_1.BrowserXhr, core_1.provide(base_request_options_1.RequestOptions, {useClass: base_request_options_1.BaseRequestOptions}), core_1.provide(base_response_options_1.ResponseOptions, {useClass: base_response_options_1.BaseResponseOptions}), xhr_backend_1.XHRBackend]; - exports.HTTP_BINDINGS = exports.HTTP_PROVIDERS; - exports.JSONP_PROVIDERS = [core_1.provide(http_1.Jsonp, { - useFactory: function(jsonpBackend, requestOptions) { - return new http_1.Jsonp(jsonpBackend, requestOptions); - }, - deps: [jsonp_backend_1.JSONPBackend, base_request_options_1.RequestOptions] - }), browser_jsonp_1.BrowserJsonp, core_1.provide(base_request_options_1.RequestOptions, {useClass: base_request_options_1.BaseRequestOptions}), core_1.provide(base_response_options_1.ResponseOptions, {useClass: base_response_options_1.BaseResponseOptions}), core_1.provide(jsonp_backend_1.JSONPBackend, {useClass: jsonp_backend_1.JSONPBackend_})]; - exports.JSON_BINDINGS = exports.JSONP_PROVIDERS; - global.define = __define; - return module.exports; -}); - -//# sourceMappingURLDisabled=http.dev.js.map \ No newline at end of file diff --git a/demo-shell-ng2/dist/lib/jquery.min.js b/demo-shell-ng2/dist/lib/jquery.min.js deleted file mode 100644 index b8c4187de1..0000000000 --- a/demo-shell-ng2/dist/lib/jquery.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v2.2.3 | (c) jQuery Foundation | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c; -}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length",""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,la=/\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("