child
'\n\t * })\n\t * class ChildCmp {\n\t * doSomething() {}\n\t * }\n\t *\n\t * @Component({\n\t * selector: 'some-cmp',\n\t * template: `\n\t *child
'\n\t * })\n\t * class ChildCmp {\n\t * doSomething() {}\n\t * }\n\t *\n\t * @Component({\n\t * selector: 'some-cmp',\n\t * template: `\n\t *child
'\n\t * })\n\t * class ChildCmp {\n\t * doSomething() {}\n\t * }\n\t *\n\t * @Component({\n\t * selector: 'some-cmp',\n\t * template: 'child
'\n\t * })\n\t * class ChildCmp {\n\t * doSomething() {}\n\t * }\n\t *\n\t * @Component({\n\t * selector: 'some-cmp',\n\t * template: 'myProp = {{myProp}}
`\n\t * })\n\t * class MyComponent implements OnChanges {\n\t * @Input() myProp: any;\n\t *\n\t * ngOnChanges(changes: SimpleChanges) {\n\t * console.log('ngOnChanges - myProp = ' + changes['myProp'].currentValue);\n\t * }\n\t * }\n\t *\n\t * @Component({\n\t * selector: 'app',\n\t * template: `\n\t * \n\t *my-component
`\n\t * })\n\t * class MyComponent implements OnInit, OnDestroy {\n\t * ngOnInit() {\n\t * console.log('ngOnInit');\n\t * }\n\t *\n\t * ngOnDestroy() {\n\t * console.log('ngOnDestroy');\n\t * }\n\t * }\n\t *\n\t * @Component({\n\t * selector: 'app',\n\t * template: `\n\t * \n\t *Changes:
\n\t *my-component
`\n\t * })\n\t * class MyComponent implements OnInit, OnDestroy {\n\t * ngOnInit() {\n\t * console.log('ngOnInit');\n\t * }\n\t *\n\t * ngOnDestroy() {\n\t * console.log('ngOnDestroy');\n\t * }\n\t * }\n\t *\n\t * @Component({\n\t * selector: 'app',\n\t * template: `\n\t * \n\t *child
'\n\t * })\n\t * class ChildCmp {\n\t * doSomething() {}\n\t * }\n\t *\n\t * @Component({\n\t * selector: 'some-cmp',\n\t * template: `\n\t *child
'\n\t * })\n\t * class ChildCmp {\n\t * doSomething() {}\n\t * }\n\t *\n\t * @Component({\n\t * selector: 'some-cmp',\n\t * template: `\n\t *child
'\n\t * })\n\t * class ChildCmp {\n\t * doSomething() {}\n\t * }\n\t *\n\t * @Component({\n\t * selector: 'some-cmp',\n\t * template: 'child
'\n\t * })\n\t * class ChildCmp {\n\t * doSomething() {}\n\t * }\n\t *\n\t * @Component({\n\t * selector: 'some-cmp',\n\t * template: 'Progress: {{progress}}%
\n\t *= 100\">Done processing {{label}} of Angular zone!
\n\t *\n\t * \n\t * \n\t * `,\n\t * directives: [NgIf]\n\t * })\n\t * export class NgZoneDemo {\n\t * progress: number = 0;\n\t * label: string;\n\t *\n\t * constructor(private _ngZone: NgZone) {}\n\t *\n\t * // Loop inside the Angular zone\n\t * // so the UI DOES refresh after each setTimeout cycle\n\t * processWithinAngularZone() {\n\t * this.label = 'inside';\n\t * this.progress = 0;\n\t * this._increaseProgress(() => console.log('Inside Done!'));\n\t * }\n\t *\n\t * // Loop outside of the Angular zone\n\t * // so the UI DOES NOT refresh after each setTimeout cycle\n\t * processOutsideOfAngularZone() {\n\t * this.label = 'outside';\n\t * this.progress = 0;\n\t * this._ngZone.runOutsideAngular(() => {\n\t * this._increaseProgress(() => {\n\t * // reenter the Angular zone and display done\n\t * this._ngZone.run(() => {console.log('Outside Done!') });\n\t * }}));\n\t * }\n\t *\n\t *\n\t * _increaseProgress(doneCallback: () => void) {\n\t * this.progress += 1;\n\t * console.log(`Current progress: ${this.progress}%`);\n\t *\n\t * if (this.progress < 100) {\n\t * window.setTimeout(() => this._increaseProgress(doneCallback)), 10)\n\t * } else {\n\t * doneCallback();\n\t * }\n\t * }\n\t * }\n\t * ```\n\t * @experimental\n\t */\n\t var NgZone = (function () {\n\t function NgZone(_a) {\n\t var _this = this;\n\t var _b = _a.enableLongStackTrace, enableLongStackTrace = _b === void 0 ? false : _b;\n\t this._hasPendingMicrotasks = false;\n\t this._hasPendingMacrotasks = false;\n\t /** @internal */\n\t this._isStable = true;\n\t /** @internal */\n\t this._nesting = 0;\n\t /** @internal */\n\t this._onUnstable = new EventEmitter(false);\n\t /** @internal */\n\t this._onMicrotaskEmpty = new EventEmitter(false);\n\t /** @internal */\n\t this._onStable = new EventEmitter(false);\n\t /** @internal */\n\t this._onErrorEvents = new EventEmitter(false);\n\t this._zoneImpl = new NgZoneImpl({\n\t trace: enableLongStackTrace,\n\t onEnter: function () {\n\t // console.log('ZONE.enter', this._nesting, this._isStable);\n\t _this._nesting++;\n\t if (_this._isStable) {\n\t _this._isStable = false;\n\t _this._onUnstable.emit(null);\n\t }\n\t },\n\t onLeave: function () {\n\t _this._nesting--;\n\t // console.log('ZONE.leave', this._nesting, this._isStable);\n\t _this._checkStable();\n\t },\n\t setMicrotask: function (hasMicrotasks) {\n\t _this._hasPendingMicrotasks = hasMicrotasks;\n\t _this._checkStable();\n\t },\n\t setMacrotask: function (hasMacrotasks) { _this._hasPendingMacrotasks = hasMacrotasks; },\n\t onError: function (error) { return _this._onErrorEvents.emit(error); }\n\t });\n\t }\n\t NgZone.isInAngularZone = function () { return NgZoneImpl.isInAngularZone(); };\n\t NgZone.assertInAngularZone = function () {\n\t if (!NgZoneImpl.isInAngularZone()) {\n\t throw new Error('Expected to be in Angular Zone, but it is not!');\n\t }\n\t };\n\t NgZone.assertNotInAngularZone = function () {\n\t if (NgZoneImpl.isInAngularZone()) {\n\t throw new Error('Expected to not be in Angular Zone, but it is!');\n\t }\n\t };\n\t NgZone.prototype._checkStable = function () {\n\t var _this = this;\n\t if (this._nesting == 0) {\n\t if (!this._hasPendingMicrotasks && !this._isStable) {\n\t try {\n\t // console.log('ZONE.microtaskEmpty');\n\t this._nesting++;\n\t this._onMicrotaskEmpty.emit(null);\n\t }\n\t finally {\n\t this._nesting--;\n\t if (!this._hasPendingMicrotasks) {\n\t try {\n\t // console.log('ZONE.stable', this._nesting, this._isStable);\n\t this.runOutsideAngular(function () { return _this._onStable.emit(null); });\n\t }\n\t finally {\n\t this._isStable = true;\n\t }\n\t }\n\t }\n\t }\n\t }\n\t };\n\t ;\n\t Object.defineProperty(NgZone.prototype, \"onUnstable\", {\n\t /**\n\t * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n\t */\n\t get: function () { return this._onUnstable; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(NgZone.prototype, \"onMicrotaskEmpty\", {\n\t /**\n\t * Notifies when there is no more microtasks enqueue in the current VM Turn.\n\t * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n\t * For this reason this event can fire multiple times per VM Turn.\n\t */\n\t get: function () { return this._onMicrotaskEmpty; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(NgZone.prototype, \"onStable\", {\n\t /**\n\t * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n\t * implies we are about to relinquish VM turn.\n\t * This event gets called just once.\n\t */\n\t get: function () { return this._onStable; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(NgZone.prototype, \"onError\", {\n\t /**\n\t * Notify that an error has been delivered.\n\t */\n\t get: function () { return this._onErrorEvents; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(NgZone.prototype, \"isStable\", {\n\t /**\n\t * Whether there are no outstanding microtasks or microtasks.\n\t */\n\t get: function () { return this._isStable; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(NgZone.prototype, \"hasPendingMicrotasks\", {\n\t /**\n\t * Whether there are any outstanding microtasks.\n\t */\n\t get: function () { return this._hasPendingMicrotasks; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(NgZone.prototype, \"hasPendingMacrotasks\", {\n\t /**\n\t * Whether there are any outstanding microtasks.\n\t */\n\t get: function () { return this._hasPendingMacrotasks; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t /**\n\t * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n\t * the function.\n\t *\n\t * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n\t * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n\t *\n\t * Any future tasks or microtasks scheduled from within this function will continue executing from\n\t * within the Angular zone.\n\t *\n\t * If a synchronous error happens it will be rethrown and not reported via `onError`.\n\t */\n\t NgZone.prototype.run = function (fn) { return this._zoneImpl.runInner(fn); };\n\t /**\n\t * Same as #run, except that synchronous errors are caught and forwarded\n\t * via `onError` and not rethrown.\n\t */\n\t NgZone.prototype.runGuarded = function (fn) { return this._zoneImpl.runInnerGuarded(fn); };\n\t /**\n\t * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n\t * the function.\n\t *\n\t * Running functions via `runOutsideAngular` allows you to escape Angular's zone and do work that\n\t * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n\t *\n\t * Any future tasks or microtasks scheduled from within this function will continue executing from\n\t * outside of the Angular zone.\n\t *\n\t * Use {@link #run} to reenter the Angular zone and do work that updates the application model.\n\t */\n\t NgZone.prototype.runOutsideAngular = function (fn) { return this._zoneImpl.runOuter(fn); };\n\t return NgZone;\n\t }());\n\t\n\t /**\n\t * The Testability service provides testing hooks that can be accessed from\n\t * the browser and by services such as Protractor. Each bootstrapped Angular\n\t * application on the page will have an instance of Testability.\n\t * @experimental\n\t */\n\t var Testability = (function () {\n\t function Testability(_ngZone) {\n\t this._ngZone = _ngZone;\n\t /** @internal */\n\t this._pendingCount = 0;\n\t /** @internal */\n\t this._isZoneStable = true;\n\t /**\n\t * Whether any work was done since the last 'whenStable' callback. This is\n\t * useful to detect if this could have potentially destabilized another\n\t * component while it is stabilizing.\n\t * @internal\n\t */\n\t this._didWork = false;\n\t /** @internal */\n\t this._callbacks = [];\n\t this._watchAngularEvents();\n\t }\n\t /** @internal */\n\t Testability.prototype._watchAngularEvents = function () {\n\t var _this = this;\n\t this._ngZone.onUnstable.subscribe({\n\t next: function () {\n\t _this._didWork = true;\n\t _this._isZoneStable = false;\n\t }\n\t });\n\t this._ngZone.runOutsideAngular(function () {\n\t _this._ngZone.onStable.subscribe({\n\t next: function () {\n\t NgZone.assertNotInAngularZone();\n\t scheduleMicroTask(function () {\n\t _this._isZoneStable = true;\n\t _this._runCallbacksIfReady();\n\t });\n\t }\n\t });\n\t });\n\t };\n\t Testability.prototype.increasePendingRequestCount = function () {\n\t this._pendingCount += 1;\n\t this._didWork = true;\n\t return this._pendingCount;\n\t };\n\t Testability.prototype.decreasePendingRequestCount = function () {\n\t this._pendingCount -= 1;\n\t if (this._pendingCount < 0) {\n\t throw new Error('pending async requests below zero');\n\t }\n\t this._runCallbacksIfReady();\n\t return this._pendingCount;\n\t };\n\t Testability.prototype.isStable = function () {\n\t return this._isZoneStable && this._pendingCount == 0 && !this._ngZone.hasPendingMacrotasks;\n\t };\n\t /** @internal */\n\t Testability.prototype._runCallbacksIfReady = function () {\n\t var _this = this;\n\t if (this.isStable()) {\n\t // Schedules the call backs in a new frame so that it is always async.\n\t scheduleMicroTask(function () {\n\t while (_this._callbacks.length !== 0) {\n\t (_this._callbacks.pop())(_this._didWork);\n\t }\n\t _this._didWork = false;\n\t });\n\t }\n\t else {\n\t // Not Ready\n\t this._didWork = true;\n\t }\n\t };\n\t Testability.prototype.whenStable = function (callback) {\n\t this._callbacks.push(callback);\n\t this._runCallbacksIfReady();\n\t };\n\t Testability.prototype.getPendingRequestCount = function () { return this._pendingCount; };\n\t Testability.prototype.findBindings = function (using, provider, exactMatch) {\n\t // TODO(juliemr): implement.\n\t return [];\n\t };\n\t Testability.prototype.findProviders = function (using, provider, exactMatch) {\n\t // TODO(juliemr): implement.\n\t return [];\n\t };\n\t Testability.decorators = [\n\t { type: Injectable },\n\t ];\n\t /** @nocollapse */\n\t Testability.ctorParameters = [\n\t { type: NgZone, },\n\t ];\n\t return Testability;\n\t }());\n\t /**\n\t * A global registry of {@link Testability} instances for specific elements.\n\t * @experimental\n\t */\n\t var TestabilityRegistry = (function () {\n\t function TestabilityRegistry() {\n\t /** @internal */\n\t this._applications = new Map$1();\n\t _testabilityGetter.addToWindow(this);\n\t }\n\t TestabilityRegistry.prototype.registerApplication = function (token, testability) {\n\t this._applications.set(token, testability);\n\t };\n\t TestabilityRegistry.prototype.getTestability = function (elem) { return this._applications.get(elem); };\n\t TestabilityRegistry.prototype.getAllTestabilities = function () { return MapWrapper.values(this._applications); };\n\t TestabilityRegistry.prototype.getAllRootElements = function () { return MapWrapper.keys(this._applications); };\n\t TestabilityRegistry.prototype.findTestabilityInTree = function (elem, findInAncestors) {\n\t if (findInAncestors === void 0) { findInAncestors = true; }\n\t return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors);\n\t };\n\t TestabilityRegistry.decorators = [\n\t { type: Injectable },\n\t ];\n\t /** @nocollapse */\n\t TestabilityRegistry.ctorParameters = [];\n\t return TestabilityRegistry;\n\t }());\n\t var _NoopGetTestability = (function () {\n\t function _NoopGetTestability() {\n\t }\n\t _NoopGetTestability.prototype.addToWindow = function (registry) { };\n\t _NoopGetTestability.prototype.findTestabilityInTree = function (registry, elem, findInAncestors) {\n\t return null;\n\t };\n\t return _NoopGetTestability;\n\t }());\n\t /**\n\t * Set the {@link GetTestability} implementation used by the Angular testing framework.\n\t * @experimental\n\t */\n\t function setTestabilityGetter(getter) {\n\t _testabilityGetter = getter;\n\t }\n\t var _testabilityGetter = new _NoopGetTestability();\n\t\n\t /**\n\t * @license\n\t * Copyright Google Inc. All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\t var __extends$6 = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t };\n\t var _devMode = true;\n\t var _runModeLocked = false;\n\t var _platform;\n\t /**\n\t * Disable Angular's development mode, which turns off assertions and other\n\t * checks within the framework.\n\t *\n\t * One important assertion this disables verifies that a change detection pass\n\t * does not result in additional changes to any bindings (also known as\n\t * unidirectional data flow).\n\t *\n\t * @stable\n\t */\n\t function enableProdMode() {\n\t if (_runModeLocked) {\n\t throw new Error('Cannot enable prod mode after platform setup.');\n\t }\n\t _devMode = false;\n\t }\n\t /**\n\t * Returns whether Angular is in development mode. After called once,\n\t * the value is locked and won't change any more.\n\t *\n\t * By default, this is true, unless a user calls `enableProdMode` before calling this.\n\t *\n\t * @experimental APIs related to application bootstrap are currently under review.\n\t */\n\t function isDevMode() {\n\t _runModeLocked = true;\n\t return _devMode;\n\t }\n\t /**\n\t * Creates a platform.\n\t * Platforms have to be eagerly created via this function.\n\t *\n\t * @experimental APIs related to application bootstrap are currently under review.\n\t */\n\t function createPlatform(injector) {\n\t if (isPresent(_platform) && !_platform.destroyed) {\n\t throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n\t }\n\t _platform = injector.get(PlatformRef);\n\t var inits = injector.get(PLATFORM_INITIALIZER, null);\n\t if (isPresent(inits))\n\t inits.forEach(function (init) { return init(); });\n\t return _platform;\n\t }\n\t /**\n\t * Creates a factory for a platform\n\t *\n\t * @experimental APIs related to application bootstrap are currently under review.\n\t */\n\t function createPlatformFactory(parentPlaformFactory, name, providers) {\n\t if (providers === void 0) { providers = []; }\n\t var marker = new OpaqueToken(\"Platform: \" + name);\n\t return function (extraProviders) {\n\t if (extraProviders === void 0) { extraProviders = []; }\n\t if (!getPlatform()) {\n\t if (parentPlaformFactory) {\n\t parentPlaformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));\n\t }\n\t else {\n\t createPlatform(ReflectiveInjector.resolveAndCreate(providers.concat(extraProviders).concat({ provide: marker, useValue: true })));\n\t }\n\t }\n\t return assertPlatform(marker);\n\t };\n\t }\n\t /**\n\t * Checks that there currently is a platform\n\t * which contains the given token as a provider.\n\t *\n\t * @experimental APIs related to application bootstrap are currently under review.\n\t */\n\t function assertPlatform(requiredToken) {\n\t var platform = getPlatform();\n\t if (isBlank(platform)) {\n\t throw new Error('No platform exists!');\n\t }\n\t if (isPresent(platform) && isBlank(platform.injector.get(requiredToken, null))) {\n\t throw new Error('A platform with a different configuration has been created. Please destroy it first.');\n\t }\n\t return platform;\n\t }\n\t /**\n\t * Destroy the existing platform.\n\t *\n\t * @experimental APIs related to application bootstrap are currently under review.\n\t */\n\t function destroyPlatform() {\n\t if (isPresent(_platform) && !_platform.destroyed) {\n\t _platform.destroy();\n\t }\n\t }\n\t /**\n\t * Returns the current platform.\n\t *\n\t * @experimental APIs related to application bootstrap are currently under review.\n\t */\n\t function getPlatform() {\n\t return isPresent(_platform) && !_platform.destroyed ? _platform : null;\n\t }\n\t /**\n\t * The Angular platform is the entry point for Angular on a web page. Each page\n\t * has exactly one platform, and services (such as reflection) which are common\n\t * to every Angular application running on the page are bound in its scope.\n\t *\n\t * A page's platform is initialized implicitly when {@link bootstrap}() is called, or\n\t * explicitly by calling {@link createPlatform}().\n\t *\n\t * @stable\n\t */\n\t var PlatformRef = (function () {\n\t function PlatformRef() {\n\t }\n\t /**\n\t * Creates an instance of an `@NgModule` for the given platform\n\t * for offline compilation.\n\t *\n\t * ## Simple Example\n\t *\n\t * ```typescript\n\t * my_module.ts:\n\t *\n\t * @NgModule({\n\t * imports: [BrowserModule]\n\t * })\n\t * class MyModule {}\n\t *\n\t * main.ts:\n\t * import {MyModuleNgFactory} from './my_module.ngfactory';\n\t * import {platformBrowser} from '@angular/platform-browser';\n\t *\n\t * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);\n\t * ```\n\t *\n\t * @experimental APIs related to application bootstrap are currently under review.\n\t */\n\t PlatformRef.prototype.bootstrapModuleFactory = function (moduleFactory) {\n\t throw unimplemented();\n\t };\n\t /**\n\t * Creates an instance of an `@NgModule` for a given platform using the given runtime compiler.\n\t *\n\t * ## Simple Example\n\t *\n\t * ```typescript\n\t * @NgModule({\n\t * imports: [BrowserModule]\n\t * })\n\t * class MyModule {}\n\t *\n\t * let moduleRef = platformBrowser().bootstrapModule(MyModule);\n\t * ```\n\t * @stable\n\t */\n\t PlatformRef.prototype.bootstrapModule = function (moduleType, compilerOptions) {\n\t if (compilerOptions === void 0) { compilerOptions = []; }\n\t throw unimplemented();\n\t };\n\t Object.defineProperty(PlatformRef.prototype, \"injector\", {\n\t /**\n\t * Retrieve the platform {@link Injector}, which is the parent injector for\n\t * every Angular application on the page and provides singleton providers.\n\t */\n\t get: function () { throw unimplemented(); },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t ;\n\t Object.defineProperty(PlatformRef.prototype, \"destroyed\", {\n\t get: function () { throw unimplemented(); },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t return PlatformRef;\n\t }());\n\t function _callAndReportToErrorHandler(errorHandler, callback) {\n\t try {\n\t var result = callback();\n\t if (isPromise(result)) {\n\t return result.catch(function (e) {\n\t errorHandler.handleError(e);\n\t // rethrow as the exception handler might not do it\n\t throw e;\n\t });\n\t }\n\t else {\n\t return result;\n\t }\n\t }\n\t catch (e) {\n\t errorHandler.handleError(e);\n\t // rethrow as the exception handler might not do it\n\t throw e;\n\t }\n\t }\n\t var PlatformRef_ = (function (_super) {\n\t __extends$6(PlatformRef_, _super);\n\t function PlatformRef_(_injector) {\n\t _super.call(this);\n\t this._injector = _injector;\n\t this._modules = [];\n\t this._destroyListeners = [];\n\t this._destroyed = false;\n\t }\n\t PlatformRef_.prototype.onDestroy = function (callback) { this._destroyListeners.push(callback); };\n\t Object.defineProperty(PlatformRef_.prototype, \"injector\", {\n\t get: function () { return this._injector; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(PlatformRef_.prototype, \"destroyed\", {\n\t get: function () { return this._destroyed; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t PlatformRef_.prototype.destroy = function () {\n\t if (this._destroyed) {\n\t throw new Error('The platform has already been destroyed!');\n\t }\n\t ListWrapper.clone(this._modules).forEach(function (app) { return app.destroy(); });\n\t this._destroyListeners.forEach(function (dispose) { return dispose(); });\n\t this._destroyed = true;\n\t };\n\t PlatformRef_.prototype.bootstrapModuleFactory = function (moduleFactory) {\n\t return this._bootstrapModuleFactoryWithZone(moduleFactory, null);\n\t };\n\t PlatformRef_.prototype._bootstrapModuleFactoryWithZone = function (moduleFactory, ngZone) {\n\t var _this = this;\n\t // Note: We need to create the NgZone _before_ we instantiate the module,\n\t // as instantiating the module creates some providers eagerly.\n\t // So we create a mini parent injector that just contains the new NgZone and\n\t // pass that as parent to the NgModuleFactory.\n\t if (!ngZone)\n\t ngZone = new NgZone({ enableLongStackTrace: isDevMode() });\n\t // Attention: Don't use ApplicationRef.run here,\n\t // as we want to be sure that all possible constructor calls are inside `ngZone.run`!\n\t return ngZone.run(function () {\n\t var ngZoneInjector = ReflectiveInjector.resolveAndCreate([{ provide: NgZone, useValue: ngZone }], _this.injector);\n\t var moduleRef = moduleFactory.create(ngZoneInjector);\n\t var exceptionHandler = moduleRef.injector.get(ErrorHandler, null);\n\t if (!exceptionHandler) {\n\t throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?');\n\t }\n\t moduleRef.onDestroy(function () { return ListWrapper.remove(_this._modules, moduleRef); });\n\t ngZone.onError.subscribe({ next: function (error) { exceptionHandler.handleError(error); } });\n\t return _callAndReportToErrorHandler(exceptionHandler, function () {\n\t var initStatus = moduleRef.injector.get(ApplicationInitStatus);\n\t return initStatus.donePromise.then(function () {\n\t _this._moduleDoBootstrap(moduleRef);\n\t return moduleRef;\n\t });\n\t });\n\t });\n\t };\n\t PlatformRef_.prototype.bootstrapModule = function (moduleType, compilerOptions) {\n\t if (compilerOptions === void 0) { compilerOptions = []; }\n\t return this._bootstrapModuleWithZone(moduleType, compilerOptions, null);\n\t };\n\t PlatformRef_.prototype._bootstrapModuleWithZone = function (moduleType, compilerOptions, ngZone, componentFactoryCallback) {\n\t var _this = this;\n\t if (compilerOptions === void 0) { compilerOptions = []; }\n\t var compilerFactory = this.injector.get(CompilerFactory);\n\t var compiler = compilerFactory.createCompiler(compilerOptions instanceof Array ? compilerOptions : [compilerOptions]);\n\t // ugly internal api hack: generate host component factories for all declared components and\n\t // pass the factories into the callback - this is used by UpdateAdapter to get hold of all\n\t // factories.\n\t if (componentFactoryCallback) {\n\t return compiler.compileModuleAndAllComponentsAsync(moduleType)\n\t .then(function (_a) {\n\t var ngModuleFactory = _a.ngModuleFactory, componentFactories = _a.componentFactories;\n\t componentFactoryCallback(componentFactories);\n\t return _this._bootstrapModuleFactoryWithZone(ngModuleFactory, ngZone);\n\t });\n\t }\n\t return compiler.compileModuleAsync(moduleType)\n\t .then(function (moduleFactory) { return _this._bootstrapModuleFactoryWithZone(moduleFactory, ngZone); });\n\t };\n\t PlatformRef_.prototype._moduleDoBootstrap = function (moduleRef) {\n\t var appRef = moduleRef.injector.get(ApplicationRef);\n\t if (moduleRef.bootstrapFactories.length > 0) {\n\t moduleRef.bootstrapFactories.forEach(function (compFactory) { return appRef.bootstrap(compFactory); });\n\t }\n\t else if (moduleRef.instance.ngDoBootstrap) {\n\t moduleRef.instance.ngDoBootstrap(appRef);\n\t }\n\t else {\n\t throw new Error((\"The module \" + stringify(moduleRef.instance.constructor) + \" was bootstrapped, but it does not declare \\\"@NgModule.bootstrap\\\" components nor a \\\"ngDoBootstrap\\\" method. \") +\n\t \"Please define one of these.\");\n\t }\n\t };\n\t PlatformRef_.decorators = [\n\t { type: Injectable },\n\t ];\n\t /** @nocollapse */\n\t PlatformRef_.ctorParameters = [\n\t { type: Injector, },\n\t ];\n\t return PlatformRef_;\n\t }(PlatformRef));\n\t /**\n\t * A reference to an Angular application running on a page.\n\t *\n\t * For more about Angular applications, see the documentation for {@link bootstrap}.\n\t *\n\t * @stable\n\t */\n\t var ApplicationRef = (function () {\n\t function ApplicationRef() {\n\t }\n\t Object.defineProperty(ApplicationRef.prototype, \"componentTypes\", {\n\t /**\n\t * Get a list of component types registered to this application.\n\t * This list is populated even before the component is created.\n\t */\n\t get: function () { return unimplemented(); },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t ;\n\t Object.defineProperty(ApplicationRef.prototype, \"components\", {\n\t /**\n\t * Get a list of components registered to this application.\n\t */\n\t get: function () { return unimplemented(); },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t ;\n\t return ApplicationRef;\n\t }());\n\t var ApplicationRef_ = (function (_super) {\n\t __extends$6(ApplicationRef_, _super);\n\t function ApplicationRef_(_zone, _console, _injector, _exceptionHandler, _componentFactoryResolver, _initStatus, _testabilityRegistry, _testability) {\n\t var _this = this;\n\t _super.call(this);\n\t this._zone = _zone;\n\t this._console = _console;\n\t this._injector = _injector;\n\t this._exceptionHandler = _exceptionHandler;\n\t this._componentFactoryResolver = _componentFactoryResolver;\n\t this._initStatus = _initStatus;\n\t this._testabilityRegistry = _testabilityRegistry;\n\t this._testability = _testability;\n\t this._bootstrapListeners = [];\n\t this._rootComponents = [];\n\t this._rootComponentTypes = [];\n\t this._changeDetectorRefs = [];\n\t this._runningTick = false;\n\t this._enforceNoNewChanges = false;\n\t this._enforceNoNewChanges = isDevMode();\n\t this._zone.onMicrotaskEmpty.subscribe({ next: function () { _this._zone.run(function () { _this.tick(); }); } });\n\t }\n\t ApplicationRef_.prototype.registerChangeDetector = function (changeDetector) {\n\t this._changeDetectorRefs.push(changeDetector);\n\t };\n\t ApplicationRef_.prototype.unregisterChangeDetector = function (changeDetector) {\n\t ListWrapper.remove(this._changeDetectorRefs, changeDetector);\n\t };\n\t ApplicationRef_.prototype.bootstrap = function (componentOrFactory) {\n\t var _this = this;\n\t if (!this._initStatus.done) {\n\t throw new Error('Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.');\n\t }\n\t var componentFactory;\n\t if (componentOrFactory instanceof ComponentFactory) {\n\t componentFactory = componentOrFactory;\n\t }\n\t else {\n\t componentFactory = this._componentFactoryResolver.resolveComponentFactory(componentOrFactory);\n\t }\n\t this._rootComponentTypes.push(componentFactory.componentType);\n\t var compRef = componentFactory.create(this._injector, [], componentFactory.selector);\n\t compRef.onDestroy(function () { _this._unloadComponent(compRef); });\n\t var testability = compRef.injector.get(Testability, null);\n\t if (isPresent(testability)) {\n\t compRef.injector.get(TestabilityRegistry)\n\t .registerApplication(compRef.location.nativeElement, testability);\n\t }\n\t this._loadComponent(compRef);\n\t if (isDevMode()) {\n\t this._console.log(\"Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.\");\n\t }\n\t return compRef;\n\t };\n\t /** @internal */\n\t ApplicationRef_.prototype._loadComponent = function (componentRef) {\n\t this._changeDetectorRefs.push(componentRef.changeDetectorRef);\n\t this.tick();\n\t this._rootComponents.push(componentRef);\n\t // Get the listeners lazily to prevent DI cycles.\n\t var listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, [])\n\t .concat(this._bootstrapListeners);\n\t listeners.forEach(function (listener) { return listener(componentRef); });\n\t };\n\t /** @internal */\n\t ApplicationRef_.prototype._unloadComponent = function (componentRef) {\n\t if (!ListWrapper.contains(this._rootComponents, componentRef)) {\n\t return;\n\t }\n\t this.unregisterChangeDetector(componentRef.changeDetectorRef);\n\t ListWrapper.remove(this._rootComponents, componentRef);\n\t };\n\t ApplicationRef_.prototype.tick = function () {\n\t if (this._runningTick) {\n\t throw new Error('ApplicationRef.tick is called recursively');\n\t }\n\t var s = ApplicationRef_._tickScope();\n\t try {\n\t this._runningTick = true;\n\t this._changeDetectorRefs.forEach(function (detector) { return detector.detectChanges(); });\n\t if (this._enforceNoNewChanges) {\n\t this._changeDetectorRefs.forEach(function (detector) { return detector.checkNoChanges(); });\n\t }\n\t }\n\t finally {\n\t this._runningTick = false;\n\t wtfLeave(s);\n\t }\n\t };\n\t ApplicationRef_.prototype.ngOnDestroy = function () {\n\t // TODO(alxhub): Dispose of the NgZone.\n\t ListWrapper.clone(this._rootComponents).forEach(function (ref) { return ref.destroy(); });\n\t };\n\t Object.defineProperty(ApplicationRef_.prototype, \"componentTypes\", {\n\t get: function () { return this._rootComponentTypes; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(ApplicationRef_.prototype, \"components\", {\n\t get: function () { return this._rootComponents; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t /** @internal */\n\t ApplicationRef_._tickScope = wtfCreateScope('ApplicationRef#tick()');\n\t ApplicationRef_.decorators = [\n\t { type: Injectable },\n\t ];\n\t /** @nocollapse */\n\t ApplicationRef_.ctorParameters = [\n\t { type: NgZone, },\n\t { type: Console, },\n\t { type: Injector, },\n\t { type: ErrorHandler, },\n\t { type: ComponentFactoryResolver, },\n\t { type: ApplicationInitStatus, },\n\t { type: TestabilityRegistry, decorators: [{ type: Optional },] },\n\t { type: Testability, decorators: [{ type: Optional },] },\n\t ];\n\t return ApplicationRef_;\n\t }(ApplicationRef));\n\t\n\t /**\n\t * @license\n\t * Copyright Google Inc. All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\t var __extends$12 = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t };\n\t /**\n\t * Represents an instance of an NgModule created via a {@link NgModuleFactory}.\n\t *\n\t * `NgModuleRef` provides access to the NgModule Instance as well other objects related to this\n\t * NgModule Instance.\n\t *\n\t * @stable\n\t */\n\t var NgModuleRef = (function () {\n\t function NgModuleRef() {\n\t }\n\t Object.defineProperty(NgModuleRef.prototype, \"injector\", {\n\t /**\n\t * The injector that contains all of the providers of the NgModule.\n\t */\n\t get: function () { return unimplemented(); },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(NgModuleRef.prototype, \"componentFactoryResolver\", {\n\t /**\n\t * The ComponentFactoryResolver to get hold of the ComponentFactories\n\t * declared in the `entryComponents` property of the module.\n\t */\n\t get: function () { return unimplemented(); },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(NgModuleRef.prototype, \"instance\", {\n\t /**\n\t * The NgModule instance.\n\t */\n\t get: function () { return unimplemented(); },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t return NgModuleRef;\n\t }());\n\t /**\n\t * @experimental\n\t */\n\t var NgModuleFactory = (function () {\n\t function NgModuleFactory(_injectorClass, _moduleType) {\n\t this._injectorClass = _injectorClass;\n\t this._moduleType = _moduleType;\n\t }\n\t Object.defineProperty(NgModuleFactory.prototype, \"moduleType\", {\n\t get: function () { return this._moduleType; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t NgModuleFactory.prototype.create = function (parentInjector) {\n\t if (!parentInjector) {\n\t parentInjector = Injector.NULL;\n\t }\n\t var instance = new this._injectorClass(parentInjector);\n\t instance.create();\n\t return instance;\n\t };\n\t return NgModuleFactory;\n\t }());\n\t var _UNDEFINED = new Object();\n\t var NgModuleInjector = (function (_super) {\n\t __extends$12(NgModuleInjector, _super);\n\t function NgModuleInjector(parent, factories, bootstrapFactories) {\n\t _super.call(this, factories, parent.get(ComponentFactoryResolver, ComponentFactoryResolver.NULL));\n\t this.parent = parent;\n\t this.bootstrapFactories = bootstrapFactories;\n\t this._destroyListeners = [];\n\t this._destroyed = false;\n\t }\n\t NgModuleInjector.prototype.create = function () { this.instance = this.createInternal(); };\n\t NgModuleInjector.prototype.get = function (token, notFoundValue) {\n\t if (notFoundValue === void 0) { notFoundValue = THROW_IF_NOT_FOUND; }\n\t if (token === Injector || token === ComponentFactoryResolver) {\n\t return this;\n\t }\n\t var result = this.getInternal(token, _UNDEFINED);\n\t return result === _UNDEFINED ? this.parent.get(token, notFoundValue) : result;\n\t };\n\t Object.defineProperty(NgModuleInjector.prototype, \"injector\", {\n\t get: function () { return this; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t Object.defineProperty(NgModuleInjector.prototype, \"componentFactoryResolver\", {\n\t get: function () { return this; },\n\t enumerable: true,\n\t configurable: true\n\t });\n\t NgModuleInjector.prototype.destroy = function () {\n\t if (this._destroyed) {\n\t throw new Error(\"The ng module \" + stringify(this.instance.constructor) + \" has already been destroyed.\");\n\t }\n\t this._destroyed = true;\n\t this.destroyInternal();\n\t this._destroyListeners.forEach(function (listener) { return listener(); });\n\t };\n\t NgModuleInjector.prototype.onDestroy = function (callback) { this._destroyListeners.push(callback); };\n\t return NgModuleInjector;\n\t }(CodegenComponentFactoryResolver));\n\t\n\t /**\n\t * @license\n\t * Copyright Google Inc. All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\t /**\n\t * Used to load ng module factories.\n\t * @stable\n\t */\n\t var NgModuleFactoryLoader = (function () {\n\t function NgModuleFactoryLoader() {\n\t }\n\t return NgModuleFactoryLoader;\n\t }());\n\t\n\t /**\n\t * An unmodifiable list of items that Angular keeps up to date when the state\n\t * of the application changes.\n\t *\n\t * The type of object that {@link QueryMetadata} and {@link ViewQueryMetadata} provide.\n\t *\n\t * Implements an iterable interface, therefore it can be used in both ES6\n\t * javascript `for (var i of items)` loops as well as in Angular templates with\n\t * `*ngFor=\"let i of myList\"`.\n\t *\n\t * Changes can be observed by subscribing to the changes `Observable`.\n\t *\n\t * NOTE: In the future this class will implement an `Observable` interface.\n\t *\n\t * ### Example ([live demo](http://plnkr.co/edit/RX8sJnQYl9FWuSCWme5z?p=preview))\n\t * ```typescript\n\t * @Component({...})\n\t * class Container {\n\t * @ViewChildren(Item) items:QueryList{ICU message}
` would produce two messages:\n\t * - one for the content with meaning and description,\n\t * - another one for the ICU message.\n\t *\n\t * In this case the last message is discarded as it contains less information (the AST is\n\t * otherwise identical).\n\t *\n\t * Note that we should still keep messages extracted from attributes inside the section (ie in the\n\t * ICU message here)\n\t */\n\t _Visitor.prototype._closeTranslatableSection = function (node, directChildren) {\n\t if (!this._isInTranslatableSection) {\n\t this._reportError(node, 'Unexpected section end');\n\t return;\n\t }\n\t var startIndex = this._msgCountAtSectionStart;\n\t var significantChildren = directChildren.reduce(function (count, node) { return count + (node instanceof Comment ? 0 : 1); }, 0);\n\t if (significantChildren == 1) {\n\t for (var i = this._messages.length - 1; i >= startIndex; i--) {\n\t var ast = this._messages[i].nodes;\n\t if (!(ast.length == 1 && ast[0] instanceof Text$1)) {\n\t this._messages.splice(i, 1);\n\t break;\n\t }\n\t }\n\t }\n\t this._msgCountAtSectionStart = void 0;\n\t };\n\t _Visitor.prototype._reportError = function (node, msg) {\n\t this._errors.push(new I18nError(node.sourceSpan, msg));\n\t };\n\t return _Visitor;\n\t }());\n\t function _isOpeningComment(n) {\n\t return n instanceof Comment && n.value && n.value.startsWith('i18n');\n\t }\n\t function _isClosingComment(n) {\n\t return n instanceof Comment && n.value && n.value === '/i18n';\n\t }\n\t function _getI18nAttr(p) {\n\t return p.attrs.find(function (attr) { return attr.name === _I18N_ATTR; }) || null;\n\t }\n\t function _splitMeaningAndDesc(i18n) {\n\t if (!i18n)\n\t return ['', ''];\n\t var pipeIndex = i18n.indexOf('|');\n\t return pipeIndex == -1 ? ['', i18n] : [i18n.slice(0, pipeIndex), i18n.slice(pipeIndex + 1)];\n\t }\n\t\n\t /**\n\t * A container for message extracted from the templates.\n\t */\n\t var MessageBundle = (function () {\n\t function MessageBundle(_htmlParser, _implicitTags, _implicitAttrs) {\n\t this._htmlParser = _htmlParser;\n\t this._implicitTags = _implicitTags;\n\t this._implicitAttrs = _implicitAttrs;\n\t this._messageMap = {};\n\t }\n\t MessageBundle.prototype.updateFromTemplate = function (html, url, interpolationConfig) {\n\t var _this = this;\n\t var htmlParserResult = this._htmlParser.parse(html, url, true, interpolationConfig);\n\t if (htmlParserResult.errors.length) {\n\t return htmlParserResult.errors;\n\t }\n\t var i18nParserResult = extractMessages(htmlParserResult.rootNodes, interpolationConfig, this._implicitTags, this._implicitAttrs);\n\t if (i18nParserResult.errors.length) {\n\t return i18nParserResult.errors;\n\t }\n\t i18nParserResult.messages.forEach(function (message) { _this._messageMap[digestMessage(message)] = message; });\n\t };\n\t MessageBundle.prototype.getMessageMap = function () { return this._messageMap; };\n\t MessageBundle.prototype.write = function (serializer) { return serializer.write(this._messageMap); };\n\t return MessageBundle;\n\t }());\n\t\n\t var XmlTagDefinition = (function () {\n\t function XmlTagDefinition() {\n\t this.closedByParent = false;\n\t this.contentType = TagContentType.PARSABLE_DATA;\n\t this.isVoid = false;\n\t this.ignoreFirstLf = false;\n\t this.canSelfClose = true;\n\t }\n\t XmlTagDefinition.prototype.requireExtraParent = function (currentParent) { return false; };\n\t XmlTagDefinition.prototype.isClosedByChild = function (name) { return false; };\n\t return XmlTagDefinition;\n\t }());\n\t var _TAG_DEFINITION = new XmlTagDefinition();\n\t function getXmlTagDefinition(tagName) {\n\t return _TAG_DEFINITION;\n\t }\n\t\n\t /**\n\t * @license\n\t * Copyright Google Inc. All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\t var __extends$7 = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t };\n\t var XmlParser = (function (_super) {\n\t __extends$7(XmlParser, _super);\n\t function XmlParser() {\n\t _super.call(this, getXmlTagDefinition);\n\t }\n\t XmlParser.prototype.parse = function (source, url, parseExpansionForms) {\n\t if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n\t return _super.prototype.parse.call(this, source, url, parseExpansionForms, null);\n\t };\n\t return XmlParser;\n\t }(Parser$1));\n\t\n\t /**\n\t * @license\n\t * Copyright Google Inc. All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\t // Generate a map of placeholder to content indexed by message ids\n\t function extractPlaceholders(messageBundle) {\n\t var messageMap = messageBundle.getMessageMap();\n\t var placeholders = {};\n\t Object.keys(messageMap).forEach(function (msgId) {\n\t placeholders[msgId] = messageMap[msgId].placeholders;\n\t });\n\t return placeholders;\n\t }\n\t // Generate a map of placeholder to message ids indexed by message ids\n\t function extractPlaceholderToIds(messageBundle) {\n\t var messageMap = messageBundle.getMessageMap();\n\t var placeholderToIds = {};\n\t Object.keys(messageMap).forEach(function (msgId) {\n\t placeholderToIds[msgId] = messageMap[msgId].placeholderToMsgIds;\n\t });\n\t return placeholderToIds;\n\t }\n\t\n\t /**\n\t * @license\n\t * Copyright Google Inc. All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\t var _Visitor$1 = (function () {\n\t function _Visitor() {\n\t }\n\t _Visitor.prototype.visitTag = function (tag) {\n\t var _this = this;\n\t var strAttrs = this._serializeAttributes(tag.attrs);\n\t if (tag.children.length == 0) {\n\t return \"<\" + tag.name + strAttrs + \"/>\";\n\t }\n\t var strChildren = tag.children.map(function (node) { return node.visit(_this); });\n\t return \"<\" + tag.name + strAttrs + \">\" + strChildren.join('') + \"\" + tag.name + \">\";\n\t };\n\t _Visitor.prototype.visitText = function (text) { return text.value; };\n\t _Visitor.prototype.visitDeclaration = function (decl) {\n\t return \"\";\n\t };\n\t _Visitor.prototype._serializeAttributes = function (attrs) {\n\t var strAttrs = Object.keys(attrs).map(function (name) { return (name + \"=\\\"\" + attrs[name] + \"\\\"\"); }).join(' ');\n\t return strAttrs.length > 0 ? ' ' + strAttrs : '';\n\t };\n\t _Visitor.prototype.visitDoctype = function (doctype) {\n\t return \"\";\n\t };\n\t return _Visitor;\n\t }());\n\t var _visitor = new _Visitor$1();\n\t function serialize(nodes) {\n\t return nodes.map(function (node) { return node.visit(_visitor); }).join('');\n\t }\n\t var Declaration = (function () {\n\t function Declaration(unescapedAttrs) {\n\t var _this = this;\n\t this.attrs = {};\n\t Object.keys(unescapedAttrs).forEach(function (k) {\n\t _this.attrs[k] = _escapeXml(unescapedAttrs[k]);\n\t });\n\t }\n\t Declaration.prototype.visit = function (visitor) { return visitor.visitDeclaration(this); };\n\t return Declaration;\n\t }());\n\t var Doctype = (function () {\n\t function Doctype(rootTag, dtd) {\n\t this.rootTag = rootTag;\n\t this.dtd = dtd;\n\t }\n\t ;\n\t Doctype.prototype.visit = function (visitor) { return visitor.visitDoctype(this); };\n\t return Doctype;\n\t }());\n\t var Tag = (function () {\n\t function Tag(name, unescapedAttrs, children) {\n\t var _this = this;\n\t if (unescapedAttrs === void 0) { unescapedAttrs = {}; }\n\t if (children === void 0) { children = []; }\n\t this.name = name;\n\t this.children = children;\n\t this.attrs = {};\n\t Object.keys(unescapedAttrs).forEach(function (k) {\n\t _this.attrs[k] = _escapeXml(unescapedAttrs[k]);\n\t });\n\t }\n\t Tag.prototype.visit = function (visitor) { return visitor.visitTag(this); };\n\t return Tag;\n\t }());\n\t var Text$2 = (function () {\n\t function Text(unescapedValue) {\n\t this.value = _escapeXml(unescapedValue);\n\t }\n\t ;\n\t Text.prototype.visit = function (visitor) { return visitor.visitText(this); };\n\t return Text;\n\t }());\n\t var _ESCAPED_CHARS = [\n\t [/&/g, '&'],\n\t [/\"/g, '"'],\n\t [/'/g, '''],\n\t [//g, '>'],\n\t ];\n\t function _escapeXml(text) {\n\t return _ESCAPED_CHARS.reduce(function (text, entry) { return text.replace(entry[0], entry[1]); }, text);\n\t }\n\t\n\t var _VERSION = '1.2';\n\t var _XMLNS = 'urn:oasis:names:tc:xliff:document:1.2';\n\t // TODO(vicb): make this a param (s/_/-/)\n\t var _SOURCE_LANG = 'en';\n\t var _PLACEHOLDER_TAG = 'x';\n\t var _SOURCE_TAG = 'source';\n\t var _TARGET_TAG = 'target';\n\t var _UNIT_TAG = 'trans-unit';\n\t var _CR = function (ws) {\n\t if (ws === void 0) { ws = 0; }\n\t return new Text$2(\"\\n\" + new Array(ws).join(' '));\n\t };\n\t // http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html\n\t // http://docs.oasis-open.org/xliff/v1.2/xliff-profile-html/xliff-profile-html-1.2.html\n\t var Xliff = (function () {\n\t function Xliff(_htmlParser, _interpolationConfig) {\n\t this._htmlParser = _htmlParser;\n\t this._interpolationConfig = _interpolationConfig;\n\t }\n\t Xliff.prototype.write = function (messageMap) {\n\t var visitor = new _WriteVisitor();\n\t var transUnits = [];\n\t Object.keys(messageMap).forEach(function (id) {\n\t var message = messageMap[id];\n\t var transUnit = new Tag(_UNIT_TAG, { id: id, datatype: 'html' });\n\t transUnit.children.push(_CR(8), new Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes)), _CR(8), new Tag(_TARGET_TAG));\n\t if (message.description) {\n\t transUnit.children.push(_CR(8), new Tag('note', { priority: '1', from: 'description' }, [new Text$2(message.description)]));\n\t }\n\t if (message.meaning) {\n\t transUnit.children.push(_CR(8), new Tag('note', { priority: '1', from: 'meaning' }, [new Text$2(message.meaning)]));\n\t }\n\t transUnit.children.push(_CR(6));\n\t transUnits.push(_CR(6), transUnit);\n\t });\n\t var body = new Tag('body', {}, transUnits.concat([_CR(4)]));\n\t var file = new Tag('file', { 'source-language': _SOURCE_LANG, datatype: 'plaintext', original: 'ng2.template' }, [_CR(4), body, _CR(2)]);\n\t var xliff = new Tag('xliff', { version: _VERSION, xmlns: _XMLNS }, [_CR(2), file, _CR()]);\n\t return serialize([new Declaration({ version: '1.0', encoding: 'UTF-8' }), _CR(), xliff]);\n\t };\n\t Xliff.prototype.load = function (content, url, messageBundle) {\n\t var _this = this;\n\t // Parse the xtb file into xml nodes\n\t var result = new XmlParser().parse(content, url);\n\t if (result.errors.length) {\n\t throw new Error(\"xtb parse errors:\\n\" + result.errors.join('\\n'));\n\t }\n\t // Replace the placeholders, messages are now string\n\t var _a = new _LoadVisitor().parse(result.rootNodes, messageBundle), messages = _a.messages, errors = _a.errors;\n\t if (errors.length) {\n\t throw new Error(\"xtb parse errors:\\n\" + errors.join('\\n'));\n\t }\n\t // Convert the string messages to html ast\n\t // TODO(vicb): map error message back to the original message in xtb\n\t var messageMap = {};\n\t var parseErrors = [];\n\t Object.keys(messages).forEach(function (id) {\n\t var res = _this._htmlParser.parse(messages[id], url, true, _this._interpolationConfig);\n\t parseErrors.push.apply(parseErrors, res.errors);\n\t messageMap[id] = res.rootNodes;\n\t });\n\t if (parseErrors.length) {\n\t throw new Error(\"xtb parse errors:\\n\" + parseErrors.join('\\n'));\n\t }\n\t return messageMap;\n\t };\n\t return Xliff;\n\t }());\n\t var _WriteVisitor = (function () {\n\t function _WriteVisitor() {\n\t }\n\t _WriteVisitor.prototype.visitText = function (text, context) { return [new Text$2(text.value)]; };\n\t _WriteVisitor.prototype.visitContainer = function (container, context) {\n\t var _this = this;\n\t var nodes = [];\n\t container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });\n\t return nodes;\n\t };\n\t _WriteVisitor.prototype.visitIcu = function (icu, context) {\n\t if (this._isInIcu) {\n\t // nested ICU is not supported\n\t throw new Error('xliff does not support nested ICU messages');\n\t }\n\t this._isInIcu = true;\n\t // TODO(vicb): support ICU messages\n\t // https://lists.oasis-open.org/archives/xliff/201201/msg00028.html\n\t // http://docs.oasis-open.org/xliff/v1.2/xliff-profile-po/xliff-profile-po-1.2-cd02.html\n\t var nodes = [];\n\t this._isInIcu = false;\n\t return nodes;\n\t };\n\t _WriteVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n\t var startTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype: ph.tag });\n\t if (ph.isVoid) {\n\t // void tags have no children nor closing tags\n\t return [startTagPh];\n\t }\n\t var closeTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.closeName, ctype: ph.tag });\n\t return [startTagPh].concat(this.serialize(ph.children), [closeTagPh]);\n\t };\n\t _WriteVisitor.prototype.visitPlaceholder = function (ph, context) {\n\t return [new Tag(_PLACEHOLDER_TAG, { id: ph.name })];\n\t };\n\t _WriteVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n\t return [new Tag(_PLACEHOLDER_TAG, { id: ph.name })];\n\t };\n\t _WriteVisitor.prototype.serialize = function (nodes) {\n\t var _this = this;\n\t this._isInIcu = false;\n\t return ListWrapper.flatten(nodes.map(function (node) { return node.visit(_this); }));\n\t };\n\t return _WriteVisitor;\n\t }());\n\t // TODO(vicb): add error management (structure)\n\t // TODO(vicb): factorize (xtb) ?\n\t var _LoadVisitor = (function () {\n\t function _LoadVisitor() {\n\t }\n\t _LoadVisitor.prototype.parse = function (nodes, messageBundle) {\n\t var _this = this;\n\t this._messageNodes = [];\n\t this._translatedMessages = {};\n\t this._msgId = '';\n\t this._target = [];\n\t this._errors = [];\n\t // Find all messages\n\t visitAll(this, nodes, null);\n\t var messageMap = messageBundle.getMessageMap();\n\t var placeholders = extractPlaceholders(messageBundle);\n\t var placeholderToIds = extractPlaceholderToIds(messageBundle);\n\t this._messageNodes\n\t .filter(function (message) {\n\t // Remove any messages that is not present in the source message bundle.\n\t return messageMap.hasOwnProperty(message[0]);\n\t })\n\t .sort(function (a, b) {\n\t // Because there could be no ICU placeholders inside an ICU message,\n\t // we do not need to take into account the `placeholderToMsgIds` of the referenced\n\t // messages, those would always be empty\n\t // TODO(vicb): overkill - create 2 buckets and [...woDeps, ...wDeps].process()\n\t if (Object.keys(messageMap[a[0]].placeholderToMsgIds).length == 0) {\n\t return -1;\n\t }\n\t if (Object.keys(messageMap[b[0]].placeholderToMsgIds).length == 0) {\n\t return 1;\n\t }\n\t return 0;\n\t })\n\t .forEach(function (message) {\n\t var id = message[0];\n\t _this._placeholders = placeholders[id] || {};\n\t _this._placeholderToIds = placeholderToIds[id] || {};\n\t // TODO(vicb): make sure there is no `_TRANSLATIONS_TAG` nor `_TRANSLATION_TAG`\n\t _this._translatedMessages[id] = visitAll(_this, message[1]).join('');\n\t });\n\t return { messages: this._translatedMessages, errors: this._errors };\n\t };\n\t _LoadVisitor.prototype.visitElement = function (element, context) {\n\t switch (element.name) {\n\t case _UNIT_TAG:\n\t this._target = null;\n\t var msgId = element.attrs.find(function (attr) { return attr.name === 'id'; });\n\t if (!msgId) {\n\t this._addError(element, \"<\" + _UNIT_TAG + \"> misses the \\\"id\\\" attribute\");\n\t }\n\t else {\n\t this._msgId = msgId.value;\n\t }\n\t visitAll(this, element.children, null);\n\t if (this._msgId !== null) {\n\t this._messageNodes.push([this._msgId, this._target]);\n\t }\n\t break;\n\t case _SOURCE_TAG:\n\t // ignore source message\n\t break;\n\t case _TARGET_TAG:\n\t this._target = element.children;\n\t break;\n\t case _PLACEHOLDER_TAG:\n\t var idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n\t if (!idAttr) {\n\t this._addError(element, \"<\" + _PLACEHOLDER_TAG + \"> misses the \\\"id\\\" attribute\");\n\t }\n\t else {\n\t var id = idAttr.value;\n\t if (this._placeholders.hasOwnProperty(id)) {\n\t return this._placeholders[id];\n\t }\n\t if (this._placeholderToIds.hasOwnProperty(id) &&\n\t this._translatedMessages.hasOwnProperty(this._placeholderToIds[id])) {\n\t return this._translatedMessages[this._placeholderToIds[id]];\n\t }\n\t // TODO(vicb): better error message for when\n\t // !this._translatedMessages.hasOwnProperty(this._placeholderToIds[id])\n\t this._addError(element, \"The placeholder \\\"\" + id + \"\\\" does not exists in the source message\");\n\t }\n\t break;\n\t default:\n\t visitAll(this, element.children, null);\n\t }\n\t };\n\t _LoadVisitor.prototype.visitAttribute = function (attribute, context) {\n\t throw new Error('unreachable code');\n\t };\n\t _LoadVisitor.prototype.visitText = function (text, context) { return text.value; };\n\t _LoadVisitor.prototype.visitComment = function (comment, context) { return ''; };\n\t _LoadVisitor.prototype.visitExpansion = function (expansion, context) {\n\t throw new Error('unreachable code');\n\t };\n\t _LoadVisitor.prototype.visitExpansionCase = function (expansionCase, context) {\n\t throw new Error('unreachable code');\n\t };\n\t _LoadVisitor.prototype._addError = function (node, message) {\n\t this._errors.push(new I18nError(node.sourceSpan, message));\n\t };\n\t return _LoadVisitor;\n\t }());\n\t\n\t var _MESSAGES_TAG = 'messagebundle';\n\t var _MESSAGE_TAG = 'msg';\n\t var _PLACEHOLDER_TAG$1 = 'ph';\n\t var _EXEMPLE_TAG = 'ex';\n\t var _DOCTYPE = \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\";\n\t var Xmb = (function () {\n\t function Xmb() {\n\t }\n\t Xmb.prototype.write = function (messageMap) {\n\t var visitor = new _Visitor$2();\n\t var rootNode = new Tag(_MESSAGES_TAG);\n\t rootNode.children.push(new Text$2('\\n'));\n\t Object.keys(messageMap).forEach(function (id) {\n\t var message = messageMap[id];\n\t var attrs = { id: id };\n\t if (message.description) {\n\t attrs['desc'] = message.description;\n\t }\n\t if (message.meaning) {\n\t attrs['meaning'] = message.meaning;\n\t }\n\t rootNode.children.push(new Text$2(' '), new Tag(_MESSAGE_TAG, attrs, visitor.serialize(message.nodes)), new Text$2('\\n'));\n\t });\n\t return serialize([\n\t new Declaration({ version: '1.0', encoding: 'UTF-8' }),\n\t new Text$2('\\n'),\n\t new Doctype(_MESSAGES_TAG, _DOCTYPE),\n\t new Text$2('\\n'),\n\t rootNode,\n\t ]);\n\t };\n\t Xmb.prototype.load = function (content, url, messageBundle) {\n\t throw new Error('Unsupported');\n\t };\n\t return Xmb;\n\t }());\n\t var _Visitor$2 = (function () {\n\t function _Visitor() {\n\t }\n\t _Visitor.prototype.visitText = function (text, context) { return [new Text$2(text.value)]; };\n\t _Visitor.prototype.visitContainer = function (container, context) {\n\t var _this = this;\n\t var nodes = [];\n\t container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });\n\t return nodes;\n\t };\n\t _Visitor.prototype.visitIcu = function (icu, context) {\n\t var _this = this;\n\t var nodes = [new Text$2(\"{\" + icu.expression + \", \" + icu.type + \", \")];\n\t Object.keys(icu.cases).forEach(function (c) {\n\t nodes.push.apply(nodes, [new Text$2(c + \" {\")].concat(icu.cases[c].visit(_this), [new Text$2(\"} \")]));\n\t });\n\t nodes.push(new Text$2(\"}\"));\n\t return nodes;\n\t };\n\t _Visitor.prototype.visitTagPlaceholder = function (ph, context) {\n\t var startEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2(\"<\" + ph.tag + \">\")]);\n\t var startTagPh = new Tag(_PLACEHOLDER_TAG$1, { name: ph.startName }, [startEx]);\n\t if (ph.isVoid) {\n\t // void tags have no children nor closing tags\n\t return [startTagPh];\n\t }\n\t var closeEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2(\"\" + ph.tag + \">\")]);\n\t var closeTagPh = new Tag(_PLACEHOLDER_TAG$1, { name: ph.closeName }, [closeEx]);\n\t return [startTagPh].concat(this.serialize(ph.children), [closeTagPh]);\n\t };\n\t _Visitor.prototype.visitPlaceholder = function (ph, context) {\n\t return [new Tag(_PLACEHOLDER_TAG$1, { name: ph.name })];\n\t };\n\t _Visitor.prototype.visitIcuPlaceholder = function (ph, context) {\n\t return [new Tag(_PLACEHOLDER_TAG$1, { name: ph.name })];\n\t };\n\t _Visitor.prototype.serialize = function (nodes) {\n\t var _this = this;\n\t return ListWrapper.flatten(nodes.map(function (node) { return node.visit(_this); }));\n\t };\n\t return _Visitor;\n\t }());\n\t\n\t var _TRANSLATIONS_TAG = 'translationbundle';\n\t var _TRANSLATION_TAG = 'translation';\n\t var _PLACEHOLDER_TAG$2 = 'ph';\n\t var Xtb = (function () {\n\t function Xtb(_htmlParser, _interpolationConfig) {\n\t this._htmlParser = _htmlParser;\n\t this._interpolationConfig = _interpolationConfig;\n\t }\n\t Xtb.prototype.write = function (messageMap) { throw new Error('Unsupported'); };\n\t Xtb.prototype.load = function (content, url, messageBundle) {\n\t var _this = this;\n\t // Parse the xtb file into xml nodes\n\t var result = new XmlParser().parse(content, url);\n\t if (result.errors.length) {\n\t throw new Error(\"xtb parse errors:\\n\" + result.errors.join('\\n'));\n\t }\n\t // Replace the placeholders, messages are now string\n\t var _a = new _Visitor$3().parse(result.rootNodes, messageBundle), messages = _a.messages, errors = _a.errors;\n\t if (errors.length) {\n\t throw new Error(\"xtb parse errors:\\n\" + errors.join('\\n'));\n\t }\n\t // Convert the string messages to html ast\n\t // TODO(vicb): map error message back to the original message in xtb\n\t var messageMap = {};\n\t var parseErrors = [];\n\t Object.keys(messages).forEach(function (id) {\n\t var res = _this._htmlParser.parse(messages[id], url, true, _this._interpolationConfig);\n\t parseErrors.push.apply(parseErrors, res.errors);\n\t messageMap[id] = res.rootNodes;\n\t });\n\t if (parseErrors.length) {\n\t throw new Error(\"xtb parse errors:\\n\" + parseErrors.join('\\n'));\n\t }\n\t return messageMap;\n\t };\n\t return Xtb;\n\t }());\n\t var _Visitor$3 = (function () {\n\t function _Visitor() {\n\t }\n\t _Visitor.prototype.parse = function (nodes, messageBundle) {\n\t var _this = this;\n\t this._messageNodes = [];\n\t this._translatedMessages = {};\n\t this._bundleDepth = 0;\n\t this._translationDepth = 0;\n\t this._errors = [];\n\t // Find all messages\n\t visitAll(this, nodes, null);\n\t var messageMap = messageBundle.getMessageMap();\n\t var placeholders = extractPlaceholders(messageBundle);\n\t var placeholderToIds = extractPlaceholderToIds(messageBundle);\n\t this._messageNodes\n\t .filter(function (message) {\n\t // Remove any messages that is not present in the source message bundle.\n\t return messageMap.hasOwnProperty(message[0]);\n\t })\n\t .sort(function (a, b) {\n\t // Because there could be no ICU placeholders inside an ICU message,\n\t // we do not need to take into account the `placeholderToMsgIds` of the referenced\n\t // messages, those would always be empty\n\t // TODO(vicb): overkill - create 2 buckets and [...woDeps, ...wDeps].process()\n\t if (Object.keys(messageMap[a[0]].placeholderToMsgIds).length == 0) {\n\t return -1;\n\t }\n\t if (Object.keys(messageMap[b[0]].placeholderToMsgIds).length == 0) {\n\t return 1;\n\t }\n\t return 0;\n\t })\n\t .forEach(function (message) {\n\t var id = message[0];\n\t _this._placeholders = placeholders[id] || {};\n\t _this._placeholderToIds = placeholderToIds[id] || {};\n\t // TODO(vicb): make sure there is no `_TRANSLATIONS_TAG` nor `_TRANSLATION_TAG`\n\t _this._translatedMessages[id] = visitAll(_this, message[1]).join('');\n\t });\n\t return { messages: this._translatedMessages, errors: this._errors };\n\t };\n\t _Visitor.prototype.visitElement = function (element, context) {\n\t switch (element.name) {\n\t case _TRANSLATIONS_TAG:\n\t this._bundleDepth++;\n\t if (this._bundleDepth > 1) {\n\t this._addError(element, \"<\" + _TRANSLATIONS_TAG + \"> elements can not be nested\");\n\t }\n\t visitAll(this, element.children, null);\n\t this._bundleDepth--;\n\t break;\n\t case _TRANSLATION_TAG:\n\t this._translationDepth++;\n\t if (this._translationDepth > 1) {\n\t this._addError(element, \"<\" + _TRANSLATION_TAG + \"> elements can not be nested\");\n\t }\n\t var idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n\t if (!idAttr) {\n\t this._addError(element, \"<\" + _TRANSLATION_TAG + \"> misses the \\\"id\\\" attribute\");\n\t }\n\t else {\n\t // ICU placeholders are reference to other messages.\n\t // The referenced message might not have been decoded yet.\n\t // We need to have all messages available to make sure deps are decoded first.\n\t // TODO(vicb): report an error on duplicate id\n\t this._messageNodes.push([idAttr.value, element.children]);\n\t }\n\t this._translationDepth--;\n\t break;\n\t case _PLACEHOLDER_TAG$2:\n\t var nameAttr = element.attrs.find(function (attr) { return attr.name === 'name'; });\n\t if (!nameAttr) {\n\t this._addError(element, \"<\" + _PLACEHOLDER_TAG$2 + \"> misses the \\\"name\\\" attribute\");\n\t }\n\t else {\n\t var name_1 = nameAttr.value;\n\t if (this._placeholders.hasOwnProperty(name_1)) {\n\t return this._placeholders[name_1];\n\t }\n\t if (this._placeholderToIds.hasOwnProperty(name_1) &&\n\t this._translatedMessages.hasOwnProperty(this._placeholderToIds[name_1])) {\n\t return this._translatedMessages[this._placeholderToIds[name_1]];\n\t }\n\t // TODO(vicb): better error message for when\n\t // !this._translatedMessages.hasOwnProperty(this._placeholderToIds[name])\n\t this._addError(element, \"The placeholder \\\"\" + name_1 + \"\\\" does not exists in the source message\");\n\t }\n\t break;\n\t default:\n\t this._addError(element, 'Unexpected tag');\n\t }\n\t };\n\t _Visitor.prototype.visitAttribute = function (attribute, context) {\n\t throw new Error('unreachable code');\n\t };\n\t _Visitor.prototype.visitText = function (text, context) { return text.value; };\n\t _Visitor.prototype.visitComment = function (comment, context) { return ''; };\n\t _Visitor.prototype.visitExpansion = function (expansion, context) {\n\t var _this = this;\n\t var strCases = expansion.cases.map(function (c) { return c.visit(_this, null); });\n\t return \"{\" + expansion.switchValue + \", \" + expansion.type + \", strCases.join(' ')}\";\n\t };\n\t _Visitor.prototype.visitExpansionCase = function (expansionCase, context) {\n\t return expansionCase.value + \" {\" + visitAll(this, expansionCase.expression, null) + \"}\";\n\t };\n\t _Visitor.prototype._addError = function (node, message) {\n\t this._errors.push(new I18nError(node.sourceSpan, message));\n\t };\n\t return _Visitor;\n\t }());\n\t\n\t /**\n\t * @license\n\t * Copyright Google Inc. All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\t /**\n\t * A container for translated messages\n\t */\n\t var TranslationBundle = (function () {\n\t function TranslationBundle(_messageMap) {\n\t if (_messageMap === void 0) { _messageMap = {}; }\n\t this._messageMap = _messageMap;\n\t }\n\t TranslationBundle.load = function (content, url, messageBundle, serializer) {\n\t return new TranslationBundle(serializer.load(content, url, messageBundle));\n\t };\n\t TranslationBundle.prototype.get = function (id) { return this._messageMap[id]; };\n\t TranslationBundle.prototype.has = function (id) { return id in this._messageMap; };\n\t return TranslationBundle;\n\t }());\n\t\n\t var I18NHtmlParser = (function () {\n\t // TODO(vicb): transB.load() should not need a msgB & add transB.resolve(msgB,\n\t // interpolationConfig)\n\t // TODO(vicb): remove the interpolationConfig from the Xtb serializer\n\t function I18NHtmlParser(_htmlParser, _translations, _translationsFormat) {\n\t this._htmlParser = _htmlParser;\n\t this._translations = _translations;\n\t this._translationsFormat = _translationsFormat;\n\t }\n\t I18NHtmlParser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {\n\t if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n\t if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n\t var parseResult = this._htmlParser.parse(source, url, parseExpansionForms, interpolationConfig);\n\t if (!this._translations || this._translations === '') {\n\t // Do not enable i18n when no translation bundle is provided\n\t return parseResult;\n\t }\n\t // TODO(vicb): add support for implicit tags / attributes\n\t var messageBundle = new MessageBundle(this._htmlParser, [], {});\n\t var errors = messageBundle.updateFromTemplate(source, url, interpolationConfig);\n\t if (errors && errors.length) {\n\t return new ParseTreeResult(parseResult.rootNodes, parseResult.errors.concat(errors));\n\t }\n\t var serializer = this._createSerializer(interpolationConfig);\n\t var translationBundle = TranslationBundle.load(this._translations, url, messageBundle, serializer);\n\t return mergeTranslations(parseResult.rootNodes, translationBundle, interpolationConfig, [], {});\n\t };\n\t I18NHtmlParser.prototype._createSerializer = function (interpolationConfig) {\n\t var format = (this._translationsFormat || 'xlf').toLowerCase();\n\t switch (format) {\n\t case 'xmb':\n\t return new Xmb();\n\t case 'xtb':\n\t return new Xtb(this._htmlParser, interpolationConfig);\n\t case 'xliff':\n\t case 'xlf':\n\t default:\n\t return new Xliff(this._htmlParser, interpolationConfig);\n\t }\n\t };\n\t return I18NHtmlParser;\n\t }());\n\t\n\t var isDefaultChangeDetectionStrategy = _angular_core.__core_private__.isDefaultChangeDetectionStrategy;\n\t var ChangeDetectorStatus = _angular_core.__core_private__.ChangeDetectorStatus;\n\t var LifecycleHooks = _angular_core.__core_private__.LifecycleHooks;\n\t var LIFECYCLE_HOOKS_VALUES = _angular_core.__core_private__.LIFECYCLE_HOOKS_VALUES;\n\t var ReflectorReader = _angular_core.__core_private__.ReflectorReader;\n\t var AppElement = _angular_core.__core_private__.AppElement;\n\t var CodegenComponentFactoryResolver = _angular_core.__core_private__.CodegenComponentFactoryResolver;\n\t var AppView = _angular_core.__core_private__.AppView;\n\t var DebugAppView = _angular_core.__core_private__.DebugAppView;\n\t var NgModuleInjector = _angular_core.__core_private__.NgModuleInjector;\n\t var ViewType = _angular_core.__core_private__.ViewType;\n\t var MAX_INTERPOLATION_VALUES = _angular_core.__core_private__.MAX_INTERPOLATION_VALUES;\n\t var checkBinding = _angular_core.__core_private__.checkBinding;\n\t var flattenNestedViewRenderNodes = _angular_core.__core_private__.flattenNestedViewRenderNodes;\n\t var interpolate = _angular_core.__core_private__.interpolate;\n\t var ViewUtils = _angular_core.__core_private__.ViewUtils;\n\t var DebugContext = _angular_core.__core_private__.DebugContext;\n\t var StaticNodeDebugInfo = _angular_core.__core_private__.StaticNodeDebugInfo;\n\t var devModeEqual = _angular_core.__core_private__.devModeEqual;\n\t var UNINITIALIZED = _angular_core.__core_private__.UNINITIALIZED;\n\t var ValueUnwrapper = _angular_core.__core_private__.ValueUnwrapper;\n\t var TemplateRef_ = _angular_core.__core_private__.TemplateRef_;\n\t var EMPTY_ARRAY = _angular_core.__core_private__.EMPTY_ARRAY;\n\t var EMPTY_MAP = _angular_core.__core_private__.EMPTY_MAP;\n\t var pureProxy1 = _angular_core.__core_private__.pureProxy1;\n\t var pureProxy2 = _angular_core.__core_private__.pureProxy2;\n\t var pureProxy3 = _angular_core.__core_private__.pureProxy3;\n\t var pureProxy4 = _angular_core.__core_private__.pureProxy4;\n\t var pureProxy5 = _angular_core.__core_private__.pureProxy5;\n\t var pureProxy6 = _angular_core.__core_private__.pureProxy6;\n\t var pureProxy7 = _angular_core.__core_private__.pureProxy7;\n\t var pureProxy8 = _angular_core.__core_private__.pureProxy8;\n\t var pureProxy9 = _angular_core.__core_private__.pureProxy9;\n\t var pureProxy10 = _angular_core.__core_private__.pureProxy10;\n\t var castByValue = _angular_core.__core_private__.castByValue;\n\t var Console = _angular_core.__core_private__.Console;\n\t var reflector = _angular_core.__core_private__.reflector;\n\t var Reflector = _angular_core.__core_private__.Reflector;\n\t var ReflectionCapabilities = _angular_core.__core_private__.ReflectionCapabilities;\n\t var NoOpAnimationPlayer = _angular_core.__core_private__.NoOpAnimationPlayer;\n\t var AnimationSequencePlayer = _angular_core.__core_private__.AnimationSequencePlayer;\n\t var AnimationGroupPlayer = _angular_core.__core_private__.AnimationGroupPlayer;\n\t var AnimationKeyframe = _angular_core.__core_private__.AnimationKeyframe;\n\t var AnimationStyles = _angular_core.__core_private__.AnimationStyles;\n\t var AnimationOutput = _angular_core.__core_private__.AnimationOutput;\n\t var ANY_STATE = _angular_core.__core_private__.ANY_STATE;\n\t var DEFAULT_STATE = _angular_core.__core_private__.DEFAULT_STATE;\n\t var EMPTY_ANIMATION_STATE = _angular_core.__core_private__.EMPTY_STATE;\n\t var FILL_STYLE_FLAG = _angular_core.__core_private__.FILL_STYLE_FLAG;\n\t var prepareFinalAnimationStyles = _angular_core.__core_private__.prepareFinalAnimationStyles;\n\t var balanceAnimationKeyframes = _angular_core.__core_private__.balanceAnimationKeyframes;\n\t var clearStyles = _angular_core.__core_private__.clearStyles;\n\t var collectAndResolveStyles = _angular_core.__core_private__.collectAndResolveStyles;\n\t var renderStyles = _angular_core.__core_private__.renderStyles;\n\t var ComponentStillLoadingError = _angular_core.__core_private__.ComponentStillLoadingError;\n\t\n\t var APP_VIEW_MODULE_URL = assetUrl('core', 'linker/view');\n\t var VIEW_UTILS_MODULE_URL = assetUrl('core', 'linker/view_utils');\n\t var CD_MODULE_URL = assetUrl('core', 'change_detection/change_detection');\n\t var ANIMATION_STYLE_UTIL_ASSET_URL = assetUrl('core', 'animation/animation_style_util');\n\t var Identifiers = (function () {\n\t function Identifiers() {\n\t }\n\t Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS = {\n\t name: 'ANALYZE_FOR_ENTRY_COMPONENTS',\n\t moduleUrl: assetUrl('core', 'metadata/di'),\n\t runtime: _angular_core.ANALYZE_FOR_ENTRY_COMPONENTS\n\t };\n\t Identifiers.ViewUtils = {\n\t name: 'ViewUtils',\n\t moduleUrl: assetUrl('core', 'linker/view_utils'),\n\t runtime: ViewUtils\n\t };\n\t Identifiers.AppView = { name: 'AppView', moduleUrl: APP_VIEW_MODULE_URL, runtime: AppView };\n\t Identifiers.DebugAppView = {\n\t name: 'DebugAppView',\n\t moduleUrl: APP_VIEW_MODULE_URL,\n\t runtime: DebugAppView\n\t };\n\t Identifiers.AppElement = {\n\t name: 'AppElement',\n\t moduleUrl: assetUrl('core', 'linker/element'),\n\t runtime: AppElement\n\t };\n\t Identifiers.ElementRef = {\n\t name: 'ElementRef',\n\t moduleUrl: assetUrl('core', 'linker/element_ref'),\n\t runtime: _angular_core.ElementRef\n\t };\n\t Identifiers.ViewContainerRef = {\n\t name: 'ViewContainerRef',\n\t moduleUrl: assetUrl('core', 'linker/view_container_ref'),\n\t runtime: _angular_core.ViewContainerRef\n\t };\n\t Identifiers.ChangeDetectorRef = {\n\t name: 'ChangeDetectorRef',\n\t moduleUrl: assetUrl('core', 'change_detection/change_detector_ref'),\n\t runtime: _angular_core.ChangeDetectorRef\n\t };\n\t Identifiers.RenderComponentType = {\n\t name: 'RenderComponentType',\n\t moduleUrl: assetUrl('core', 'render/api'),\n\t runtime: _angular_core.RenderComponentType\n\t };\n\t Identifiers.QueryList = {\n\t name: 'QueryList',\n\t moduleUrl: assetUrl('core', 'linker/query_list'),\n\t runtime: _angular_core.QueryList\n\t };\n\t Identifiers.TemplateRef = {\n\t name: 'TemplateRef',\n\t moduleUrl: assetUrl('core', 'linker/template_ref'),\n\t runtime: _angular_core.TemplateRef\n\t };\n\t Identifiers.TemplateRef_ = {\n\t name: 'TemplateRef_',\n\t moduleUrl: assetUrl('core', 'linker/template_ref'),\n\t runtime: TemplateRef_\n\t };\n\t Identifiers.CodegenComponentFactoryResolver = {\n\t name: 'CodegenComponentFactoryResolver',\n\t moduleUrl: assetUrl('core', 'linker/component_factory_resolver'),\n\t runtime: CodegenComponentFactoryResolver\n\t };\n\t Identifiers.ComponentFactoryResolver = {\n\t name: 'ComponentFactoryResolver',\n\t moduleUrl: assetUrl('core', 'linker/component_factory_resolver'),\n\t runtime: _angular_core.ComponentFactoryResolver\n\t };\n\t Identifiers.ComponentFactory = {\n\t name: 'ComponentFactory',\n\t runtime: _angular_core.ComponentFactory,\n\t moduleUrl: assetUrl('core', 'linker/component_factory')\n\t };\n\t Identifiers.NgModuleFactory = {\n\t name: 'NgModuleFactory',\n\t runtime: _angular_core.NgModuleFactory,\n\t moduleUrl: assetUrl('core', 'linker/ng_module_factory')\n\t };\n\t Identifiers.NgModuleInjector = {\n\t name: 'NgModuleInjector',\n\t runtime: NgModuleInjector,\n\t moduleUrl: assetUrl('core', 'linker/ng_module_factory')\n\t };\n\t Identifiers.ValueUnwrapper = { name: 'ValueUnwrapper', moduleUrl: CD_MODULE_URL, runtime: ValueUnwrapper };\n\t Identifiers.Injector = {\n\t name: 'Injector',\n\t moduleUrl: assetUrl('core', 'di/injector'),\n\t runtime: _angular_core.Injector\n\t };\n\t Identifiers.ViewEncapsulation = {\n\t name: 'ViewEncapsulation',\n\t moduleUrl: assetUrl('core', 'metadata/view'),\n\t runtime: _angular_core.ViewEncapsulation\n\t };\n\t Identifiers.ViewType = {\n\t name: 'ViewType',\n\t moduleUrl: assetUrl('core', 'linker/view_type'),\n\t runtime: ViewType\n\t };\n\t Identifiers.ChangeDetectionStrategy = {\n\t name: 'ChangeDetectionStrategy',\n\t moduleUrl: CD_MODULE_URL,\n\t runtime: _angular_core.ChangeDetectionStrategy\n\t };\n\t Identifiers.StaticNodeDebugInfo = {\n\t name: 'StaticNodeDebugInfo',\n\t moduleUrl: assetUrl('core', 'linker/debug_context'),\n\t runtime: StaticNodeDebugInfo\n\t };\n\t Identifiers.DebugContext = {\n\t name: 'DebugContext',\n\t moduleUrl: assetUrl('core', 'linker/debug_context'),\n\t runtime: DebugContext\n\t };\n\t Identifiers.Renderer = {\n\t name: 'Renderer',\n\t moduleUrl: assetUrl('core', 'render/api'),\n\t runtime: _angular_core.Renderer\n\t };\n\t Identifiers.SimpleChange = { name: 'SimpleChange', moduleUrl: CD_MODULE_URL, runtime: _angular_core.SimpleChange };\n\t Identifiers.UNINITIALIZED = { name: 'UNINITIALIZED', moduleUrl: CD_MODULE_URL, runtime: UNINITIALIZED };\n\t Identifiers.ChangeDetectorStatus = {\n\t name: 'ChangeDetectorStatus',\n\t moduleUrl: CD_MODULE_URL,\n\t runtime: ChangeDetectorStatus\n\t };\n\t Identifiers.checkBinding = {\n\t name: 'checkBinding',\n\t moduleUrl: VIEW_UTILS_MODULE_URL,\n\t runtime: checkBinding\n\t };\n\t Identifiers.flattenNestedViewRenderNodes = {\n\t name: 'flattenNestedViewRenderNodes',\n\t moduleUrl: VIEW_UTILS_MODULE_URL,\n\t runtime: flattenNestedViewRenderNodes\n\t };\n\t Identifiers.devModeEqual = { name: 'devModeEqual', moduleUrl: CD_MODULE_URL, runtime: devModeEqual };\n\t Identifiers.interpolate = {\n\t name: 'interpolate',\n\t moduleUrl: VIEW_UTILS_MODULE_URL,\n\t runtime: interpolate\n\t };\n\t Identifiers.castByValue = {\n\t name: 'castByValue',\n\t moduleUrl: VIEW_UTILS_MODULE_URL,\n\t runtime: castByValue\n\t };\n\t Identifiers.EMPTY_ARRAY = {\n\t name: 'EMPTY_ARRAY',\n\t moduleUrl: VIEW_UTILS_MODULE_URL,\n\t runtime: EMPTY_ARRAY\n\t };\n\t Identifiers.EMPTY_MAP = { name: 'EMPTY_MAP', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: EMPTY_MAP };\n\t Identifiers.pureProxies = [\n\t null,\n\t { name: 'pureProxy1', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy1 },\n\t { name: 'pureProxy2', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy2 },\n\t { name: 'pureProxy3', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy3 },\n\t { name: 'pureProxy4', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy4 },\n\t { name: 'pureProxy5', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy5 },\n\t { name: 'pureProxy6', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy6 },\n\t { name: 'pureProxy7', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy7 },\n\t { name: 'pureProxy8', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy8 },\n\t { name: 'pureProxy9', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy9 },\n\t { name: 'pureProxy10', moduleUrl: VIEW_UTILS_MODULE_URL, runtime: pureProxy10 },\n\t ];\n\t Identifiers.SecurityContext = {\n\t name: 'SecurityContext',\n\t moduleUrl: assetUrl('core', 'security'),\n\t runtime: _angular_core.SecurityContext,\n\t };\n\t Identifiers.AnimationKeyframe = {\n\t name: 'AnimationKeyframe',\n\t moduleUrl: assetUrl('core', 'animation/animation_keyframe'),\n\t runtime: AnimationKeyframe\n\t };\n\t Identifiers.AnimationStyles = {\n\t name: 'AnimationStyles',\n\t moduleUrl: assetUrl('core', 'animation/animation_styles'),\n\t runtime: AnimationStyles\n\t };\n\t Identifiers.NoOpAnimationPlayer = {\n\t name: 'NoOpAnimationPlayer',\n\t moduleUrl: assetUrl('core', 'animation/animation_player'),\n\t runtime: NoOpAnimationPlayer\n\t };\n\t Identifiers.AnimationGroupPlayer = {\n\t name: 'AnimationGroupPlayer',\n\t moduleUrl: assetUrl('core', 'animation/animation_group_player'),\n\t runtime: AnimationGroupPlayer\n\t };\n\t Identifiers.AnimationSequencePlayer = {\n\t name: 'AnimationSequencePlayer',\n\t moduleUrl: assetUrl('core', 'animation/animation_sequence_player'),\n\t runtime: AnimationSequencePlayer\n\t };\n\t Identifiers.prepareFinalAnimationStyles = {\n\t name: 'prepareFinalAnimationStyles',\n\t moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,\n\t runtime: prepareFinalAnimationStyles\n\t };\n\t Identifiers.balanceAnimationKeyframes = {\n\t name: 'balanceAnimationKeyframes',\n\t moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,\n\t runtime: balanceAnimationKeyframes\n\t };\n\t Identifiers.clearStyles = {\n\t name: 'clearStyles',\n\t moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,\n\t runtime: clearStyles\n\t };\n\t Identifiers.renderStyles = {\n\t name: 'renderStyles',\n\t moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,\n\t runtime: renderStyles\n\t };\n\t Identifiers.collectAndResolveStyles = {\n\t name: 'collectAndResolveStyles',\n\t moduleUrl: ANIMATION_STYLE_UTIL_ASSET_URL,\n\t runtime: collectAndResolveStyles\n\t };\n\t Identifiers.LOCALE_ID = {\n\t name: 'LOCALE_ID',\n\t moduleUrl: assetUrl('core', 'i18n/tokens'),\n\t runtime: _angular_core.LOCALE_ID\n\t };\n\t Identifiers.TRANSLATIONS_FORMAT = {\n\t name: 'TRANSLATIONS_FORMAT',\n\t moduleUrl: assetUrl('core', 'i18n/tokens'),\n\t runtime: _angular_core.TRANSLATIONS_FORMAT\n\t };\n\t Identifiers.AnimationOutput = {\n\t name: 'AnimationOutput',\n\t moduleUrl: assetUrl('core', 'animation/animation_output'),\n\t runtime: AnimationOutput\n\t };\n\t return Identifiers;\n\t }());\n\t function resolveIdentifier(identifier) {\n\t return new CompileIdentifierMetadata({\n\t name: identifier.name,\n\t moduleUrl: identifier.moduleUrl,\n\t reference: reflector.resolveIdentifier(identifier.name, identifier.moduleUrl, identifier.runtime)\n\t });\n\t }\n\t function identifierToken(identifier) {\n\t return new CompileTokenMetadata({ identifier: identifier });\n\t }\n\t function resolveIdentifierToken(identifier) {\n\t return identifierToken(resolveIdentifier(identifier));\n\t }\n\t function resolveEnumIdentifier(enumType, name) {\n\t var resolvedEnum = reflector.resolveEnum(enumType.reference, name);\n\t return new CompileIdentifierMetadata({ name: enumType.name + \".\" + name, moduleUrl: enumType.moduleUrl, reference: resolvedEnum });\n\t }\n\t\n\t /**\n\t * @license\n\t * Copyright Google Inc. All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\t var __extends$8 = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t };\n\t var HtmlParser = (function (_super) {\n\t __extends$8(HtmlParser, _super);\n\t function HtmlParser() {\n\t _super.call(this, getHtmlTagDefinition);\n\t }\n\t HtmlParser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {\n\t if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n\t if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n\t return _super.prototype.parse.call(this, source, url, parseExpansionForms, interpolationConfig);\n\t };\n\t HtmlParser.decorators = [\n\t { type: _angular_core.Injectable },\n\t ];\n\t /** @nocollapse */\n\t HtmlParser.ctorParameters = [];\n\t return HtmlParser;\n\t }(Parser$1));\n\t\n\t /**\n\t * @license\n\t * Copyright Google Inc. All Rights Reserved.\n\t *\n\t * Use of this source code is governed by an MIT-style license that can be\n\t * found in the LICENSE file at https://angular.io/license\n\t */\n\t var __extends$9 = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t };\n\t // http://cldr.unicode.org/index/cldr-spec/plural-rules\n\t var PLURAL_CASES = ['zero', 'one', 'two', 'few', 'many', 'other'];\n\t /**\n\t * Expands special forms into elements.\n\t *\n\t * For example,\n\t *\n\t * ```\n\t * { messages.length, plural,\n\t * =0 {zero}\n\t * =1 {one}\n\t * other {more than one}\n\t * }\n\t * ```\n\t *\n\t * will be expanded into\n\t *\n\t * ```\n\t *