Socket
Socket
Sign inDemoInstall

@angular/upgrade

Package Overview
Dependencies
Maintainers
1
Versions
838
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/upgrade - npm Package Compare versions

Comparing version 4.0.0-beta.8 to 4.0.0-rc.0

@angular/upgrade.es5.js

929

bundles/upgrade-static.umd.js
/**
* @license Angular v4.0.0-beta.8
* @license Angular v4.0.0-rc.0
* (c) 2010-2017 Google, Inc. https://angular.io/

@@ -7,7 +7,29 @@ * License: MIT

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
typeof define === 'function' && define.amd ? define(['exports', '@angular/core'], factory) :
(factory((global.ng = global.ng || {}, global.ng.upgrade = global.ng.upgrade || {}, global.ng.upgrade.static = global.ng.upgrade.static || {}),global.ng.core));
}(this, function (exports,_angular_core) { 'use strict';
if (typeof define === "function" && define.amd) {
define('@angular/upgrade/static', ['exports', '@angular/core'], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require('@angular/core'));
} else {
var mod = {
exports: {}
};
factory(mod.exports, global.angularCore);
global.ng = global.ng || {};
global.ng.upgrade = global.ng.upgrade || {};
global.ng.upgrade.static = mod.exports;
}
})(this, function (exports, _core) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.UpgradeModule = exports.UpgradeComponent = exports.VERSION = exports.downgradeInjectable = exports.downgradeComponent = exports.ɵb = exports.ɵd = exports.ɵa = exports.ɵc = exports.ɵe = exports.ɵf = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
/**

@@ -26,16 +48,16 @@ * @license

* found in the LICENSE file at https://angular.io/license
*/ var /** @type {?} */ $COMPILE = '$compile';
var /** @type {?} */ $CONTROLLER = '$controller';
var /** @type {?} */ $DELEGATE = '$delegate';
var /** @type {?} */ $HTTP_BACKEND = '$httpBackend';
var /** @type {?} */ $INJECTOR = '$injector';
var /** @type {?} */ $PARSE = '$parse';
var /** @type {?} */ $PROVIDE = '$provide';
var /** @type {?} */ $SCOPE = '$scope';
var /** @type {?} */ $TEMPLATE_CACHE = '$templateCache';
var /** @type {?} */ $$TESTABILITY = '$$testability';
var /** @type {?} */ INJECTOR_KEY = '$$angularInjector';
var /** @type {?} */ REQUIRE_INJECTOR = '?^^' + INJECTOR_KEY;
var /** @type {?} */ REQUIRE_NG_MODEL = '?ngModel';
var /** @type {?} */ UPGRADE_MODULE_NAME = '$$UpgradeModule';
*/var $COMPILE = '$compile';
var $CONTROLLER = '$controller';
var $DELEGATE = '$delegate';
var $HTTP_BACKEND = '$httpBackend';
var $INJECTOR = '$injector';
var $PARSE = '$parse';
var $PROVIDE = '$provide';
var $SCOPE = '$scope';
var $TEMPLATE_CACHE = '$templateCache';
var $$TESTABILITY = '$$testability';
var INJECTOR_KEY = '$$angularInjector';
var REQUIRE_INJECTOR = '?^^' + INJECTOR_KEY;
var REQUIRE_NG_MODEL = '?ngModel';
var UPGRADE_MODULE_NAME = '$$UpgradeModule';

@@ -55,6 +77,3 @@ /**

*/
var PropertyBinding = (function () {
/**
* @param {?} binding
*/
var PropertyBinding = function () {
function PropertyBinding(binding) {

@@ -64,7 +83,4 @@ this.binding = binding;

}
/**
* @return {?}
*/
PropertyBinding.prototype.parseBinding = function () {
var /** @type {?} */ parts = this.binding.split(':');
var parts = this.binding.split(':');
this.prop = parts[0].trim();

@@ -75,3 +91,3 @@ this.attr = (parts[1] || this.prop).trim();

this.bracketParenAttr = "[(" + this.attr + ")]";
var /** @type {?} */ capitalAttr = this.attr.charAt(0).toUpperCase() + this.attr.substr(1);
var capitalAttr = this.attr.charAt(0).toUpperCase() + this.attr.substr(1);
this.onAttr = "on" + capitalAttr;

@@ -82,3 +98,3 @@ this.bindAttr = "bind" + capitalAttr;

return PropertyBinding;
}());
}();

@@ -92,11 +108,4 @@ /**

*/
var ContentProjectionHelper = (function () {
function ContentProjectionHelper() {
}
/**
* @param {?} $injector
* @param {?} component
* @param {?} nodes
* @return {?}
*/
var ContentProjectionHelper = function () {
function ContentProjectionHelper() {}
ContentProjectionHelper.prototype.groupProjectableNodes = function ($injector, component, nodes) {

@@ -108,22 +117,13 @@ // By default, do not support multi-slot projection,

return ContentProjectionHelper;
}());
}();
/**
* @param {?} name
* @return {?}
*/
function controllerKey(name) {
return '$' + name + 'Controller';
}
/**
* @param {?} component
* @return {?}
*/
function getComponentName(component) {
// Return the name of the component or the first line of its stringified version.
return ((component)).overriddenName || component.name || component.toString().split('\n')[0];
return component.overriddenName || component.name || component.toString().split('\n')[0];
}
/**
* @param {?} component
* @return {?} Whether the passed-in component implements the subset of the
* @return Whether the passed-in component implements the subset of the
* `ControlValueAccessor` interface needed for AngularJS `ng-model`

@@ -133,4 +133,3 @@ * compatibility.

function supportsNgModel(component) {
return typeof component.writeValue === 'function' &&
typeof component.registerOnChange === 'function';
return typeof component.writeValue === 'function' && typeof component.registerOnChange === 'function';
}

@@ -140,9 +139,8 @@ /**

* (if it implements the needed subset of the `ControlValueAccessor` interface).
* @param {?} ngModel
* @param {?} component
* @return {?}
*/
function hookupNgModel(ngModel, component) {
if (ngModel && supportsNgModel(component)) {
ngModel.$render = function () { component.writeValue(ngModel.$viewValue); };
ngModel.$render = function () {
component.writeValue(ngModel.$viewValue);
};
component.registerOnChange(ngModel.$setViewValue.bind(ngModel));

@@ -152,19 +150,6 @@ }

var /** @type {?} */ INITIAL_VALUE = {
var INITIAL_VALUE = {
__UNINITIALIZED__: true
};
var DowngradeComponentAdapter = (function () {
/**
* @param {?} id
* @param {?} info
* @param {?} element
* @param {?} attrs
* @param {?} scope
* @param {?} ngModel
* @param {?} parentInjector
* @param {?} $injector
* @param {?} $compile
* @param {?} $parse
* @param {?} componentFactory
*/
var DowngradeComponentAdapter = function () {
function DowngradeComponentAdapter(id, info, element, attrs, scope, ngModel, parentInjector, $injector, $compile, $parse, componentFactory) {

@@ -190,12 +175,11 @@ this.id = id;

}
/**
* @return {?}
*/
DowngradeComponentAdapter.prototype.compileContents = function () {
var _this = this;
var /** @type {?} */ compiledProjectableNodes = [];
var compiledProjectableNodes = [];
// The projected content has to be grouped, before it is compiled.
var /** @type {?} */ projectionHelper = this.parentInjector.get(ContentProjectionHelper);
var /** @type {?} */ projectableNodes = projectionHelper.groupProjectableNodes(this.$injector, this.info.component, this.element.contents());
var /** @type {?} */ linkFns = projectableNodes.map(function (nodes) { return _this.$compile(nodes); });
var projectionHelper = this.parentInjector.get(ContentProjectionHelper);
var projectableNodes = projectionHelper.groupProjectableNodes(this.$injector, this.info.component, this.element.contents());
var linkFns = projectableNodes.map(function (nodes) {
return _this.$compile(nodes);
});
this.element.empty();

@@ -210,10 +194,5 @@ linkFns.forEach(function (linkFn) {

};
/**
* @param {?} projectableNodes
* @return {?}
*/
DowngradeComponentAdapter.prototype.createComponent = function (projectableNodes) {
var /** @type {?} */ childInjector = _angular_core.ReflectiveInjector.resolveAndCreate([{ provide: $SCOPE, useValue: this.componentScope }], this.parentInjector);
this.componentRef =
this.componentFactory.create(childInjector, projectableNodes, this.element[0]);
var childInjector = _core.ReflectiveInjector.resolveAndCreate([{ provide: $SCOPE, useValue: this.componentScope }], this.parentInjector);
this.componentRef = this.componentFactory.create(childInjector, projectableNodes, this.element[0]);
this.changeDetector = this.componentRef.changeDetectorRef;

@@ -223,15 +202,12 @@ this.component = this.componentRef.instance;

};
/**
* @return {?}
*/
DowngradeComponentAdapter.prototype.setupInputs = function () {
var _this = this;
var /** @type {?} */ attrs = this.attrs;
var /** @type {?} */ inputs = this.info.inputs || [];
for (var /** @type {?} */ i = 0; i < inputs.length; i++) {
var /** @type {?} */ input = new PropertyBinding(inputs[i]);
var /** @type {?} */ expr = null;
var attrs = this.attrs;
var inputs = this.info.inputs || [];
for (var i = 0; i < inputs.length; i++) {
var input = new PropertyBinding(inputs[i]);
var expr = null;
if (attrs.hasOwnProperty(input.attr)) {
var /** @type {?} */ observeFn = (function (prop) {
var /** @type {?} */ prevValue = INITIAL_VALUE;
var observeFn = function (prop) {
var prevValue = INITIAL_VALUE;
return function (currValue) {

@@ -244,82 +220,79 @@ if (prevValue === INITIAL_VALUE) {

};
})(input.prop);
}(input.prop);
attrs.$observe(input.attr, observeFn);
} else if (attrs.hasOwnProperty(input.bindAttr)) {
expr = attrs /** TODO #9100 */[input.bindAttr];
} else if (attrs.hasOwnProperty(input.bracketAttr)) {
expr = attrs /** TODO #9100 */[input.bracketAttr];
} else if (attrs.hasOwnProperty(input.bindonAttr)) {
expr = attrs /** TODO #9100 */[input.bindonAttr];
} else if (attrs.hasOwnProperty(input.bracketParenAttr)) {
expr = attrs /** TODO #9100 */[input.bracketParenAttr];
}
else if (attrs.hasOwnProperty(input.bindAttr)) {
expr = ((attrs) /** TODO #9100 */)[input.bindAttr];
}
else if (attrs.hasOwnProperty(input.bracketAttr)) {
expr = ((attrs) /** TODO #9100 */)[input.bracketAttr];
}
else if (attrs.hasOwnProperty(input.bindonAttr)) {
expr = ((attrs) /** TODO #9100 */)[input.bindonAttr];
}
else if (attrs.hasOwnProperty(input.bracketParenAttr)) {
expr = ((attrs) /** TODO #9100 */)[input.bracketParenAttr];
}
if (expr != null) {
var /** @type {?} */ watchFn = (function (prop) { return function (currValue, prevValue) {
return _this.updateInput(prop, prevValue, currValue);
}; })(input.prop);
var watchFn = function (prop) {
return function (currValue, prevValue) {
return _this.updateInput(prop, prevValue, currValue);
};
}(input.prop);
this.componentScope.$watch(expr, watchFn);
}
}
var /** @type {?} */ prototype = this.info.component.prototype;
if (prototype && ((prototype)).ngOnChanges) {
var prototype = this.info.component.prototype;
if (prototype && prototype.ngOnChanges) {
// Detect: OnChanges interface
this.inputChanges = {};
this.componentScope.$watch(function () { return _this.inputChangeCount; }, function () {
var /** @type {?} */ inputChanges = _this.inputChanges;
this.componentScope.$watch(function () {
return _this.inputChangeCount;
}, function () {
var inputChanges = _this.inputChanges;
_this.inputChanges = {};
((_this.component)).ngOnChanges(inputChanges);
_this.component.ngOnChanges(inputChanges);
});
}
this.componentScope.$watch(function () { return _this.changeDetector && _this.changeDetector.detectChanges(); });
this.componentScope.$watch(function () {
return _this.changeDetector && _this.changeDetector.detectChanges();
});
};
/**
* @return {?}
*/
DowngradeComponentAdapter.prototype.setupOutputs = function () {
var _this = this;
var /** @type {?} */ attrs = this.attrs;
var /** @type {?} */ outputs = this.info.outputs || [];
for (var /** @type {?} */ j = 0; j < outputs.length; j++) {
var /** @type {?} */ output = new PropertyBinding(outputs[j]);
var /** @type {?} */ expr = null;
var /** @type {?} */ assignExpr = false;
var /** @type {?} */ bindonAttr = output.bindonAttr ? output.bindonAttr.substring(0, output.bindonAttr.length - 6) : null;
var /** @type {?} */ bracketParenAttr = output.bracketParenAttr ?
"[(" + output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8) + ")]" :
null;
var attrs = this.attrs;
var outputs = this.info.outputs || [];
for (var j = 0; j < outputs.length; j++) {
var output = new PropertyBinding(outputs[j]);
var expr = null;
var assignExpr = false;
var bindonAttr = output.bindonAttr ? output.bindonAttr.substring(0, output.bindonAttr.length - 6) : null;
var bracketParenAttr = output.bracketParenAttr ? "[(" + output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8) + ")]" : null;
if (attrs.hasOwnProperty(output.onAttr)) {
expr = ((attrs) /** TODO #9100 */)[output.onAttr];
}
else if (attrs.hasOwnProperty(output.parenAttr)) {
expr = ((attrs) /** TODO #9100 */)[output.parenAttr];
}
else if (attrs.hasOwnProperty(bindonAttr)) {
expr = ((attrs) /** TODO #9100 */)[bindonAttr];
expr = attrs /** TODO #9100 */[output.onAttr];
} else if (attrs.hasOwnProperty(output.parenAttr)) {
expr = attrs /** TODO #9100 */[output.parenAttr];
} else if (attrs.hasOwnProperty(bindonAttr)) {
expr = attrs /** TODO #9100 */[bindonAttr];
assignExpr = true;
}
else if (attrs.hasOwnProperty(bracketParenAttr)) {
expr = ((attrs) /** TODO #9100 */)[bracketParenAttr];
} else if (attrs.hasOwnProperty(bracketParenAttr)) {
expr = attrs /** TODO #9100 */[bracketParenAttr];
assignExpr = true;
}
if (expr != null && assignExpr != null) {
var /** @type {?} */ getter = this.$parse(expr);
var /** @type {?} */ setter = getter.assign;
var getter = this.$parse(expr);
var setter = getter.assign;
if (assignExpr && !setter) {
throw new Error("Expression '" + expr + "' is not assignable!");
}
var /** @type {?} */ emitter = (this.component[output.prop]);
var emitter = this.component[output.prop];
if (emitter) {
emitter.subscribe({
next: assignExpr ?
(function (setter) { return function (v /** TODO #9100 */) { return setter(_this.scope, v); }; })(setter) :
(function (getter) { return function (v /** TODO #9100 */) {
next: assignExpr ? function (setter) {
return function (v /** TODO #9100 */) {
return setter(_this.scope, v);
};
}(setter) : function (getter) {
return function (v /** TODO #9100 */) {
return getter(_this.scope, { $event: v });
}; })(getter)
};
}(getter)
});
}
else {
} else {
throw new Error("Missing emitter '" + output.prop + "' on component '" + getComponentName(this.info.component) + "'!");

@@ -330,5 +303,2 @@ }

};
/**
* @return {?}
*/
DowngradeComponentAdapter.prototype.registerCleanup = function () {

@@ -341,16 +311,9 @@ var _this = this;

};
/**
* @return {?}
*/
DowngradeComponentAdapter.prototype.getInjector = function () { return this.componentRef && this.componentRef.injector; };
/**
* @param {?} prop
* @param {?} prevValue
* @param {?} currValue
* @return {?}
*/
DowngradeComponentAdapter.prototype.getInjector = function () {
return this.componentRef && this.componentRef.injector;
};
DowngradeComponentAdapter.prototype.updateInput = function (prop, prevValue, currValue) {
if (this.inputChanges) {
this.inputChangeCount++;
this.inputChanges[prop] = new _angular_core.SimpleChange(prevValue, currValue, prevValue === currValue);
this.inputChanges[prop] = new _core.SimpleChange(prevValue, currValue, prevValue === currValue);
}

@@ -360,7 +323,7 @@ this.component[prop] = currValue;

return DowngradeComponentAdapter;
}());
}();
var /** @type {?} */ downgradeCount = 0;
var downgradeCount = 0;
/**
* \@whatItDoes
* @whatItDoes
*

@@ -372,3 +335,3 @@ * *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)

*
* \@howToUse
* @howToUse
*

@@ -378,3 +341,3 @@ * Let's assume that you have an Angular component called `ng2Heroes` that needs

*
* {\@example upgrade/static/ts/module.ts region="ng2-heroes"}
* {@example upgrade/static/ts/module.ts region="ng2-heroes"}
*

@@ -386,3 +349,3 @@ * We must create an AngularJS [directive](https://docs.angularjs.org/guide/directive)

*
* {\@example upgrade/static/ts/module.ts region="ng2-heroes-wrapper"}
* {@example upgrade/static/ts/module.ts region="ng2-heroes-wrapper"}
*

@@ -397,3 +360,3 @@ * In this example you can see that we must provide information about the component being

*
* \@description
* @description
*

@@ -413,10 +376,8 @@ * A helper function that returns a factory function to be used for registering an

*
* \@experimental
* @param {?} info
* @return {?}
* @experimental
*/
function downgradeComponent(info) {
var /** @type {?} */ idPrefix = "NG2_UPGRADE_" + downgradeCount++ + "_";
var /** @type {?} */ idCount = 0;
var /** @type {?} */ directiveFactory = function ($compile, $injector, $parse) {
var idPrefix = "NG2_UPGRADE_" + downgradeCount++ + "_";
var idCount = 0;
var directiveFactory = function directiveFactory($compile, $injector, $parse) {
return {

@@ -426,18 +387,18 @@ restrict: 'E',

require: [REQUIRE_INJECTOR, REQUIRE_NG_MODEL],
link: function (scope, element, attrs, required) {
link: function link(scope, element, attrs, required) {
// We might have to compile the contents asynchronously, because this might have been
// triggered by `UpgradeNg1ComponentAdapterBuilder`, before the Angular templates have
// been compiled.
var /** @type {?} */ parentInjector = required[0] || $injector.get(INJECTOR_KEY);
var /** @type {?} */ ngModel = required[1];
var /** @type {?} */ downgradeFn = function (injector) {
var /** @type {?} */ componentFactoryResolver = injector.get(_angular_core.ComponentFactoryResolver);
var /** @type {?} */ componentFactory = componentFactoryResolver.resolveComponentFactory(info.component);
var parentInjector = required[0] || $injector.get(INJECTOR_KEY);
var ngModel = required[1];
var downgradeFn = function downgradeFn(injector) {
var componentFactoryResolver = injector.get(_core.ComponentFactoryResolver);
var componentFactory = componentFactoryResolver.resolveComponentFactory(info.component);
if (!componentFactory) {
throw new Error('Expecting ComponentFactory for: ' + getComponentName(info.component));
}
var /** @type {?} */ id = idPrefix + (idCount++);
var /** @type {?} */ injectorPromise = new ParentInjectorPromise(element);
var /** @type {?} */ facade = new DowngradeComponentAdapter(id, info, element, attrs, scope, ngModel, injector, $injector, $compile, $parse, componentFactory);
var /** @type {?} */ projectableNodes = facade.compileContents();
var id = idPrefix + idCount++;
var injectorPromise = new ParentInjectorPromise(element);
var facade = new DowngradeComponentAdapter(id, info, element, attrs, scope, ngModel, injector, $injector, $compile, $parse, componentFactory);
var projectableNodes = facade.compileContents();
facade.createComponent(projectableNodes);

@@ -451,4 +412,3 @@ facade.setupInputs();

parentInjector.then(downgradeFn);
}
else {
} else {
downgradeFn(parentInjector);

@@ -467,6 +427,3 @@ }

*/
var ParentInjectorPromise = (function () {
/**
* @param {?} element
*/
var ParentInjectorPromise = function () {
function ParentInjectorPromise(element) {

@@ -479,18 +436,9 @@ this.element = element;

}
/**
* @param {?} callback
* @return {?}
*/
ParentInjectorPromise.prototype.then = function (callback) {
if (this.injector) {
callback(this.injector);
}
else {
} else {
this.callbacks.push(callback);
}
};
/**
* @param {?} injector
* @return {?}
*/
ParentInjectorPromise.prototype.resolve = function (injector) {

@@ -503,10 +451,12 @@ this.injector = injector;

// Run the queued callbacks.
this.callbacks.forEach(function (callback) { return callback(injector); });
this.callbacks.forEach(function (callback) {
return callback(injector);
});
this.callbacks.length = 0;
};
return ParentInjectorPromise;
}());
}();
/**
* \@whatItDoes
* @whatItDoes
*

@@ -518,13 +468,13 @@ * *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)

*
* \@howToUse
* @howToUse
*
* First ensure that the service to be downgraded is provided in an {\@link NgModule}
* First ensure that the service to be downgraded is provided in an {@link NgModule}
* that will be part of the upgrade application. For example, let's assume we have
* defined `HeroesService`
*
* {\@example upgrade/static/ts/module.ts region="ng2-heroes-service"}
* {@example upgrade/static/ts/module.ts region="ng2-heroes-service"}
*
* and that we have included this in our upgrade app {\@link NgModule}
* and that we have included this in our upgrade app {@link NgModule}
*
* {\@example upgrade/static/ts/module.ts region="ng2-module"}
* {@example upgrade/static/ts/module.ts region="ng2-module"}
*

@@ -534,3 +484,3 @@ * Now we can register the `downgradeInjectable` factory function for the service

*
* {\@example upgrade/static/ts/module.ts region="downgrade-ng2-heroes-service"}
* {@example upgrade/static/ts/module.ts region="downgrade-ng2-heroes-service"}
*

@@ -540,5 +490,5 @@ * Inside an AngularJS component's controller we can get hold of the

*
* {\@example upgrade/static/ts/module.ts region="example-app"}
* {@example upgrade/static/ts/module.ts region="example-app"}
*
* \@description
* @description
*

@@ -553,9 +503,9 @@ * Takes a `token` that identifies a service provided from Angular.

*
* \@experimental
* @param {?} token
* @return {?}
* @experimental
*/
function downgradeInjectable(token) {
var /** @type {?} */ factory = function (i) { return i.get(token); };
((factory)).$inject = [INJECTOR_KEY];
var factory = function factory(i) {
return i.get(token);
};
factory.$inject = [INJECTOR_KEY];
return factory;

@@ -567,3 +517,3 @@ }

*/
var /** @type {?} */ VERSION = new _angular_core.Version('4.0.0-beta.8');
var VERSION = new _core.Version('4.0.0-rc.0');

@@ -577,9 +527,6 @@ /**

*/
/**
* @return {?}
*/
function noNg() {
throw new Error('AngularJS v1.x is not loaded!');
}
var /** @type {?} */ angular = ({
var angular = {
bootstrap: noNg,

@@ -591,19 +538,13 @@ module: noNg,

getTestability: noNg
});
};
try {
if (window.hasOwnProperty('angular')) {
angular = ((window)).angular;
angular = window.angular;
}
}
catch (e) {
}
var /** @type {?} */ bootstrap = angular.bootstrap;
var /** @type {?} */ module$1 = angular.module;
var /** @type {?} */ element = angular.element;
} catch (e) {}
var bootstrap = angular.bootstrap;
var module$1 = angular.module;
var element = angular.element;
/**
* @param {?} a
* @param {?} b
* @return {?}
*/
// JS has NaN !== NaN
function looseIdentical(a, b) {

@@ -613,8 +554,8 @@ return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);

var /** @type {?} */ REQUIRE_PREFIX_RE = /^(\^\^?)?(\?)?(\^\^?)?/;
var /** @type {?} */ NOT_SUPPORTED = 'NOT_SUPPORTED';
var /** @type {?} */ INITIAL_VALUE$1 = {
var REQUIRE_PREFIX_RE = /^(\^\^?)?(\?)?(\^\^?)?/;
var NOT_SUPPORTED = 'NOT_SUPPORTED';
var INITIAL_VALUE$1 = {
__UNINITIALIZED__: true
};
var Bindings = (function () {
var Bindings = function () {
function Bindings() {

@@ -627,5 +568,5 @@ this.twoWayBoundProperties = [];

return Bindings;
}());
}();
/**
* \@whatItDoes
* @whatItDoes
*

@@ -637,3 +578,3 @@ * *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)

*
* \@howToUse
* @howToUse
*

@@ -643,11 +584,11 @@ * Let's assume that you have an AngularJS component called `ng1Hero` that needs

*
* {\@example upgrade/static/ts/module.ts region="ng1-hero"}
* {@example upgrade/static/ts/module.ts region="ng1-hero"}
*
* We must create a {\@link Directive} that will make this AngularJS component
* We must create a {@link Directive} that will make this AngularJS component
* available inside Angular templates.
*
* {\@example upgrade/static/ts/module.ts region="ng1-hero-wrapper"}
* {@example upgrade/static/ts/module.ts region="ng1-hero-wrapper"}
*
* In this example you can see that we must derive from the {\@link UpgradeComponent}
* base class but also provide an {\@link Directive `\@Directive`} decorator. This is
* In this example you can see that we must derive from the {@link UpgradeComponent}
* base class but also provide an {@link Directive `@Directive`} decorator. This is
* because the AoT compiler requires that this information is statically available at

@@ -662,5 +603,5 @@ * compile time.

* * the AngularJS name of the component (`ng1Hero`)
* * the {\@link ElementRef} and {\@link Injector} for the component wrapper
* * the {@link ElementRef} and {@link Injector} for the component wrapper
*
* \@description
* @description
*

@@ -670,5 +611,5 @@ * A helper class that should be used as a base class for creating Angular directives

*
* \@experimental
* @experimental
*/
var UpgradeComponent = (function () {
var UpgradeComponent = function () {
/**

@@ -679,3 +620,3 @@ * Create a new `UpgradeComponent` instance. You should not normally need to do this.

*
* {\@example upgrade/static/ts/module.ts region="ng1-hero-wrapper" }
* {@example upgrade/static/ts/module.ts region="ng1-hero-wrapper" }
*

@@ -690,5 +631,2 @@ * * The `name` parameter should be the name of the AngularJS directive.

* already implements them and so does not wire up calls to them at runtime.
* @param {?} name
* @param {?} elementRef
* @param {?} injector
*/

@@ -721,4 +659,3 @@ function UpgradeComponent(name, elementRef, injector) {

this.controllerInstance = this.buildController(controllerType, this.$componentScope, this.$element, this.directive.controllerAs);
}
else if (bindToController) {
} else if (bindToController) {
throw new Error("Upgraded directive '" + name + "' specifies 'bindToController' but no controller.");

@@ -729,13 +666,10 @@ }

}
/**
* @return {?}
*/
UpgradeComponent.prototype.ngOnInit = function () {
var _this = this;
var /** @type {?} */ attrs = NOT_SUPPORTED;
var /** @type {?} */ transcludeFn = NOT_SUPPORTED;
var /** @type {?} */ directiveRequire = this.getDirectiveRequire(this.directive);
var /** @type {?} */ requiredControllers = this.resolveRequire(this.directive.name, this.$element, directiveRequire);
var attrs = NOT_SUPPORTED;
var transcludeFn = NOT_SUPPORTED;
var directiveRequire = this.getDirectiveRequire(this.directive);
var requiredControllers = this.resolveRequire(this.directive.name, this.$element, directiveRequire);
if (this.directive.bindToController && isMap(directiveRequire)) {
var /** @type {?} */ requiredControllersMap_1 = (requiredControllers);
var requiredControllersMap_1 = requiredControllers;
Object.keys(requiredControllersMap_1).forEach(function (key) {

@@ -749,14 +683,16 @@ _this.controllerInstance[key] = requiredControllersMap_1[key];

if (this.controllerInstance && isFunction(this.controllerInstance.$doCheck)) {
var /** @type {?} */ callDoCheck = function () { return _this.controllerInstance.$doCheck(); };
var callDoCheck = function callDoCheck() {
return _this.controllerInstance.$doCheck();
};
this.unregisterDoCheckWatcher = this.$componentScope.$parent.$watch(callDoCheck);
callDoCheck();
}
var /** @type {?} */ link = this.directive.link;
var /** @type {?} */ preLink = (typeof link == 'object') && ((link)).pre;
var /** @type {?} */ postLink = (typeof link == 'object') ? ((link)).post : link;
var link = this.directive.link;
var preLink = (typeof link === 'undefined' ? 'undefined' : _typeof(link)) == 'object' && link.pre;
var postLink = (typeof link === 'undefined' ? 'undefined' : _typeof(link)) == 'object' ? link.post : link;
if (preLink) {
preLink(this.$componentScope, this.$element, attrs, requiredControllers, transcludeFn);
}
var /** @type {?} */ childNodes = [];
var /** @type {?} */ childNode;
var childNodes = [];
var childNode;
while (childNode = this.element.firstChild) {

@@ -766,4 +702,8 @@ this.element.removeChild(childNode);

}
var /** @type {?} */ attachElement = function (clonedElements, scope) { _this.$element.append(clonedElements); };
var /** @type {?} */ attachChildNodes = function (scope, cloneAttach) { return cloneAttach(childNodes); };
var attachElement = function attachElement(clonedElements, scope) {
_this.$element.append(clonedElements);
};
var attachChildNodes = function attachChildNodes(scope, cloneAttach) {
return cloneAttach(childNodes);
};
this.linkFn(this.$componentScope, attachElement, { parentBoundTranscludeFn: attachChildNodes });

@@ -777,10 +717,8 @@ if (postLink) {

};
/**
* @param {?} changes
* @return {?}
*/
UpgradeComponent.prototype.ngOnChanges = function (changes) {
var _this = this;
// Forward input changes to `bindingDestination`
Object.keys(changes).forEach(function (propName) { return _this.bindingDestination[propName] = changes[propName].currentValue; });
Object.keys(changes).forEach(function (propName) {
return _this.bindingDestination[propName] = changes[propName].currentValue;
});
if (isFunction(this.bindingDestination.$onChanges)) {

@@ -790,16 +728,13 @@ this.bindingDestination.$onChanges(changes);

};
/**
* @return {?}
*/
UpgradeComponent.prototype.ngDoCheck = function () {
var _this = this;
var /** @type {?} */ twoWayBoundProperties = this.bindings.twoWayBoundProperties;
var /** @type {?} */ twoWayBoundLastValues = this.bindings.twoWayBoundLastValues;
var /** @type {?} */ propertyToOutputMap = this.bindings.propertyToOutputMap;
var twoWayBoundProperties = this.bindings.twoWayBoundProperties;
var twoWayBoundLastValues = this.bindings.twoWayBoundLastValues;
var propertyToOutputMap = this.bindings.propertyToOutputMap;
twoWayBoundProperties.forEach(function (propName, idx) {
var /** @type {?} */ newValue = _this.bindingDestination[propName];
var /** @type {?} */ oldValue = twoWayBoundLastValues[idx];
var newValue = _this.bindingDestination[propName];
var oldValue = twoWayBoundLastValues[idx];
if (!looseIdentical(newValue, oldValue)) {
var /** @type {?} */ outputName = propertyToOutputMap[propName];
var /** @type {?} */ eventEmitter = ((_this))[outputName];
var outputName = propertyToOutputMap[propName];
var eventEmitter = _this[outputName];
eventEmitter.emit(newValue);

@@ -810,5 +745,2 @@ twoWayBoundLastValues[idx] = newValue;

};
/**
* @return {?}
*/
UpgradeComponent.prototype.ngOnDestroy = function () {

@@ -823,37 +755,25 @@ if (isFunction(this.unregisterDoCheckWatcher)) {

};
/**
* @param {?} name
* @return {?}
*/
UpgradeComponent.prototype.getDirective = function (name) {
var /** @type {?} */ directives = this.$injector.get(name + 'Directive');
var directives = this.$injector.get(name + 'Directive');
if (directives.length > 1) {
throw new Error('Only support single directive definition for: ' + this.name);
}
var /** @type {?} */ directive = directives[0];
if (directive.replace)
this.notSupported('replace');
if (directive.terminal)
this.notSupported('terminal');
if (directive.compile)
this.notSupported('compile');
var /** @type {?} */ link = directive.link;
var directive = directives[0];
if (directive.replace) this.notSupported('replace');
if (directive.terminal) this.notSupported('terminal');
if (directive.compile) this.notSupported('compile');
var link = directive.link;
// QUESTION: why not support link.post?
if (typeof link == 'object') {
if (((link)).post)
this.notSupported('link.post');
if ((typeof link === 'undefined' ? 'undefined' : _typeof(link)) == 'object') {
if (link.post) this.notSupported('link.post');
}
return directive;
};
/**
* @param {?} directive
* @return {?}
*/
UpgradeComponent.prototype.getDirectiveRequire = function (directive) {
var /** @type {?} */ require = directive.require || (directive.controller && directive.name);
var require = directive.require || directive.controller && directive.name;
if (isMap(require)) {
Object.keys(require).forEach(function (key) {
var /** @type {?} */ value = require[key];
var /** @type {?} */ match = value.match(REQUIRE_PREFIX_RE);
var /** @type {?} */ name = value.substring(match[0].length);
var value = require[key];
var match = value.match(REQUIRE_PREFIX_RE);
var name = value.substring(match[0].length);
if (!name) {

@@ -866,18 +786,14 @@ require[key] = match[0] + key;

};
/**
* @param {?} directive
* @return {?}
*/
UpgradeComponent.prototype.initializeBindings = function (directive) {
var _this = this;
var /** @type {?} */ btcIsObject = typeof directive.bindToController === 'object';
var btcIsObject = _typeof(directive.bindToController) === 'object';
if (btcIsObject && Object.keys(directive.scope).length) {
throw new Error("Binding definitions on scope and controller at the same time is not supported.");
}
var /** @type {?} */ context = (btcIsObject) ? directive.bindToController : directive.scope;
var /** @type {?} */ bindings = new Bindings();
if (typeof context == 'object') {
var context = btcIsObject ? directive.bindToController : directive.scope;
var bindings = new Bindings();
if ((typeof context === 'undefined' ? 'undefined' : _typeof(context)) == 'object') {
Object.keys(context).forEach(function (propName) {
var /** @type {?} */ definition = context[propName];
var /** @type {?} */ bindingType = definition.charAt(0);
var definition = context[propName];
var bindingType = definition.charAt(0);
// QUESTION: What about `=*`? Ignore? Throw? Support?

@@ -901,3 +817,3 @@ switch (bindingType) {

default:
var /** @type {?} */ json = JSON.stringify(context);
var json = JSON.stringify(context);
throw new Error("Unexpected mapping '" + bindingType + "' in '" + json + "' in '" + _this.name + "' directive.");

@@ -909,44 +825,24 @@ }

};
/**
* @param {?} directive
* @return {?}
*/
UpgradeComponent.prototype.compileTemplate = function (directive) {
if (this.directive.template !== undefined) {
return this.compileHtml(getOrCall(this.directive.template));
}
else if (this.directive.templateUrl) {
var /** @type {?} */ url = getOrCall(this.directive.templateUrl);
var /** @type {?} */ html = (this.$templateCache.get(url));
} else if (this.directive.templateUrl) {
var url = getOrCall(this.directive.templateUrl);
var html = this.$templateCache.get(url);
if (html !== undefined) {
return this.compileHtml(html);
}
else {
} else {
throw new Error('loading directive templates asynchronously is not supported');
}
}
else {
} else {
throw new Error("Directive '" + this.name + "' is not a component, it is missing template.");
}
};
/**
* @param {?} controllerType
* @param {?} $scope
* @param {?} $element
* @param {?} controllerAs
* @return {?}
*/
UpgradeComponent.prototype.buildController = function (controllerType, $scope, $element, controllerAs) {
// TODO: Document that we do not pre-assign bindings on the controller instance
var /** @type {?} */ locals = { $scope: $scope, $element: $element };
var /** @type {?} */ controller = this.$controller(controllerType, locals, null, controllerAs);
var locals = { $scope: $scope, $element: $element };
var controller = this.$controller(controllerType, locals, null, controllerAs);
$element.data(controllerKey(this.directive.name), controller);
return controller;
};
/**
* @param {?} directiveName
* @param {?} $element
* @param {?} require
* @return {?}
*/
UpgradeComponent.prototype.resolveRequire = function (directiveName, $element, require) {

@@ -956,23 +852,24 @@ var _this = this;

return null;
}
else if (Array.isArray(require)) {
return require.map(function (req) { return _this.resolveRequire(directiveName, $element, req); });
}
else if (typeof require === 'object') {
var /** @type {?} */ value_1 = {};
Object.keys(require).forEach(function (key) { return value_1[key] = _this.resolveRequire(directiveName, $element, require[key]); });
} else if (Array.isArray(require)) {
return require.map(function (req) {
return _this.resolveRequire(directiveName, $element, req);
});
} else if ((typeof require === 'undefined' ? 'undefined' : _typeof(require)) === 'object') {
var value_1 = {};
Object.keys(require).forEach(function (key) {
return value_1[key] = _this.resolveRequire(directiveName, $element, require[key]);
});
return value_1;
}
else if (typeof require === 'string') {
var /** @type {?} */ match = require.match(REQUIRE_PREFIX_RE);
var /** @type {?} */ inheritType = match[1] || match[3];
var /** @type {?} */ name_1 = require.substring(match[0].length);
var /** @type {?} */ isOptional = !!match[2];
var /** @type {?} */ searchParents = !!inheritType;
var /** @type {?} */ startOnParent = inheritType === '^^';
var /** @type {?} */ ctrlKey = controllerKey(name_1);
} else if (typeof require === 'string') {
var match = require.match(REQUIRE_PREFIX_RE);
var inheritType = match[1] || match[3];
var name_1 = require.substring(match[0].length);
var isOptional = !!match[2];
var searchParents = !!inheritType;
var startOnParent = inheritType === '^^';
var ctrlKey = controllerKey(name_1);
if (startOnParent) {
$element = $element.parent();
}
var /** @type {?} */ value = searchParents ? $element.inheritedData(ctrlKey) : $element.data(ctrlKey);
var value = searchParents ? $element.inheritedData(ctrlKey) : $element.data(ctrlKey);
if (!value && !isOptional) {

@@ -982,10 +879,6 @@ throw new Error("Unable to find required '" + require + "' in upgraded directive '" + directiveName + "'.");

return value;
}
else {
} else {
throw new Error("Unrecognized require syntax on upgraded directive '" + directiveName + "': " + require);
}
};
/**
* @return {?}
*/
UpgradeComponent.prototype.setupOutputs = function () {

@@ -995,27 +888,21 @@ var _this = this;

this.bindings.twoWayBoundProperties.forEach(function (propName) {
var /** @type {?} */ outputName = _this.bindings.propertyToOutputMap[propName];
((_this))[outputName] = new _angular_core.EventEmitter();
var outputName = _this.bindings.propertyToOutputMap[propName];
_this[outputName] = new _core.EventEmitter();
});
// Set up the outputs for `&` bindings
this.bindings.expressionBoundProperties.forEach(function (propName) {
var /** @type {?} */ outputName = _this.bindings.propertyToOutputMap[propName];
var /** @type {?} */ emitter = ((_this))[outputName] = new _angular_core.EventEmitter();
var outputName = _this.bindings.propertyToOutputMap[propName];
var emitter = _this[outputName] = new _core.EventEmitter();
// QUESTION: Do we want the ng1 component to call the function with `<value>` or with
// `{$event: <value>}`. The former is closer to ng2, the latter to ng1.
_this.bindingDestination[propName] = function (value) { return emitter.emit(value); };
_this.bindingDestination[propName] = function (value) {
return emitter.emit(value);
};
});
};
/**
* @param {?} feature
* @return {?}
*/
UpgradeComponent.prototype.notSupported = function (feature) {
throw new Error("Upgraded directive '" + this.name + "' contains unsupported feature: '" + feature + "'.");
};
/**
* @param {?} html
* @return {?}
*/
UpgradeComponent.prototype.compileHtml = function (html) {
var /** @type {?} */ div = document.createElement('div');
var div = document.createElement('div');
div.innerHTML = html;

@@ -1025,23 +912,12 @@ return this.$compile(div.childNodes);

return UpgradeComponent;
}());
/**
* @param {?} property
* @return {?}
*/
}();
function getOrCall(property) {
return isFunction(property) ? property() : property;
}
/**
* @param {?} value
* @return {?}
*/
function isFunction(value) {
return typeof value === 'function';
}
/**
* @param {?} value
* @return {?}
*/
// NOTE: Only works for `typeof T !== 'object'`.
function isMap(value) {
return value && !Array.isArray(value) && typeof value === 'object';
return value && !Array.isArray(value) && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object';
}

@@ -1060,52 +936,29 @@

// the stored injector and release the reference to it.
var /** @type {?} */ tempInjectorRef;
/**
* @param {?} injector
* @return {?}
*/
var tempInjectorRef;
function setTempInjectorRef(injector) {
tempInjectorRef = injector;
}
/**
* @return {?}
*/
function injectorFactory() {
var /** @type {?} */ injector = tempInjectorRef;
var injector = tempInjectorRef;
tempInjectorRef = null; // clear the value to prevent memory leaks
return injector;
}
/**
* @param {?} i
* @return {?}
*/
function rootScopeFactory(i) {
return i.get('$rootScope');
}
/**
* @param {?} i
* @return {?}
*/
function compileFactory(i) {
return i.get('$compile');
}
/**
* @param {?} i
* @return {?}
*/
function parseFactory(i) {
return i.get('$parse');
}
var /** @type {?} */ angular1Providers = [
// We must use exported named functions for the ng2 factories to keep the compiler happy:
// > Metadata collected contains an error that will be reported at runtime:
// > Function calls are not supported.
// > Consider replacing the function or lambda with a reference to an exported function
{ provide: '$injector', useFactory: injectorFactory },
{ provide: '$rootScope', useFactory: rootScopeFactory, deps: ['$injector'] },
{ provide: '$compile', useFactory: compileFactory, deps: ['$injector'] },
{ provide: '$parse', useFactory: parseFactory, deps: ['$injector'] }
];
var angular1Providers = [
// We must use exported named functions for the ng2 factories to keep the compiler happy:
// > Metadata collected contains an error that will be reported at runtime:
// > Function calls are not supported.
// > Consider replacing the function or lambda with a reference to an exported function
{ provide: '$injector', useFactory: injectorFactory }, { provide: '$rootScope', useFactory: rootScopeFactory, deps: ['$injector'] }, { provide: '$compile', useFactory: compileFactory, deps: ['$injector'] }, { provide: '$parse', useFactory: parseFactory, deps: ['$injector'] }];
/**
* \@whatItDoes
* @whatItDoes
*

@@ -1120,13 +973,13 @@ * *Part of the [upgrade/static](/docs/ts/latest/api/#!?query=upgrade%2Fstatic)

* 1. Creation of an Angular directive that wraps and exposes an AngularJS component so
* that it can be used in an Angular template. See {\@link UpgradeComponent}.
* that it can be used in an Angular template. See {@link UpgradeComponent}.
* 2. Creation of an AngularJS directive that wraps and exposes an Angular component so
* that it can be used in an AngularJS template. See {\@link downgradeComponent}.
* that it can be used in an AngularJS template. See {@link downgradeComponent}.
* 3. Creation of an Angular root injector provider that wraps and exposes an AngularJS
* service so that it can be injected into an Angular context. See
* {\@link UpgradeModule#upgrading-an-angular-1-service Upgrading an AngularJS service} below.
* {@link UpgradeModule#upgrading-an-angular-1-service Upgrading an AngularJS service} below.
* 4. Creation of an AngularJS service that wraps and exposes an Angular injectable
* so that it can be injected into an AngularJS context. See {\@link downgradeInjectable}.
* so that it can be injected into an AngularJS context. See {@link downgradeInjectable}.
* 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks
* coexisting in a single application. See the
* {\@link UpgradeModule#example example} below.
* {@link UpgradeModule#example example} below.
*

@@ -1149,6 +1002,6 @@ * ## Mental Model

* defining an Angular directive, which bootstraps the AngularJS component at its location
* in the DOM. See {\@link UpgradeComponent}.
* in the DOM. See {@link UpgradeComponent}.
* 6. An Angular component can be "downgraded"" to an AngularJS component. This is achieved by
* defining an AngularJS directive, which bootstraps the Angular component at its location
* in the DOM. See {\@link downgradeComponent}.
* in the DOM. See {@link downgradeComponent}.
* 7. Whenever an "upgraded"/"downgraded" component is instantiated the host element is owned by

@@ -1169,16 +1022,16 @@ * the framework doing the instantiation. The other framework then instantiates and owns the

*
* \@howToUse
* @howToUse
*
* `import {UpgradeModule} from '\@angular/upgrade/static';`
* `import {UpgradeModule} from '@angular/upgrade/static';`
*
* ## Example
* Import the {\@link UpgradeModule} into your top level {\@link NgModule Angular `NgModule`}.
* Import the {@link UpgradeModule} into your top level {@link NgModule Angular `NgModule`}.
*
* {\@example upgrade/static/ts/module.ts region='ng2-module'}
* {@example upgrade/static/ts/module.ts region='ng2-module'}
*
* Then bootstrap the hybrid upgrade app's module, get hold of the {\@link UpgradeModule} instance
* Then bootstrap the hybrid upgrade app's module, get hold of the {@link UpgradeModule} instance
* and use it to bootstrap the top level [AngularJS
* module](https://docs.angularjs.org/api/ng/type/angular.Module).
*
* {\@example upgrade/static/ts/module.ts region='bootstrap'}
* {@example upgrade/static/ts/module.ts region='bootstrap'}
*

@@ -1193,8 +1046,8 @@ *

*
* {\@example upgrade/static/ts/module.ts region="ng1-title-case-service"}
* {@example upgrade/static/ts/module.ts region="ng1-title-case-service"}
*
* Then you should define an Angular provider to be included in your {\@link NgModule} `providers`
* Then you should define an Angular provider to be included in your {@link NgModule} `providers`
* property.
*
* {\@example upgrade/static/ts/module.ts region="upgrade-ng1-service"}
* {@example upgrade/static/ts/module.ts region="upgrade-ng1-service"}
*

@@ -1204,5 +1057,5 @@ * Then you can use the "upgraded" AngularJS service by injecting it into an Angular component

*
* {\@example upgrade/static/ts/module.ts region="use-ng1-upgraded-service"}
* {@example upgrade/static/ts/module.ts region="use-ng1-upgraded-service"}
*
* \@description
* @description
*

@@ -1213,22 +1066,22 @@ * This class is an `NgModule`, which you import to provide AngularJS core services,

* ## Core AngularJS services
* Importing this {\@link NgModule} will add providers for the core
* Importing this {@link NgModule} will add providers for the core
* [AngularJS services](https://docs.angularjs.org/api/ng/service) to the root injector.
*
* ## Bootstrap
* The runtime instance of this class contains a {\@link UpgradeModule#bootstrap `bootstrap()`}
* The runtime instance of this class contains a {@link UpgradeModule#bootstrap `bootstrap()`}
* method, which you use to bootstrap the top level AngularJS module onto an element in the
* DOM for the hybrid upgrade app.
*
* It also contains properties to access the {\@link UpgradeModule#injector root injector}, the
* bootstrap {\@link NgZone} and the
* It also contains properties to access the {@link UpgradeModule#injector root injector}, the
* bootstrap {@link NgZone} and the
* [AngularJS $injector](https://docs.angularjs.org/api/auto/service/$injector).
*
* \@experimental
* @experimental
*/
var UpgradeModule = (function () {
/**
* @param {?} injector
* @param {?} ngZone
*/
function UpgradeModule(injector, ngZone) {
var UpgradeModule = function () {
function UpgradeModule(
/** The root {@link Injector} for the upgrade application. */
injector,
/** The bootstrap zone for the upgrade application */
ngZone) {
this.injector = injector;

@@ -1239,76 +1092,72 @@ this.ngZone = ngZone;

* Bootstrap an AngularJS application from this NgModule
* @param {?} element the element on which to bootstrap the AngularJS application
* @param {?=} modules
* @param {?=} config
* @return {?}
* @param element the element on which to bootstrap the AngularJS application
* @param [modules] the AngularJS modules to bootstrap for this application
* @param [config] optional extra AngularJS bootstrap configuration
*/
UpgradeModule.prototype.bootstrap = function (element$$, modules, config /*angular.IAngularBootstrapConfig*/) {
var _this = this;
if (modules === void 0) { modules = []; }
var /** @type {?} */ INIT_MODULE_NAME = UPGRADE_MODULE_NAME + '.init';
if (modules === void 0) {
modules = [];
}
var INIT_MODULE_NAME = UPGRADE_MODULE_NAME + '.init';
// Create an ng1 module to bootstrap
var /** @type {?} */ initModule = module$1(INIT_MODULE_NAME, [])
.value(INJECTOR_KEY, this.injector)
.config([
$PROVIDE, $INJECTOR,
function ($provide, $injector) {
if ($injector.has($$TESTABILITY)) {
$provide.decorator($$TESTABILITY, [
$DELEGATE,
function (testabilityDelegate) {
var /** @type {?} */ originalWhenStable = testabilityDelegate.whenStable;
var /** @type {?} */ injector = _this.injector;
// Cannot use arrow function below because we need the context
var /** @type {?} */ newWhenStable = function (callback) {
originalWhenStable.call(testabilityDelegate, function () {
var /** @type {?} */ ng2Testability = injector.get(_angular_core.Testability);
if (ng2Testability.isStable()) {
callback();
}
else {
ng2Testability.whenStable(newWhenStable.bind(testabilityDelegate, callback));
}
});
};
testabilityDelegate.whenStable = newWhenStable;
return testabilityDelegate;
}
]);
}
var initModule = module$1(INIT_MODULE_NAME, []).value(INJECTOR_KEY, this.injector).config([$PROVIDE, $INJECTOR, function ($provide, $injector) {
if ($injector.has($$TESTABILITY)) {
$provide.decorator($$TESTABILITY, [$DELEGATE, function (testabilityDelegate) {
var originalWhenStable = testabilityDelegate.whenStable;
var injector = _this.injector;
// Cannot use arrow function below because we need the context
var newWhenStable = function newWhenStable(callback) {
originalWhenStable.call(testabilityDelegate, function () {
var ng2Testability = injector.get(_core.Testability);
if (ng2Testability.isStable()) {
callback();
} else {
ng2Testability.whenStable(newWhenStable.bind(testabilityDelegate, callback));
}
});
};
testabilityDelegate.whenStable = newWhenStable;
return testabilityDelegate;
}]);
}
])
.run([
$INJECTOR,
function ($injector) {
_this.$injector = $injector;
// Initialize the ng1 $injector provider
setTempInjectorRef($injector);
_this.injector.get($INJECTOR);
// Put the injector on the DOM, so that it can be "required"
element(element$$).data(controllerKey(INJECTOR_KEY), _this.injector);
// Wire up the ng1 rootScope to run a digest cycle whenever the zone settles
// We need to do this in the next tick so that we don't prevent the bootup
// stabilizing
setTimeout(function () {
var /** @type {?} */ $rootScope = $injector.get('$rootScope');
var /** @type {?} */ subscription = _this.ngZone.onMicrotaskEmpty.subscribe(function () { return $rootScope.$digest(); });
$rootScope.$on('$destroy', function () { subscription.unsubscribe(); });
}, 0);
}
]);
var /** @type {?} */ upgradeModule = module$1(UPGRADE_MODULE_NAME, [INIT_MODULE_NAME].concat(modules));
}]).run([$INJECTOR, function ($injector) {
_this.$injector = $injector;
// Initialize the ng1 $injector provider
setTempInjectorRef($injector);
_this.injector.get($INJECTOR);
// Put the injector on the DOM, so that it can be "required"
element(element$$).data(controllerKey(INJECTOR_KEY), _this.injector);
// Wire up the ng1 rootScope to run a digest cycle whenever the zone settles
// We need to do this in the next tick so that we don't prevent the bootup
// stabilizing
setTimeout(function () {
var $rootScope = $injector.get('$rootScope');
var subscription = _this.ngZone.onMicrotaskEmpty.subscribe(function () {
return $rootScope.$digest();
});
$rootScope.$on('$destroy', function () {
subscription.unsubscribe();
});
}, 0);
}]);
var upgradeModule = module$1(UPGRADE_MODULE_NAME, [INIT_MODULE_NAME].concat(modules));
// Make sure resumeBootstrap() only exists if the current bootstrap is deferred
var /** @type {?} */ windowAngular = ((window) /** TODO #???? */)['angular'];
var windowAngular = window /** TODO #???? */['angular'];
windowAngular.resumeBootstrap = undefined;
// Bootstrap the AngularJS application inside our zone
this.ngZone.run(function () { bootstrap(element$$, [upgradeModule.name], config); });
this.ngZone.run(function () {
bootstrap(element$$, [upgradeModule.name], config);
});
// Patch resumeBootstrap() to run inside the ngZone
if (windowAngular.resumeBootstrap) {
var /** @type {?} */ originalResumeBootstrap_1 = windowAngular.resumeBootstrap;
var /** @type {?} */ ngZone_1 = this.ngZone;
var originalResumeBootstrap_1 = windowAngular.resumeBootstrap;
var ngZone_1 = this.ngZone;
windowAngular.resumeBootstrap = function () {
var _this = this;
var /** @type {?} */ args = arguments;
var args = arguments;
windowAngular.resumeBootstrap = originalResumeBootstrap_1;
ngZone_1.run(function () { windowAngular.resumeBootstrap.apply(_this, args); });
ngZone_1.run(function () {
windowAngular.resumeBootstrap.apply(_this, args);
});
};

@@ -1318,12 +1167,15 @@ }

return UpgradeModule;
}());
UpgradeModule.decorators = [
{ type: _angular_core.NgModule, args: [{ providers: [angular1Providers, ContentProjectionHelper] },] },
];
}();
UpgradeModule.decorators = [{ type: _core.NgModule, args: [{ providers: [angular1Providers, ContentProjectionHelper] }] }];
/** @nocollapse */
UpgradeModule.ctorParameters = function () { return [
{ type: _angular_core.Injector, },
{ type: _angular_core.NgZone, },
]; };
UpgradeModule.ctorParameters = function () {
return [{ type: _core.Injector }, { type: _core.NgZone }];
};
exports.ɵf = ContentProjectionHelper;
exports.ɵe = angular1Providers;
exports.ɵc = compileFactory;
exports.ɵa = injectorFactory;
exports.ɵd = parseFactory;
exports.ɵb = rootScopeFactory;
exports.downgradeComponent = downgradeComponent;

@@ -1334,9 +1186,2 @@ exports.downgradeInjectable = downgradeInjectable;

exports.UpgradeModule = UpgradeModule;
exports.ɵf = ContentProjectionHelper;
exports.ɵa = angular1Providers;
exports.ɵd = compileFactory;
exports.ɵb = injectorFactory;
exports.ɵe = parseFactory;
exports.ɵc = rootScopeFactory;
}));
});
/**
* @license Angular v4.0.0-beta.8
* @license Angular v4.0.0-rc.0
* (c) 2010-2017 Google, Inc. https://angular.io/
* License: MIT
*/
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],factory):factory((global.ng=global.ng||{},global.ng.upgrade=global.ng.upgrade||{},global.ng.upgrade.static=global.ng.upgrade.static||{}),global.ng.core)}(this,function(exports,_angular_core){"use strict";function controllerKey(name){return"$"+name+"Controller"}function getComponentName(component){return component.overriddenName||component.name||component.toString().split("\n")[0]}function supportsNgModel(component){return"function"==typeof component.writeValue&&"function"==typeof component.registerOnChange}function hookupNgModel(ngModel,component){ngModel&&supportsNgModel(component)&&(ngModel.$render=function(){component.writeValue(ngModel.$viewValue)},component.registerOnChange(ngModel.$setViewValue.bind(ngModel)))}function downgradeComponent(info){var idPrefix="NG2_UPGRADE_"+downgradeCount++ +"_",idCount=0,directiveFactory=function($compile,$injector,$parse){return{restrict:"E",terminal:!0,require:[REQUIRE_INJECTOR,REQUIRE_NG_MODEL],link:function(scope,element,attrs,required){var parentInjector=required[0]||$injector.get(INJECTOR_KEY),ngModel=required[1],downgradeFn=function(injector){var componentFactoryResolver=injector.get(_angular_core.ComponentFactoryResolver),componentFactory=componentFactoryResolver.resolveComponentFactory(info.component);if(!componentFactory)throw new Error("Expecting ComponentFactory for: "+getComponentName(info.component));var id=idPrefix+idCount++,injectorPromise=new ParentInjectorPromise(element),facade=new DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,injector,$injector,$compile,$parse,componentFactory),projectableNodes=facade.compileContents();facade.createComponent(projectableNodes),facade.setupInputs(),facade.setupOutputs(),facade.registerCleanup(),injectorPromise.resolve(facade.getInjector())};parentInjector instanceof ParentInjectorPromise?parentInjector.then(downgradeFn):downgradeFn(parentInjector)}}};return directiveFactory.$inject=[$COMPILE,$INJECTOR,$PARSE],directiveFactory}function downgradeInjectable(token){var factory=function(i){return i.get(token)};return factory.$inject=[INJECTOR_KEY],factory}/**
!function(global,factory){if("function"==typeof define&&define.amd)define("@angular/upgrade/static",["exports","@angular/core"],factory);else if("undefined"!=typeof exports)factory(exports,require("@angular/core"));else{var mod={exports:{}};factory(mod.exports,global.angularCore),global.ng=global.ng||{},global.ng.upgrade=global.ng.upgrade||{},global.ng.upgrade.static=mod.exports}}(this,function(exports,_core){"use strict";function controllerKey(name){return"$"+name+"Controller"}function getComponentName(component){return component.overriddenName||component.name||component.toString().split("\n")[0]}function supportsNgModel(component){return"function"==typeof component.writeValue&&"function"==typeof component.registerOnChange}function hookupNgModel(ngModel,component){ngModel&&supportsNgModel(component)&&(ngModel.$render=function(){component.writeValue(ngModel.$viewValue)},component.registerOnChange(ngModel.$setViewValue.bind(ngModel)))}function downgradeComponent(info){var idPrefix="NG2_UPGRADE_"+downgradeCount++ +"_",idCount=0,directiveFactory=function($compile,$injector,$parse){return{restrict:"E",terminal:!0,require:[REQUIRE_INJECTOR,REQUIRE_NG_MODEL],link:function(scope,element,attrs,required){var parentInjector=required[0]||$injector.get(INJECTOR_KEY),ngModel=required[1],downgradeFn=function(injector){var componentFactoryResolver=injector.get(_core.ComponentFactoryResolver),componentFactory=componentFactoryResolver.resolveComponentFactory(info.component);if(!componentFactory)throw new Error("Expecting ComponentFactory for: "+getComponentName(info.component));var id=idPrefix+idCount++,injectorPromise=new ParentInjectorPromise(element),facade=new DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,injector,$injector,$compile,$parse,componentFactory),projectableNodes=facade.compileContents();facade.createComponent(projectableNodes),facade.setupInputs(),facade.setupOutputs(),facade.registerCleanup(),injectorPromise.resolve(facade.getInjector())};parentInjector instanceof ParentInjectorPromise?parentInjector.then(downgradeFn):downgradeFn(parentInjector)}}};return directiveFactory.$inject=[$COMPILE,$INJECTOR,$PARSE],directiveFactory}function downgradeInjectable(token){var factory=function(i){return i.get(token)};return factory.$inject=[INJECTOR_KEY],factory}/**
* @license

@@ -13,16 +13,2 @@ * Copyright Google Inc. All Rights Reserved.

*/
function noNg(){throw new Error("AngularJS v1.x is not loaded!")}function looseIdentical(a,b){return a===b||"number"==typeof a&&"number"==typeof b&&isNaN(a)&&isNaN(b)}function getOrCall(property){return isFunction(property)?property():property}function isFunction(value){return"function"==typeof value}function isMap(value){return value&&!Array.isArray(value)&&"object"==typeof value}function setTempInjectorRef(injector){tempInjectorRef=injector}function injectorFactory(){var injector=tempInjectorRef;return tempInjectorRef=null,injector}function rootScopeFactory(i){return i.get("$rootScope")}function compileFactory(i){return i.get("$compile")}function parseFactory(i){return i.get("$parse")}/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var $COMPILE="$compile",$CONTROLLER="$controller",$DELEGATE="$delegate",$HTTP_BACKEND="$httpBackend",$INJECTOR="$injector",$PARSE="$parse",$PROVIDE="$provide",$SCOPE="$scope",$TEMPLATE_CACHE="$templateCache",$$TESTABILITY="$$testability",INJECTOR_KEY="$$angularInjector",REQUIRE_INJECTOR="?^^"+INJECTOR_KEY,REQUIRE_NG_MODEL="?ngModel",UPGRADE_MODULE_NAME="$$UpgradeModule",PropertyBinding=function(){function PropertyBinding(binding){this.binding=binding,this.parseBinding()}return PropertyBinding.prototype.parseBinding=function(){var parts=this.binding.split(":");this.prop=parts[0].trim(),this.attr=(parts[1]||this.prop).trim(),this.bracketAttr="["+this.attr+"]",this.parenAttr="("+this.attr+")",this.bracketParenAttr="[("+this.attr+")]";var capitalAttr=this.attr.charAt(0).toUpperCase()+this.attr.substr(1);this.onAttr="on"+capitalAttr,this.bindAttr="bind"+capitalAttr,this.bindonAttr="bindon"+capitalAttr},PropertyBinding}(),ContentProjectionHelper=function(){function ContentProjectionHelper(){}return ContentProjectionHelper.prototype.groupProjectableNodes=function($injector,component,nodes){return[nodes]},ContentProjectionHelper}(),INITIAL_VALUE={__UNINITIALIZED__:!0},DowngradeComponentAdapter=function(){function DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,parentInjector,$injector,$compile,$parse,componentFactory){this.id=id,this.info=info,this.element=element,this.attrs=attrs,this.scope=scope,this.ngModel=ngModel,this.parentInjector=parentInjector,this.$injector=$injector,this.$compile=$compile,this.$parse=$parse,this.componentFactory=componentFactory,this.inputChangeCount=0,this.inputChanges=null,this.componentRef=null,this.component=null,this.changeDetector=null,this.element[0].id=id,this.componentScope=scope.$new()}return DowngradeComponentAdapter.prototype.compileContents=function(){var _this=this,compiledProjectableNodes=[],projectionHelper=this.parentInjector.get(ContentProjectionHelper),projectableNodes=projectionHelper.groupProjectableNodes(this.$injector,this.info.component,this.element.contents()),linkFns=projectableNodes.map(function(nodes){return _this.$compile(nodes)});return this.element.empty(),linkFns.forEach(function(linkFn){linkFn(_this.scope,function(clone){compiledProjectableNodes.push(clone),_this.element.append(clone)})}),compiledProjectableNodes},DowngradeComponentAdapter.prototype.createComponent=function(projectableNodes){var childInjector=_angular_core.ReflectiveInjector.resolveAndCreate([{provide:$SCOPE,useValue:this.componentScope}],this.parentInjector);this.componentRef=this.componentFactory.create(childInjector,projectableNodes,this.element[0]),this.changeDetector=this.componentRef.changeDetectorRef,this.component=this.componentRef.instance,hookupNgModel(this.ngModel,this.component)},DowngradeComponentAdapter.prototype.setupInputs=function(){for(var _this=this,attrs=this.attrs,inputs=this.info.inputs||[],i=0;i<inputs.length;i++){var input=new PropertyBinding(inputs[i]),expr=null;if(attrs.hasOwnProperty(input.attr)){var observeFn=function(prop){var prevValue=INITIAL_VALUE;return function(currValue){prevValue===INITIAL_VALUE&&(prevValue=currValue),_this.updateInput(prop,prevValue,currValue),prevValue=currValue}}(input.prop);attrs.$observe(input.attr,observeFn)}else attrs.hasOwnProperty(input.bindAttr)?expr=attrs[input.bindAttr]:attrs.hasOwnProperty(input.bracketAttr)?expr=attrs[input.bracketAttr]:attrs.hasOwnProperty(input.bindonAttr)?expr=attrs[input.bindonAttr]:attrs.hasOwnProperty(input.bracketParenAttr)&&(expr=attrs[input.bracketParenAttr]);if(null!=expr){var watchFn=function(prop){return function(currValue,prevValue){return _this.updateInput(prop,prevValue,currValue)}}(input.prop);this.componentScope.$watch(expr,watchFn)}}var prototype=this.info.component.prototype;prototype&&prototype.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return _this.inputChangeCount},function(){var inputChanges=_this.inputChanges;_this.inputChanges={},_this.component.ngOnChanges(inputChanges)})),this.componentScope.$watch(function(){return _this.changeDetector&&_this.changeDetector.detectChanges()})},DowngradeComponentAdapter.prototype.setupOutputs=function(){for(var _this=this,attrs=this.attrs,outputs=this.info.outputs||[],j=0;j<outputs.length;j++){var output=new PropertyBinding(outputs[j]),expr=null,assignExpr=!1,bindonAttr=output.bindonAttr?output.bindonAttr.substring(0,output.bindonAttr.length-6):null,bracketParenAttr=output.bracketParenAttr?"[("+output.bracketParenAttr.substring(2,output.bracketParenAttr.length-8)+")]":null;if(attrs.hasOwnProperty(output.onAttr)?expr=attrs[output.onAttr]:attrs.hasOwnProperty(output.parenAttr)?expr=attrs[output.parenAttr]:attrs.hasOwnProperty(bindonAttr)?(expr=attrs[bindonAttr],assignExpr=!0):attrs.hasOwnProperty(bracketParenAttr)&&(expr=attrs[bracketParenAttr],assignExpr=!0),null!=expr&&null!=assignExpr){var getter=this.$parse(expr),setter=getter.assign;if(assignExpr&&!setter)throw new Error("Expression '"+expr+"' is not assignable!");var emitter=this.component[output.prop];if(!emitter)throw new Error("Missing emitter '"+output.prop+"' on component '"+getComponentName(this.info.component)+"'!");emitter.subscribe({next:assignExpr?function(setter){return function(v){return setter(_this.scope,v)}}(setter):function(getter){return function(v){return getter(_this.scope,{$event:v})}}(getter)})}}},DowngradeComponentAdapter.prototype.registerCleanup=function(){var _this=this;this.element.bind("$destroy",function(){_this.componentScope.$destroy(),_this.componentRef.destroy()})},DowngradeComponentAdapter.prototype.getInjector=function(){return this.componentRef&&this.componentRef.injector},DowngradeComponentAdapter.prototype.updateInput=function(prop,prevValue,currValue){this.inputChanges&&(this.inputChangeCount++,this.inputChanges[prop]=new _angular_core.SimpleChange(prevValue,currValue,prevValue===currValue)),this.component[prop]=currValue},DowngradeComponentAdapter}(),downgradeCount=0,ParentInjectorPromise=function(){function ParentInjectorPromise(element){this.element=element,this.injectorKey=controllerKey(INJECTOR_KEY),this.callbacks=[],element.data(this.injectorKey,this)}return ParentInjectorPromise.prototype.then=function(callback){this.injector?callback(this.injector):this.callbacks.push(callback)},ParentInjectorPromise.prototype.resolve=function(injector){this.injector=injector,this.element.data(this.injectorKey,injector),this.element=null,this.callbacks.forEach(function(callback){return callback(injector)}),this.callbacks.length=0},ParentInjectorPromise}(),VERSION=new _angular_core.Version("4.0.0-beta.8"),angular={bootstrap:noNg,module:noNg,element:noNg,version:noNg,resumeBootstrap:noNg,getTestability:noNg};try{window.hasOwnProperty("angular")&&(angular=window.angular)}catch(e){}var tempInjectorRef,bootstrap=angular.bootstrap,module$1=angular.module,element=angular.element,REQUIRE_PREFIX_RE=/^(\^\^?)?(\?)?(\^\^?)?/,NOT_SUPPORTED="NOT_SUPPORTED",INITIAL_VALUE$1={__UNINITIALIZED__:!0},Bindings=function(){function Bindings(){this.twoWayBoundProperties=[],this.twoWayBoundLastValues=[],this.expressionBoundProperties=[],this.propertyToOutputMap={}}return Bindings}(),UpgradeComponent=function(){function UpgradeComponent(name,elementRef,injector){this.name=name,this.elementRef=elementRef,this.injector=injector,this.controllerInstance=null,this.bindingDestination=null,this.$injector=injector.get($INJECTOR),this.$compile=this.$injector.get($COMPILE),this.$templateCache=this.$injector.get($TEMPLATE_CACHE),this.$httpBackend=this.$injector.get($HTTP_BACKEND),this.$controller=this.$injector.get($CONTROLLER),this.element=elementRef.nativeElement,this.$element=element(this.element),this.directive=this.getDirective(name),this.bindings=this.initializeBindings(this.directive),this.linkFn=this.compileTemplate(this.directive);var $parentScope=injector.get($SCOPE);this.$componentScope=$parentScope.$new(!!this.directive.scope);var controllerType=this.directive.controller,bindToController=this.directive.bindToController;if(controllerType)this.controllerInstance=this.buildController(controllerType,this.$componentScope,this.$element,this.directive.controllerAs);else if(bindToController)throw new Error("Upgraded directive '"+name+"' specifies 'bindToController' but no controller.");this.bindingDestination=bindToController?this.controllerInstance:this.$componentScope,this.setupOutputs()}return UpgradeComponent.prototype.ngOnInit=function(){var _this=this,attrs=NOT_SUPPORTED,transcludeFn=NOT_SUPPORTED,directiveRequire=this.getDirectiveRequire(this.directive),requiredControllers=this.resolveRequire(this.directive.name,this.$element,directiveRequire);if(this.directive.bindToController&&isMap(directiveRequire)){var requiredControllersMap_1=requiredControllers;Object.keys(requiredControllersMap_1).forEach(function(key){_this.controllerInstance[key]=requiredControllersMap_1[key]})}if(this.controllerInstance&&isFunction(this.controllerInstance.$onInit)&&this.controllerInstance.$onInit(),this.controllerInstance&&isFunction(this.controllerInstance.$doCheck)){var callDoCheck=function(){return _this.controllerInstance.$doCheck()};this.unregisterDoCheckWatcher=this.$componentScope.$parent.$watch(callDoCheck),callDoCheck()}var link=this.directive.link,preLink="object"==typeof link&&link.pre,postLink="object"==typeof link?link.post:link;preLink&&preLink(this.$componentScope,this.$element,attrs,requiredControllers,transcludeFn);for(var childNode,childNodes=[];childNode=this.element.firstChild;)this.element.removeChild(childNode),childNodes.push(childNode);var attachElement=function(clonedElements,scope){_this.$element.append(clonedElements)},attachChildNodes=function(scope,cloneAttach){return cloneAttach(childNodes)};this.linkFn(this.$componentScope,attachElement,{parentBoundTranscludeFn:attachChildNodes}),postLink&&postLink(this.$componentScope,this.$element,attrs,requiredControllers,transcludeFn),this.controllerInstance&&isFunction(this.controllerInstance.$postLink)&&this.controllerInstance.$postLink()},UpgradeComponent.prototype.ngOnChanges=function(changes){var _this=this;Object.keys(changes).forEach(function(propName){return _this.bindingDestination[propName]=changes[propName].currentValue}),isFunction(this.bindingDestination.$onChanges)&&this.bindingDestination.$onChanges(changes)},UpgradeComponent.prototype.ngDoCheck=function(){var _this=this,twoWayBoundProperties=this.bindings.twoWayBoundProperties,twoWayBoundLastValues=this.bindings.twoWayBoundLastValues,propertyToOutputMap=this.bindings.propertyToOutputMap;twoWayBoundProperties.forEach(function(propName,idx){var newValue=_this.bindingDestination[propName],oldValue=twoWayBoundLastValues[idx];if(!looseIdentical(newValue,oldValue)){var outputName=propertyToOutputMap[propName],eventEmitter=_this[outputName];eventEmitter.emit(newValue),twoWayBoundLastValues[idx]=newValue}})},UpgradeComponent.prototype.ngOnDestroy=function(){isFunction(this.unregisterDoCheckWatcher)&&this.unregisterDoCheckWatcher(),this.controllerInstance&&isFunction(this.controllerInstance.$onDestroy)&&this.controllerInstance.$onDestroy(),this.$componentScope.$destroy()},UpgradeComponent.prototype.getDirective=function(name){var directives=this.$injector.get(name+"Directive");if(directives.length>1)throw new Error("Only support single directive definition for: "+this.name);var directive=directives[0];directive.replace&&this.notSupported("replace"),directive.terminal&&this.notSupported("terminal"),directive.compile&&this.notSupported("compile");var link=directive.link;return"object"==typeof link&&link.post&&this.notSupported("link.post"),directive},UpgradeComponent.prototype.getDirectiveRequire=function(directive){var require=directive.require||directive.controller&&directive.name;return isMap(require)&&Object.keys(require).forEach(function(key){var value=require[key],match=value.match(REQUIRE_PREFIX_RE),name=value.substring(match[0].length);name||(require[key]=match[0]+key)}),require},UpgradeComponent.prototype.initializeBindings=function(directive){var _this=this,btcIsObject="object"==typeof directive.bindToController;if(btcIsObject&&Object.keys(directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time is not supported.");var context=btcIsObject?directive.bindToController:directive.scope,bindings=new Bindings;return"object"==typeof context&&Object.keys(context).forEach(function(propName){var definition=context[propName],bindingType=definition.charAt(0);switch(bindingType){case"@":case"<":break;case"=":bindings.twoWayBoundProperties.push(propName),bindings.twoWayBoundLastValues.push(INITIAL_VALUE$1),bindings.propertyToOutputMap[propName]=propName+"Change";break;case"&":bindings.expressionBoundProperties.push(propName),bindings.propertyToOutputMap[propName]=propName;break;default:var json=JSON.stringify(context);throw new Error("Unexpected mapping '"+bindingType+"' in '"+json+"' in '"+_this.name+"' directive.")}}),bindings},UpgradeComponent.prototype.compileTemplate=function(directive){if(void 0!==this.directive.template)return this.compileHtml(getOrCall(this.directive.template));if(this.directive.templateUrl){var url=getOrCall(this.directive.templateUrl),html=this.$templateCache.get(url);if(void 0!==html)return this.compileHtml(html);throw new Error("loading directive templates asynchronously is not supported")}throw new Error("Directive '"+this.name+"' is not a component, it is missing template.")},UpgradeComponent.prototype.buildController=function(controllerType,$scope,$element,controllerAs){var locals={$scope:$scope,$element:$element},controller=this.$controller(controllerType,locals,null,controllerAs);return $element.data(controllerKey(this.directive.name),controller),controller},UpgradeComponent.prototype.resolveRequire=function(directiveName,$element,require){var _this=this;if(require){if(Array.isArray(require))return require.map(function(req){return _this.resolveRequire(directiveName,$element,req)});if("object"==typeof require){var value_1={};return Object.keys(require).forEach(function(key){return value_1[key]=_this.resolveRequire(directiveName,$element,require[key])}),value_1}if("string"==typeof require){var match=require.match(REQUIRE_PREFIX_RE),inheritType=match[1]||match[3],name_1=require.substring(match[0].length),isOptional=!!match[2],searchParents=!!inheritType,startOnParent="^^"===inheritType,ctrlKey=controllerKey(name_1);startOnParent&&($element=$element.parent());var value=searchParents?$element.inheritedData(ctrlKey):$element.data(ctrlKey);if(!value&&!isOptional)throw new Error("Unable to find required '"+require+"' in upgraded directive '"+directiveName+"'.");return value}throw new Error("Unrecognized require syntax on upgraded directive '"+directiveName+"': "+require)}return null},UpgradeComponent.prototype.setupOutputs=function(){var _this=this;this.bindings.twoWayBoundProperties.forEach(function(propName){var outputName=_this.bindings.propertyToOutputMap[propName];_this[outputName]=new _angular_core.EventEmitter}),this.bindings.expressionBoundProperties.forEach(function(propName){var outputName=_this.bindings.propertyToOutputMap[propName],emitter=_this[outputName]=new _angular_core.EventEmitter;_this.bindingDestination[propName]=function(value){return emitter.emit(value)}})},UpgradeComponent.prototype.notSupported=function(feature){throw new Error("Upgraded directive '"+this.name+"' contains unsupported feature: '"+feature+"'.")},UpgradeComponent.prototype.compileHtml=function(html){var div=document.createElement("div");return div.innerHTML=html,this.$compile(div.childNodes)},UpgradeComponent}(),angular1Providers=[{provide:"$injector",useFactory:injectorFactory},{provide:"$rootScope",useFactory:rootScopeFactory,deps:["$injector"]},{provide:"$compile",useFactory:compileFactory,deps:["$injector"]},{provide:"$parse",useFactory:parseFactory,deps:["$injector"]}],UpgradeModule=function(){function UpgradeModule(injector,ngZone){this.injector=injector,this.ngZone=ngZone}return UpgradeModule.prototype.bootstrap=function(element$$,modules,config){var _this=this;void 0===modules&&(modules=[]);var INIT_MODULE_NAME=UPGRADE_MODULE_NAME+".init",upgradeModule=(module$1(INIT_MODULE_NAME,[]).value(INJECTOR_KEY,this.injector).config([$PROVIDE,$INJECTOR,function($provide,$injector){$injector.has($$TESTABILITY)&&$provide.decorator($$TESTABILITY,[$DELEGATE,function(testabilityDelegate){var originalWhenStable=testabilityDelegate.whenStable,injector=_this.injector,newWhenStable=function(callback){originalWhenStable.call(testabilityDelegate,function(){var ng2Testability=injector.get(_angular_core.Testability);ng2Testability.isStable()?callback():ng2Testability.whenStable(newWhenStable.bind(testabilityDelegate,callback))})};return testabilityDelegate.whenStable=newWhenStable,testabilityDelegate}])}]).run([$INJECTOR,function($injector){_this.$injector=$injector,setTempInjectorRef($injector),_this.injector.get($INJECTOR),element(element$$).data(controllerKey(INJECTOR_KEY),_this.injector),setTimeout(function(){var $rootScope=$injector.get("$rootScope"),subscription=_this.ngZone.onMicrotaskEmpty.subscribe(function(){return $rootScope.$digest()});$rootScope.$on("$destroy",function(){subscription.unsubscribe()})},0)}]),module$1(UPGRADE_MODULE_NAME,[INIT_MODULE_NAME].concat(modules))),windowAngular=window.angular;if(windowAngular.resumeBootstrap=void 0,this.ngZone.run(function(){bootstrap(element$$,[upgradeModule.name],config)}),windowAngular.resumeBootstrap){var originalResumeBootstrap_1=windowAngular.resumeBootstrap,ngZone_1=this.ngZone;windowAngular.resumeBootstrap=function(){var _this=this,args=arguments;windowAngular.resumeBootstrap=originalResumeBootstrap_1,ngZone_1.run(function(){windowAngular.resumeBootstrap.apply(_this,args)})}}},UpgradeModule}();UpgradeModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[angular1Providers,ContentProjectionHelper]}]}],UpgradeModule.ctorParameters=function(){return[{type:_angular_core.Injector},{type:_angular_core.NgZone}]},exports.downgradeComponent=downgradeComponent,exports.downgradeInjectable=downgradeInjectable,exports.VERSION=VERSION,exports.UpgradeComponent=UpgradeComponent,exports.UpgradeModule=UpgradeModule,exports.ɵf=ContentProjectionHelper,exports.ɵa=angular1Providers,exports.ɵd=compileFactory,exports.ɵb=injectorFactory,exports.ɵe=parseFactory,exports.ɵc=rootScopeFactory});
function noNg(){throw new Error("AngularJS v1.x is not loaded!")}function looseIdentical(a,b){return a===b||"number"==typeof a&&"number"==typeof b&&isNaN(a)&&isNaN(b)}function getOrCall(property){return isFunction(property)?property():property}function isFunction(value){return"function"==typeof value}function isMap(value){return value&&!Array.isArray(value)&&"object"===("undefined"==typeof value?"undefined":_typeof(value))}function setTempInjectorRef(injector){tempInjectorRef=injector}function injectorFactory(){var injector=tempInjectorRef;return tempInjectorRef=null,injector}function rootScopeFactory(i){return i.get("$rootScope")}function compileFactory(i){return i.get("$compile")}function parseFactory(i){return i.get("$parse")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.UpgradeModule=exports.UpgradeComponent=exports.VERSION=exports.downgradeInjectable=exports.downgradeComponent=exports.ɵb=exports.ɵd=exports.ɵa=exports.ɵc=exports.ɵe=exports.ɵf=void 0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},$COMPILE="$compile",$CONTROLLER="$controller",$DELEGATE="$delegate",$HTTP_BACKEND="$httpBackend",$INJECTOR="$injector",$PARSE="$parse",$PROVIDE="$provide",$SCOPE="$scope",$TEMPLATE_CACHE="$templateCache",$$TESTABILITY="$$testability",INJECTOR_KEY="$$angularInjector",REQUIRE_INJECTOR="?^^"+INJECTOR_KEY,REQUIRE_NG_MODEL="?ngModel",UPGRADE_MODULE_NAME="$$UpgradeModule",PropertyBinding=function(){function PropertyBinding(binding){this.binding=binding,this.parseBinding()}return PropertyBinding.prototype.parseBinding=function(){var parts=this.binding.split(":");this.prop=parts[0].trim(),this.attr=(parts[1]||this.prop).trim(),this.bracketAttr="["+this.attr+"]",this.parenAttr="("+this.attr+")",this.bracketParenAttr="[("+this.attr+")]";var capitalAttr=this.attr.charAt(0).toUpperCase()+this.attr.substr(1);this.onAttr="on"+capitalAttr,this.bindAttr="bind"+capitalAttr,this.bindonAttr="bindon"+capitalAttr},PropertyBinding}(),ContentProjectionHelper=function(){function ContentProjectionHelper(){}return ContentProjectionHelper.prototype.groupProjectableNodes=function($injector,component,nodes){return[nodes]},ContentProjectionHelper}(),INITIAL_VALUE={__UNINITIALIZED__:!0},DowngradeComponentAdapter=function(){function DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,parentInjector,$injector,$compile,$parse,componentFactory){this.id=id,this.info=info,this.element=element,this.attrs=attrs,this.scope=scope,this.ngModel=ngModel,this.parentInjector=parentInjector,this.$injector=$injector,this.$compile=$compile,this.$parse=$parse,this.componentFactory=componentFactory,this.inputChangeCount=0,this.inputChanges=null,this.componentRef=null,this.component=null,this.changeDetector=null,this.element[0].id=id,this.componentScope=scope.$new()}return DowngradeComponentAdapter.prototype.compileContents=function(){var _this=this,compiledProjectableNodes=[],projectionHelper=this.parentInjector.get(ContentProjectionHelper),projectableNodes=projectionHelper.groupProjectableNodes(this.$injector,this.info.component,this.element.contents()),linkFns=projectableNodes.map(function(nodes){return _this.$compile(nodes)});return this.element.empty(),linkFns.forEach(function(linkFn){linkFn(_this.scope,function(clone){compiledProjectableNodes.push(clone),_this.element.append(clone)})}),compiledProjectableNodes},DowngradeComponentAdapter.prototype.createComponent=function(projectableNodes){var childInjector=_core.ReflectiveInjector.resolveAndCreate([{provide:$SCOPE,useValue:this.componentScope}],this.parentInjector);this.componentRef=this.componentFactory.create(childInjector,projectableNodes,this.element[0]),this.changeDetector=this.componentRef.changeDetectorRef,this.component=this.componentRef.instance,hookupNgModel(this.ngModel,this.component)},DowngradeComponentAdapter.prototype.setupInputs=function(){for(var _this=this,attrs=this.attrs,inputs=this.info.inputs||[],i=0;i<inputs.length;i++){var input=new PropertyBinding(inputs[i]),expr=null;if(attrs.hasOwnProperty(input.attr)){var observeFn=function(prop){var prevValue=INITIAL_VALUE;return function(currValue){prevValue===INITIAL_VALUE&&(prevValue=currValue),_this.updateInput(prop,prevValue,currValue),prevValue=currValue}}(input.prop);attrs.$observe(input.attr,observeFn)}else attrs.hasOwnProperty(input.bindAttr)?expr=attrs[input.bindAttr]:attrs.hasOwnProperty(input.bracketAttr)?expr=attrs[input.bracketAttr]:attrs.hasOwnProperty(input.bindonAttr)?expr=attrs[input.bindonAttr]:attrs.hasOwnProperty(input.bracketParenAttr)&&(expr=attrs[input.bracketParenAttr]);if(null!=expr){var watchFn=function(prop){return function(currValue,prevValue){return _this.updateInput(prop,prevValue,currValue)}}(input.prop);this.componentScope.$watch(expr,watchFn)}}var prototype=this.info.component.prototype;prototype&&prototype.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return _this.inputChangeCount},function(){var inputChanges=_this.inputChanges;_this.inputChanges={},_this.component.ngOnChanges(inputChanges)})),this.componentScope.$watch(function(){return _this.changeDetector&&_this.changeDetector.detectChanges()})},DowngradeComponentAdapter.prototype.setupOutputs=function(){for(var _this=this,attrs=this.attrs,outputs=this.info.outputs||[],j=0;j<outputs.length;j++){var output=new PropertyBinding(outputs[j]),expr=null,assignExpr=!1,bindonAttr=output.bindonAttr?output.bindonAttr.substring(0,output.bindonAttr.length-6):null,bracketParenAttr=output.bracketParenAttr?"[("+output.bracketParenAttr.substring(2,output.bracketParenAttr.length-8)+")]":null;if(attrs.hasOwnProperty(output.onAttr)?expr=attrs[output.onAttr]:attrs.hasOwnProperty(output.parenAttr)?expr=attrs[output.parenAttr]:attrs.hasOwnProperty(bindonAttr)?(expr=attrs[bindonAttr],assignExpr=!0):attrs.hasOwnProperty(bracketParenAttr)&&(expr=attrs[bracketParenAttr],assignExpr=!0),null!=expr&&null!=assignExpr){var getter=this.$parse(expr),setter=getter.assign;if(assignExpr&&!setter)throw new Error("Expression '"+expr+"' is not assignable!");var emitter=this.component[output.prop];if(!emitter)throw new Error("Missing emitter '"+output.prop+"' on component '"+getComponentName(this.info.component)+"'!");emitter.subscribe({next:assignExpr?function(setter){return function(v){return setter(_this.scope,v)}}(setter):function(getter){return function(v){return getter(_this.scope,{$event:v})}}(getter)})}}},DowngradeComponentAdapter.prototype.registerCleanup=function(){var _this=this;this.element.bind("$destroy",function(){_this.componentScope.$destroy(),_this.componentRef.destroy()})},DowngradeComponentAdapter.prototype.getInjector=function(){return this.componentRef&&this.componentRef.injector},DowngradeComponentAdapter.prototype.updateInput=function(prop,prevValue,currValue){this.inputChanges&&(this.inputChangeCount++,this.inputChanges[prop]=new _core.SimpleChange(prevValue,currValue,prevValue===currValue)),this.component[prop]=currValue},DowngradeComponentAdapter}(),downgradeCount=0,ParentInjectorPromise=function(){function ParentInjectorPromise(element){this.element=element,this.injectorKey=controllerKey(INJECTOR_KEY),this.callbacks=[],element.data(this.injectorKey,this)}return ParentInjectorPromise.prototype.then=function(callback){this.injector?callback(this.injector):this.callbacks.push(callback)},ParentInjectorPromise.prototype.resolve=function(injector){this.injector=injector,this.element.data(this.injectorKey,injector),this.element=null,this.callbacks.forEach(function(callback){return callback(injector)}),this.callbacks.length=0},ParentInjectorPromise}(),VERSION=new _core.Version("4.0.0-rc.0"),angular={bootstrap:noNg,module:noNg,element:noNg,version:noNg,resumeBootstrap:noNg,getTestability:noNg};try{window.hasOwnProperty("angular")&&(angular=window.angular)}catch(e){}var tempInjectorRef,bootstrap=angular.bootstrap,module$1=angular.module,element=angular.element,REQUIRE_PREFIX_RE=/^(\^\^?)?(\?)?(\^\^?)?/,NOT_SUPPORTED="NOT_SUPPORTED",INITIAL_VALUE$1={__UNINITIALIZED__:!0},Bindings=function(){function Bindings(){this.twoWayBoundProperties=[],this.twoWayBoundLastValues=[],this.expressionBoundProperties=[],this.propertyToOutputMap={}}return Bindings}(),UpgradeComponent=function(){function UpgradeComponent(name,elementRef,injector){this.name=name,this.elementRef=elementRef,this.injector=injector,this.controllerInstance=null,this.bindingDestination=null,this.$injector=injector.get($INJECTOR),this.$compile=this.$injector.get($COMPILE),this.$templateCache=this.$injector.get($TEMPLATE_CACHE),this.$httpBackend=this.$injector.get($HTTP_BACKEND),this.$controller=this.$injector.get($CONTROLLER),this.element=elementRef.nativeElement,this.$element=element(this.element),this.directive=this.getDirective(name),this.bindings=this.initializeBindings(this.directive),this.linkFn=this.compileTemplate(this.directive);var $parentScope=injector.get($SCOPE);this.$componentScope=$parentScope.$new(!!this.directive.scope);var controllerType=this.directive.controller,bindToController=this.directive.bindToController;if(controllerType)this.controllerInstance=this.buildController(controllerType,this.$componentScope,this.$element,this.directive.controllerAs);else if(bindToController)throw new Error("Upgraded directive '"+name+"' specifies 'bindToController' but no controller.");this.bindingDestination=bindToController?this.controllerInstance:this.$componentScope,this.setupOutputs()}return UpgradeComponent.prototype.ngOnInit=function(){var _this=this,attrs=NOT_SUPPORTED,transcludeFn=NOT_SUPPORTED,directiveRequire=this.getDirectiveRequire(this.directive),requiredControllers=this.resolveRequire(this.directive.name,this.$element,directiveRequire);if(this.directive.bindToController&&isMap(directiveRequire)){var requiredControllersMap_1=requiredControllers;Object.keys(requiredControllersMap_1).forEach(function(key){_this.controllerInstance[key]=requiredControllersMap_1[key]})}if(this.controllerInstance&&isFunction(this.controllerInstance.$onInit)&&this.controllerInstance.$onInit(),this.controllerInstance&&isFunction(this.controllerInstance.$doCheck)){var callDoCheck=function(){return _this.controllerInstance.$doCheck()};this.unregisterDoCheckWatcher=this.$componentScope.$parent.$watch(callDoCheck),callDoCheck()}var link=this.directive.link,preLink="object"==("undefined"==typeof link?"undefined":_typeof(link))&&link.pre,postLink="object"==("undefined"==typeof link?"undefined":_typeof(link))?link.post:link;preLink&&preLink(this.$componentScope,this.$element,attrs,requiredControllers,transcludeFn);for(var childNode,childNodes=[];childNode=this.element.firstChild;)this.element.removeChild(childNode),childNodes.push(childNode);var attachElement=function(clonedElements,scope){_this.$element.append(clonedElements)},attachChildNodes=function(scope,cloneAttach){return cloneAttach(childNodes)};this.linkFn(this.$componentScope,attachElement,{parentBoundTranscludeFn:attachChildNodes}),postLink&&postLink(this.$componentScope,this.$element,attrs,requiredControllers,transcludeFn),this.controllerInstance&&isFunction(this.controllerInstance.$postLink)&&this.controllerInstance.$postLink()},UpgradeComponent.prototype.ngOnChanges=function(changes){var _this=this;Object.keys(changes).forEach(function(propName){return _this.bindingDestination[propName]=changes[propName].currentValue}),isFunction(this.bindingDestination.$onChanges)&&this.bindingDestination.$onChanges(changes)},UpgradeComponent.prototype.ngDoCheck=function(){var _this=this,twoWayBoundProperties=this.bindings.twoWayBoundProperties,twoWayBoundLastValues=this.bindings.twoWayBoundLastValues,propertyToOutputMap=this.bindings.propertyToOutputMap;twoWayBoundProperties.forEach(function(propName,idx){var newValue=_this.bindingDestination[propName],oldValue=twoWayBoundLastValues[idx];if(!looseIdentical(newValue,oldValue)){var outputName=propertyToOutputMap[propName],eventEmitter=_this[outputName];eventEmitter.emit(newValue),twoWayBoundLastValues[idx]=newValue}})},UpgradeComponent.prototype.ngOnDestroy=function(){isFunction(this.unregisterDoCheckWatcher)&&this.unregisterDoCheckWatcher(),this.controllerInstance&&isFunction(this.controllerInstance.$onDestroy)&&this.controllerInstance.$onDestroy(),this.$componentScope.$destroy()},UpgradeComponent.prototype.getDirective=function(name){var directives=this.$injector.get(name+"Directive");if(directives.length>1)throw new Error("Only support single directive definition for: "+this.name);var directive=directives[0];directive.replace&&this.notSupported("replace"),directive.terminal&&this.notSupported("terminal"),directive.compile&&this.notSupported("compile");var link=directive.link;return"object"==("undefined"==typeof link?"undefined":_typeof(link))&&link.post&&this.notSupported("link.post"),directive},UpgradeComponent.prototype.getDirectiveRequire=function(directive){var require=directive.require||directive.controller&&directive.name;return isMap(require)&&Object.keys(require).forEach(function(key){var value=require[key],match=value.match(REQUIRE_PREFIX_RE),name=value.substring(match[0].length);name||(require[key]=match[0]+key)}),require},UpgradeComponent.prototype.initializeBindings=function(directive){var _this=this,btcIsObject="object"===_typeof(directive.bindToController);if(btcIsObject&&Object.keys(directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time is not supported.");var context=btcIsObject?directive.bindToController:directive.scope,bindings=new Bindings;return"object"==("undefined"==typeof context?"undefined":_typeof(context))&&Object.keys(context).forEach(function(propName){var definition=context[propName],bindingType=definition.charAt(0);switch(bindingType){case"@":case"<":break;case"=":bindings.twoWayBoundProperties.push(propName),bindings.twoWayBoundLastValues.push(INITIAL_VALUE$1),bindings.propertyToOutputMap[propName]=propName+"Change";break;case"&":bindings.expressionBoundProperties.push(propName),bindings.propertyToOutputMap[propName]=propName;break;default:var json=JSON.stringify(context);throw new Error("Unexpected mapping '"+bindingType+"' in '"+json+"' in '"+_this.name+"' directive.")}}),bindings},UpgradeComponent.prototype.compileTemplate=function(directive){if(void 0!==this.directive.template)return this.compileHtml(getOrCall(this.directive.template));if(this.directive.templateUrl){var url=getOrCall(this.directive.templateUrl),html=this.$templateCache.get(url);if(void 0!==html)return this.compileHtml(html);throw new Error("loading directive templates asynchronously is not supported")}throw new Error("Directive '"+this.name+"' is not a component, it is missing template.")},UpgradeComponent.prototype.buildController=function(controllerType,$scope,$element,controllerAs){var locals={$scope:$scope,$element:$element},controller=this.$controller(controllerType,locals,null,controllerAs);return $element.data(controllerKey(this.directive.name),controller),controller},UpgradeComponent.prototype.resolveRequire=function(directiveName,$element,require){var _this=this;if(require){if(Array.isArray(require))return require.map(function(req){return _this.resolveRequire(directiveName,$element,req)});if("object"===("undefined"==typeof require?"undefined":_typeof(require))){var value_1={};return Object.keys(require).forEach(function(key){return value_1[key]=_this.resolveRequire(directiveName,$element,require[key])}),value_1}if("string"==typeof require){var match=require.match(REQUIRE_PREFIX_RE),inheritType=match[1]||match[3],name_1=require.substring(match[0].length),isOptional=!!match[2],searchParents=!!inheritType,startOnParent="^^"===inheritType,ctrlKey=controllerKey(name_1);startOnParent&&($element=$element.parent());var value=searchParents?$element.inheritedData(ctrlKey):$element.data(ctrlKey);if(!value&&!isOptional)throw new Error("Unable to find required '"+require+"' in upgraded directive '"+directiveName+"'.");return value}throw new Error("Unrecognized require syntax on upgraded directive '"+directiveName+"': "+require)}return null},UpgradeComponent.prototype.setupOutputs=function(){var _this=this;this.bindings.twoWayBoundProperties.forEach(function(propName){var outputName=_this.bindings.propertyToOutputMap[propName];_this[outputName]=new _core.EventEmitter}),this.bindings.expressionBoundProperties.forEach(function(propName){var outputName=_this.bindings.propertyToOutputMap[propName],emitter=_this[outputName]=new _core.EventEmitter;_this.bindingDestination[propName]=function(value){return emitter.emit(value)}})},UpgradeComponent.prototype.notSupported=function(feature){throw new Error("Upgraded directive '"+this.name+"' contains unsupported feature: '"+feature+"'.")},UpgradeComponent.prototype.compileHtml=function(html){var div=document.createElement("div");return div.innerHTML=html,this.$compile(div.childNodes)},UpgradeComponent}(),angular1Providers=[{provide:"$injector",useFactory:injectorFactory},{provide:"$rootScope",useFactory:rootScopeFactory,deps:["$injector"]},{provide:"$compile",useFactory:compileFactory,deps:["$injector"]},{provide:"$parse",useFactory:parseFactory,deps:["$injector"]}],UpgradeModule=function(){function UpgradeModule(injector,ngZone){this.injector=injector,this.ngZone=ngZone}return UpgradeModule.prototype.bootstrap=function(element$$,modules,config){var _this=this;void 0===modules&&(modules=[]);var INIT_MODULE_NAME=UPGRADE_MODULE_NAME+".init",upgradeModule=(module$1(INIT_MODULE_NAME,[]).value(INJECTOR_KEY,this.injector).config([$PROVIDE,$INJECTOR,function($provide,$injector){$injector.has($$TESTABILITY)&&$provide.decorator($$TESTABILITY,[$DELEGATE,function(testabilityDelegate){var originalWhenStable=testabilityDelegate.whenStable,injector=_this.injector,newWhenStable=function newWhenStable(callback){originalWhenStable.call(testabilityDelegate,function(){var ng2Testability=injector.get(_core.Testability);ng2Testability.isStable()?callback():ng2Testability.whenStable(newWhenStable.bind(testabilityDelegate,callback))})};return testabilityDelegate.whenStable=newWhenStable,testabilityDelegate}])}]).run([$INJECTOR,function($injector){_this.$injector=$injector,setTempInjectorRef($injector),_this.injector.get($INJECTOR),element(element$$).data(controllerKey(INJECTOR_KEY),_this.injector),setTimeout(function(){var $rootScope=$injector.get("$rootScope"),subscription=_this.ngZone.onMicrotaskEmpty.subscribe(function(){return $rootScope.$digest()});$rootScope.$on("$destroy",function(){subscription.unsubscribe()})},0)}]),module$1(UPGRADE_MODULE_NAME,[INIT_MODULE_NAME].concat(modules))),windowAngular=window.angular;if(windowAngular.resumeBootstrap=void 0,this.ngZone.run(function(){bootstrap(element$$,[upgradeModule.name],config)}),windowAngular.resumeBootstrap){var originalResumeBootstrap_1=windowAngular.resumeBootstrap,ngZone_1=this.ngZone;windowAngular.resumeBootstrap=function(){var _this=this,args=arguments;windowAngular.resumeBootstrap=originalResumeBootstrap_1,ngZone_1.run(function(){windowAngular.resumeBootstrap.apply(_this,args)})}}},UpgradeModule}();UpgradeModule.decorators=[{type:_core.NgModule,args:[{providers:[angular1Providers,ContentProjectionHelper]}]}],UpgradeModule.ctorParameters=function(){return[{type:_core.Injector},{type:_core.NgZone}]},exports.ɵf=ContentProjectionHelper,exports.ɵe=angular1Providers,exports.ɵc=compileFactory,exports.ɵa=injectorFactory,exports.ɵd=parseFactory,exports.ɵb=rootScopeFactory,exports.downgradeComponent=downgradeComponent,exports.downgradeInjectable=downgradeInjectable,exports.VERSION=VERSION,exports.UpgradeComponent=UpgradeComponent,exports.UpgradeModule=UpgradeModule});

@@ -1,20 +0,1 @@

/**
* @license Angular v4.0.0-beta.8
* (c) 2010-2017 Google, Inc. https://angular.io/
* License: MIT
*/
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("@angular/compiler"),require("@angular/platform-browser-dynamic")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/compiler","@angular/platform-browser-dynamic"],factory):factory((global.ng=global.ng||{},global.ng.upgrade=global.ng.upgrade||{}),global.ng.core,global.ng.compiler,global.ng.platformBrowserDynamic)}(this,function(exports,_angular_core,_angular_compiler,_angular_platformBrowserDynamic){"use strict";/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
function noNg(){throw new Error("AngularJS v1.x is not loaded!")}/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
function onError(e){throw console.error?console.error(e,e.stack):console.log(e,e.stack),e}function controllerKey(name){return"$"+name+"Controller"}function getAttributesAsArray(node){var asArray,attributes=node.attributes;if(attributes){var attrLen=attributes.length;asArray=new Array(attrLen);for(var i=0;i<attrLen;i++)asArray[i]=[attributes[i].nodeName,attributes[i].nodeValue]}return asArray||[]}function getComponentName(component){return component.overriddenName||component.name||component.toString().split("\n")[0]}function supportsNgModel(component){return"function"==typeof component.writeValue&&"function"==typeof component.registerOnChange}function hookupNgModel(ngModel,component){ngModel&&supportsNgModel(component)&&(ngModel.$render=function(){component.writeValue(ngModel.$viewValue)},component.registerOnChange(ngModel.$setViewValue.bind(ngModel)))}function downgradeComponent(info){var idPrefix="NG2_UPGRADE_"+downgradeCount++ +"_",idCount=0,directiveFactory=function($compile,$injector,$parse){return{restrict:"E",terminal:!0,require:[REQUIRE_INJECTOR,REQUIRE_NG_MODEL],link:function(scope,element,attrs,required){var parentInjector=required[0]||$injector.get(INJECTOR_KEY),ngModel=required[1],downgradeFn=function(injector){var componentFactoryResolver=injector.get(_angular_core.ComponentFactoryResolver),componentFactory=componentFactoryResolver.resolveComponentFactory(info.component);if(!componentFactory)throw new Error("Expecting ComponentFactory for: "+getComponentName(info.component));var id=idPrefix+idCount++,injectorPromise=new ParentInjectorPromise$1(element),facade=new DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,injector,$injector,$compile,$parse,componentFactory),projectableNodes=facade.compileContents();facade.createComponent(projectableNodes),facade.setupInputs(),facade.setupOutputs(),facade.registerCleanup(),injectorPromise.resolve(facade.getInjector())};parentInjector instanceof ParentInjectorPromise$1?parentInjector.then(downgradeFn):downgradeFn(parentInjector)}}};return directiveFactory.$inject=[$COMPILE,$INJECTOR,$PARSE],directiveFactory}function downgradeInjectable(token){var factory=function(i){return i.get(token)};return factory.$inject=[INJECTOR_KEY],factory}function isFunction(value){return"function"==typeof value}var VERSION=new _angular_core.Version("4.0.0-beta.8"),angular={bootstrap:noNg,module:noNg,element:noNg,version:noNg,resumeBootstrap:noNg,getTestability:noNg};try{window.hasOwnProperty("angular")&&(angular=window.angular)}catch(e){}var bootstrap=angular.bootstrap,module$1=angular.module,element=angular.element,$COMPILE="$compile",$CONTROLLER="$controller",$HTTP_BACKEND="$httpBackend",$INJECTOR="$injector",$PARSE="$parse",$ROOT_SCOPE="$rootScope",$SCOPE="$scope",$TEMPLATE_CACHE="$templateCache",$$TESTABILITY="$$testability",COMPILER_KEY="$$angularCompiler",INJECTOR_KEY="$$angularInjector",NG_ZONE_KEY="$$angularNgZone",REQUIRE_INJECTOR="?^^"+INJECTOR_KEY,REQUIRE_NG_MODEL="?ngModel",ContentProjectionHelper=function(){function ContentProjectionHelper(){}return ContentProjectionHelper.prototype.groupProjectableNodes=function($injector,component,nodes){return[nodes]},ContentProjectionHelper}(),PropertyBinding=function(){function PropertyBinding(binding){this.binding=binding,this.parseBinding()}return PropertyBinding.prototype.parseBinding=function(){var parts=this.binding.split(":");this.prop=parts[0].trim(),this.attr=(parts[1]||this.prop).trim(),this.bracketAttr="["+this.attr+"]",this.parenAttr="("+this.attr+")",this.bracketParenAttr="[("+this.attr+")]";var capitalAttr=this.attr.charAt(0).toUpperCase()+this.attr.substr(1);this.onAttr="on"+capitalAttr,this.bindAttr="bind"+capitalAttr,this.bindonAttr="bindon"+capitalAttr},PropertyBinding}(),Deferred=function(){function Deferred(){var _this=this;this.promise=new Promise(function(res,rej){_this.resolve=res,_this.reject=rej})}return Deferred}(),INITIAL_VALUE={__UNINITIALIZED__:!0},DowngradeComponentAdapter=function(){function DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,parentInjector,$injector,$compile,$parse,componentFactory){this.id=id,this.info=info,this.element=element,this.attrs=attrs,this.scope=scope,this.ngModel=ngModel,this.parentInjector=parentInjector,this.$injector=$injector,this.$compile=$compile,this.$parse=$parse,this.componentFactory=componentFactory,this.inputChangeCount=0,this.inputChanges=null,this.componentRef=null,this.component=null,this.changeDetector=null,this.element[0].id=id,this.componentScope=scope.$new()}return DowngradeComponentAdapter.prototype.compileContents=function(){var _this=this,compiledProjectableNodes=[],projectionHelper=this.parentInjector.get(ContentProjectionHelper),projectableNodes=projectionHelper.groupProjectableNodes(this.$injector,this.info.component,this.element.contents()),linkFns=projectableNodes.map(function(nodes){return _this.$compile(nodes)});return this.element.empty(),linkFns.forEach(function(linkFn){linkFn(_this.scope,function(clone){compiledProjectableNodes.push(clone),_this.element.append(clone)})}),compiledProjectableNodes},DowngradeComponentAdapter.prototype.createComponent=function(projectableNodes){var childInjector=_angular_core.ReflectiveInjector.resolveAndCreate([{provide:$SCOPE,useValue:this.componentScope}],this.parentInjector);this.componentRef=this.componentFactory.create(childInjector,projectableNodes,this.element[0]),this.changeDetector=this.componentRef.changeDetectorRef,this.component=this.componentRef.instance,hookupNgModel(this.ngModel,this.component)},DowngradeComponentAdapter.prototype.setupInputs=function(){for(var _this=this,attrs=this.attrs,inputs=this.info.inputs||[],i=0;i<inputs.length;i++){var input=new PropertyBinding(inputs[i]),expr=null;if(attrs.hasOwnProperty(input.attr)){var observeFn=function(prop){var prevValue=INITIAL_VALUE;return function(currValue){prevValue===INITIAL_VALUE&&(prevValue=currValue),_this.updateInput(prop,prevValue,currValue),prevValue=currValue}}(input.prop);attrs.$observe(input.attr,observeFn)}else attrs.hasOwnProperty(input.bindAttr)?expr=attrs[input.bindAttr]:attrs.hasOwnProperty(input.bracketAttr)?expr=attrs[input.bracketAttr]:attrs.hasOwnProperty(input.bindonAttr)?expr=attrs[input.bindonAttr]:attrs.hasOwnProperty(input.bracketParenAttr)&&(expr=attrs[input.bracketParenAttr]);if(null!=expr){var watchFn=function(prop){return function(currValue,prevValue){return _this.updateInput(prop,prevValue,currValue)}}(input.prop);this.componentScope.$watch(expr,watchFn)}}var prototype=this.info.component.prototype;prototype&&prototype.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return _this.inputChangeCount},function(){var inputChanges=_this.inputChanges;_this.inputChanges={},_this.component.ngOnChanges(inputChanges)})),this.componentScope.$watch(function(){return _this.changeDetector&&_this.changeDetector.detectChanges()})},DowngradeComponentAdapter.prototype.setupOutputs=function(){for(var _this=this,attrs=this.attrs,outputs=this.info.outputs||[],j=0;j<outputs.length;j++){var output=new PropertyBinding(outputs[j]),expr=null,assignExpr=!1,bindonAttr=output.bindonAttr?output.bindonAttr.substring(0,output.bindonAttr.length-6):null,bracketParenAttr=output.bracketParenAttr?"[("+output.bracketParenAttr.substring(2,output.bracketParenAttr.length-8)+")]":null;if(attrs.hasOwnProperty(output.onAttr)?expr=attrs[output.onAttr]:attrs.hasOwnProperty(output.parenAttr)?expr=attrs[output.parenAttr]:attrs.hasOwnProperty(bindonAttr)?(expr=attrs[bindonAttr],assignExpr=!0):attrs.hasOwnProperty(bracketParenAttr)&&(expr=attrs[bracketParenAttr],assignExpr=!0),null!=expr&&null!=assignExpr){var getter=this.$parse(expr),setter=getter.assign;if(assignExpr&&!setter)throw new Error("Expression '"+expr+"' is not assignable!");var emitter=this.component[output.prop];if(!emitter)throw new Error("Missing emitter '"+output.prop+"' on component '"+getComponentName(this.info.component)+"'!");emitter.subscribe({next:assignExpr?function(setter){return function(v){return setter(_this.scope,v)}}(setter):function(getter){return function(v){return getter(_this.scope,{$event:v})}}(getter)})}}},DowngradeComponentAdapter.prototype.registerCleanup=function(){var _this=this;this.element.bind("$destroy",function(){_this.componentScope.$destroy(),_this.componentRef.destroy()})},DowngradeComponentAdapter.prototype.getInjector=function(){return this.componentRef&&this.componentRef.injector},DowngradeComponentAdapter.prototype.updateInput=function(prop,prevValue,currValue){this.inputChanges&&(this.inputChangeCount++,this.inputChanges[prop]=new _angular_core.SimpleChange(prevValue,currValue,prevValue===currValue)),this.component[prop]=currValue},DowngradeComponentAdapter}(),downgradeCount=0,ParentInjectorPromise$1=function(){function ParentInjectorPromise(element){this.element=element,this.injectorKey=controllerKey(INJECTOR_KEY),this.callbacks=[],element.data(this.injectorKey,this)}return ParentInjectorPromise.prototype.then=function(callback){this.injector?callback(this.injector):this.callbacks.push(callback)},ParentInjectorPromise.prototype.resolve=function(injector){this.injector=injector,this.element.data(this.injectorKey,injector),this.element=null,this.callbacks.forEach(function(callback){return callback(injector)}),this.callbacks.length=0},ParentInjectorPromise}(),__extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},DynamicContentProjectionHelper=function(_super){function DynamicContentProjectionHelper(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(DynamicContentProjectionHelper,_super),DynamicContentProjectionHelper.prototype.groupProjectableNodes=function($injector,component,nodes){var ng2Compiler=$injector.get(COMPILER_KEY),ngContentSelectors=ng2Compiler.getNgContentSelectors(component);if(!ngContentSelectors)throw new Error("Expecting ngContentSelectors for: "+getComponentName(component));return this.groupNodesBySelector(ngContentSelectors,nodes)},DynamicContentProjectionHelper.prototype.groupNodesBySelector=function(ngContentSelectors,nodes){for(var wildcardNgContentIndex,projectableNodes=[],matcher=new _angular_compiler.SelectorMatcher,i=0,ii=ngContentSelectors.length;i<ii;++i){projectableNodes[i]=[];var selector=ngContentSelectors[i];"*"===selector?wildcardNgContentIndex=i:matcher.addSelectables(_angular_compiler.CssSelector.parse(selector),i)}for(var _loop_1=function(j,jj){var ngContentIndices=[],node=nodes[j],selector=_angular_compiler.createElementCssSelector(node.nodeName.toLowerCase(),getAttributesAsArray(node));matcher.match(selector,function(_,index){return ngContentIndices.push(index)}),ngContentIndices.sort(),void 0!==wildcardNgContentIndex&&ngContentIndices.push(wildcardNgContentIndex),ngContentIndices.length&&projectableNodes[ngContentIndices[0]].push(node)},j=0,jj=nodes.length;j<jj;++j)_loop_1(j,jj);return projectableNodes},DynamicContentProjectionHelper}(ContentProjectionHelper),CAMEL_CASE=/([A-Z])/g,INITIAL_VALUE$1={__UNINITIALIZED__:!0},NOT_SUPPORTED="NOT_SUPPORTED",UpgradeNg1ComponentAdapterBuilder=function(){function UpgradeNg1ComponentAdapterBuilder(name){this.name=name,this.inputs=[],this.inputsRename=[],this.outputs=[],this.outputsRename=[],this.propertyOutputs=[],this.checkProperties=[],this.propertyMap={},this.linkFn=null,this.directive=null,this.$controller=null;var selector=name.replace(CAMEL_CASE,function(all,next){return"-"+next.toLowerCase()}),self=this;this.type=_angular_core.Directive({selector:selector,inputs:this.inputsRename,outputs:this.outputsRename}).Class({constructor:[new _angular_core.Inject($SCOPE),_angular_core.ElementRef,function(scope,elementRef){return new UpgradeNg1ComponentAdapter(self.linkFn,scope,self.directive,elementRef,self.$controller,self.inputs,self.outputs,self.propertyOutputs,self.checkProperties,self.propertyMap)}],ngOnInit:function(){},ngOnChanges:function(){},ngDoCheck:function(){},ngOnDestroy:function(){}})}return UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective=function(injector){var directives=injector.get(this.name+"Directive");if(directives.length>1)throw new Error("Only support single directive definition for: "+this.name);var directive=directives[0];directive.replace&&this.notSupported("replace"),directive.terminal&&this.notSupported("terminal");var link=directive.link;return"object"==typeof link&&link.post&&this.notSupported("link.post"),directive},UpgradeNg1ComponentAdapterBuilder.prototype.notSupported=function(feature){throw new Error("Upgraded directive '"+this.name+"' does not support '"+feature+"'.")},UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings=function(){var btcIsObject="object"==typeof this.directive.bindToController;if(btcIsObject&&Object.keys(this.directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time are not supported.");var context=btcIsObject?this.directive.bindToController:this.directive.scope;if("object"==typeof context)for(var name_1 in context)if(context.hasOwnProperty(name_1)){var localName=context[name_1],type=localName.charAt(0),typeOptions=localName.charAt(1);localName="?"===typeOptions?localName.substr(2):localName.substr(1),localName=localName||name_1;var outputName="output_"+name_1,outputNameRename=outputName+": "+name_1,outputNameRenameChange=outputName+": "+name_1+"Change",inputName="input_"+name_1,inputNameRename=inputName+": "+name_1;switch(type){case"=":this.propertyOutputs.push(outputName),this.checkProperties.push(localName),this.outputs.push(outputName),this.outputsRename.push(outputNameRenameChange),this.propertyMap[outputName]=localName,this.inputs.push(inputName),this.inputsRename.push(inputNameRename),this.propertyMap[inputName]=localName;break;case"@":case"<":this.inputs.push(inputName),this.inputsRename.push(inputNameRename),this.propertyMap[inputName]=localName;break;case"&":this.outputs.push(outputName),this.outputsRename.push(outputNameRename),this.propertyMap[outputName]=localName;break;default:var json=JSON.stringify(context);throw new Error("Unexpected mapping '"+type+"' in '"+json+"' in '"+this.name+"' directive.")}}},UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate=function(compile,templateCache,httpBackend){function compileHtml(html){var div=document.createElement("div");return div.innerHTML=html,compile(div.childNodes)}var _this=this;if(void 0!==this.directive.template)this.linkFn=compileHtml(isFunction(this.directive.template)?this.directive.template():this.directive.template);else{if(!this.directive.templateUrl)throw new Error("Directive '"+this.name+"' is not a component, it is missing template.");var url_1=isFunction(this.directive.templateUrl)?this.directive.templateUrl():this.directive.templateUrl,html=templateCache.get(url_1);if(void 0===html)return new Promise(function(resolve,err){httpBackend("GET",url_1,null,function(status,response){200==status?resolve(_this.linkFn=compileHtml(templateCache.put(url_1,response))):err("GET "+url_1+" returned "+status+": "+response)})});this.linkFn=compileHtml(html)}return null},UpgradeNg1ComponentAdapterBuilder.resolve=function(exportedComponents,injector){var promises=[],compile=injector.get($COMPILE),templateCache=injector.get($TEMPLATE_CACHE),httpBackend=injector.get($HTTP_BACKEND),$controller=injector.get($CONTROLLER);for(var name_2 in exportedComponents)if(exportedComponents.hasOwnProperty(name_2)){var exportedComponent=exportedComponents[name_2];exportedComponent.directive=exportedComponent.extractDirective(injector),exportedComponent.$controller=$controller,exportedComponent.extractBindings();var promise=exportedComponent.compileTemplate(compile,templateCache,httpBackend);promise&&promises.push(promise)}return Promise.all(promises)},UpgradeNg1ComponentAdapterBuilder}(),UpgradeNg1ComponentAdapter=function(){function UpgradeNg1ComponentAdapter(linkFn,scope,directive,elementRef,$controller,inputs,outputs,propOuts,checkProperties,propertyMap){this.linkFn=linkFn,this.directive=directive,this.$controller=$controller,this.inputs=inputs,this.outputs=outputs,this.propOuts=propOuts,this.checkProperties=checkProperties,this.propertyMap=propertyMap,this.controllerInstance=null,this.destinationObj=null,this.checkLastValues=[],this.$element=null,this.element=elementRef.nativeElement,this.componentScope=scope.$new(!!directive.scope),this.$element=element(this.element);var controllerType=directive.controller;directive.bindToController&&controllerType?(this.controllerInstance=this.buildController(controllerType),this.destinationObj=this.controllerInstance):this.destinationObj=this.componentScope;for(var i=0;i<inputs.length;i++)this[inputs[i]]=null;for(var j=0;j<outputs.length;j++){var emitter=this[outputs[j]]=new _angular_core.EventEmitter;this.setComponentProperty(outputs[j],function(emitter){return function(value){return emitter.emit(value)}}(emitter))}for(var k=0;k<propOuts.length;k++)this[propOuts[k]]=new _angular_core.EventEmitter,this.checkLastValues.push(INITIAL_VALUE$1)}return UpgradeNg1ComponentAdapter.prototype.ngOnInit=function(){var _this=this;!this.directive.bindToController&&this.directive.controller&&(this.controllerInstance=this.buildController(this.directive.controller)),this.controllerInstance&&isFunction(this.controllerInstance.$onInit)&&this.controllerInstance.$onInit();var link=this.directive.link;if("object"==typeof link&&(link=link.pre),link){var attrs=NOT_SUPPORTED,transcludeFn=NOT_SUPPORTED,linkController=this.resolveRequired(this.$element,this.directive.require);this.directive.link(this.componentScope,this.$element,attrs,linkController,transcludeFn)}for(var childNode,childNodes=[];childNode=this.element.firstChild;)this.element.removeChild(childNode),childNodes.push(childNode);this.linkFn(this.componentScope,function(clonedElement,scope){for(var i=0,ii=clonedElement.length;i<ii;i++)_this.element.appendChild(clonedElement[i])},{parentBoundTranscludeFn:function(scope,cloneAttach){cloneAttach(childNodes)}}),this.controllerInstance&&isFunction(this.controllerInstance.$postLink)&&this.controllerInstance.$postLink()},UpgradeNg1ComponentAdapter.prototype.ngOnChanges=function(changes){var _this=this,ng1Changes={};Object.keys(changes).forEach(function(name){var change=changes[name];_this.setComponentProperty(name,change.currentValue),ng1Changes[_this.propertyMap[name]]=change}),isFunction(this.destinationObj.$onChanges)&&this.destinationObj.$onChanges(ng1Changes)},UpgradeNg1ComponentAdapter.prototype.ngDoCheck=function(){for(var destinationObj=this.destinationObj,lastValues=this.checkLastValues,checkProperties=this.checkProperties,i=0;i<checkProperties.length;i++){var value=destinationObj[checkProperties[i]],last=lastValues[i];if(value!==last)if("number"==typeof value&&isNaN(value)&&"number"==typeof last&&isNaN(last));else{var eventEmitter=this[this.propOuts[i]];eventEmitter.emit(lastValues[i]=value)}}this.controllerInstance&&isFunction(this.controllerInstance.$doCheck)&&this.controllerInstance.$doCheck()},UpgradeNg1ComponentAdapter.prototype.ngOnDestroy=function(){this.controllerInstance&&isFunction(this.controllerInstance.$onDestroy)&&this.controllerInstance.$onDestroy()},UpgradeNg1ComponentAdapter.prototype.setComponentProperty=function(name,value){this.destinationObj[this.propertyMap[name]]=value},UpgradeNg1ComponentAdapter.prototype.buildController=function(controllerType){var locals={$scope:this.componentScope,$element:this.$element},controller=this.$controller(controllerType,locals,null,this.directive.controllerAs);return this.$element.data(controllerKey(this.directive.name),controller),controller},UpgradeNg1ComponentAdapter.prototype.resolveRequired=function($element,require){if(require){if("string"==typeof require){var name_3=require,isOptional=!1,startParent=!1,searchParents=!1;"?"==name_3.charAt(0)&&(isOptional=!0,name_3=name_3.substr(1)),"^"==name_3.charAt(0)&&(searchParents=!0,name_3=name_3.substr(1)),"^"==name_3.charAt(0)&&(startParent=!0,name_3=name_3.substr(1));var key=controllerKey(name_3);startParent&&($element=$element.parent());var dep=searchParents?$element.inheritedData(key):$element.data(key);if(!dep&&!isOptional)throw new Error("Can not locate '"+require+"' in '"+this.directive.name+"'.");return dep}if(require instanceof Array){for(var deps=[],i=0;i<require.length;i++)deps.push(this.resolveRequired($element,require[i]));return deps}throw new Error("Directive '"+this.directive.name+"' require syntax unrecognized: "+this.directive.require)}},UpgradeNg1ComponentAdapter}(),upgradeCount=0,UpgradeAdapter=function(){function UpgradeAdapter(ng2AppModule,compilerOptions){if(this.ng2AppModule=ng2AppModule,this.compilerOptions=compilerOptions,this.idPrefix="NG2_UPGRADE_"+upgradeCount++ +"_",this.directiveResolver=new _angular_compiler.DirectiveResolver,this.downgradedComponents=[],this.ng1ComponentsToBeUpgraded={},this.upgradedProviders=[],this.moduleRef=null,!ng2AppModule)throw new Error("UpgradeAdapter cannot be instantiated without an NgModule of the Angular app.")}return UpgradeAdapter.prototype.downgradeNg2Component=function(component){this.downgradedComponents.push(component);var metadata=this.directiveResolver.resolve(component),info={component:component,inputs:metadata.inputs,outputs:metadata.outputs};return downgradeComponent(info)},UpgradeAdapter.prototype.upgradeNg1Component=function(name){return this.ng1ComponentsToBeUpgraded.hasOwnProperty(name)?this.ng1ComponentsToBeUpgraded[name].type:(this.ng1ComponentsToBeUpgraded[name]=new UpgradeNg1ComponentAdapterBuilder(name)).type},UpgradeAdapter.prototype.registerForNg1Tests=function(modules){var _this=this,windowNgMock=window.angular.mock;if(!windowNgMock||!windowNgMock.module)throw new Error("Failed to find 'angular.mock.module'.");this.declareNg1Module(modules),windowNgMock.module(this.ng1Module.name);var upgrade=new UpgradeAdapterRef;return this.ng2BootstrapDeferred.promise.then(function(ng1Injector){upgrade._bootstrapDone(_this.moduleRef,ng1Injector)},onError),upgrade},UpgradeAdapter.prototype.bootstrap=function(element$$,modules,config){var _this=this;this.declareNg1Module(modules);var upgrade=new UpgradeAdapterRef,windowAngular=window.angular;windowAngular.resumeBootstrap=void 0,this.ngZone.run(function(){bootstrap(element$$,[_this.ng1Module.name],config)});var ng1BootstrapPromise=new Promise(function(resolve){if(windowAngular.resumeBootstrap){var originalResumeBootstrap_1=windowAngular.resumeBootstrap;windowAngular.resumeBootstrap=function(){windowAngular.resumeBootstrap=originalResumeBootstrap_1,windowAngular.resumeBootstrap.apply(this,arguments),resolve()}}else resolve()});return Promise.all([this.ng2BootstrapDeferred.promise,ng1BootstrapPromise]).then(function(_a){var ng1Injector=_a[0];element(element$$).data(controllerKey(INJECTOR_KEY),_this.moduleRef.injector),_this.moduleRef.injector.get(_angular_core.NgZone).run(function(){upgrade._bootstrapDone(_this.moduleRef,ng1Injector)})},onError),upgrade},UpgradeAdapter.prototype.upgradeNg1Provider=function(name,options){var token=options&&options.asToken||name;this.upgradedProviders.push({provide:token,useFactory:function($injector){return $injector.get(name)},deps:[$INJECTOR]})},UpgradeAdapter.prototype.downgradeNg2Provider=function(token){return downgradeInjectable(token)},UpgradeAdapter.prototype.declareNg1Module=function(modules){var _this=this;void 0===modules&&(modules=[]);var original$applyFn,rootScopePrototype,rootScope,delayApplyExps=[],upgradeAdapter=this,ng1Module=this.ng1Module=module$1(this.idPrefix,modules),platformRef=_angular_platformBrowserDynamic.platformBrowserDynamic();return this.ngZone=new _angular_core.NgZone({enableLongStackTrace:Zone.hasOwnProperty("longStackTraceZoneSpec")}),this.ng2BootstrapDeferred=new Deferred,ng1Module.factory(INJECTOR_KEY,function(){return _this.moduleRef.injector.get(_angular_core.Injector)}).constant(NG_ZONE_KEY,this.ngZone).factory(COMPILER_KEY,function(){return _this.moduleRef.injector.get(_angular_core.Compiler)}).config(["$provide","$injector",function(provide,ng1Injector){provide.decorator($ROOT_SCOPE,["$delegate",function(rootScopeDelegate){if(rootScopePrototype=rootScopeDelegate.constructor.prototype,!rootScopePrototype.hasOwnProperty("$apply"))throw new Error("Failed to find '$apply' on '$rootScope'!");return original$applyFn=rootScopePrototype.$apply,rootScopePrototype.$apply=function(exp){return delayApplyExps.push(exp)},rootScope=rootScopeDelegate}]),ng1Injector.has($$TESTABILITY)&&provide.decorator($$TESTABILITY,["$delegate",function(testabilityDelegate){var originalWhenStable=testabilityDelegate.whenStable,newWhenStable=function(callback){originalWhenStable.call(this,function(){var ng2Testability=upgradeAdapter.moduleRef.injector.get(_angular_core.Testability);ng2Testability.isStable()?callback.apply(this,arguments):ng2Testability.whenStable(newWhenStable.bind(this,callback))})};return testabilityDelegate.whenStable=newWhenStable,testabilityDelegate}])}]),ng1Module.run(["$injector","$rootScope",function(ng1Injector,rootScope){UpgradeNg1ComponentAdapterBuilder.resolve(_this.ng1ComponentsToBeUpgraded,ng1Injector).then(function(){var DynamicNgUpgradeModule=_angular_core.NgModule({providers:[{provide:$INJECTOR,useFactory:function(){return ng1Injector}},{provide:$COMPILE,useFactory:function(){return ng1Injector.get($COMPILE)}},{provide:ContentProjectionHelper,useClass:DynamicContentProjectionHelper},_this.upgradedProviders],imports:[_this.ng2AppModule],entryComponents:_this.downgradedComponents}).Class({constructor:function(){},ngDoBootstrap:function(){}});platformRef._bootstrapModuleWithZone(DynamicNgUpgradeModule,_this.compilerOptions,_this.ngZone).then(function(ref){_this.moduleRef=ref,_this.ngZone.run(function(){if(rootScopePrototype){for(rootScopePrototype.$apply=original$applyFn;delayApplyExps.length;)rootScope.$apply(delayApplyExps.shift());rootScopePrototype=null}})}).then(function(){return _this.ng2BootstrapDeferred.resolve(ng1Injector)},onError).then(function(){var subscription=_this.ngZone.onMicrotaskEmpty.subscribe({next:function(){return rootScope.$digest()}});rootScope.$on("$destroy",function(){subscription.unsubscribe()})})}).catch(function(e){return _this.ng2BootstrapDeferred.reject(e)})}]),ng1Module},UpgradeAdapter}(),UpgradeAdapterRef=(function(){function ParentInjectorPromise(element){this.element=element,this.callbacks=[],element.data(controllerKey(INJECTOR_KEY),this)}return ParentInjectorPromise.prototype.then=function(callback){this.injector?callback(this.injector):this.callbacks.push(callback)},ParentInjectorPromise.prototype.resolve=function(injector){this.injector=injector,this.element.data(controllerKey(INJECTOR_KEY),injector),this.element=null,this.callbacks.forEach(function(callback){return callback(injector)}),this.callbacks.length=0},ParentInjectorPromise}(),function(){function UpgradeAdapterRef(){this._readyFn=null,this.ng1RootScope=null,this.ng1Injector=null,this.ng2ModuleRef=null,this.ng2Injector=null}return UpgradeAdapterRef.prototype._bootstrapDone=function(ngModuleRef,ng1Injector){this.ng2ModuleRef=ngModuleRef,this.ng2Injector=ngModuleRef.injector,this.ng1Injector=ng1Injector,this.ng1RootScope=ng1Injector.get($ROOT_SCOPE),this._readyFn&&this._readyFn(this)},UpgradeAdapterRef.prototype.ready=function(fn){this._readyFn=fn},UpgradeAdapterRef.prototype.dispose=function(){this.ng1Injector.get($ROOT_SCOPE).$destroy(),this.ng2ModuleRef.destroy()},UpgradeAdapterRef}());exports.VERSION=VERSION,exports.UpgradeAdapter=UpgradeAdapter,exports.UpgradeAdapterRef=UpgradeAdapterRef});
!function(global,factory){if("function"==typeof define&&define.amd)define("@angular/upgrade",["exports","@angular/core","@angular/compiler","@angular/platform-browser-dynamic"],factory);else if("undefined"!=typeof exports)factory(exports,require("@angular/core"),require("@angular/compiler"),require("@angular/platform-browser-dynamic"));else{var mod={exports:{}};factory(mod.exports,global.ng.core,global.ng.compiler,global.ng.platformBrowserDynamic),global.ng=global.ng||{},global.ng.upgrade=mod.exports}}(this,function(exports,_core,_compiler,_platformBrowserDynamic){"use strict";function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function noNg(){throw new Error("AngularJS v1.x is not loaded!")}function onError(a){throw console.error?console.error(a,a.stack):console.log(a,a.stack),a}function controllerKey(a){return"$"+a+"Controller"}function getAttributesAsArray(a){var b=a.attributes,c=void 0;if(b){var d=b.length;c=Array(d);for(var f=0;f<d;f++)c[f]=[b[f].nodeName,b[f].nodeValue]}return c||[]}function getComponentName(a){return a.overriddenName||a.name||a.toString().split("\n")[0]}function supportsNgModel(a){return"function"==typeof a.writeValue&&"function"==typeof a.registerOnChange}function hookupNgModel(a,b){a&&supportsNgModel(b)&&(a.$render=function(){b.writeValue(a.$viewValue)},b.registerOnChange(a.$setViewValue.bind(a)))}function downgradeComponent(a){var b="NG2_UPGRADE_"+downgradeCount++ +"_",c=0,d=function(f,g,h){return{restrict:"E",terminal:!0,require:[REQUIRE_INJECTOR,REQUIRE_NG_MODEL],link:function(l,m,n,o){var p=o[0]||g.get(INJECTOR_KEY),q=o[1],r=function(s){var t=s.get(_core.ComponentFactoryResolver),u=t.resolveComponentFactory(a.component);if(!u)throw new Error("Expecting ComponentFactory for: "+getComponentName(a.component));var w=b+c++,x=new ParentInjectorPromise$1(m),y=new DowngradeComponentAdapter(w,a,m,n,l,q,s,g,f,h,u),z=y.compileContents();y.createComponent(z),y.setupInputs(),y.setupOutputs(),y.registerCleanup(),x.resolve(y.getInjector())};p instanceof ParentInjectorPromise$1?p.then(r):r(p)}}};return d.$inject=[$COMPILE,$INJECTOR,$PARSE],d}function downgradeInjectable(a){var b=function(c){return c.get(a)};return b.$inject=[INJECTOR_KEY],b}function isFunction(a){return"function"==typeof a}Object.defineProperty(exports,"__esModule",{value:!0}),exports.UpgradeAdapterRef=exports.UpgradeAdapter=exports.VERSION=void 0;var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),VERSION=new _core.Version("4.0.0-rc.0"),angular={bootstrap:noNg,module:noNg,element:noNg,version:noNg,resumeBootstrap:noNg,getTestability:noNg};try{window.hasOwnProperty("angular")&&(angular=window.angular)}catch(a){}var _bootstrap=angular.bootstrap,module$1=angular.module,element=angular.element,$COMPILE="$compile",$CONTROLLER="$controller",$HTTP_BACKEND="$httpBackend",$INJECTOR="$injector",$PARSE="$parse",$ROOT_SCOPE="$rootScope",$SCOPE="$scope",$TEMPLATE_CACHE="$templateCache",$$TESTABILITY="$$testability",COMPILER_KEY="$$angularCompiler",INJECTOR_KEY="$$angularInjector",NG_ZONE_KEY="$$angularNgZone",REQUIRE_INJECTOR="?^^"+INJECTOR_KEY,REQUIRE_NG_MODEL="?ngModel",ContentProjectionHelper=function(){function ContentProjectionHelper(){_classCallCheck(this,ContentProjectionHelper)}return _createClass(ContentProjectionHelper,[{key:"groupProjectableNodes",value:function(a,b,c){return[c]}}]),ContentProjectionHelper}(),PropertyBinding=function(){function PropertyBinding(a){_classCallCheck(this,PropertyBinding),this.binding=a,this.parseBinding()}return _createClass(PropertyBinding,[{key:"parseBinding",value:function(){var a=this.binding.split(":");this.prop=a[0].trim(),this.attr=(a[1]||this.prop).trim(),this.bracketAttr="["+this.attr+"]",this.parenAttr="("+this.attr+")",this.bracketParenAttr="[("+this.attr+")]";var b=this.attr.charAt(0).toUpperCase()+this.attr.substr(1);this.onAttr="on"+b,this.bindAttr="bind"+b,this.bindonAttr="bindon"+b}}]),PropertyBinding}(),Deferred=function Deferred(){var _this=this;_classCallCheck(this,Deferred),this.promise=new Promise(function(a,b){_this.resolve=a,_this.reject=b})},INITIAL_VALUE={__UNINITIALIZED__:!0},DowngradeComponentAdapter=function(){function DowngradeComponentAdapter(a,b,c,d,f,g,h,l,m,n,o){_classCallCheck(this,DowngradeComponentAdapter),this.id=a,this.info=b,this.element=c,this.attrs=d,this.scope=f,this.ngModel=g,this.parentInjector=h,this.$injector=l,this.$compile=m,this.$parse=n,this.componentFactory=o,this.inputChangeCount=0,this.inputChanges=null,this.componentRef=null,this.component=null,this.changeDetector=null,this.element[0].id=a,this.componentScope=f.$new()}return _createClass(DowngradeComponentAdapter,[{key:"compileContents",value:function(){var _this2=this,a=[],b=this.parentInjector.get(ContentProjectionHelper),c=b.groupProjectableNodes(this.$injector,this.info.component,this.element.contents()),d=c.map(function(f){return _this2.$compile(f)});return this.element.empty(),d.forEach(function(f){f(_this2.scope,function(g){a.push(g),_this2.element.append(g)})}),a}},{key:"createComponent",value:function(a){var b=_core.ReflectiveInjector.resolveAndCreate([{provide:$SCOPE,useValue:this.componentScope}],this.parentInjector);this.componentRef=this.componentFactory.create(b,a,this.element[0]),this.changeDetector=this.componentRef.changeDetectorRef,this.component=this.componentRef.instance,hookupNgModel(this.ngModel,this.component)}},{key:"setupInputs",value:function(){for(var _this3=this,a=this.attrs,b=this.info.inputs||[],d=0;d<b.length;d++){var f=new PropertyBinding(b[d]),g=null;if(a.hasOwnProperty(f.attr)){var h=function(l){var m=INITIAL_VALUE;return function(n){m===INITIAL_VALUE&&(m=n),_this3.updateInput(l,m,n),m=n}}(f.prop);a.$observe(f.attr,h)}else a.hasOwnProperty(f.bindAttr)?g=a[f.bindAttr]:a.hasOwnProperty(f.bracketAttr)?g=a[f.bracketAttr]:a.hasOwnProperty(f.bindonAttr)?g=a[f.bindonAttr]:a.hasOwnProperty(f.bracketParenAttr)&&(g=a[f.bracketParenAttr]);if(null!=g){var _h=function(l){return function(m,n){return _this3.updateInput(l,n,m)}}(f.prop);this.componentScope.$watch(g,_h)}}var c=this.info.component.prototype;c&&c.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return _this3.inputChangeCount},function(){var d=_this3.inputChanges;_this3.inputChanges={},_this3.component.ngOnChanges(d)})),this.componentScope.$watch(function(){return _this3.changeDetector&&_this3.changeDetector.detectChanges()})}},{key:"setupOutputs",value:function(){for(var _this4=this,a=this.attrs,b=this.info.outputs||[],c=0;c<b.length;c++){var d=new PropertyBinding(b[c]),f=null,g=!1,h=d.bindonAttr?d.bindonAttr.substring(0,d.bindonAttr.length-6):null,l=d.bracketParenAttr?"[("+d.bracketParenAttr.substring(2,d.bracketParenAttr.length-8)+")]":null;if(a.hasOwnProperty(d.onAttr)?f=a[d.onAttr]:a.hasOwnProperty(d.parenAttr)?f=a[d.parenAttr]:a.hasOwnProperty(h)?(f=a[h],g=!0):a.hasOwnProperty(l)&&(f=a[l],g=!0),null!=f&&null!=g){var m=this.$parse(f),n=m.assign;if(g&&!n)throw new Error("Expression '"+f+"' is not assignable!");var o=this.component[d.prop];if(!o)throw new Error("Missing emitter '"+d.prop+"' on component '"+getComponentName(this.info.component)+"'!");o.subscribe({next:g?function(p){return function(q){return p(_this4.scope,q)}}(n):function(p){return function(q){return p(_this4.scope,{$event:q})}}(m)})}}}},{key:"registerCleanup",value:function(){var _this5=this;this.element.bind("$destroy",function(){_this5.componentScope.$destroy(),_this5.componentRef.destroy()})}},{key:"getInjector",value:function(){return this.componentRef&&this.componentRef.injector}},{key:"updateInput",value:function(a,b,c){this.inputChanges&&(this.inputChangeCount++,this.inputChanges[a]=new _core.SimpleChange(b,c,b===c)),this.component[a]=c}}]),DowngradeComponentAdapter}(),downgradeCount=0,ParentInjectorPromise$1=function(){function ParentInjectorPromise$1(a){_classCallCheck(this,ParentInjectorPromise$1),this.element=a,this.injectorKey=controllerKey(INJECTOR_KEY),this.callbacks=[],a.data(this.injectorKey,this)}return _createClass(ParentInjectorPromise$1,[{key:"then",value:function(a){this.injector?a(this.injector):this.callbacks.push(a)}},{key:"resolve",value:function(a){this.injector=a,this.element.data(this.injectorKey,a),this.element=null,this.callbacks.forEach(function(b){return b(a)}),this.callbacks.length=0}}]),ParentInjectorPromise$1}(),DynamicContentProjectionHelper=function(_ContentProjectionHel){function DynamicContentProjectionHelper(){return _classCallCheck(this,DynamicContentProjectionHelper),_possibleConstructorReturn(this,(DynamicContentProjectionHelper.__proto__||Object.getPrototypeOf(DynamicContentProjectionHelper)).apply(this,arguments))}return _inherits(DynamicContentProjectionHelper,_ContentProjectionHel),_createClass(DynamicContentProjectionHelper,[{key:"groupProjectableNodes",value:function(a,b,c){var d=a.get(COMPILER_KEY),f=d.getNgContentSelectors(b);if(!f)throw new Error("Expecting ngContentSelectors for: "+getComponentName(b));return this.groupNodesBySelector(f,c)}},{key:"groupNodesBySelector",value:function(a,b){for(var c=[],d=new _compiler.SelectorMatcher,f=void 0,g=0,h=a.length;g<h;++g){c[g]=[];var l=a[g];"*"===l?f=g:d.addSelectables(_compiler.CssSelector.parse(l),g)}for(var _loop=function(_g,_h2){var l=[],m=b[_g],n=(0,_compiler.createElementCssSelector)(m.nodeName.toLowerCase(),getAttributesAsArray(m));d.match(n,function(o,p){return l.push(p)}),l.sort(),void 0!==f&&l.push(f),l.length&&c[l[0]].push(m)},_g=0,_h2=b.length;_g<_h2;++_g)_loop(_g,_h2);return c}}]),DynamicContentProjectionHelper}(ContentProjectionHelper),CAMEL_CASE=/([A-Z])/g,INITIAL_VALUE$1={__UNINITIALIZED__:!0},NOT_SUPPORTED="NOT_SUPPORTED",UpgradeNg1ComponentAdapterBuilder=function(){function UpgradeNg1ComponentAdapterBuilder(a){_classCallCheck(this,UpgradeNg1ComponentAdapterBuilder),this.name=a,this.inputs=[],this.inputsRename=[],this.outputs=[],this.outputsRename=[],this.propertyOutputs=[],this.checkProperties=[],this.propertyMap={},this.linkFn=null,this.directive=null,this.$controller=null;var b=a.replace(CAMEL_CASE,function(d,f){return"-"+f.toLowerCase()}),c=this;this.type=(0,_core.Directive)({selector:b,inputs:this.inputsRename,outputs:this.outputsRename}).Class({constructor:[new _core.Inject($SCOPE),_core.ElementRef,function(d,f){return new UpgradeNg1ComponentAdapter(c.linkFn,d,c.directive,f,c.$controller,c.inputs,c.outputs,c.propertyOutputs,c.checkProperties,c.propertyMap)}],ngOnInit:function(){},ngOnChanges:function(){},ngDoCheck:function(){},ngOnDestroy:function(){}})}return _createClass(UpgradeNg1ComponentAdapterBuilder,[{key:"extractDirective",value:function(a){var b=a.get(this.name+"Directive");if(1<b.length)throw new Error("Only support single directive definition for: "+this.name);var c=b[0];c.replace&&this.notSupported("replace"),c.terminal&&this.notSupported("terminal");var d=c.link;return"object"==("undefined"==typeof d?"undefined":_typeof(d))&&d.post&&this.notSupported("link.post"),c}},{key:"notSupported",value:function(a){throw new Error("Upgraded directive '"+this.name+"' does not support '"+a+"'.")}},{key:"extractBindings",value:function(){var a="object"==_typeof(this.directive.bindToController);if(a&&Object.keys(this.directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time are not supported.");var b=a?this.directive.bindToController:this.directive.scope;if("object"==("undefined"==typeof b?"undefined":_typeof(b)))for(var c in b)if(b.hasOwnProperty(c)){var d=b[c],f=d.charAt(0),g=d.charAt(1);d="?"===g?d.substr(2):d.substr(1),d=d||c;var h="output_"+c,n="input_"+c,o=n+": "+c;switch(f){case"=":this.propertyOutputs.push(h),this.checkProperties.push(d),this.outputs.push(h),this.outputsRename.push(h+": "+c+"Change"),this.propertyMap[h]=d,this.inputs.push(n),this.inputsRename.push(o),this.propertyMap[n]=d;break;case"@":case"<":this.inputs.push(n),this.inputsRename.push(o),this.propertyMap[n]=d;break;case"&":this.outputs.push(h),this.outputsRename.push(h+": "+c),this.propertyMap[h]=d;break;default:var p=JSON.stringify(b);throw new Error("Unexpected mapping '"+f+"' in '"+p+"' in '"+this.name+"' directive.")}}}},{key:"compileTemplate",value:function(a,b,c){function d(f){var g=document.createElement("div");return g.innerHTML=f,a(g.childNodes)}var _this7=this;if(void 0!==this.directive.template)this.linkFn=d(isFunction(this.directive.template)?this.directive.template():this.directive.template);else{if(!this.directive.templateUrl)throw new Error("Directive '"+this.name+"' is not a component, it is missing template.");var f=isFunction(this.directive.templateUrl)?this.directive.templateUrl():this.directive.templateUrl,g=b.get(f);if(void 0===g)return new Promise(function(h,l){c("GET",f,null,function(m,n){200==m?h(_this7.linkFn=d(b.put(f,n))):l("GET "+f+" returned "+m+": "+n)})});this.linkFn=d(g)}return null}}],[{key:"resolve",value:function(a,b){var c=[],d=b.get($COMPILE),f=b.get($TEMPLATE_CACHE),g=b.get($HTTP_BACKEND),h=b.get($CONTROLLER);for(var l in a)if(a.hasOwnProperty(l)){var m=a[l];m.directive=m.extractDirective(b),m.$controller=h,m.extractBindings();var n=m.compileTemplate(d,f,g);n&&c.push(n)}return Promise.all(c)}}]),UpgradeNg1ComponentAdapterBuilder}(),UpgradeNg1ComponentAdapter=function(){function UpgradeNg1ComponentAdapter(a,b,c,d,f,g,h,l,m,n){_classCallCheck(this,UpgradeNg1ComponentAdapter),this.linkFn=a,this.directive=c,this.$controller=f,this.inputs=g,this.outputs=h,this.propOuts=l,this.checkProperties=m,this.propertyMap=n,this.controllerInstance=null,this.destinationObj=null,this.checkLastValues=[],this.$element=null,this.element=d.nativeElement,this.componentScope=b.$new(!!c.scope),this.$element=element(this.element);var o=c.controller;c.bindToController&&o?(this.controllerInstance=this.buildController(o),this.destinationObj=this.controllerInstance):this.destinationObj=this.componentScope;for(var p=0;p<g.length;p++)this[g[p]]=null;for(var _p=0;_p<h.length;_p++){var q=this[h[_p]]=new _core.EventEmitter;this.setComponentProperty(h[_p],function(r){return function(s){return r.emit(s)}}(q))}for(var _p2=0;_p2<l.length;_p2++)this[l[_p2]]=new _core.EventEmitter,this.checkLastValues.push(INITIAL_VALUE$1)}return _createClass(UpgradeNg1ComponentAdapter,[{key:"ngOnInit",value:function(){var _this8=this;!this.directive.bindToController&&this.directive.controller&&(this.controllerInstance=this.buildController(this.directive.controller)),this.controllerInstance&&isFunction(this.controllerInstance.$onInit)&&this.controllerInstance.$onInit();var a=this.directive.link;if("object"==("undefined"==typeof a?"undefined":_typeof(a))&&(a=a.pre),a){var g=this.resolveRequired(this.$element,this.directive.require);this.directive.link(this.componentScope,this.$element,NOT_SUPPORTED,g,NOT_SUPPORTED)}for(var c,b=[];c=this.element.firstChild;)this.element.removeChild(c),b.push(c);this.linkFn(this.componentScope,function(d){for(var _g2=0,h=d.length;_g2<h;_g2++)_this8.element.appendChild(d[_g2])},{parentBoundTranscludeFn:function(d,f){f(b)}}),this.controllerInstance&&isFunction(this.controllerInstance.$postLink)&&this.controllerInstance.$postLink()}},{key:"ngOnChanges",value:function(a){var _this9=this,b={};Object.keys(a).forEach(function(c){var d=a[c];_this9.setComponentProperty(c,d.currentValue),b[_this9.propertyMap[c]]=d}),isFunction(this.destinationObj.$onChanges)&&this.destinationObj.$onChanges(b)}},{key:"ngDoCheck",value:function(){for(var a=this.destinationObj,b=this.checkLastValues,c=this.checkProperties,d=0;d<c.length;d++){var f=a[c[d]],g=b[d];if(f!==g)if("number"==typeof f&&isNaN(f)&&"number"==typeof g&&isNaN(g));else{var h=this[this.propOuts[d]];h.emit(b[d]=f)}}this.controllerInstance&&isFunction(this.controllerInstance.$doCheck)&&this.controllerInstance.$doCheck()}},{key:"ngOnDestroy",value:function(){this.controllerInstance&&isFunction(this.controllerInstance.$onDestroy)&&this.controllerInstance.$onDestroy()}},{key:"setComponentProperty",value:function(a,b){this.destinationObj[this.propertyMap[a]]=b}},{key:"buildController",value:function(a){var b={$scope:this.componentScope,$element:this.$element},c=this.$controller(a,b,null,this.directive.controllerAs);return this.$element.data(controllerKey(this.directive.name),c),c}},{key:"resolveRequired",value:function(a,b){if(b){if("string"==typeof b){var c=b,d=!1,f=!1,g=!1;"?"==c.charAt(0)&&(d=!0,c=c.substr(1)),"^"==c.charAt(0)&&(g=!0,c=c.substr(1)),"^"==c.charAt(0)&&(f=!0,c=c.substr(1));var h=controllerKey(c);f&&(a=a.parent());var l=g?a.inheritedData(h):a.data(h);if(!l&&!d)throw new Error("Can not locate '"+b+"' in '"+this.directive.name+"'.");return l}if(b instanceof Array){for(var _c=[],_d=0;_d<b.length;_d++)_c.push(this.resolveRequired(a,b[_d]));return _c}throw new Error("Directive '"+this.directive.name+"' require syntax unrecognized: "+this.directive.require)}}}]),UpgradeNg1ComponentAdapter}(),upgradeCount=0,UpgradeAdapter=function(){function UpgradeAdapter(a,b){if(_classCallCheck(this,UpgradeAdapter),this.ng2AppModule=a,this.compilerOptions=b,this.idPrefix="NG2_UPGRADE_"+upgradeCount++ +"_",this.directiveResolver=new _compiler.DirectiveResolver,this.downgradedComponents=[],this.ng1ComponentsToBeUpgraded={},this.upgradedProviders=[],this.moduleRef=null,!a)throw new Error("UpgradeAdapter cannot be instantiated without an NgModule of the Angular app.")}return _createClass(UpgradeAdapter,[{key:"downgradeNg2Component",value:function(a){this.downgradedComponents.push(a);var b=this.directiveResolver.resolve(a),c={component:a,inputs:b.inputs,outputs:b.outputs};return downgradeComponent(c)}},{key:"upgradeNg1Component",value:function(a){return this.ng1ComponentsToBeUpgraded.hasOwnProperty(a)?this.ng1ComponentsToBeUpgraded[a].type:(this.ng1ComponentsToBeUpgraded[a]=new UpgradeNg1ComponentAdapterBuilder(a)).type}},{key:"registerForNg1Tests",value:function(a){var _this10=this,b=window.angular.mock;if(!b||!b.module)throw new Error("Failed to find 'angular.mock.module'.");this.declareNg1Module(a),b.module(this.ng1Module.name);var c=new UpgradeAdapterRef;return this.ng2BootstrapDeferred.promise.then(function(d){c._bootstrapDone(_this10.moduleRef,d)},onError),c}},{key:"bootstrap",value:function(a,b,c){var _this11=this;this.declareNg1Module(b);var d=new UpgradeAdapterRef,f=window.angular;f.resumeBootstrap=void 0,this.ngZone.run(function(){_bootstrap(a,[_this11.ng1Module.name],c)});var g=new Promise(function(h){if(f.resumeBootstrap){var l=f.resumeBootstrap;f.resumeBootstrap=function(){f.resumeBootstrap=l,f.resumeBootstrap.apply(this,arguments),h()}}else h()});return Promise.all([this.ng2BootstrapDeferred.promise,g]).then(function(_ref){var _ref2=_slicedToArray(_ref,1),h=_ref2[0];element(a).data(controllerKey(INJECTOR_KEY),_this11.moduleRef.injector),_this11.moduleRef.injector.get(_core.NgZone).run(function(){d._bootstrapDone(_this11.moduleRef,h)})},onError),d}},{key:"upgradeNg1Provider",value:function(a,b){var c=b&&b.asToken||a;this.upgradedProviders.push({provide:c,useFactory:function(d){return d.get(a)},deps:[$INJECTOR]})}},{key:"downgradeNg2Provider",value:function(a){return downgradeInjectable(a)}},{key:"declareNg1Module",value:function(){var _this12=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],b=[],c=void 0,d=void 0,f=void 0,g=this,h=this.ng1Module=module$1(this.idPrefix,a),l=(0,_platformBrowserDynamic.platformBrowserDynamic)();return this.ngZone=new _core.NgZone({enableLongStackTrace:Zone.hasOwnProperty("longStackTraceZoneSpec")}),this.ng2BootstrapDeferred=new Deferred,h.factory(INJECTOR_KEY,function(){return _this12.moduleRef.injector.get(_core.Injector)}).constant(NG_ZONE_KEY,this.ngZone).factory(COMPILER_KEY,function(){return _this12.moduleRef.injector.get(_core.Compiler)}).config(["$provide","$injector",function(m,n){m.decorator($ROOT_SCOPE,["$delegate",function(o){if(d=o.constructor.prototype,!d.hasOwnProperty("$apply"))throw new Error("Failed to find '$apply' on '$rootScope'!");return c=d.$apply,d.$apply=function(p){return b.push(p)},f=o}]),n.has($$TESTABILITY)&&m.decorator($$TESTABILITY,["$delegate",function(o){var p=o.whenStable,q=function q(r){p.call(this,function(){var s=g.moduleRef.injector.get(_core.Testability);s.isStable()?r.apply(this,arguments):s.whenStable(q.bind(this,r))})};return o.whenStable=q,o}])}]),h.run(["$injector","$rootScope",function(m,n){UpgradeNg1ComponentAdapterBuilder.resolve(_this12.ng1ComponentsToBeUpgraded,m).then(function(){var o=(0,_core.NgModule)({providers:[{provide:$INJECTOR,useFactory:function(){return m}},{provide:$COMPILE,useFactory:function(){return m.get($COMPILE)}},{provide:ContentProjectionHelper,useClass:DynamicContentProjectionHelper},_this12.upgradedProviders],imports:[_this12.ng2AppModule],entryComponents:_this12.downgradedComponents}).Class({constructor:function(){},ngDoBootstrap:function(){}});l._bootstrapModuleWithZone(o,_this12.compilerOptions,_this12.ngZone).then(function(p){_this12.moduleRef=p,_this12.ngZone.run(function(){if(d){for(d.$apply=c;b.length;)n.$apply(b.shift());d=null}})}).then(function(){return _this12.ng2BootstrapDeferred.resolve(m)},onError).then(function(){var p=_this12.ngZone.onMicrotaskEmpty.subscribe({next:function(){return n.$digest()}});n.$on("$destroy",function(){p.unsubscribe()})})}).catch(function(o){return _this12.ng2BootstrapDeferred.reject(o)})}]),h}}]),UpgradeAdapter}(),UpgradeAdapterRef=function(){function UpgradeAdapterRef(){_classCallCheck(this,UpgradeAdapterRef),this._readyFn=null,this.ng1RootScope=null,this.ng1Injector=null,this.ng2ModuleRef=null,this.ng2Injector=null}return _createClass(UpgradeAdapterRef,[{key:"_bootstrapDone",value:function(a,b){this.ng2ModuleRef=a,this.ng2Injector=a.injector,this.ng1Injector=b,this.ng1RootScope=b.get($ROOT_SCOPE),this._readyFn&&this._readyFn(this)}},{key:"ready",value:function(a){this._readyFn=a}},{key:"dispose",value:function(){this.ng1Injector.get($ROOT_SCOPE).$destroy(),this.ng2ModuleRef.destroy()}}]),UpgradeAdapterRef}();exports.VERSION=VERSION,exports.UpgradeAdapter=UpgradeAdapter,exports.UpgradeAdapterRef=UpgradeAdapterRef});
{
"name": "@angular/upgrade",
"version": "4.0.0-beta.8",
"version": "4.0.0-rc.0",
"description": "Angular - the library for easing update from v1 to v2",
"main": "bundles/upgrade.umd.js",
"module": "index.js",
"typings": "index.d.ts",
"main": "./bundles/upgrade.umd.js",
"module": "./@angular/upgrade.es5.js",
"es2015": "./@angular/upgrade.js",
"typings": "./typings/upgrade.d.ts",
"author": "angular",
"license": "MIT",
"peerDependencies": {
"@angular/core": "4.0.0-beta.8",
"@angular/compiler": "4.0.0-beta.8",
"@angular/platform-browser": "4.0.0-beta.8",
"@angular/platform-browser-dynamic": "4.0.0-beta.8"
"@angular/core": "4.0.0-rc.0",
"@angular/compiler": "4.0.0-rc.0",
"@angular/platform-browser": "4.0.0-rc.0",
"@angular/platform-browser-dynamic": "4.0.0-rc.0"
},

@@ -16,0 +17,0 @@ "repository": {

@@ -1,1 +0,1 @@

{"main": "../bundles/upgrade-static.umd.js"}
{"typings": "../typings/static/static.d.ts", "main": "../bundles/upgrade-static.umd.js", "module": "../@angular/upgrade/static.es5.js", "es2015": "../@angular/upgrade/static.js"}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc